query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Move function for adding moves when user clicks on cards
function addMoves() { 'use strict'; // turn on Strict Mode moves++; movesCounter.innerHTML = moves; rating(); //Starting timer when user makes its first click on the cards if (moves == 1) { second = 0; minute = 0; hour = 0; startTimer(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeMove(){\n\t$(\".card\").click(function(e){\n\t\tshowCardSymbol($(e.target));\n\t\taddToCardCheck($(e.target));\n\t\tif (cardCheck.length === 2) {\n\t\t\tcheckMatches();\n\t\t}\n\t\tcongratsMessage();\n\t});\n}", "function takeCards()\n {\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n showMenuId = cards[0].addEventListener(\"move\", showMenu);\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \"PX\", height: sizes.desk.height + \"PX\"}, true);\n }\n }", "move(from, fromIx, fromCount, to, toIx) {\n let evdata = {\n success: false,\n from: from, \n fromIx: fromIx,\n fromCount: fromCount,\n to: to,\n toIx: toIx\n };\n if (!this.canMove(from, fromIx, fromCount, to, toIx)) {\n //this._event(Game.EV.MOVE, evdata); \n return false;\n }\n let card = false;\n let dest = false;\n if (from == 'w') {\n card = this.waste.pop();\n } \n else if (from == 'f') {\n card = this.foundations[fromIx - 1].pop();\n }\n else if (from == 't') {\n let t = this.tableau[fromIx - 1];\n card = t.slice(t.length - fromCount);\n t.length = t.length - fromCount;\n }\n if (to == 't') {\n dest = this.tableau[toIx - 1];\n }\n else if (to == 'f') {\n dest = this.foundations[toIx - 1];\n }\n if (!card || !dest) {\n //this._event(Game.EV.MOVE, evdata); \n return false;\n }\n if (Array.isArray(card)) {\n card.forEach((c) => { \n dest.push(c); \n });\n }\n else {\n dest.push(card);\n }\n evdata.success = true;\n this._event(Game.EV.MOVE, evdata); \n if (from == 't') {\n let last = this.tableau[fromIx - 1].last();\n this._event(Game.EV.REVEAL, {\n tableau: fromIx,\n card: last\n });\n }\n return true;\n }", "function cardMovement(event) {\n // prevent default action (open as link for some elements)\n event.preventDefault();\n // move dragged element to the selected drop target\n let cardName = dragged.parentNode.className;\n let cardNum = parseFloat(cardName.slice(0, 3));\n let left = cardNum - 1 + \"_card\";\n let right = cardNum + 1 + \"_card\";\n let up = cardNum - 6 + \"_card\";\n let down = cardNum + 6 + \"_card\";\n\n if (event.target.className != \"card\") {\n if (\n event.target.className == left ||\n event.target.className == right ||\n event.target.className == up ||\n event.target.className == down\n ) {\n event.target.style.background = \"\";\n dragged.parentNode.removeChild(dragged);\n event.target.appendChild(dragged);\n }\n }\n}", "move(id1, id2) {\n //move takes in two indexes: these represent the cards you clicked on \n if (this.board[id1] == this.board[id2]) {\n this.score += 1; \n this.matched[id1] = true;\n this.matched[id2] = true;\n }\n\n //check if the user won after a move \n if (this.score == 6) {\n this.won = true; \n }\n }", "function makeMove(e) {\n if(e.target.id >= 1 && e.target.id <= 9 && !e.target.classList.contains('selected')) {\n //Increment selected fields counter\n logic.incrementCount();\n //Save selected field to data array\n logic.addField(e.target.id-1);\n //Update UI\n e.target.classList.add('selected');\n e.target.removeEventListener('click', e); \n logic.getActivePlayer() === 1 ? e.target.innerText = 'O' : e.target.innerText = 'X';\n afterMove();\n } \n }", "function cardUp() {\n openList.push($(this).children('i').attr('class'));\n counter++;\n $('.moves').html(Math.floor(counter / 2));\n startTimer();\n //once two cards are choosen\n if (openList.length === 2) {\n stars();\n modalStars();\n //if matched\n if (openList[0] === openList[1]) {\n matched();\n matchCount++;\n matchingCards.push(matchCount);\n if (matchingCards.length == 8) {\n winner();\n }\n //no match\n } else {\n unMatched();\n }\n }\n }", "function move() {\n \n let elem = playCard; // Elem is the canvas element of the play card\n \n let bottom = 0; // Bottom and side are the base position of the play card, so in the right corner of the screen\n\tlet side = 0;\n \n // Elem (representing the play card) must move to the position of the clicked card\n // In order to do so, the style of the clicked card is saved in temporaryStyle \n\tlet temporaryStyle = window.getComputedStyle(document.getElementById(clickedCardId));\n \n // NewBottom and newSide are the bottom and side positions of the clicked card\n\tlet newBottom = parseInt(temporaryStyle.getPropertyValue('bottom'), 10); \n\tlet newSide = parseInt(temporaryStyle.getPropertyValue('right'), 10);\n \n // FactorSide and factorBottom are the factors by which the play card must move up and left to reach the clicked card in 100 steps\n\tlet factorSide = (newSide/100)\n\tlet factorBottom = (newBottom/100)\n\n // The z-index of all key cards is set to 0 in css\n // The z-index of the play card is set to 1 in css, to make it flow OVER the key cards\n // The z-index of the clicked card is temporarily set to 2 during the movement so that the play card disappears IN the deck\n document.getElementById(clickedCardId).style.zIndex = 2;\n \n // Id is a setinterval function that executes the function frame every 5 miliseconds\n\tlet id = setInterval(frame, 5);\n \n // Frame adds one factor to the bottom and side until the position of the play card is not anymore lower than the clicked card\n // In that case, the interval is cleared, and the function moveBack is executed\n function frame() {\n if (bottom < newBottom) {\n bottom = bottom + factorBottom\n side = side + factorSide\n elem.style.bottom = bottom + 'px';\n elem.style.right = side + 'px';\n clickable = false; // During the move, clickable is false so no card can be clicked during the movement\n } else {\n\t clearInterval(id);\n moveBack();\n }\n }\n \n // MoveBack sets the position of the play card back to the bottom right corner of the screen\n \tfunction moveBack(){\n\t\telem.style.bottom = 0 + \"%\";\n\t\telem.style.right = 0 + \"%\";\n document.getElementById(clickedCardId).style.zIndex = 0; \t// The key card is set back to it's initial z-value\n\t\tcreateCard(contextPlayCard, playCard); \t\t\t\t\t// A new play card is created and displayed on the canvas\n\t\tclickable = true; \t\t\t\t\t\t\t\t\t\t// Clickable is set to true, so that a new card can be clicked\t\n\t}\n \n }", "goNextMove() {\n let piecesToMove = null; // this holds the pieces that are allowed to move\n let piecesToStayStill = null; // the others\n if (this.WhiteToMove == true) {\n // white is moving\n piecesToMove = this.GameData.getPiecesOfColor(PieceColors.White); // get the info from the model\n piecesToStayStill = this.GameData.getPiecesOfColor(PieceColors.Black);\n } else {\n // black is moving\n piecesToMove = this.GameData.getPiecesOfColor(PieceColors.Black);\n piecesToStayStill = this.GameData.getPiecesOfColor(PieceColors.White);\n }\n // add listeners for the pieces to move\n piecesToMove.forEach(curPiece => {\n this.GameView.bindMouseDown(\n curPiece.RowPos,\n curPiece.ColPos,\n this.mouseDownOnPieceEvent\n );\n });\n\n // remove listeners for the other pieces\n piecesToStayStill.forEach(curPiece => {\n // TRICKY: remove piece and add it again to remove the listeners !\n this.GameView.removePieceFromBoard(\n curPiece.RowPos,\n curPiece.ColPos,\n curPiece.getClassName()\n );\n this.GameView.putPieceOnBoard(\n curPiece.RowPos,\n curPiece.ColPos,\n curPiece.getClassName()\n );\n });\n this.WhiteToMove = !this.WhiteToMove; // switch player\n }", "function clickCard() {\n $(\".card\").click(function() {\n // Return the function if the card is open\n if ($(this).hasClass(\"open show\")) {\n return;\n }\n // Return if there are 2 opened cards\n if (openCards.length === 2) {\n return;\n }\n // Display the card symbol and add the card to openCards list\n $(this).addClass(\"open show\");\n openCards.push($(this));\n // Start runner if this is the first move\n if (moves === 0) {\n startRunner();\n }\n // Check if the cards match\n if (openCards.length === 2) {\n if (openCards[0][0].firstChild.className === openCards[1][0].firstChild.className) {\n setTimeout(addMatch,300);\n } else {\n setTimeout(removeClasses,1300);\n }\n // Increase moves after checking\n incrementMoves();\n }\n });\n }", "function cardClick(){\n\tthis.classList.add('show', 'open');\n\tclickedCards.push(event.target);\n\tif(clickedCards.length === 2){\n\t\tmoves++;\n\t\tif(moves === 1){\n\t\t\ttimerStart();\n\t\t\tmovesCounter.innerHTML = `<span class=\"moves green\">${moves} Move</span>`;\n\t\t} else if(moves >= 2 && moves <= 20) {\n\t\t\tmovesCounter.innerHTML = `<span class=\"moves green\">${moves} Moves</span>`;\n\t\t} else if(moves >= 21 && moves <= 29){\n\t\t\tmovesCounter.innerHTML = `<span class=\"moves gold\">${moves} Moves</span>`;\n\t\t} else {\n\t\t\tmovesCounter.innerHTML = `<span class=\"moves red\">${moves} Moves</span>`;\n\t\t}\n\t\tif(clickedCards[0].innerHTML === clickedCards[1].innerHTML){\n\t\t\tmatching();\n\t\t\twinCheck();\n\t\t} else {\n\t\t\tnotMatching();\n\t\t}\n\t}\n\tcheckRating(moves);\n}", "function clickedCard() {\n if (event.target.classList.contains('card')) {\n event.target.classList.add('open', 'show', 'temp');\n tempArray.push(event.target);\n if (tempArray.length == 2) {\n if (tempArray[0] != tempArray[1]) {\n move++;\n moves.innerHTML = move;\n checkMatch();\n if (move === 15) {\n stars.children[2].classList.add('hide');\n starsArray.pop();\n } else if (move === 19) {\n stars.children[1].classList.add('hide');\n starsArray.pop();\n }\n } else {\n tempArray.splice(1);\n }\n }\n }\n}", "function actionMove (col, row){\n addXO(col,row)\n}", "function cardClicked(event) {\n openCardsList.push(this);\n this.classList.add('open', 'show', 'disable');\n if (openCardsList.length === 2 && openCardsList[0].innerHTML === openCardsList[1].innerHTML) {\n match();\n addMoves();\n }\n if (openCardsList.length === 2 && openCardsList[0].innerHTML != openCardsList[1].innerHTML) {\n noMatch();\n addMoves();\n }\n if (!watch.isOn) {\n watch.start();\n }\n}", "function move() {\r\n\t\r\n}", "function cardClick() {\n\tif (clickedCards.length === 2 || matchedCards.includes(this.id)) {\n\t\treturn;\n\t}\n\tif(clickedCards.length === 0 || this.id != clickedCards[0].id){\n\n\t\tif(timeTrigger){\n\t\t\ttimerStart();\n\t\t\ttimeTrigger = false;\n\t\t}\n\t\tthis.classList.add('show', 'open');\n\t\tclickedCards.push(event.target);\n\t\tdetermineAction();\n\t}\n\telse {\n\t\treturn;\n\t}\n\tsetRating(moves);\n}", "static async onClick(event) {\n // filtering clicked html\n let currentCard = Board.instance.getSelectedCard(event.target);\n if (!currentCard)\n return;\n\n // ignoring some click events if matches some constraints \n if (!currentCard ||\n currentCard.isVisible() ||\n currentCard.isMatched() ||\n Board.instance.waitingAnimationFinish) {\n return;\n }\n\n // changing card state\n currentCard.toggle();\n Board.instance.selectedCards.push(currentCard);\n\n // updating moves\n Board.instance.movesCount++;\n document.querySelector('#moves').textContent = Board.instance.movesCount.toString();\n \n // removing stars from board(if any to remove)\n Board.instance.removeStars();\n\n // only one card was selected, nothing to handle \n if (Board.instance.selectedCards.length === 1)\n return;\n \n // checking if card pair is equal\n const previousCard = Board.instance.cardMap[Board.instance.selectedCards[0].getUid()];\n if (currentCard.getUid() == previousCard.getFkUid()) {\n // cards are equal!!! :D\n // checking if game finished\n await Board.instance.handleEqualCards(currentCard, previousCard);\n }\n else {\n // cards are different :(\n // animating different cards\n await Board.instance.handleDifferentCards(currentCard, previousCard);\n }\n\n // clear selectedCards\n Board.instance.selectedCards.splice(0, Board.instance.selectedCards.length);\n return;\n }", "function clickFunction() {\r\n\r\n let moveCounter = document.querySelector('.moves');\r\n let moves = 0;\r\n moveCounter.innerText = moves;\r\n\r\n let allCards = document.querySelectorAll('.card');\r\n let openCards = []; // saves opened cards in an array\r\n\r\n let movesText = document.querySelector('.moves_text');\r\n let stars = document.querySelector('.stars');\r\n\r\n const item = document.getElementsByTagName('li');\r\n\r\n allCards.forEach(function(card) {\r\n card.addEventListener('click', function() {\r\n\r\n if (!card.classList.contains(\"open\") && !card.classList.contains(\"show\") && !card.classList.contains(\"match\") && openCards.length < 2) {\r\n openCards.push(card);\r\n card.classList.add(\"open\", \"show\");\r\n\r\n if (openCards.length == 2) {\r\n if (openCards[0].dataset.card == openCards[1].dataset.card) {\r\n\r\n openCards[0].classList.add(\"match\", \"open\", \"show\");\r\n openCards[1].classList.add(\"match\", \"open\", \"show\");\r\n\r\n openCards = [];\r\n\r\n } else {\r\n\r\n function closeCards() {\r\n openCards.forEach(function(card) {\r\n card.classList.remove(\"open\", \"show\");\r\n });\r\n openCards = [];\r\n }\r\n setTimeout(closeCards, 1000);\r\n\r\n } // end of else\r\n\r\n moves += 1;\r\n moveCounter.innerText = moves;\r\n\r\n item[1].innerHTML = `With ${moves} moves`;\r\n\r\n /* if 1 - \"Move\", if more than 1 - \"Moves\" */\r\n if (moves == 1) {\r\n movesText.innerHTML = \"Move\";\r\n } else {\r\n movesText.innerHTML = \"Moves\";\r\n }\r\n\r\n /* stars - game rating */\r\n function hideStar() {\r\n const starList = document.querySelectorAll('.stars li');\r\n for (star of starList) {\r\n if (star.style.display !== 'none') {\r\n star.style.display = 'none';\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (moves == 11) {\r\n hideStar();\r\n } else if (moves == 15) {\r\n hideStar();\r\n }\r\n\r\n }\r\n }\r\n });\r\n });\r\n\r\n }", "function moveCards(event) {\n event.from.forEach(function(fromPos, index) {\n var toPos = event.to[index];\n animationQueue.add(function() {\n console.log(\"[START] move card event from \"+fromPos+\" to \"+toPos);\n $(\"#slot_\" + fromPos)\n .one(\"webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend\", function() {\n console.log(\"[END] move card event from \"+fromPos+\" to \"+toPos);\n animationQueue.next();\n })\n .attr(\"id\", \"slot_\" + toPos);\n return false;\n });\n console.log(\"[QUEUED] move card event from \"+fromPos+\" to \"+toPos);\n });\n}", "function addCard() {\n // match timer start with first click\n const viewCard = this;\n const previousCard = openedCards[0];\n\n if (openedCards.length === 1) {\n card.classList.add('open', 'show', 'remove');\n openedCards.push(this);\n moves++;\n moveNumber.textContent = moves;\n compare(viewCard, previousCard);\n stars();\n } else {\n card.classList.add('open', 'show', 'remove');\n openedCards.push(this);\n stars();\n }\n\n if (isFirstClick === true) {\n timer();\n isFirstClick = false;\n }\n }", "function after_move() {\n var svl_id = $(moving_channel_div).find(\".card.channel\").attr(\"svl_id\");\n var idx_from = $(selected_channel_div).find(\".card.channel\").attr(\"channel_idx\");\n var idx_to = $(moving_channel_div).find(\".card.channel\").attr(\"channel_idx\");\n \n console.log(\"selected_channel_div:\" + selected_channel_div);\n //restore style\n selected_channel_div.css({\"top\": \"auto\",\"left\": \"auto\"});\n selected_channel_div.find(\".card-content\").show();\n selected_channel_div.find(\".card-favorite-icon\").show();\n $(\".item .col-md-3\").find(\".before-move\").removeClass(\"before-move\");\n //insert slected channel to new position\n console.log(\"---------moving_index:\" + moving_index)\n \n if (idx_from == idx_to || \n (moving_index == selected_channel_index && selected_channel_page_idx == g_channel_page_idx) || \n idx_to == undefined) {\n //remove clone channel card\n removeCloneDiv();\n //show channel\n show_selected_postion_channel(selected_channel_index);\n return;\n }\n \n if (selected_channel_page_idx == g_channel_page_idx) {\n //hide selected card\n $(\".item .col-md-3\").eq(selected_channel_index).remove();\n }\n\n /* last last position case */\n if (is_last_last_channel_card_positon(moving_index)) {\n if (0 == moving_index) {\n /* insert after to last channel card postion */\n selected_channel_div.insertAfter(moving_channel_div);\n /* channel page idx need --, due to correct update channel after move channel*/\n g_channel_page_idx--;\n } else {\n /* insert after to last channel card postion */\n selected_channel_div.insertAfter($(\".item .col-md-3\").eq(moving_index - 1));\n }\n\n /* insert to last postion channel index rewrite to last index + 1 */\n //$(moving_channel_div).find(\".card.channel\").attr(\"channel_idx\", g_channel_cnt);\n idx_to = g_channel_cnt;\n } \n /* not last last position case */\n else {\n /* in selected channel page && selected_channel_index < moving_index */\n if (selected_channel_index < moving_index && \n selected_channel_page_idx == g_channel_page_idx) {\n selected_channel_div.insertBefore($(\".item .col-md-3\").eq(moving_index - 1));\n } \n else {\n selected_channel_div.insertBefore($(\".item .col-md-3\").eq(moving_index));\n }\n\n //remove active card\n $('#id_collapsible_channel').find(\".item .card.channel\").attr(\"class\", \"card channel\");\n //set selected channel to active\n $(selected_channel_div).find(\".card.channel\").attr(\"class\", \"card channel active\");\n }\n\n //switch_channel_by_channel_id(svl_id, ch_from, ch_to, FAVORITE_TYPE_0);\n insert_channel_by_ch_idx(svl_id, MaskList.Mask_favorite, MaskValueList.MaskValue_favorite, idx_from, idx_to, FAVORITE_TYPE_0);\n\n /* store to acfg */\n store_channel_list_to_acfg();\n\n}", "function addMove() {\n\tmoves++;\n\tconst movesText = document.querySelector('.moves')\n\tmovesText.innerHTML = moves;\n}", "move() {\n\n }", "findSpot(suit, value, _index, drawCard) {\n var hasMoved = false;\n // Sets up local variables for the arrays for all the cards on the board\n var columns = [\n this.state.col_1,\n this.state.col_2,\n this.state.col_3,\n this.state.col_4,\n this.state.col_5,\n this.state.col_6,\n this.state.col_7\n ];\n // Sets up local variables for the arrays for all the cards on the upper dropzones\n var upColumns = [\n 'up_1',\n 'up_2',\n 'up_3',\n 'up_4'\n ];\n upColumns.map((item, index) => {\n if (this.validMove({ suit: suit, value: value, column: upColumns[index], findSpotCheck: true, upperDrop: true, drawCard: drawCard, index: _index }) && !hasMoved) {\n this.showDropSpots({ suit: suit, value: value, index: _index, upperDrop: true });\n hasMoved = true;\n this.moveItem({ suit: suit, value: value, column: upColumns[index], index: _index, upperDrop: true });\n return false;\n }\n return true;\n });\n if (!hasMoved) {\n columns.map((item, index) => {\n if (this.validMove({ suit: suit, value: value, column: index + 1, findSpotCheck: true, drawCard: drawCard, index: _index }) && !hasMoved) {\n this.showDropSpots({ suit: suit, value: value, index: _index });\n hasMoved = true;\n this.moveItem({ suit: suit, value: value, column: index + 1, index: _index });\n return false;\n }\n return true;\n });\n }\n }", "function makeMove(x1, y1, x2, y2) {\n /** @type {glassevent} */\n var dir;\n dir = getDirection(x1, y1, x2, y2);\n\n switch (dir) {\n case glassevent.RIGHT:\n activeCard.right();\n break;\n case glassevent.LEFT:\n activeCard.left();\n break;\n case glassevent.UP:\n activeCard.up();\n break;\n case glassevent.DOWN:\n activeCard.down();\n break;\n case glassevent.TAP:\n activeCard.tap();\n break;\n }\n }", "function addMove() {\n\tmoves++;\n\tconst movesText = document.querySelector('.moves');\n\tmovesText.innerHTML = moves;\n}", "function clickCard(event) {\n // discard clicks on already matched or open cards\n if (event.target.nodeName === 'LI'\n && !(event.target.classList.contains(\"match\"))\n && !(event.target.classList.contains(\"open\")) ) {\n\n clickCounter += 1;\n\n if(clickCounter == 1) {\n startTimer();\n }\n\n //increase moveCounter every second click (one move = turning two cards)\n if(clickCounter % 2 == 0) {\n countMoves();\n\n // remove stars after 12 moves and then again every two moves\n // if(numberOfMoves > 0) { // for testing\n if(numberOfMoves >= 12 && numberOfMoves % 4 == 0) {\n removeStar();\n }\n }\n\n turnCard(event); // show the hidden side of the card\n\n openCardCounter += 1; // that many cards are turned over right now\n\n\n // if this is the 3rd card that has been clicked, turn first two cards over again and set openCardCounter to one\n if(openCardCounter == 3) {\n thirdCard();\n openCardCounter = 1;\n }\n\n // if it is the 1st or 2nd card that has been clicked, push the event targets and symbols in arrays\n // (if it had been the 3rd card, it will now be the 1st, as the arrays and counter have been reset\n cardArray.push(event.target);\n symbolArray.push(event.target.firstElementChild.classList[1])\n\n // if two cards are open, compare them\n if (openCardCounter == 2) {\n compareCards(event);\n }\n\n // if all cards have been matched, end the game\n // if (matchList == 4) { // for testing\n if(matchList == cards.length) {\n gameEnd();\n }\n }\n}", "function placeCards(x) {\n let index = 0;\n moveCount.html('0');\n cardIcon.each(function () {\n let icon = cards[index].icon;\n $(this).addClass(icon);\n index++;\n });\n}", "function move() {\n\t\tmovePiece(this);\n\t}", "function passCards()\n {\n DOM.cardsContainer.classList.remove(CSS.hidden);\n DOM.container.classList.remove(CSS.container.pause);\n DOM.container.classList.add(CSS.container.game);\n state.screen = \"GAME\";\n\n if (state.newGame)\n {\n useMemorisingTimeId = cards[0].addEventListener(\"move\", useMemorisingTime);\n }\n else\n {\n state.cardsTurnable = true;\n }\n\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(\n DOM.game.field.rows[cards[counter].dataset.position.row].cells[cards[counter].dataset.position.col],\n {height: sizes.card.height + \"PX\", width: sizes.card.width + \"PX\"},\n true\n );\n }\n\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, false);\n desk.removeEventListener(\"closeFan\", passCardsId);\n }", "function move()\n{\n\n}", "function Move_Card(card_to_move: GameObject)\n\t{\n\t\tif(Physics.Raycast (ray, hit))\n\t\t{\n\t\t\tcard_to_move.GetComponent(Base_Card).SendMessage(\"Local_Move\", Vector3.Lerp(card_to_move.transform.position, Vector3(hit.point.x, 3.0, hit.point.z), MOVE_SPEED));\n\t\t}\n\t}", "function moves(position) { // a position like 'a3', 'e3'\n let player0 = (whichPlayer(position) == '0')\n let player1 = (whichPlayer(position) == '1')\n className = document.getElementById(position).firstChild.classList[0]\n console.log(className)\n // console.log(whichPlayer(position))\n // console.log(player0)\n // console.log(player1)\n let nextMoves = []\n let filteredMoves = []\n switch (className) {\n case 'pawn':\n // moving and capturing moves :)) :\n if (player0) {\n let forward = moveXY(position, 0, 1)\n if (forward == 'outOfBoard') {\n // TODO special case, getting a bishop\n } else if (!isOccupied(forward)) {\n nextMoves.push(forward)\n if (position.charAt(1) === '2') {\n let forward2 = moveXY(position, 0, 2)\n if (forward2 != 'outOfBoard' && !isOccupied(forward2)) {\n nextMoves.push(forward2)\n }\n }\n }\n // capturing:\n if (!outOfBoard(moveXY(position, -1, 1)) &&\n whichPlayer(moveXY(position, -1, 1)) == '1')\n nextMoves.push(moveXY(position, -1, 1))\n if (!outOfBoard(moveXY(position, +1, 1)) &&\n whichPlayer(moveXY(position, +1, 1)) == '1')\n nextMoves.push(moveXY(position, +1, 1))\n } else if (player1) {\n let forward = moveXY(position, 0, -1)\n if (forward == 'outOfBoard') {\n // TODO special case, getting a bishop\n } else if (!isOccupied(forward)) {\n nextMoves.push(forward)\n if (position.charAt(1) === '7') {\n let forward2 = moveXY(position, 0, -2)\n if (forward2 != 'outOfBoard' && !isOccupied(forward2)) {\n nextMoves.push(forward2)\n }\n }\n }\n // capturing:\n if (!outOfBoard(moveXY(position, -1, -1)) &&\n whichPlayer(moveXY(position, -1, -1)) == '0')\n nextMoves.push(moveXY(position, -1, -1))\n if (!outOfBoard(moveXY(position, +1, -1)) &&\n whichPlayer(moveXY(position, +1, -1)) == '0')\n nextMoves.push(moveXY(position, +1, -1))\n }\n // keep the ones inside the board\n filteredMoves = nextMoves.filter((x) => {\n return x != 'outOfBoard'\n })\n // TODO filter be the position being empty\n console.log(nextMoves)\n console.log(filteredMoves)\n break;\n case 'rook':\n plusX = true\n plusY = true\n minusX = true\n minusY = true\n for (let i = 1; i < 8; i++) {\n // first check the conditions\n if (plusX) {\n if (outOfBoard(moveXY(position, i, 0))) {\n plusX = false\n } else if (isOccupied(moveXY(position, i, 0))) {\n // we can also attack the first piece partaining to the other player\n thisPlayer = whichPlayer(position)\n thatPlayer = whichPlayer(moveXY(position, i, 0))\n if (thisPlayer + thatPlayer == 1) {\n nextMoves.push(moveXY(position, i, 0))\n }\n plusX = false\n }\n }\n if (plusY) {\n if (outOfBoard(moveXY(position, 0, i))) {\n plusY = false;\n } else if (isOccupied(moveXY(position, 0, i))) {\n // we can also attack the first piece partaining to the other player\n thisPlayer = whichPlayer(position)\n thatPlayer = whichPlayer(moveXY(position, 0, i))\n if (thisPlayer + thatPlayer == 1) {\n nextMoves.push(moveXY(position, 0, i))\n }\n plusY = false\n }\n }\n if (minusX) {\n if (outOfBoard(moveXY(position, -i, 0))) {\n minusX = false\n } else if (isOccupied(moveXY(position, -i, 0))) {\n // we can also attack the first piece partaining to the other player\n thisPlayer = whichPlayer(position)\n thatPlayer = whichPlayer(moveXY(position, -i, 0))\n if (thisPlayer + thatPlayer == 1) {\n nextMoves.push(moveXY(position, -i, 0))\n }\n minusX = false\n }\n }\n if (minusY) {\n if (outOfBoard(moveXY(position, 0, -i))) {\n minusY = false\n } else if (isOccupied(moveXY(position, 0, -i))) {\n // we can also attack the first piece partaining to the other player\n thisPlayer = whichPlayer(position)\n thatPlayer = whichPlayer(moveXY(position, 0, -i))\n if (thisPlayer + thatPlayer == 1) {\n nextMoves.push(moveXY(position, 0, -i))\n }\n minusY = false\n }\n }\n // then for all the true conditions, add the positions :D\n if (plusX) {\n nextMoves.push(moveXY(position, i, 0))\n }\n if (plusY) {\n nextMoves.push(moveXY(position, i, 0))\n }\n if (minusX) {\n nextMoves.push(moveXY(position, 0, -i))\n }\n if (minusY) {\n nextMoves.push(moveXY(position, 0, -i))\n }\n }\n filteredMoves = nextMoves\n break;\n case 'knight':\n // eight possible moves, just test them if are either free or occupied, we will just filter them :D\n break;\n case 'bishop':\n // will be similar to rook ----> they actually could both be solved with different (literal) for a common function\n break;\n case 'queen':\n // the same as the bishop, and as the rook\n break;\n case 'king':\n // easier than the rest, just a square move, but we need to check the the position is 'safe' ----> function for this\n break;\n default:\n\n }\n return filteredMoves\n }", "function addMyCards(card, divName, pos) {\r\n let strs = card.split(\" \");\r\n let num = strs[0];\r\n let type = strs[1];\r\n\r\n // add points of my cards\r\n if (divName == \"my-cards\") {\r\n if (parseInt(num) > 10) {\r\n sum += 10\r\n } else {\r\n sum += parseInt(num)\r\n }\r\n }\r\n if (sum > 21) { // if exceed disable the draw btn\r\n $(\"#game-draw\").addClass(\"disabled\")\r\n $(\"#game-draw\").prop(\"disabled\", true)\r\n }\r\n\r\n // add padding\r\n if ($(\"#\" + divName).children().length == 0) {\r\n let interval = \" <div class=\\\"col-sm-1\\\">\" +\r\n \" </div>\"\r\n $(\"#\" + divName).append(interval)\r\n }\r\n let cardName = type + \"-\" + num + \".jpg\";\r\n let newCard;\r\n // hide first card on the opponents' deck\r\n if (divName === \"opponent-cards\" && $(\"#\" + divName).children().length == 1) {\r\n newCard = \"<img src=\\\"\" + CARD_STATIC_URL\r\n + \"blue-card.png\" + \"\\\" class=\\\"col-sm-2 cards img-rounded\\\">\"\r\n } else {\r\n newCard = \"<img src=\\\"\" + CARD_STATIC_URL\r\n + cardName + \"\\\" class=\\\"col-sm-2 cards img-rounded\\\">\"\r\n }\r\n if (pos == -1) {\r\n $(\"#\" + divName).append(newCard)\r\n } else if (pos == 0) {\r\n $(\"#\" + divName + \" img:nth-child(2)\").before(newCard)\r\n }\r\n}", "function click(card) {\n card.addEventListener(\"click\", function() {\n if (switchTimer) {\n Timer = setInterval(setTimer, 1000);;\n switchTimer = false;\n }\n //Compare cards, and toggle each card's class depending on status\n card.classList.add(\"open\", \"show\", \"disabled\");\n openedCards.push(this);\n if (openedCards.length === 2) {\n moves++;\n numberMoves.innerHTML = moves;\n //Cards matched\n if (openedCards[0].innerHTML === openedCards[1].innerHTML) {\n openedCards[0].classList.add(\"match\", \"disabled\");\n openedCards[1].classList.add(\"match\", \"disabled\");\n matchedCards.push(openedCards[0], openedCards[1]);\n openedCards = [];\n //Cards unmatched\n } else {\n openedCards[0].classList.remove(\"open\", \"show\", \"disabled\");\n openedCards[1].classList.remove(\"open\", \"show\", \"disabled\");\n openedCards = [];\n }\n }\n\n //Star ratings determined\n if (moves < 15) {\n starNumber = 3;\n numberStars.innerHTML = `<li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li><li><i class=\"fa fa-star\"></i></li>`\n } else if (moves < 25) {\n starNumber = 2;\n numberStars.innerHTML = `<li><i class=\"fa fa-star\"></i></li><li><i class=\"fa fa-star\"></i></li>`\n\n } else {\n starNumber = 1;\n numberStars.innerHTML = `<li><i class=\"fa fa-star\"></i></li>`\n\n }\n gameOver();\n\n\n });\n }", "move(event) {\n event.target.classList.remove('free'); //The 'free' class is removed indcating the space cannot be played again\n event.target.classList.add(this._playClass); //Adds the class for the current player (The 'X' or the 'O')\n event.target.classList.add('taken'); // A class of 'taken' is given showing the space is played\n board.updateBoard(event, this); //Calls the updateBoard method to update the board._board array.\n this.turn = false; //Sets the turn of the player that just moved to false\n\n //Sets the state of the other player's turn to true\n if (this._player === 'player1') {\n player2.turn = true;\n } else if (this._player === 'player2') {\n player1.turn = true;\n } else {\n return false;\n }\n\n //If player 2 is a computer player, the computerMove method is evoked\n if (this._player === 'player1' && player2._isComputer && !player1._isWinner && !player2._isWinner) {\n player2.computerMove();\n }\n }", "function addPlayerMove(move) {\n\t\t// Player does not have those cards if he or she passes\n\t\tif (move.moveType == moveType.PASS) {\n\t\t\tfor (var i = 0, length = vm.cardNames.length; i < length; i++) {\n\t\t\t\tmove.person.cards[vm.cardNames[i]].state = cardState.NOT_OWN;\n\t\t\t}\n\t\t} else {\n\t\t\tvm.hasShow = true; \n\t\t}\n\t\t\n\t\tvm.moves.push(move);\n\t}", "function onCardClicked() {\n //get the card that was clicked\n let selectedId = $(this).attr('id').replace('card-','');\n let selectedCard = cards[selectedId];\n\n if (selectedCard.isDisplayed() || openCards.length >= 2) {\n return;\n } else {\n //increment click counter\n moveCount++;\n $('.moves').text(moveCount);\n\n //check move count and decrement stars if needed.\n if (moveCount == 20) {\n $('#star-3').removeClass('fa-star');\n $('#star-3').addClass('fa-star-o');\n } else if (moveCount == 30) {\n $('#star-2').removeClass('fa-star');\n $('#star-2').addClass('fa-star-o');\n }\n\n //display the card.\n selectedCard.flip();\n\n //after short delay, check if there is a match.\n //this is done so that the cards do not immediately flip back\n //preventing you from seeing the 2nd card.\n setTimeout(function() {\n if (!findCardMatch(selectedCard)) {\n //add selected card to list of open cards\n openCards.push(selectedCard);\n\n if (openCards.length == 2) {\n //hide both cards\n openCards[0].flip();\n openCards[1].flip();\n openCards = [];\n }\n }\n }, 800);\n }\n}", "function listener(e) {\n let card = e.target;\n moves++;\n //when moves = 1 -> start stopwatch\n if (moves === 1) {\n second++;\n stopWatch();\n }\n card.className = 'card open show disabled';\n //checking pairs of cards\n checkCardPairsArray(card);\n}", "function swap_after_move() {\n var svl_id = $(moving_channel_div).find(\".card.channel\").attr(\"svl_id\");\n var ch_from = $(selected_channel_div).find(\".card.channel\").attr(\"channel_id\");\n var ch_to = $(moving_channel_div).find(\".card.channel\").attr(\"channel_id\");\n \n console.log(\"selected_channel_div:\" + selected_channel_div);\n //restore style\n selected_channel_div.css({\"top\": \"auto\",\"left\": \"auto\"});\n selected_channel_div.find(\".card-content\").show();\n selected_channel_div.find(\".card-favorite-icon\").show();\n $(\".item .col-md-3\").find(\".before-move\").removeClass(\"before-move\");\n //insert slected channel to new position\n console.log(\"---------moving_index:\" + moving_index)\n \n if (ch_from == ch_to || \n (moving_index == selected_channel_index && selected_channel_page_idx == g_channel_page_idx) || \n ch_to == undefined) {\n //remove clone channel card\n removeCloneDiv();\n //show channel\n show_selected_postion_channel(selected_channel_index);\n return;\n }\n \n if (selected_channel_page_idx == g_channel_page_idx) {\n //hide selected card\n $(\".item .col-md-3\").eq(selected_channel_index).remove();\n }\n \n selected_channel_div.insertBefore($(\".item .col-md-3\").eq(moving_index));\n\n //remove active card\n $('#id_collapsible_channel').find(\".item .card.channel\").attr(\"class\", \"card channel\");\n //set selected channel to active\n $(selected_channel_div).find(\".card.channel\").attr(\"class\", \"card channel active\");\n \n sort_channel_by_channel_id(svl_id, ch_from, ch_to);\n update_current_page_ch_list();\n\n /* store to acfg */\n store_channel_list_to_acfg();\n\n}", "handleOnCardClicked(event) {\n const card = event.target;\n // skip and return if event target is not li or \n // if it is already open\n // if it is already matched\n if (card.nodeName.toLowerCase() !== 'li' ||\n this.mModel.mOpenCards.includes(card) ||\n this.mModel.mMatchedCards.includes(card)) {\n console.log('skipped click handling')\n return;\n }\n\n // add move, and then check resulting moves\n this.checkStars(this.mModel.addMove());\n\n // add card to the list of open cards\n this.mModel.addCardToOpenCards(card);\n }", "applyMove(move) {\n const { piece: pieceToMove, direction: { dx, dy } } = move;\n\n const clonedPieces = this.pieces.map(piece => {\n const newPiece = clonePiece(piece);\n if (newPiece.id === pieceToMove.id) {\n newPiece.pos.x += dx;\n newPiece.pos.y += dy;\n }\n return newPiece;\n });\n\n return new Board({\n pieces: clonedPieces,\n height: this.height,\n width: this.width,\n });\n }", "shiftCards() {\n\n\t\tfor (var i = this.cards.children.length - 1; i >= 0; i--) {\n\n\t\t\tvar card = this.cards.getChildAt(i);\n\t\t\tvar newX = card.x - 20;\n\n\t\t\tif (newX < this.leftBound) {\n\t\t\t\tnewX = this.leftBound;\n\t\t\t}\n\n\t\t\tif (newX != card.x) {\n\t\t\t\tcard.moveCardTo(newX, card.y, 1);\n\t\t\t}\n\t\t}\n\t}", "function humanMove(elementid){\n\n\tvar element = document.querySelector(\"#\"+elementid);\n\telement.style.backgroundColor = \"#dc685a\";\n\telement.style.color = \"white\";\n\telement.innerHTML = \"+\";\n\tif(screen.width > 450)\n\t\telement.style.fontSize = \"120px\";\n\telse\n\t\telement.style.fontSize = \"80px\"; \n\telement.style.textAlign= \"center\";\n\telement.className += \" clicked\";\n\telement.style.textShadow=\"2px 2px 4px rgba(0, 0, 0, 0.2)\";\n\n\tif(items.game.status === \"running\" && items.game.currentState.turn === \"+\") {\n var indx = parseInt(element.id[1]*1-1);\n\n var next = new State(items.game.currentState);\n next.board[indx] = \"+\";\n console.log(next.board);\n\n next.nextTurn();\n\n items.game.advanceTo(next);\n\n }\n\n}", "function dropCard() {\n player.cards.onHand.forEach((element, c) => {\n if (element.selected) {\n element.selected = false;\n // element.bgc = \"#EEDFA6\";\n myDom.canvas3.removeEventListener(\"mousemove\", getCurPos, false);\n player.battleGround.spots.forEach((spot, s) => {\n // console.log(spot.x, spot.y, element.x, element.y + element.height);\n if (\n element.y + element.height > spot.y &&\n element.y + element.height < spot.y + spot.height &&\n element.x > spot.x &&\n element.x + element.width < spot.x + spot.width\n ){\n\n const ar = player.cards.onHand[c];\n player.cards.onHand.splice(c, 1);\n player.cards.onSpot[s] = new Card(\n s,\n ar.player,\n ar.image.src,\n ar.imageSelect.src,\n ar.imageBg,\n ar.physic,\n ar.magic,\n ar.hp,\n ar.atribute,\n ar.speaking,\n ar.degrees,\n true,\n false,\n \n player.battleGround.spots[s].x +\n player.battleGround.spots[s].width / 2 -\n ar.width / 2,\n player.battleGround.spots[s].y -\n player.battleGround.spots[s].height * 1.2,\n ar.height,\n ar.width\n );\n player.cards.onSpot[s].load();\n enemy.cards.onSpot[s] = new Card(\n s,\n false,\n ar.image.src,\n ar.imageSelect.src,\n ar.imageBg,\n ar.physic,\n ar.magic,\n ar.hp,\n ar.atribute,\n ar.speaking,\n ar.degrees,\n true,\n false,\n enemy.battleGround.spots[s].x +\n enemy.battleGround.spots[s].width / 2 -\n ar.width / 2,\n enemy.battleGround.spots[s].y -\n enemy.battleGround.spots[s].height * 1.2,\n ar.height,\n ar.width\n );\n enemy.cards.onSpot[s].load();\n\n\n // re index private index property\n for (let i = 0; i < player.cards.onHand.length; i++) {\n player.cards.onHand[i].index = i;\n }\n // console.log(card.onHand, card.onSpot);\n }\n });\n //if u put card somewhere else than in destiny point than resize,new position on hand\n for (let i = 0; i < player.cards.onHand.length; i++) {\n player.cards.onHand[i].resize();\n }\n }\n });\n}", "function makeMove(cell) {\n if (activePlayer === playerX) {\n piece = 'X';\n if (document.getElementById(event.target.id).innerText === '') {\n document.getElementById(event.target.id).innerText = piece;\n playCount++;\n activePlayer = playerO;\n }\n } else {\n piece = 'O';\n if (document.getElementById(event.target.id).innerText === '') {\n document.getElementById(event.target.id).innerText = piece;\n playCount++;\n activePlayer = playerX;\n }\n }\n}", "function clickedCard(event){\n if(event.target && event.target.nodeName == \"LI\") {\n event.target.addEventListener(\"click\", clickedCard);\n // Turning the cards is just changing the background color to reveal the hidden text\n event.target.style.backgroundColor= \"#00d37e\";\n const cardClass = event.target.className;\n const cardId = event.target.id;\n\n /* If no other card in cardId has the same id as the event.target,\n we add event.target's id to the array.\n Also, if a card has a match, we take from it the possibility of being played again. */\n if (cardsId.includes(cardId) || event.target.classList.length === 3){\n true;\n } else {\n // Add the click to the moves counter\n addMoves();\n // Check for potential matches\n cardsTurned.push(cardClass);\n cardsId.push(cardId);\n checkingTurned();\n }\n }\n}", "function moveCounter() {\n if (clickedCards.length === 0) {\n moves++;\n moveNumber.innerHTML = moves;\n starRating(moves);\n }\n}", "processMove() {\n let movedPieces = this.gameOrchestrator.gameboard.movePiece(this.firstTile, this.secondTile);\n this.gameMove.setMovedPieces(movedPieces);\n this.gameOrchestrator.gameSequence.addGameMove(this.gameMove);\n }", "function makeMovement(event){\n\tvar x = event.clientX - canvas.offsetLeft;\n\tvar y = event.clientY - canvas.offsetTop;\n\tvar col = Math.floor(y / pieceSize) ;\n\tvar row = Math.floor(x / pieceSize) ;\n\t// Check if it's turn of IA or Player;\n\tif (turn==0){\n\t\tplay(row,col);\n\t}\n\tif (turn==1){\n\t\tvar pos = minMax(MINMAX_DEPTH,INIT_MINMAX_FLAG,pieces,validPlays);\n\t\tplay(pos[0],pos[1]);\n\t}\n}", "move () {\n }", "advance () {\n this.frame++\n while (this.carts.filter((c) => c.moved === this.frame).length < this.carts.length) {\n this.carts.filter((c) => c.moved !== this.frame).sort(dynamicSortMultiple('y', 'x')).forEach((c) => {\n try {\n this.moveCart(c)\n } catch (err) {\n console.error(`Problem moving cart in frame ${this.frame}`)\n console.error(err)\n }\n })\n }\n }", "function addCard(newState, action){\r\n\r\n switch (action.pile) { //depending on the suited destination, we perform different moves\r\n case 'leftPostPile':\r\n newState.playerData[`player${action.player}Data`].leftPostPile.unshift(action.card);\r\n break;\r\n case 'middlePostPile':\r\n newState.playerData[`player${action.player}Data`].middlePostPile.unshift(action.card);\r\n break;\r\n case 'rightPostPile':\r\n newState.playerData[`player${action.player}Data`].rightPostPile.unshift(action.card);\r\n break;\r\n default:\r\n }\r\n return newState;\r\n}", "moveItem(item) {\n var suit = item.suit;\n var value = item.value;\n var column;\n\n // Sets up local variables for the arrays for all the cards on the board\n var columns = [\n this.state.col_1,\n this.state.col_2,\n this.state.col_3,\n this.state.col_4,\n this.state.col_5,\n this.state.col_6,\n this.state.col_7\n ];\n // Sets up local variables for the arrays for all the cards on the upper dropzones\n var upColumns = {\n up_1: this.state.up_1,\n up_2: this.state.up_2,\n up_3: this.state.up_3,\n up_4: this.state.up_4\n };\n // Local variables for cards in the draw pile\n var upDrawCards = this.state.upDrawCards;\n var usedDrawCards = this.state.usedDrawCards;\n\n // Boolean variables that are true if the dragged card is in that collumn\n var inCol_1 = this.checkIfExists(columns[0], suit, value);\n var inCol_2 = this.checkIfExists(columns[1], suit, value);\n var inCol_3 = this.checkIfExists(columns[2], suit, value);\n var inCol_4 = this.checkIfExists(columns[3], suit, value);\n var inCol_5 = this.checkIfExists(columns[4], suit, value);\n var inCol_6 = this.checkIfExists(columns[5], suit, value);\n var inCol_7 = this.checkIfExists(columns[6], suit, value);\n\n // Boolean variables that are true if the dragged card is in that collumn of the upper dropzones\n var inUp_1 = this.checkIfExists(upColumns['up_1'], suit, value);\n var inUp_2 = this.checkIfExists(upColumns['up_2'], suit, value);\n var inUp_3 = this.checkIfExists(upColumns['up_3'], suit, value);\n var inUp_4 = this.checkIfExists(upColumns['up_4'], suit, value);\n\n // Boolean variable that are true if the dragged card is in the draw pile\n var inUsedDrawCards = this.checkIfExists(usedDrawCards, suit, value);\n\n // Checks that the move is valid\n if (item.column !== undefined && this.validMove(item)) {\n var index = item.index;\n column = item.column;\n var itemsToMove;\n\n // Removes the dropzones from all the stacks\n columns.map((_column, _index) => {\n return _column.map((item) => {\n return item.column !== undefined ? _column.length = (_column.length - 1) : null;\n });\n });\n\n // Standard move from one of the 7 columns on the main board\n if (!item.upperDrop && !inUp_1 && !inUp_2 && !inUp_3 && !inUp_4 && !inUsedDrawCards) {\n // Checks which column the dragged card came from\n if (inCol_1) {\n // Removes the card(s) from the column\n itemsToMove = columns[0].slice(index);\n columns[0].length = index;\n // If there's a card under the dragged card flips it over to be used\n if (columns[0][columns[0].length - 1] !== undefined) {\n columns[0][columns[0].length - 1].showBack = false;\n }\n // Follows same pattern as above \n } else if (inCol_2) {\n itemsToMove = columns[1].slice(index);\n columns[1].length = index;\n if (columns[1][columns[1].length - 1] !== undefined) {\n columns[1][columns[1].length - 1].showBack = false;\n }\n } else if (inCol_3) {\n itemsToMove = columns[2].slice(index);\n columns[2].length = index;\n if (columns[2][columns[2].length - 1] !== undefined) {\n columns[2][columns[2].length - 1].showBack = false;\n }\n } else if (inCol_4) {\n itemsToMove = columns[3].slice(index);\n columns[3].length = index;\n if (columns[3][columns[3].length - 1] !== undefined) {\n columns[3][columns[3].length - 1].showBack = false;\n }\n } else if (inCol_5) {\n itemsToMove = columns[4].slice(index);\n columns[4].length = index;\n if (columns[4][columns[4].length - 1] !== undefined) {\n columns[4][columns[4].length - 1].showBack = false;\n }\n } else if (inCol_6) {\n itemsToMove = columns[5].slice(index);\n columns[5].length = index;\n if (columns[5][columns[5].length - 1] !== undefined) {\n columns[5][columns[5].length - 1].showBack = false;\n }\n } else if (inCol_7) {\n itemsToMove = columns[6].slice(index);\n columns[6].length = index;\n if (columns[6][columns[6].length - 1] !== undefined) {\n columns[6][columns[6].length - 1].showBack = false;\n }\n } else {\n // If dragged card came from the draw pile instead of a standard pile\n itemsToMove = upDrawCards.slice(upDrawCards.length - 1);\n upDrawCards.length = upDrawCards.length - 1;\n }\n\n // Puts the dragged card into the new column to be rendered\n itemsToMove.map((_item) => {\n return columns[column - 1].push(_item);\n });\n // If dragged card came from one of the upper dropzones\n } else if (inUp_1 || inUp_2 || inUp_3 || inUp_4) {\n // Follows same logic pattern as above, just with a different set of columns\n if (inUp_1) {\n itemsToMove = upColumns['up_1'].slice(index);\n upColumns['up_1'].length = index;\n } else if (inUp_2) {\n itemsToMove = upColumns['up_2'].slice(index);\n upColumns['up_2'].length = index;\n } else if (inUp_3) {\n itemsToMove = upColumns['up_3'].slice(index);\n upColumns['up_3'].length = index;\n } else if (inUp_4) {\n itemsToMove = upColumns['up_4'].slice(index);\n upColumns['up_4'].length = index;\n }\n\n // Puts the dragged card into the new column to be rendered \n if (item.upperDrop) {\n itemsToMove.map((_item) => {\n _item.upperCard = false;\n return upColumns[column].push(_item);\n });\n } else {\n itemsToMove.map((_item) => {\n _item.upperCard = false;\n return columns[column - 1].push(_item);\n });\n }\n // If the card came from the pile of already overturned draw cards when depleting the 3 flipped cards\n } else if (inUsedDrawCards) {\n // Again, follows same logic as above just with different columns\n itemsToMove = usedDrawCards.slice(index);\n usedDrawCards.length = index;\n\n // If card is being dropped in upper dropzones\n if (item.upperDrop) {\n // Puts the dragged card into the new column to be rendered\n itemsToMove.map((_item) => {\n _item.usedDrawCard = false;\n _item.drawCard = false;\n _item.upperCard = true;\n return upColumns[column].push(_item);\n });\n // If card is going to 1 of the 7 standard columns\n } else {\n // Puts the dragged card into the new column to be rendered\n itemsToMove.map((_item) => {\n _item.usedDrawCard = false;\n _item.drawCard = false;\n return columns[column - 1].push(_item);\n });\n }\n // If the card is being dropped into one of the upper dropzones\n } else {\n // Follows same logic pattern as above, just with different columns\n if (inCol_1 && columns[0].slice(index).length === 1) {\n itemsToMove = columns[0].slice(index);\n columns[0].length = index;\n if (columns[0][columns[0].length - 1] !== undefined) {\n columns[0][columns[0].length - 1].showBack = false;\n }\n } else if (inCol_2 && columns[1].slice(index).length === 1) {\n itemsToMove = columns[1].slice(index);\n columns[1].length = index;\n if (columns[1][columns[1].length - 1] !== undefined) {\n columns[1][columns[1].length - 1].showBack = false;\n }\n } else if (inCol_3 && columns[2].slice(index).length === 1) {\n itemsToMove = columns[2].slice(index);\n columns[2].length = index;\n if (columns[2][columns[2].length - 1] !== undefined) {\n columns[2][columns[2].length - 1].showBack = false;\n }\n } else if (inCol_4 && columns[3].slice(index).length === 1) {\n itemsToMove = columns[3].slice(index);\n columns[3].length = index;\n if (columns[3][columns[3].length - 1] !== undefined) {\n columns[3][columns[3].length - 1].showBack = false;\n }\n } else if (inCol_5 && columns[4].slice(index).length === 1) {\n itemsToMove = columns[4].slice(index);\n columns[4].length = index;\n if (columns[4][columns[4].length - 1] !== undefined) {\n columns[4][columns[4].length - 1].showBack = false;\n }\n } else if (inCol_6 && columns[5].slice(index).length === 1) {\n itemsToMove = columns[5].slice(index);\n columns[5].length = index;\n if (columns[5][columns[5].length - 1] !== undefined) {\n columns[5][columns[5].length - 1].showBack = false;\n }\n } else if (inCol_7 && columns[6].slice(index).length === 1) {\n itemsToMove = columns[6].slice(index);\n columns[6].length = index;\n if (columns[6][columns[6].length - 1] !== undefined) {\n columns[6][columns[6].length - 1].showBack = false;\n }\n } else {\n // If it came from the draw cards\n if (upDrawCards.slice(upDrawCards.length - 1).length === 1) {\n itemsToMove = upDrawCards.slice(upDrawCards.length - 1);\n upDrawCards.length = upDrawCards.length - 1;\n }\n }\n\n // Puts the dragged card into the new column to be rendered\n itemsToMove.map((_item) => {\n _item.upperCard = true;\n return upColumns[column].push(_item);\n });\n }\n // If the move isn't valid\n } else {\n // Checks if there's a dropzone in that column\n if (inCol_1) { column = 1 }\n if (inCol_2) { column = 2 }\n if (inCol_3) { column = 3 }\n if (inCol_4) { column = 4 }\n if (inCol_5) { column = 5 }\n if (inCol_6) { column = 6 }\n if (inCol_7) { column = 7 }\n\n // Removes all dropzones\n columns.map((_column, _index) => {\n return _column.map((item) => {\n return item.column !== undefined ? _column.length = (_column.length - 1) : null;\n });\n });\n }\n\n this.setState({\n col_1: columns[0],\n col_2: columns[1],\n col_3: columns[2],\n col_4: columns[3],\n col_5: columns[4],\n col_6: columns[5],\n col_7: columns[6],\n up_1: upColumns['up_1'],\n up_2: upColumns['up_2'],\n up_3: upColumns['up_3'],\n up_4: upColumns['up_4'],\n usedDrawCards: usedDrawCards,\n showUpperDrops: false\n });\n\n if (this.state.up_1.length === 13 && this.state.up_2.length === 13 && this.state.up_3.length === 13 && this.state.up_4.length === 13) {\n this.finishWinningGame();\n }\n }", "onMove() {\n }", "function moveCard(player, number) {\n\t// parse the player/number\n\tvar parsed = parseCard(player, number);\n\n\t// remove the card\n\tvar removeCard = PID(\"player\" + player + number);\n\tremoveCard.parentNode.removeChild(removeCard);\n\n\t//check the player\n\tif (player === 1) {\n\t\t//splice the removedcard out of the cards array\n\t\tplayer1cardsArray.splice(number - 1, 1);\n\t\tPID(\"player1cardsflipped\").removeChild(PID(\"player1cardsflipped\").lastElementChild);\n\t\t//for loop to update the card ids\n\t\tfor (var i = 0; i < 100; i++) {\n\t\t\t// change the ids\n\t\t\ttry {\n\t\t\t\tconsole.log(player1cardsArray[i].id, player1cardsArray[i])\n\t\t\t\tPID(\"player1\" + (i + 1)).setAttribute(\"onclick\", 'cardclicked(\"' + player + (i + 1) + '\")');\n\t\t\t\tPID(\"player1\" + (i + 1)).id = \"player\" + player + (i + 1);\n\t\t\t\tplayer1cardsArray[i].id = \"player\" + player + (i + 1);\n\t\t\t} catch {};\n\t\t\t//update the ids in the array\n\n\t\t}\n\t} else if (player === 2) {\n\t\t//splice the removedcard out of the cards array\n\t\tplayer2cardsArray.splice(number - 1, 1);\n\t\tPID(\"player2cardsflipped\").removeChild(PID(\"player2cardsflipped\").lastElementChild);\n\n\t\t//for loop to update the card ids\n\t\tfor (var i = 0; i < player2cardsArray.length; i++) {\n\t\t\t// change the ids\n\t\t\tif (PID(\"player2\" + (i + 1)) === null) {} else {\n\t\t\t\tconsole.log(player2cardsArray[i].id)\n\t\t\t\tPID(\"player2\" + (i + 1)).setAttribute(\"onclick\", 'cardclicked(\"' + player + (i + 1) + '\")');\n\t\t\t\tPID(\"player2\" + (i + 1)).id = \"player\" + player + (i + 1);\n\t\t\t\t//update the ids in the array\n\t\t\t\tplayer2cardsArray[i].id = \"player\" + player + (i + 1);\n\t\t\t}\n\n\t\t}\n\t}\n\t//create element\n\tvar element = document.createElement(\"img\")\n\n\t//change src\n\telement.src = \"Cards/\" + parsed[0] + \".svg\";\n\n\t//change styles\n\telement.style.height = \"300px\";\n\n\t//add the middlecard id\n\telement.id = \"middlecard\";\n\n\t//clear the middle\n\tPID(\"middle\").innerHTML = \"\";\n\n\t//append the element\n\tPID(\"middle\").append(element);\n}", "hover(item, monitor) { //função chamada quando eu passar um card por cima de outro. Item é qual cart estou arrastando\n const draggedListIndex = item.listIndex; \n const targetListIndex = listIndex; //lista que está recebendo o novo item\n\n const draggedIndex = item.index;//index do item que está sendo carregado\n const targetIndex = index; //para qual item estou arrastando\n \n if (draggedIndex === targetIndex && draggedListIndex === targetListIndex){\n return; //se o usuário está arrastando o card para cima dele mesmo não faz nada\n };\n\n const targetSize = ref.current.getBoundingClientRect(); //retornando o tamanho do elemento\n const targetCenter = (targetSize.bottom - targetSize.top) /2; //calculando o ponto central do card\n\n const draggedOffset = monitor.getClientOffset(); //verifica o quanto do item arrastei \n const draggedTop = draggedOffset.y - targetSize.top;\n\n //se o item que estou arrastando veio antes do item que recebeu o arraste em cima, e a posição do dragget for menor que o centro do card\n if (draggedIndex < targetIndex && draggedTop < targetCenter) {\n return;\n };\n\n //se o item que estou arrastando veio depois do item que recebeu o arraste em cima, e a posição do dragget for maior que o centro do card\n if (draggedIndex > targetIndex && draggedTop > targetCenter) {\n return;\n };\n\n move(draggedListIndex, targetListIndex, draggedIndex, targetIndex);\n \n item.index = targetIndex; //mudando o index do item que foi movido\n item.listIndex = targetListIndex; //mudando o index da lista para onde o item foi arrastado\n }", "function place(event) {\r\n // get mouse click coordinates\r\n let pos = {x: event.clientX, y: event.clientY};\r\n\r\n // convert mouse click coordinates to row/col position, then the index\r\n let board_coord = getBoardCoordinates(pos);\r\n let row = board_coord.row;\r\n let col = board_coord.col;\r\n\r\n let index = state.getIndex(row, col);\r\n\r\n // make sure the space that was clicked is empty\r\n if(state.board[index] == 0) {\r\n\r\n /*\r\n isValidMove() will return null if no pieces were flipped. As long\r\n as it's not null, we can actually place and flip our pieces.\r\n */\r\n if(game.try(index)) {\r\n state = game.getCurrentState();\r\n updateScores(state);\r\n drawPieces(state);\r\n }\r\n if (state.possible_move == false) {\r\n if(game.gameOver()) {\r\n canvas.removeEventListener('mousemove', hover);\r\n canvas.removeEventListener('click', place);\r\n let go = document.createElement(\"h3\");\r\n go.innerHTML = 'Game Over.';\r\n document.getElementById('player-one').prepend(go);\r\n }\r\n else {\r\n alert(\"Player \" + state.turn + \" has no possible moves.\")\r\n state.switchTurn();\r\n }\r\n }\r\n }\r\n }", "function frame() {\n if (bottom < newBottom) {\n bottom = bottom + factorBottom\n side = side + factorSide\n elem.style.bottom = bottom + 'px';\n elem.style.right = side + 'px';\n clickable = false; // During the move, clickable is false so no card can be clicked during the movement\n } else {\n\t clearInterval(id);\n moveBack();\n }\n }", "function addMovement() {\n moves.innerHTML = ++ moveCounter;\n\n if (moveCounter > 16 && moveCounter <= 32) {\n goodRank.className = 'fa fa-star-o';\n }\n else if (moveCounter > 32) {\n fairRank.className = 'fa fa-star-o';\n }\n}", "handleClick(type) {\n // get the card's margin-right\n let margin = window.getComputedStyle(document.getElementById(\"card\")).marginRight;\n margin = JSON.parse(margin.replace(/px/i, ''));\n\n const cardWidth = this.state.width; // the card's width\n const cardMargin = margin; // the card's margin\n const cardNumber = CardData().length; // the number of cards\n let currentCard = this.state.currentCard; // the index of the current card\n let position = this.state.position; // the position of the cards\n\n // slide cards\n if(type === 'next' && currentCard < cardNumber-1) {\n currentCard++;\n position -= (cardWidth+cardMargin);\n } else if(type === 'prev' && currentCard > 0) {\n currentCard--;\n position += (cardWidth+cardMargin);\n }\n this.setCard(currentCard, position);\n }", "reposCards() {\n\n\t\tfor (var i = this.cards.children.length - 1; i >= 0; i--) {\n\n\t\t\tvar card = this.cards.getChildAt(i);\n\n\t\t\tcard.handPosition = 20 * i;\n\n\t\t\tvar newX = this.leftBound + card.handPosition + this.viewOffset;\n\n\t\t\tif (newX < this.leftBound) {\n\t\t\t\tnewX = this.leftBound;\n\t\t\t\tthis.handMaskLeft.visible = true;\n\t\t\t}\n\n\t\t\tif (newX > this.rightBound) {\n\t\t\t\tnewX = this.rightBound;\n\t\t\t\tthis.handMaskRight.visible = true;\n\t\t\t}\n\n\t\t\tif (newX != card.x) {\n\t\t\t\tcard.moveCardTo(newX, card.y, 1);\n\t\t\t}\n\t\t}\n\t}", "handleMoveAllCards(listId) {}", "proceedMove() {\n // Proceed move\n this.PENDING.MOVE.forEach(( item ) => {\n this._move(item)\n })\n }", "function handleCardClick(event) {\n event.preventDefault();\n\n if (!timerInterval) {\n startTimer();\n }\n\n // Check if card has been matched previously\n if (this.classList.contains('.matched') || chosen.length === 2) {\n return;\n }\n // If the card has not already been selected...\n if (!chosen.includes(this)) {\n chosen.push(this);\n // Flip the Card\n this.classList.replace('hidden', 'open');\n }\n \n // Check if 2 cards are flipped\n if (chosen.length === 2) {\n // Record the move\n movesCount();\n // Check to see if the 2 flipped cards match\n if (chosen[0].dataset.icon === chosen[1].dataset.icon) {\n // Add matched class to both cards if they do match\n chosen[0].classList.add('matched');\n chosen[1].classList.add('matched');\n // add the card to the matched array\n matched.push(this);\n // Reset the chosen array\n chosen = []\n } else {\n // return cards to normal state after a short delay\n setTimeout(function () {\n chosen[0].classList.replace('open', 'hidden');\n chosen[1].classList.replace('open', 'hidden');\n // Reset the chosen array\n chosen = []\n }, 1000);\n }\n // Call to check if number of moves affect the accomplishment meter\n levelCounter();\n // Regenerate the levelDisplay based on No. of moves\n generateLevelDisplay();\n winGame();\n }\n}", "function makeMove() {\n if(turn == \"player\" && gameStatus == \"ongoing\" && playerFirstMove == true){\n playerPosition = \"p\"+(1+rollValue);\n var toGo = document.getElementsByClassName(playerPosition);\n $(toGo).attr(\"id\",\"user\");\n playerFirstMove = false\n cardOptions();\n turn = \"enemy\";\n begin.textContent=\"Roll dice for enemy move\";\n }else if(turn == \"player\" && gameStatus == \"ongoing\") {\n $(\"#user\").removeAttr(\"id\");\n playerPosition = parseInt(playerPosition.substr(1));\n if((playerPosition+rollValue)>40){\n playerPosition = \"p\"+((playerPosition+rollValue)-40);\n playerCash += 200;\n playerUpdate(\"You passed go! Collect $200\")\n updateCash();\n }else{\n playerPosition = \"p\"+(playerPosition+rollValue);\n }\n var toGo = document.getElementsByClassName(playerPosition);\n $(toGo).attr(\"id\",\"user\")\n cardOptions();\n turn = \"enemy\";\n begin.textContent=\"Roll dice for enemy move\";\n }else if(turn == \"enemy\" && gameStatus == \"ongoing\" && enemyFirstMove == true) {\n enemyPosition = \"p\"+(1+rollValue);\n var toGo = document.getElementsByClassName(enemyPosition);\n $(toGo).attr(\"id\",\"enemy\");\n enemyFirstMove = false\n cardOptions();\n executeEnemyStrategies();\n turn = \"player\";\n begin.textContent=\"Your roll\";\n }else if(turn == \"enemy\" && gameStatus == \"ongoing\") {\n $(\"#enemy\").removeAttr(\"id\");\n enemyPosition = parseInt(enemyPosition.substr(1));\n if((enemyPosition+rollValue)>40){\n enemyOfferOptions()\n enemyPosition = \"p\"+((enemyPosition+rollValue)-40);\n enemyCash += 200\n updateCash();\n enemyUpdate(\"Enemy passed go! Collect $200\")\n }else{\n enemyPosition = \"p\"+(enemyPosition+rollValue);\n }\n var toGo = document.getElementsByClassName(enemyPosition);\n $(toGo).attr(\"id\",\"enemy\")\n cardOptions();\n executeEnemyStrategies();\n turn = \"player\";\n begin.textContent=\"Your roll\";\n }\n}", "function game (){\n $( \".card\" ).on( \"click\", function() {\n $( this ).addClass(\"open\");\n openCards.push( $( this ));\n puntua();\n allAction();\n complete();\n });\n}", "function openCard(event) {\n if (event.target.classList.contains('open', 'show') || event.target.classList.contains('fa') || event.target.classList.contains('deck')) {}\n else {\n countMoves();\n event.target.classList.add('open', 'show');\n addToOpenCards(event.target);\n }\n }", "function makeMove() {\n grid = makeAMove(grid);\n myMove = false;\n updateMove();\n}", "function newMove() {\n for (var i = 0; i < divInput.length; i++) {\n divInput[i].addEventListener('click', UserMove);\n }\n}", "move() {\n }", "function firstTurn() {\n move = 1;\n for (let i = 0; i < 9; i++) {\n square[i].addEventListener('mousedown', function () {\n\n square[i].appendChild(X);\n move++\n\n })\n }\n }", "function calcMoves() {\n moves++;\n movesSpan.innerText = moves;\n updateStars();\n }", "handleClick(type) {\n // get the card's margin-right\n let margin = window.getComputedStyle(document.getElementsByClassName(\"content\")[0].firstChild).marginRight;\n margin = JSON.parse(margin.replace(/px/i, ''));\n\n const cardWidth = this.state.width; // the card's width\n const cardMargin = margin; // the card's margin\n const cardNumber = document.getElementsByClassName('content')[0].childElementCount; // the number of cards\n let currentCard = this.state.currentCard; // the index of the current card\n let position = this.state.position; // the position of the cards\n\n // slide cards\n if (type === 'next' && currentCard < cardNumber - 1) {\n currentCard++;\n position -= (cardWidth + cardMargin);\n } else if (type === 'prev' && currentCard > 0) {\n currentCard--;\n position += (cardWidth + cardMargin);\n }\n this.setCard(currentCard, position);\n\n }", "function setMovablePieces() {\n \n \n setUnmovable();\n \n var empty = getEmpty();\n \n // viimeinen sarake \n if(empty % 4 === 0){\n $(\".\"+(empty-1)).addClass(\"movable\");\n \n\n // eka sarake\n }else if(empty+3 % 4 === 0){\n $(\".\"+(empty+1)).addClass(\"movable\");\n \n // välisarakkeet \n }else {\n $(\".\"+(empty+1)).addClass(\"movable\");\n $(\".\"+(empty-1)).addClass(\"movable\");\n }\n \n //riveittäin\n if(empty <= 4){\n $(\".\"+(empty+4)).addClass(\"movable\");\n }else if(empty >= 13){\n $(\".\"+(empty-4)).addClass(\"movable\");\n }else{\n $(\".\"+(empty+4)).addClass(\"movable\");\n $(\".\"+(empty-4)).addClass(\"movable\");\n }\n \n $(\".movable\").click(function(){\n movePiece($(this));\n }); \n \n \n\n }", "function add() { \n gameCells = document.querySelectorAll('.game-square')\n \n gameCells.forEach(cell => {\n if (!cell.hasChildNodes()) {\n cell.addEventListener('click', mainGame.placeMove());\n }\n });\n }", "function incrementMoves() {\n moves ++;\n $(\".score-panel .moves\").text(moves);\n if (moves === 13) {\n decrementStars();\n }\n else if (moves === 21) {\n decrementStars();\n }\n }", "function move() {\n // check if move allowed & then eat food\n hitFood();\n hitBorder();\n hitSnake();\n // actually move the snake\n updatePositions();\n renderSnake();\n document.addEventListener(\"keydown\", turn);\n snake.canTurn = 1;\n}", "canMove(from, fromIx, fromCount, to, toIx) {\n // check 'to' values\n if (to == 'f') {\n if (toIx < 1 || toIx > 4) {\n return false;\n }\n }\n else if (to == 't') {\n if (toIx < 1 || toIx > 7) {\n return false;\n }\n }\n else {\n return false;\n }\n\n // check 'from' values\n if (from == 'f') {\n if (fromIx < 1 || fromIx > 4 || fromCount != 1) {\n return false;\n }\n }\n else if (from == 't') {\n if (fromIx < 1 || fromIx > 7 || fromCount < 1) {\n return false;\n }\n }\n else if (from != 'w' || fromCount != 1) {\n return false;\n }\n \n // get card to move\n let card = this.peek(from, fromIx, fromCount);\n if (!card || !card.faceUp) {\n return false;\n }\n\n // test move feasability\n let dest = this.peek(to, toIx);\n if (to == 't') {\n if (!dest) {\n // first tableau card must be a king\n if (card.rank != 13) {\n return false;\n }\n }\n else {\n // must alternate red/black suits\n if (this.sameColor(card, dest)) {\n return false;\n }\n // must be one rank smaller than the parent card\n if (card.rank != dest.rank - 1) {\n return false;\n }\n }\n }\n else if (to == 'f') {\n return this.foundationMatch(card, toIx) > 0;\n }\n else {\n return false;\n }\n return true;\n }", "function moveByPawn(sel,targ) {\n var moveCount = 0;\n var location = parseInt(targ.id)\n var originalLoc = parseInt(sel.parentElement.id)\n // check if the piece is white so the logic works for both ends of the board since we are not working with a 2d Array\n if (sel.classList.contains('w_piece')) {\n if(sel.classList.contains('original')){\n if(targ.innerHTML == ''){\n moveCount++\n if ((location + 16)/moveCount == originalLoc || (location + 8)/moveCount == originalLoc) {\n console.log('This can move here!')\n targ.appendChild(sel)\n sel.classList.remove('original')\n }else {\n console.log('I cannot move here!')\n }\n }else{\n console.log('handle capturing')\n }\n \n }else{\n if(targ.innerHTML == ''){\n moveCount++\n if ((location + 8)/moveCount == originalLoc) {\n console.log('This can move here!')\n targ.appendChild(sel)\n }else {\n console.log('I cannot move here!')\n }\n }\n }\n }else {\n if(sel.classList.contains('original')){\n if(targ.innerHTML == ''){\n moveCount++\n if ((location - 16)*moveCount == originalLoc || (location - 8)*moveCount == originalLoc) {\n console.log('This can move here!')\n targ.appendChild(sel)\n sel.classList.remove('original')\n }else {\n console.log('I cannot move here!')\n }\n }else{\n console.log('handle capturing')\n }\n \n }else{\n if(targ.innerHTML == ''){\n moveCount++\n if ((location - 8)*moveCount == originalLoc) {\n console.log('This can move here!')\n targ.appendChild(sel)\n }else {\n console.log('I cannot move here!')\n }\n }\n }\n } \n}", "function move(from, to) {\n\n}", "function addCardsToPlayerAfterHit(shuffledCards) {\n addCardsToPlayer(shuffledCards, 1);\n addPlayerCardsToPlayerArea();\n\n}", "function addMoveForward(distance: float){\n\taddAction( \n\tfunction(actionCard: GameObject){\n\t\treturn function(){\n\t\t\tvar targetPosition: Vector3 = transform.position + (globalForward * distance);\n\t\t\tif(checkIfPosEmpty(targetPosition)){\n\t\t\t\ttransform.Translate (localForward * distance);\n\t\t\t}\n\t\t\tactionCard.GetComponent(Button).interactable = false;\n\t\t\tscrollOnce(); // Leaving this out on purpose, it gets jarring to rescroll every time\n\t\t};\n\t}, \"Forward\");\n}", "function playerMove(event){\r\n const box = event.target; // Get the specific box that triggered click event\r\n let currentPlayer; // Tells us who's turn is this, Holds the X or O character based on that\r\n \r\n if(circleTurn){//Determine who's turn is this and assign corresponding sign the to the variable currentPlayer\r\n currentPlayer = \"O\";\r\n }\r\n else{\r\n currentPlayer = \"X\";\r\n }\r\n\r\n drawSign(box, currentPlayer)//Insert X or O into the box.\r\n\r\n for(let i = 0; i < 3; i++){//Iterate through the board to get the current state of it\r\n for(let j = 0; j < 3; j ++){\r\n currentStateOfTheBoard.push(gameBoard.firstElementChild.children[i].children[j].innerText);\r\n }\r\n }\r\n \r\n if(checkIfWin(currentPlayer)){\r\n showWinningBoxes(currentPlayer);\r\n finishGame(false);\r\n }\r\n else if(checkIfDraw()){\r\n finishGame(true);\r\n }\r\n else{\r\n swapPlayer();\r\n }\r\n\r\n currentStateOfTheBoard = []; // Clear the current state of the board\r\n}", "function appear(card){\n //OPEN first card or second card & compare between them\n function addCard() {\n // match timer start with first click\n const viewCard = this;\n const previousCard = openedCards[0];\n\n if (openedCards.length === 1) {\n card.classList.add('open', 'show', 'remove');\n openedCards.push(this);\n moves++;\n moveNumber.textContent = moves;\n compare(viewCard, previousCard);\n stars();\n } else {\n card.classList.add('open', 'show', 'remove');\n openedCards.push(this);\n stars();\n }\n\n if (isFirstClick === true) {\n timer();\n isFirstClick = false;\n }\n }\n card.addEventListener('click', addCard);\n}", "function move(){\n\t\t\tvar head={x:snakeArr[snakeArr.length-1].x+dx,y:snakeArr[snakeArr.length-1].y+dy};\n\t\t\tsnakeArr.push(head);\n\t\t\tsnakeArr.shift();\n\t\t\tsnakeArr.forEach(function(e,i){paint(e.x,e.y,'white','black',cellW);});\n\t\t}", "function resetBoard () {\n\n setTimer();\n\n clearTimeout();\n\n $('.flippable').off(); // clear out old event listeners\n\n $('.card').removeClass('red');\n\n $('.card').removeClass('green');\n\n $('.card').removeClass('flippable');\n\n $('.card').removeClass('show');\n\n $('.card').removeClass('open');\n\n $('.card').addClass('flippable');\n\n $('.stars').html(\n `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>\n `\n );\n // add back in the event listener to all cards\n $('.flippable').on('click', function () {\n handleClick($(this));\n });\n\n moves = [9]; // reset moves\n cardIDs = [];\n cardsFlipped = [];\n matches = [];\n\n $('.moves').text(moves);\n\n let cardIcons = [\"fa fa-diamond\", \"fa fa-cube\",\"fa fa-bolt\",\"fa fa-leaf\",\"fa fa-bicycle\",\"fa fa-paper-plane-o\",\"fa fa-diamond\",\n \"fa fa-cube\",\"fa fa-bolt\",\"fa fa-leaf\",\"fa fa-bicycle\",\"fa fa-paper-plane-o\"]; // our deck of card icons\n\n let cardSets = shuffle(cardIcons); // shuffles deck\n\n // For each card in the deck, add a random icon.\n $('#deck').children('li').each(function (index) {\n this.children[0].className = cardSets[index];\n });\n }", "function mouveMove() {\n refreshDisplay();\n}", "function movePiece(color, type, location, target){\n var m = chess.move({ from: location, to: target });\n console.log(m);\n if(!m)\n console.log('not a legal move');\n\n /* flags\n 'n' - a non-capture\n 'b' - a pawn push of two squares\n 'e' - an en passant capture\n 'c' - a standard capture\n 'p' - a promotion\n 'k' - kingside castling\n 'q' - queenside castling\n */\n\n $('[data-square-id=\"'+target+'\"]').html( $('[data-square-id=\"'+location+'\"] span') );\n\n switch(m.flags){\n case 'k':\n if(m.color == 'w')\n $('[data-square-id=\"f1\"]').html( $('[data-square-id=\"h1\"] span') );\n else\n $('[data-square-id=\"f8\"]').html( $('[data-square-id=\"h8\"] span') );\n break;\n \n case 'q':\n if(m.color == 'w')\n $('[data-square-id=\"d1\"]').html( $('[data-square-id=\"a1\"] span') );\n else\n $('[data-square-id=\"d8\"]').html( $('[data-square-id=\"a8\"] span') );\n break;\n \n case 'e':\n if(m.color == 'w')\n var t = m.san.substr(-2).charAt(0)+''+(parseInt(m.san.substr(-2).charAt(1))-1);\n else\n var t = m.san.substr(-2).charAt(0)+''+(parseInt(m.san.substr(-2).charAt(1))+1);\n $('[data-square-id=\"'+t+'\"]').html( '' );\n break;\n\n case 'c':\n //capture,place in jail\n break;\n\n case 'q':\n //promotion\n break;\n \n }\n\n //Update UI\n updateMoveList();\n updateFEN();\n updatePGN();\n updateTurn();\n\n //Gameover?\n if( chess.game_over() ){\n gameOver();\n }\n}", "function turnCard(){\n\tif (this.classList.contains('open')) { //to avoid double click on the opened card...\n\t\n\t} else {\n\t\tif (animationFinished == false) { //to avoid to click on the third card before finishing matchCheck...\n\t\t} else {\n\t\t\tthis.classList.add('open', 'show');\n\t\t\tclickedCount ++;\n\t\t\tmoves.textContent = clickedCount;\n\t\t\topenedCard.push(this);\n\t\t\tif (openedCard.length === 2) {\n\t\t\t\tanimationFinished = false; \n\t\t\t\tmatchCheck(); \n\t\t\t} //once the second card was turned, call matchCheck...\n\t\t};\n\t};\n}", "function makeMove(event) {\n\n\n\n $content = $(event.target).text();\n // check if empty\n if ($content === '' && gameOver === false) {\n // yes it is empty \n\n // add player to html\n $(event.target).text(currentPlayer);\n count++;\n\n // add player to js array\n\n grid[event.target.id] = currentPlayer\n\n // check winner\n findWinner()\n\n // change player\n if (currentPlayer === 'X') {\n currentPlayer = 'O'\n } else {\n currentPlayer = 'X'\n }\n\n }\n else if (gameOver == true) {\n\n }\n\n\n}", "function move() {\n var id = $(this).attr(\"data-name\");\n for (let i = 0; i < characters.length; i++){\n if(characters[i].name === id){\n player = characters[i];\n }\n }\n $(this).appendTo(\".player-area\");\n $(\".character\").off();\n $(this).removeClass(\"character\");\n $(this).addClass(\"player\");\n $(\".character\").css(\"background-color\", \"red\");\n $(\".character\").on(\"click\", moveEnemy);\n $(\".attack\").css(\"visibility\", \"visible\");\n $(\"h2\").text(\"Choose Your Enemy!\")\n}", "turn(event) {\n if (typeof DATA.boardCells[event.target.id] === 'number') {\n this.playerMove(event.target.id, DATA.human)\n if (!this.checkWin(DATA.boardCells, DATA.human) && !this.checkTie()) this.playerMove(this.aiMove(), DATA.ai);\n }\n }", "function piece_movements (name) {\n piece = new Piece ({piece: chess_pieces [name]});\n\n piece . draw ();\n\n make_credits_line (name);\n}", "function EXECUTE_MOVE(row, col, button_dir)//, board, rules)\n{\n\t//Get the row col of interest\n\t//parsed_action = parse_move(raw_text_input);\n\n\t// We need the boardsize from CSS variable\n\tboard_size = Number(getComputedStyle(document.documentElement).getPropertyValue(\"--board-size\").slice(0,-2));\n\t\n\t//Now we get latest candy size in px\n\tgridbox_size = board_size/(size+1);\n\n\tconsole.log(\"Chose: \"+row+\", \"+col); //debug purpose\n\n\t// Now get the candy object\n\tcandy = board.getCandyAt(row,col);\n\t\n\t//Actually flip the candies in the BACKEND\n\t\t\n\tother_candy = board.getCandyInDirection(candy,button_dir);\n\tboard.flipCandies(candy,other_candy);\n\t\n\t\n\t// Ok now get the candy element\n\tcandy_ele = Get_Candy_Element(row,col);\n\t\n\t//Given the DIRECTION of the swap, now do the front-end animation\n\t// by changing CSS variables\n\t//Swapping is done doing a relative offset class change\n\t\n\tif (button_dir == 'left')\n\t{\n\t\tother_candy_ele = Get_Candy_Element(row,col-1);\n\t\t\n\t\tcandy_ele.style.setProperty('--to-x', -gridbox_size+\"px\");\n\t\tother_candy_ele.style.setProperty('--to-x', gridbox_size+\"px\");\n\t}\n\telse if (button_dir == 'right')\n\t{\n\t\tother_candy_ele = Get_Candy_Element(row,col+1);\n\t\t\n\t\tcandy_ele.style.setProperty('--to-x', gridbox_size+\"px\");\n\t\tother_candy_ele.style.setProperty('--to-x', -gridbox_size+\"px\");\n\t}else if (button_dir == 'up')\n\t{\n\t\tother_candy_ele = Get_Candy_Element(row-1,col);\n\t\t\n\t\tcandy_ele.style.setProperty('--to-y', -gridbox_size+\"px\");\n\t\tother_candy_ele.style.setProperty('--to-y', gridbox_size+\"px\");\n\t}else\n\t{\n\t\tother_candy_ele = Get_Candy_Element(row+1,col);\n\t\t\n\t\tcandy_ele.style.setProperty('--to-y', gridbox_size+\"px\");\n\t\tother_candy_ele.style.setProperty('--to-y', +gridbox_size+\"px\");\n\t}\n\t\n\n\t// ok NOW that the variables are ready, actually start the animation\n\tcandy_ele.setAttribute(\"class\", \"candy_swap\");\n\tother_candy_ele.setAttribute(\"class\", \"candy_swap\");\n\treturn Util.afterAnimation(candy_ele, \"swap\");\n}", "function takeAHardMove(turn) {\n var available = game.currentState.emptyCells();\n\n //enumerate and calculate the score for each avaialable actions to the ai player\n var availableActions = available.map(function(pos) {\n var action = new AIAction(pos); //create the action object\n var next = action.applyTo(game.currentState); //get next state by applying the action\n\n action.minimaxVal = minimaxValue(next); //calculate and set the action's minmax value\n\n return action;\n });\n\n //sort the enumerated actions list by score\n if(turn === \"X\")\n //X maximizes --> sort the actions in a descending manner to have the action with maximum minimax at first\n availableActions.sort(AIAction.DESCENDING);\n else\n //O minimizes --> sort the actions in an ascending manner to have the action with minimum minimax at first\n availableActions.sort(AIAction.ASCENDING);\n\n\n //take the first action as it's the optimal\n var chosenAction = availableActions[0];\n var next = chosenAction.applyTo(game.currentState);\n\n ui.insertAt(chosenAction.movePosition, turn);\n\n game.advanceTo(next);\n }", "function movesCounter(){\n count = count + 1;// count moves\n if(count ===1){startclockTime();}//once first card clicked times function invoked\n $('.moves').html(count);\n if(count === 16 || count === 24 || count === 30){\n starDrop(count)\n }\n}", "move() { }", "move() { }", "function addCardsToClickedCards(event) {\n clickedCards.push(event.target);\n}" ]
[ "0.7880115", "0.73466146", "0.71526766", "0.7134944", "0.7134629", "0.6997075", "0.6878985", "0.68646246", "0.6824192", "0.67994934", "0.679314", "0.67784", "0.6756485", "0.6724491", "0.670292", "0.66926295", "0.66825783", "0.6666016", "0.66611254", "0.66378945", "0.6632416", "0.6624007", "0.66053104", "0.6598231", "0.65976423", "0.65972364", "0.6596914", "0.6596016", "0.6595932", "0.6570486", "0.65645486", "0.6559583", "0.6554924", "0.65527505", "0.6542507", "0.6530286", "0.6528265", "0.6514054", "0.6505744", "0.6501772", "0.64993805", "0.64966863", "0.6492936", "0.6464967", "0.64614415", "0.6453515", "0.6442484", "0.642899", "0.6425948", "0.6419287", "0.6414803", "0.64141625", "0.64107454", "0.6404512", "0.6402538", "0.63974786", "0.6385978", "0.6377795", "0.6376687", "0.6375952", "0.63758427", "0.63709164", "0.63633984", "0.6350438", "0.63444173", "0.63441706", "0.63413936", "0.63307416", "0.6329076", "0.6327817", "0.6321364", "0.6317733", "0.6317235", "0.63095707", "0.63045394", "0.6301234", "0.62971044", "0.6296068", "0.62924945", "0.6292423", "0.6291314", "0.62827", "0.6281537", "0.6278186", "0.6274438", "0.6274089", "0.62728465", "0.6269793", "0.6269551", "0.62547654", "0.6253182", "0.62529826", "0.6249744", "0.62490064", "0.6240644", "0.62349397", "0.62344223", "0.6232611", "0.6232611", "0.62316805" ]
0.67670876
12
Rating function Based on the moves, user will get rating specific rating or stars.
function rating() { 'use strict'; // turn on Strict Mode if (moves > 10 && moves < 19) { stars[2].classList.remove('fa-star'); stars[2].classList.add('fa-star-o'); starsRating = 2; } else if (moves > 20) { stars[1].classList.remove('fa-star'); stars[1].classList.add('fa-star-o'); starsRating = 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rating(moves) {\n // \n let rating = 3;\n\n // Scoring system from 1 to 3 stars\n let stars3 = 10,\n stars2 = 16,\n star1 = 20;\n\n if (moves > stars3 && moves < stars2) {\n $stars.eq(3).removeClass('fa-star').addClass('fa-star-o');\n } else if (moves > stars2 && moves < star1) {\n $stars.eq(2).removeClass('fa-star').addClass('fa-star-o');\n } else if (moves > star1) {\n $stars.eq(1).removeClass('fa-star').addClass('fa-star-o');\n rating = 1;\n }\n return {\n score: rating\n };\n}", "function calcStarRating(moves) {\n if (moves < 25) {\n return 5;\n } else if (moves >= 25 && moves <= 35) {\n return 4;\n } else if (moves > 35 && moves <= 45) {\n return 3;\n } else if (moves > 45 && moves <= 55) {\n return 2;\n } else {\n return 1;\n }\n}", "function rateTheStars(moves){\n if (moves > 24) {\n console.log(\"1 star\");\n starRating = 1;\n } else if (moves > 20) {\n console.log(\"2 stars\");\n starRating = 2;\n } else if (moves > 16){\n console.log(\"3 stars\");\n starRating = 3;\n } else if (moves > 12){\n console.log(\"4 stars\");\n starRating = 4;\n } else {\n starRating=5;\n }\n starColors(starRating);\n }", "function getRating(moves) {\n if (moves <= twoStarLimit) {\n return 3;\n } else if (moves <= oneStarLimit){\n return 2;\n } else {\n return 1;\n }\n}", "function updateRating() {\n //Rating game based on move count\n if (numMoves == (moves_to_two_stars)) {\n stars[2].classList.remove(\"fa-star\");\n stars[2].classList.add(\"fa-star-o\");\n rating = 2;\n }\n else if (numMoves == (moves_to_one_star)) {\n stars[1].classList.remove(\"fa-star\");\n stars[1].classList.add(\"fa-star-o\");\n rating = 1;\n }\n}", "function setRating(moves) {\n var rating = 3;\n if (moves > rank3stars && moves < rank2stars) {\n $starsCount.eq(2).removeClass('fa-star').addClass('fa-star-o');\n rating = 2;\n } else if (moves > rank2stars && moves < rank1stars) {\n $starsCount.eq(1).removeClass('fa-star').addClass('fa-star-o');\n rating = 1;\n } else if (moves >= rank1stars) {\n rating = 1;\n }\n return {\n score: rating\n };\n}", "function starRating() {\n if (moves > 13 && moves < 16) {\n starCounter = 3;\n } else if (moves > 17 && moves < 27) {\n starCounter = 2;\n } else if (moves > 28) {\n starCounter = 1;\n }\n showStars(starCounter);\n }", "function rating(moves) {\n let rating = 3;\n if (moves > stars3 && moves < stars2) {\n $rating.eq(3).removeClass('fa-star').addClass('fa-star-o');\n } else if (moves > stars2 && moves < star1) {\n $rating.eq(2).removeClass('fa-star').addClass('fa-star-o');\n } else if (moves > star1) {\n $rating.eq(1).removeClass('fa-star').addClass('fa-star-o');\n rating = 1;\n }\n return { score: rating };\n}", "function calculateStarRating(moves) {\n if (moves < threeStars) {\n return 3;\n } else if (moves >= threeStars && moves < twoStars) {\n return 2;\n } else if (moves >= twoStars && moves < oneStar) {\n return 1;\n } else {\n return 0;\n }\n}", "function setRating() {\n if ((moves - match) == 3) { //3 moves\n $ratingStars.eq(2).removeClass('fa-star').addClass('fa-star-o');\n rating = 2;\n questionLevel2();\n } else if ((moves - match) == 5) { //5 moves\n $ratingStars.eq(1).removeClass('fa-star').addClass('fa-star-o');\n rating = 1;\n questionLevel2();\n } else if ((moves - match) >= 7) { //7 moves\n $ratingStars.eq(0).removeClass('fa-star').addClass('fa-star-o');\n rating = 0;\n questionLevel2();\n }\n return { score: rating };\n}", "function Rating(myMoves){\r\n let score = 3;\r\n if(myMoves <= 20) {\r\n theStarsRating.eq(3).removeClass(\"fa-star\").addClass(\"fa-star-o\");\r\n score=3;\r\n } else if (myMoves > 20 && myMoves <= 30) {\r\n theStarsRating.eq(2).removeClass(\"fa-star\").addClass(\"fa-star-o\");\r\n score=2;\r\n } else if (myMoves > 30) {\r\n theStarsRating.eq(1).removeClass(\"fa-star\").addClass(\"fa-star-o\");\r\n score=1;\r\n }\r\n return score;\r\n}", "function updateStarRating(moves) {\n\tswitch (moves) {\n\t\tcase 10:\n\t\t\tstarRatingElements[2].classList.add('star--disabled');\n\t\t\tstarCount = 2;\n\t\tbreak;\n\t\tcase 15:\n\t\t\tstarRatingElements[1].classList.add('star--disabled');\n\t\t\tstarCount = 1;\n\t\tbreak;\n\t}\n}", "function rating() {\n\tconst star1 = document.getElementById(\"one-star\");\n\tconst star2 = document.getElementById(\"two-star\");\n\tconst star3 = document.getElementById(\"three-star\");\n\t// change stars style depending on number of moves\n\tif (moveCounter == 18) {\n\t\tstar1.classList.remove(\"fas\");\n\t\tstar1.classList.add(\"far\");\n\t} else if (moveCounter == 16){\n\t\tstar2.classList.remove(\"fas\");\n\t\tstar2.classList.add(\"far\");\n\t} else if (moveCounter == 14) {\n\t\tstar3.classList.remove(\"fas\");\n\t\tstar3.classList.add(\"far\");\n\t} else {\n\t\t\n\t}\n}", "function starRating(moves) {\n if (moves >= 12 && moves < 18) {\n starCount.childNodes[5].childNodes[0].className = 'fa fa-star-o';\n } else if (moves >= 18) {\n starCount.childNodes[3].childNodes[0].className = 'fa fa-star-o';\n }\n return starCount;\n}", "function updateStarRating() {\n const numCards = deckConfig.numberOfcards;\n\n if (scorePanel.moveCounter === 0) {\n scorePanel.starCounter = 3;\n $(\".star-disabled\").toggleClass(\"star-enabled star-disabled\");\n } else if (scorePanel.moveCounter === Math.trunc(numCards / 2 + numCards / 4)) {\n scorePanel.starCounter = 2;\n $($(\".stars\").children()[0]).toggleClass(\"star-enabled star-disabled\");\n } else if (scorePanel.moveCounter === (numCards)) {\n scorePanel.starCounter = 1;\n $($(\".stars\").children()[1]).toggleClass(\"star-enabled star-disabled\");\n }\n}", "function starRating() {\n let lastStar;\n let lastModalStar;\n const deckStars = document.querySelectorAll('.stars .fa-star')\n const modalStars = document.querySelectorAll('.winStars .fa-star')\n if (moves === 33) {\n lastStar = deckStars[2];\n lastModalStar = modalStars[2];\n } else if (moves === 45) {\n lastStar = deckStars[1];\n lastModalStar = modalStars[1];\n } else if (moves === 52) {\n lastStar = deckStars[0];\n lastModalStar = modalStars[0];\n }\n if (lastStar !== undefined) {\n lastStar.classList.replace('fa-star', 'fa-star-o');\n lastModalStar.classList.replace('fa-star', 'fa-star-o');\n }\n}", "function starRating () {\n if ( moveCount === 20 || moveCount === 30 ) {\n decrementStar();\n }\n}", "function starRating(movesCounter){\n let score = 3;\n if(movesCounter <= 19){\n score = 3;\n } \n else if((movesCounter > 19) && (movesCounter <= 24)){\n score = 2;\n } \n\telse{\n score = 1;\n }\n\n return score;\n}", "function rating(){\n if (moves.innerHTML > 7 && moves.innerHTML <= 10){\n uls[0].children[0].firstChild.className = \"fa fa-star-o\";\n } else if ( moves.innerHTML > 10 && moves.innerHTML <=20) {\n uls[0].children[1].firstChild.className = \"fa fa-star-o\";\n }\n else {\n checLose();\n }\n }", "function scoreRating(moves){\n var excellent = 14;\n var average = 20;\n var bad = 24;\n if (moves > excellent && moves < average){\n document.getElementById(\"3star\").className = \"fa fa-o\";\n } else if (moves > average && moves < bad) {\n document.getElementById(\"2star\").className = \"fa fa-o\";\n }\n}", "function movieScore(rating) {\r\n // Trasformazione punteggio a 5 punti\r\n var ratingTrasformato = rating / 2;\r\n\r\n var vote = Math.round(ratingTrasformato);\r\n\r\n var stars = '';\r\n for (var i = 1; i <= 5; i++) {\r\n if (i <= vote) {\r\n stars += '<i class=\"fas fa-star\"></i>';\r\n } else {\r\n stars += '<i class=\"far fa-star\"></i>';\r\n }\r\n }\r\n return stars;\r\n}", "function rating(){\n //// TODO: Bug has been fixed\n if (!cardCouple[0].classList.contains('match') && !cardCouple[1].classList.contains('match')){\n moves.innerText++;\n }\n if (moves.innerText > 14){\n document.querySelector('.stars li:nth-child(1)').classList.add('starDown');\n }\n else if (moves.innerText > 20){\n document.querySelector('.stars li:nth-child(2)').classList.add('starDown');\n }\n}", "function rating () {\n if (moves < maxStars) {\n ratingStar = \"<i class= 'star fas fa-star'></i><i class= 'star fas fa-star'></i><i class='star fas fa-star'></i>\";\n } else if (moves < minStars) {\n stars[2].style.color = \"#444\";\n ratingStar = \"<i class='star fas fa-star'></i><i class= 'star fas fa-star'></i>\";\n } else {\n stars[1].style.color = \"#444\";\n ratingStar = \"<i class='star fas fa-star'></i>\";\n }\n}", "function setRating() {\r\n // Assigning Stars according to number of moves\r\n if (moves <= 12) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star\" aria-hidden=\"true\"></i>';\r\n } else if (moves <= 14) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-half-o\" aria-hidden=\"true\"></i>';\r\n } else if (moves <= 16) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i>';\r\n } else if (moves <= 18) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-half-o\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i>';\r\n } else if (moves <= 20) {\r\n var stars = '<i class=\"fa fa-star\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i>';\r\n } else {\r\n var stars = '<i class=\"fa fa-star-half-o\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i>';\r\n }\r\n // Appending Stars\r\n $('.starsB').html(stars);\r\n }", "function getRating(currentRating)\n {\n\n\n if(currentRating === '5')\n {\n return \"star5\";\n }\n else if(currentRating === '4.5')\n {\n return \"star4half\";\n }\n else if(currentRating === '4')\n {\n return \"star4\";\n }\n else if(currentRating === '3.5')\n {\n return \"star3half\";\n }\n else if(currentRating === '3')\n {\n return \"star3\";\n }\n else if(currentRating === '2.5')\n {\n return \"star2half\";\n }\n else if(currentRating === '2')\n {\n return \"star2\";\n }\n else if(currentRating === '1.5')\n {\n return \"star1half\";\n }\n else if(currentRating === '1')\n {\n return \"star1\";\n }\n else if(currentRating === '0.5')\n {\n return \"starhalf\";\n }\n else\n {\n return \"\";\n }\n }", "function starRating() {\n if (moves === 15) {\n starChanger[0].classList.add('hide');\n starChanger[3].classList.add('hide');\n starChanger[1].classList.add('silver');\n starChanger[4].classList.add('silver');\n starChanger[2].classList.add('silver');\n starChanger[5].classList.add('silver');\n\n } if (moves === 20) {\n starChanger[1].classList.add('hide');\n starChanger[4].classList.add('hide');\n starChanger[2].classList.add('bronze');\n starChanger[5].classList.add('bronze');\n }\n}", "function starRating(){\n if (moves === 14 || moves === 24) {\n deathStar()\n }\n}", "function getStarRating() {\n if ($('#star-3').hasClass('fa-star')) {\n return 3;\n } else if ($('#star-2').hasClass('fa-star')) {\n return 2;\n } else {\n return 1;\n }\n}", "function handleStarRating(){\n\t// setting the rates based on moves\n if (numberOfMoves > 30){\n stars[1].style.visibility = \"collapse\";\n } else if (numberOfMoves > 25){\n stars[2].style.visibility = \"collapse\";\n } else if (numberOfMoves > 20){\n stars[3].style.visibility = \"collapse\";\n } else if (numberOfMoves > 16){\n stars[4].style.visibility = \"collapse\";\n }\n}", "function updateMoves() {\n if (moves === 1) {\n $(\"#movesText\").text(\" Move\");\n } else {\n $(\"#movesText\").text(\" Moves\");\n }\n $(\"#moves\").text(moves.toString());\n\n if (moves > 0 && moves < 16) { // gives star rating according the no of moves ,removes the class\n starRating = starRating;\n } else if (moves >= 16 && moves <= 20) {\n $(\"#starOne\").removeClass(\"fa-star\");\n starRating = \"2\";\n } else if (moves > 20) {\n $(\"#starTwo\").removeClass(\"fa-star\");\n starRating = \"1\";\n }\n}", "function starsRating() {\n if (moves === 14 || moves === 17 || moves === 24 || moves === 28\n ) { hideStar();\n }\n}", "function rate(rating) {\n if (song.rating < 0) return;//negative ratings cannot be changed\n if (settings.linkRatings) {\n if (rating >= settings.linkRatingsMin && !isRatingReset(song.rating, rating)) loveTrack();\n else if (settings.linkRatingsReset) unloveTrack();//unlove on reset or lower rating\n }\n executeInGoogleMusic(\"rate\", { rating: rating });\n }", "function setStars() {\n /*Grabs the section in the html that has the moves count and updates it based on moves variable. */\n document.getElementById(\"moves\").textContent = moves;\n /*Conditional used to determine what stars to display depending on the number of moves/2clicks occur. */\n if (moves <= 10){\n starsRating = 3;\n return;\n } \n /*Grabs stars elements so that later the classes can be manipulated to display clear starts instead of full stars. */\n let stars = document.getElementById(\"stars\").children;\n /*If the user has taken over 10 moves/2 clicks, then one star is replaced with a star outline. */\n stars[2].firstElementChild.classList.remove(\"fa-star\");\n stars[2].firstElementChild.classList.add(\"fa-star-o\");\n if (moves <= 20){\n starsRating = 2;\n return;\n } \n /*If the user has taken over 20 moves/2 clicks, then an addional star is repalced with a star outline. */\n stars[1].firstElementChild.classList.remove(\"fa-star\");\n stars[1].firstElementChild.classList.add(\"fa-star-o\");\n if (moves <= 30) {\n starsRating = 1;\n return;\n } \n}", "function displayStarRating() {\n const userRating = document.querySelector(\".total-rating\").textContent;\n if (userRating < 10) {\n addProfileStars(1)\n }\n else if (userRating >= 10 && userRating <= 100) {\n addProfileStars(2);\n }\n else if (userRating > 100 && userRating <= 200) {\n addProfileStars(3);\n }\n else if (userRating > 200 && userRating <= 500) {\n addProfileStars(4);\n }\n else {\n addProfileStars(5);\n }\n}", "function ratePlayer() {\n let starsChilds = stars.children('li');\n let starsClasses = 'fa-star fa-star-o';\n let rateNumber = moves === 16 ? 2 : moves === 20 ? 1 : null;\n $(starsChilds[rateNumber]).children('i').toggleClass(starsClasses);\n}", "function starRating() {\n var starsTracker = starsPanel.getElementsByTagName('i');\n\n // If game finished in 11 moves or less, return and star rating remains at 3\n if (moves <= 11) {\n return;\n // If finished between 11 to 16 moves, 3rd colored star is replaced with empty star class\n } else if (moves > 11 && moves <= 16) {\n starsTracker.item(2).className = 'fa fa-star-o';\n // If finished with more than 16 moves, 2nd colored star is replaced with empty star class\n } else {\n starsTracker.item(1).className = 'fa fa-star-o';\n }\n\n // Update stars variable by counting length of remaining colored star elements\n stars = document.querySelectorAll('.fa-star').length;\n}", "updateStarRating() {\n const { numberOfMoves, numberOfStars } = this.state;\n if(numberOfMoves < 12) {\n this.setState({\n numberOfStars: 3\n });\n } else if (numberOfMoves >= 12 && numberOfMoves < 18) {\n this.setState({\n numberOfStars: 2\n });\n } else {\n this.setState({\n numberOfStars: 1\n });\n }\n }", "function ratingBonus(rating) {\n if(rating <= 2) {\n return 0;\n } else if (rating <= 3) {\n return 0.04\n } else if(rating <= 4) {\n return 0.06;\n } else if (rating === 5) {\n return 0.1;\n }\n}//end ratingBonus", "function displayMovesAndRating() {\n\tmoves = 0; rating = 3;\n\tmoveElement.innerText = `${moves} Move`;\n\n\tratingElement.children[2].classList.remove('fa-star-o');\n\tratingElement.children[2].classList.add('fa-star');\n\n\tratingElement.children[1].classList.remove('fa-star-o');\n\tratingElement.children[1].classList.add('fa-star');\n}", "function updateMoves() {\n moves += 1;\n const move = document.querySelector(\".moves\");\n move.innerHTML = moves;\n if (moves === 16) {\n removeStar();\n starRating = 2;\n } else if (moves === 25) {\n removeStar();\n starRating = 1;\n }\n}", "function recalcStars() {\n const stars = document.querySelector(\".stars\");\n if ((countStars===3 && countMoves === 11) || (countStars===2 && countMoves === 17) ) {\n stars.children[countStars-1].firstElementChild.classList.replace('fa-star','fa-star-half-o');\n countStars -= 0.5;\n }\n if ((parseInt(countStars)===2 && countMoves === 14) || (parseInt(countStars)===1 && countMoves === 20)) {\n countStars -= 0.5;\n stars.children[countStars].firstElementChild.classList.replace('fa-star-half-o','fa-star-o');\n }\n}", "function getRating(rating){\n if (rating && rating > 0){\n var result = {\n number: Math.ceil(rating),\n color: getRatingColor(rating)\n };\n return result;\n }\n}", "function rateMovie(id){\n var title = id.replace(/1/g, \"\");\n title = title.replace(/2/g, \"\");\n title = title.replace(/3/g, \"\");\n title = title.replace(/4/g, \"\");\n title = title.replace(/5/g, \"\");\n \n \n\n var rating = id.replace(title, \"\");\n rating = parseInt(rating);\n\n //Coloring the stars\n for(var f = 1; f <= rating; f++){\n var id = title + f;\n $(\"#\" + id).addClass(\"active\");\n }\n \n //id of the titlecell\n var titleCell = createId(title, 2);\n var movieTitle = $(\"#\" + titleCell).html();\n \n //save the Rating in Parse\n pushRatingToMovie(movieTitle, rating);\n\n //Actualize the avg rating\n getAverageRatingOfMovie(movieTitle);\n\n //Set Movie to isSeen\n updateIsSeenOnParse(movieTitle, true);\n createSeenButton(movieTitle);\n\n}", "function starRating(state) {\n switch(state) {\n case 0:\n return <img src=\"images/stars/[email protected]\" />;\n case 1:\n return <img src=\"images/stars/[email protected]\" />;\n case 1.5:\n return <img src=\"images/stars/[email protected]\" />;\n case 2:\n return <img src=\"images/stars/[email protected]\" />;\n case 2.5:\n return <img src=\"images/stars/[email protected]\" />;\n case 3:\n return <img src=\"images/stars/[email protected]\" />;\n case 3.5:\n return <img src=\"images/stars/[email protected]\" />;\n case 4:\n return <img src=\"images/stars/[email protected]\" />;\n case 4.5:\n return <img src=\"images/stars/[email protected]\" />;\n case 5:\n return <img src=\"images/stars/[email protected]\" />;\n default:\n return null;\n }\n\n}", "function checkStarRating() {\n\tif (moves < twoStar) {\n\t\treturn ' <i class=\"fa fa-star\"></i> <i class=\"fa fa-star\"></i> <i class=\"fa fa-star\"></i>';\n\t} else if (moves < oneStar) {\n\t\treturn ' <i class=\"fa fa-star\"></i> <i class=\"fa fa-star\"></i>';\n\t} else {\n\t\treturn ' <i class=\"fa fa-star\"></i>';\n\t}\n}", "function adjustStarRating(moves) {\n if (moves === 16) {\n stars.children[0].remove();\n }\n else if (moves === 22) {\n stars.children[0].remove();\n }\n else if (moves === 32) {\n stars.children[0].remove();\n }\n else if (moves === 42) {\n stars.children[0].remove();\n }\n}", "function getStudentsRating () {\n\tvar actionType = '[getStudentsRating]:';\n\t// if the length of the teachers array\n\t// does not equal to the length of teachers priority list\n\t// show error message\n\tif (teachers.length !== teacherPriorityList.length) {\n\t\tconsole.log(`Only ${teacherPriorityList.length} of ${teachers.length} has provided`);\n\t\treturn console.log(actionType, \n\t\t\t'All teachers must make the priority lists before calculating the Rating.');\n\t}\n\t// Clear rating \n\t// before creating a new one.\n\tclearStudentsRating();\n\t// Go through the teachers.\n\tfor (var i = 0; i < teacherPriorityList.length; i++) {\n\t\t// Go thorugh the exacly teachers PRIORITY list.\n\t\t// VAR E IS THE STUDENT ID.\n\t\tvar studentsList = teacherPriorityList[i].studentsList;\n\t\tfor (var e = 0; e < studentsList.length; e++) {\n\t\t\t// Rating is the power (the place)\n\t\t\t// 0 place = 3 points of rating if 3 students are there.\n\t\t\tvar RATING = studentsList.length - studentsList[e];\n\t\t\t// Let's implement this now.\n\t\t\tstudents[e].rating += RATING;\n\t\t}\n\t}\n\treturn console.log(actionType, 'All students were got the rating.');\n}", "function updateStars() {\n if (moves > 10 && moves < 20) {\n starsList[4].setAttribute('class', 'fa fa-star-o');\n stars = 4;\n }\n if (moves >= 20 && moves < 30) {\n starsList[3].setAttribute('class', 'fa fa-star-o');\n stars = 3;\n }\n if (moves >= 30 && moves < 40) {\n starsList[2].setAttribute('class', 'fa fa-star-o');\n stars = 2;\n }\n if (moves >= 40) {\n starsList[1].setAttribute('class', 'fa fa-star-o');\n stars = 1;\n }\n }", "function countStars() {\n\n if (moves <= 20) {\n stars = 3;\n } else if (moves <= 25) {\n stars = 2;\n } else {\n stars = 1;\n }\n\n displayStars();\n}", "function getStarRating(confirmtimes){\n\tif(confirmtimes <= 0){\n\t\treturn \"<img src='images/star0.gif'>\";\n\t} else if (confirmtimes == 1){\n\t\treturn \"<img src='images/star1.gif'>\";\n\t} else if (confirmtimes == 2){\n\t\treturn \"<img src='images/star2.gif'>\";\n\t} else if (confirmtimes == 3){\n\t\treturn \"<img src='images/star3.gif'>\";\n\t} else if (confirmtimes == 4){\n\t\treturn \"<img src='images/star4.gif'>\";\n\t} else if (confirmtimes >= 5){\n\t\treturn \"<img src='images/star5.gif'>\";\n\t}\n}", "function rating(num){\n\tsMax = 0;\t// Isthe maximum number of stars\n\tfor(n=0; n<num.parentNode.childNodes.length; n++){\n\t\tif(num.parentNode.childNodes[n].nodeName == \"A\"){\n\t\t\tsMax++;\t\n\t\t}\n\t}\n\t\n\tif(!rated){\n\t\ts = num.id.replace(\"_\", ''); // Get the selected star\n\t\ta = 0;\n\t\tfor(i=1; i<=sMax; i++){\t\t\n\t\t\tif(i<=s){\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"on\";\n\t\t\t\tdocument.getElementById(\"rateStatus\").innerHTML = num.title;\t\n\t\t\t\tholder = a+1;\n\t\t\t\ta++;\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"\";\n\t\t\t}\n\t\t}\n\t}\n}", "function checkMovesNumber() {\n const STAR_1 = document.getElementById('star1');\n const STAR_2 = document.getElementById('star2');\n const STAR_3 = document.getElementById('star3');\n if (movesNumber > 14 && movesNumber <= 18) {\n starRating = 2.5;\n STAR_3.classList.remove('fa-star');\n STAR_3.classList.add('fa-star-half-o');\n } else if (movesNumber > 18 && movesNumber <= 22) {\n starRating = 2;\n STAR_3.classList.remove('fa-star-half-o');\n STAR_3.classList.add('fa-star-o');\n } else if (movesNumber > 22 && movesNumber <= 26) {\n starRating = 1.5;\n STAR_2.classList.remove('fa-star');\n STAR_2.classList.add('fa-star-half-o');\n } else if (movesNumber > 26 && movesNumber <= 30) {\n starRating = 1;\n STAR_2.classList.remove('fa-star-half-o');\n STAR_2.classList.add('fa-star-o');\n } else if (movesNumber > 30 && movesNumber <= 34) {\n starRating = 0.5;\n STAR_1.classList.remove('fa-star');\n STAR_1.classList.add('fa-star-half-o');\n } else if (movesNumber > 34) {\n starRating = 0;\n STAR_1.classList.remove('fa-star-half-o');\n STAR_1.classList.add('fa-star-o');\n alert('Game over! Du hattest zu viele Züge! Versuche es erneut!\\nAnzahl Züge: ' + movesNumber + '\\nVergangene Zeit: ' + sec + ' Sekunden' + '\\nDeine Bewertung: ' + starRating + ' Sterne');\n clearInterval(timer);\n } else {\n return;\n }\n}", "function stars() {\n const starSelector = document.querySelector('.stars');\n switch (true) {\n case (moveCounter >= 15):\n starSelector.children[1].firstElementChild.setAttribute('class', 'fa fa-star-o');\n break;\n case (moveCounter >= 9):\n starSelector.children[2].firstElementChild.setAttribute('class', 'fa fa-star-o');\n break;\n default:\n starSelector.children[0].firstElementChild.setAttribute('class', 'fa fa-star');\n starSelector.children[1].firstElementChild.setAttribute('class', 'fa fa-star');\n starSelector.children[2].firstElementChild.setAttribute('class', 'fa fa-star');\n }\n}", "function updateStars() {\n // if moves <=12 with 3 starts\n if (moves <= 12) {\n $('.stars .fa').addClass(\"fa-star\");\n stars = 3;\n } else if(moves >= 13 && moves <= 14){\n $('.stars li:last-child .fa').removeClass(\"fa-star\");\n $('.stars li:last-child .fa').addClass(\"fa-star-o\");\n stars = 2;\n } else if (moves >= 15 && moves <20){\n $('.stars li:nth-child(2) .fa').removeClass(\"fa-star\");\n $('.stars li:nth-child(2) .fa').addClass(\"fa-star-o\");\n stars = 1;\n } else if (moves >=20){\n $('.stars li .fa').removeClass(\"fa-star\");\n $('.stars li .fa').addClass(\"fa-star-o\");\n stars = 0;\n }\n $('.win-container .stars-number').text(stars);\n\n}", "function updateScore() {\n moveCounter += 1;\n document.getElementsByClassName('moves')[0].textContent = moveCounter;\n const stars = document.getElementsByClassName('stars')[0];\n switch (moveCounter) {\n case 16:\n setStarEmpty(stars.children[2].children[0]);\n starCounter = 2;\n break;\n case 24:\n setStarEmpty(stars.children[1].children[0]);\n starCounter = 1;\n break;\n }\n}", "function toStar(rating) {\n var star0 = chrome.extension.getURL(\"images/small_0.png\");\n var star1 = chrome.extension.getURL(\"images/small_1.png\");\n var star1half = chrome.extension.getURL(\"images/small_1_half.png\");\n var star2 = chrome.extension.getURL(\"images/small_2.png\");\n var star2half = chrome.extension.getURL(\"images/small_2_half.png\");\n var star3 = chrome.extension.getURL(\"images/small_3.png\");\n var star3half = chrome.extension.getURL(\"images/small_3_half.png\");\n var star4 = chrome.extension.getURL(\"images/small_4.png\");\n var star4half = chrome.extension.getURL(\"images/small_4_half.png\");\n var star5 = chrome.extension.getURL(\"images/small_5.png\");\n\n if (rating >= 5) {\n return star5;\n } else if (rating >= 4.5) {\n return star4half;\n } else if (rating >= 4) {\n return star4;\n } else if (rating >= 3.5) {\n return star3half;\n } else if (rating >= 3) {\n return star3;\n } else if (rating >=2.5) {\n return star2half;\n } else if (rating >=2) {\n return star2;\n } else if (rating >= 1.5) {\n return star1half;\n } else if (rating >= 1) {\n return star1;\n } else return star0;\n}", "static launchRatingOdds(rating) {\n switch(rating) {\n case Game.LaunchRating.PERFECT:\n case Game.LaunchRating.GREAT:\n return 0;\n case Game.LaunchRating.GOOD:\n return 0.05;\n case Game.LaunchRating.OKAY:\n return 0.20;\n case Game.LaunchRating.POOR:\n return 0.50;\n }\n }", "function getRatings(ratings) {\n const starsTotal = 5;\n\n for (let rating in ratings) {\n //check if the rating is greater than 5\n if (ratings[rating] > 5)\n ratings[rating] = 5;\n if (ratings[rating]<0)\n ratings[rating] = 0;\n\n //get percentage\n const starPercentage = (ratings[rating] / starsTotal) * 100;\n //round to nearest 10\n const starPercentageRounded = `${Math.round(starPercentage / 10) * 10}%`;\n //set width of star inner to percentage\n document.querySelector(`.${rating} .star-inner`).style.width = starPercentageRounded;\n }\n}", "function getCurrentRating(){\n\tvar success = function(data){\n\t\tloaded();\n\t\tsetMyRatings(data.selfEvaluation, data.managerEvaluation, data.score, data.selfEvaluationSubmitted, data.managerEvaluationSubmitted);\n\t}\n\tvar error = function(){ loaded(); }\n\t\n\tgetCurrentRatingAction(ADLoginID, success, error);\n}", "function current_rating(id, rating) {\n\tif(!is_being_rated) {\n\t\tpost_id = id;\n\t\tpost_rating = rating;\n\t\tfor(i = 1; i <= rating; i++) {\n\t\t\tdocument.images['rating_' + post_id + '_' + i].src = eval(\"ratings_mouseover_image.src\");\n\t\t}\n\t}\n}", "function starSetter() {\n // moves less than or equal 9 -> 3 stars\n // moves between 10 and 15 -> 2.5 stars\n if (moves >= 10 && moves <= 15) {\n starsList[2].className = halfStar;\n stars = 2.5;\n }\n // moves between 16 and 20 -> 2 stars\n else if (moves >= 16 && moves <= 20) {\n starsList[2].className = emptyStar;\n stars = 2;\n }\n // moves between 21 and 24 -> 1.5 stars\n else if (moves >= 21 && moves <= 24) {\n starsList[1].className = halfStar;\n stars = 1.5;\n }\n // moves between 25 and 28 -> 1 star\n else if (moves >= 25 && moves <= 28) {\n starsList[1].className = emptyStar;\n stars = 1;\n }\n // moves between 29 and more -> 0.5 stars\n else if (moves >= 29) {\n starsList[0].className = halfStar;\n stars = 0.5;\n }\n}", "function rating(num){\n\tsMax = 0;\t// Isthe maximum number of stars\n\tfor(n=0; n<num.parentNode.childNodes.length; n++){\n\t\tif(num.parentNode.childNodes[n].nodeName == \"A\"){\n\t\t\tsMax++;\t\n\t\t}\n\t}\n\t\n\tif(!rated){\n\t\ts = num.id.replace(\"_\", ''); // Get the selected star\n\t\ta = 0;\n\t\tfor(i=1; i<=sMax; i++){\t\t\n\t\t\tif(i<=s){\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"on\";\n\t\t\t\tholder = a+1;\n\t\t\t\ta++;\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(\"_\"+i).className = \"\";\n\t\t\t}\n\t\t}\n\t}\n}", "function moveCounter(moves){\n document.querySelector(\".moves\").textContent=moves.toString()+\" Moves\";\n \n if (moves==12){\n let star = document.querySelector(\"#star4\");\n star.setAttribute(\"class\",\"fa fa-star-o\");\n starRating =3;\n // $('#myModal').modal('show')\n }else if (moves==15){\n let star = document.querySelector(\"#star3\");\n star.setAttribute(\"class\",\"fa fa-star-o\");\n starRating =2;\n }else if (moves==20){\n let star = document.querySelector(\"#star2\");\n star.setAttribute(\"class\",\"fa fa-star-o\");\n starRating =1;\n }\n\n}", "function calculateRemainingStars() {\n if (state.totalMoves >= 0 && state.totalMoves < 15) {\n return 3;\n }\n \n if (state.totalMoves >= 15 && state.totalMoves < 25) {\n return 2;\n }\n \n if (state.totalMoves >= 25) {\n return 1;\n }\n \n throw 'Unable to calculate remaining stars';\n }", "function NewReviewStar(props) {\n var degToRad = function degToRad(deg) {\n return deg * 0.0174533;\n };\n\n var radius = 10;\n var strokeWidth = 0.5;\n\n var findStarPoints = function findStarPoints(r) {\n var pointAngles = [];\n\n for (var angleNum = 0; angleNum < 12; angleNum++) {\n pointAngles.push(90 + angleNum * 36);\n }\n\n pointAngles.forEach(function (angle, i) {\n if (i % 2 === 0) {\n points.push([Math.cos(degToRad(angle)) * -r + r + strokeWidth, Math.sin(degToRad(angle)) * -r + r + strokeWidth]);\n } else if (i % 2 !== 0) {\n points.push([Math.cos(degToRad(angle)) * -r * 1.91 / 5 + r + strokeWidth, Math.sin(degToRad(angle)) * -r * 1.91 / 5 + r + strokeWidth]);\n }\n });\n };\n\n var points = [];\n findStarPoints(radius);\n var ratingRounding = Math.floor(props.stars / .25) / 4;\n var starFill = 1;\n\n if (ratingRounding >= 1) {\n starFill = 1;\n } else if (ratingRounding >= .75) {\n starFill = .65;\n } else if (ratingRounding >= .5) {\n starFill = .5;\n } else if (ratingRounding >= .25) {\n starFill = .35;\n } else {\n starFill = 0;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"svg\", {\n viewBox: \"0 0 \".concat(2 * (radius + strokeWidth), \" \").concat(2 * (radius + strokeWidth)),\n width: 2 * (radius + strokeWidth),\n height: 2 * (radius + strokeWidth),\n className: \"rating-star\",\n onMouseEnter: function onMouseEnter() {\n props.setHoverRating(props.starNumber);\n },\n onMouseLeave: function onMouseLeave() {\n props.setHoverRating(0);\n },\n onClick: function onClick() {\n props.setRating(props.starNumber);\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"clipPath\", {\n id: \"clip-\".concat(props.starId)\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"path\", {\n d: \"M\\n \".concat(2 * (radius + strokeWidth), \" 0\\n \").concat(2 * (radius + strokeWidth), \" \").concat(2 * (radius + strokeWidth), \"\\n \").concat(2 * (radius + strokeWidth) * starFill, \" \").concat(2 * (radius + strokeWidth), \"\\n \").concat(2 * (radius + strokeWidth) * starFill, \" 0\\n \")\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"path\", {\n id: \"\".concat(props.starId),\n d: \"\\n M \".concat(points[0][0], \" \").concat(points[0][1], \"\\n \").concat(points[1][0], \" \").concat(points[1][1], \"\\n \").concat(points[2][0], \" \").concat(points[2][1], \"\\n \").concat(points[3][0], \" \").concat(points[3][1], \"\\n \").concat(points[4][0], \" \").concat(points[4][1], \"\\n \").concat(points[5][0], \" \").concat(points[5][1], \"\\n \").concat(points[6][0], \" \").concat(points[6][1], \"\\n \").concat(points[7][0], \" \").concat(points[7][1], \"\\n \").concat(points[8][0], \" \").concat(points[8][1], \"\\n \").concat(points[9][0], \" \").concat(points[9][1], \"\\n \").concat(points[10][0], \" \").concat(points[10][1], \"\\n \").concat(points[11][0], \" \").concat(points[11][1], \"\\n \"),\n stroke: \"black\",\n strokeWidth: strokeWidth,\n fill: \"lightgrey\"\n }), props.hoverStars > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"path\", {\n d: \"\\n M \".concat(points[0][0], \" \").concat(points[0][1], \"\\n \").concat(points[1][0], \" \").concat(points[1][1], \"\\n \").concat(points[2][0], \" \").concat(points[2][1], \"\\n \").concat(points[3][0], \" \").concat(points[3][1], \"\\n \").concat(points[4][0], \" \").concat(points[4][1], \"\\n \").concat(points[5][0], \" \").concat(points[5][1], \"\\n \").concat(points[6][0], \" \").concat(points[6][1], \"\\n \").concat(points[7][0], \" \").concat(points[7][1], \"\\n \").concat(points[8][0], \" \").concat(points[8][1], \"\\n \").concat(points[9][0], \" \").concat(points[9][1], \"\\n \").concat(points[10][0], \" \").concat(points[10][1], \"\\n \").concat(points[11][0], \" \").concat(points[11][1], \"\\n \"),\n fill: \"green\",\n stroke: \"black\",\n strokeWidth: strokeWidth * 5\n }) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"path\", {\n d: \"\\n M \".concat(points[0][0], \" \").concat(points[0][1], \"\\n \").concat(points[1][0], \" \").concat(points[1][1], \"\\n \").concat(points[2][0], \" \").concat(points[2][1], \"\\n \").concat(points[3][0], \" \").concat(points[3][1], \"\\n \").concat(points[4][0], \" \").concat(points[4][1], \"\\n \").concat(points[5][0], \" \").concat(points[5][1], \"\\n \").concat(points[6][0], \" \").concat(points[6][1], \"\\n \").concat(points[7][0], \" \").concat(points[7][1], \"\\n \").concat(points[8][0], \" \").concat(points[8][1], \"\\n \").concat(points[9][0], \" \").concat(points[9][1], \"\\n \").concat(points[10][0], \" \").concat(points[10][1], \"\\n \").concat(points[11][0], \" \").concat(points[11][1], \"\\n \"),\n fill: \"green\",\n stroke: \"black\",\n strokeWidth: strokeWidth\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"use\", {\n clipPath: \"url(#clip-\".concat(props.starId, \")\"),\n href: \"#\".concat(props.starId)\n }));\n}", "function starRating() {\n if(moveCounter <= 25) {\n starsList[0].style.display = 'inline-block';\n starsList[1].style.display = 'inline-block';\n starsList[2].style.display = 'inline-block';\n moves.style.color = \"green\";\n }\n else if(moveCounter > 25 && moveCounter <=65) {\n starsList[0].style.display = 'inline-block';\n starsList[1].style.display = 'inline-block';\n starsList[2].style.display = 'none';\n moves.style.color = \"orange\";\n }\n else if(moveCounter > 65) {\n starsList[0].style.display = 'inline-block';\n starsList[1].style.display = 'none';\n starsList[2].style.display = 'none';\n moves.style.color = \"red\";\n }\n}", "function outputStars(newRating) {\n\tlet intRating = parseInt(newRating)\n\t\n\t$('#rating-stars i').each(function(i) {\n\t\tlet $this = $(this)\n\t\t$this.removeClass('user-rating')\n\t\tif (i < intRating) {\n\t\t\t$this.removeClass('far').addClass('fas')\n\t\t} else {\n\t\t\t$this.removeClass('fas').addClass('far')\n\t\t}\n\t})\n}", "function stars() {\n\tconst starar = star.getElementsByTagName('i');\n\tfor (i = 0; i < starar.length; i++) {\n\t\tif (moves > 14 && moves <= 19) {\n\t\t\tstarar[2].className = 'fa fa-star-o';\n\t\t\tstarnum = 2;\n\t\t} else if (moves > 19) {\n\t\t\tstarar[1].className = 'fa fa-star-o';\n\t\t\tstarnum = 1;\n//\t\t} else if (moves > 24) {\n//\t\t\tstarar[0].className = 'fa fa-star-o';\n//\t\t\tstarnum = 0;\n\t\t} else {\n\t\t\tstarar[0].className = 'fa fa-star';\n\t\t\tstarar[1].className = 'fa fa-star';\n\t\t\tstarar[2].className = 'fa fa-star';\n\t\t\tstarnum = 3;\n\t\t}\n\t}\n}", "function ratingToString(rating){\n if(rating==1)\n return \"Like!\";\n if(rating==0)\n return \"Not yet rated!\";\n return \"Dislike!\";\n}", "function rating() {\n if (totalClicks <= 29) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n } else if (totalClicks >= 30 && totalClicks <= 39) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n } else if (totalClicks >= 40) {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>`;\n } else {\n starRating.innerHTML = `\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>\n <li><i class=\"fa fa-star\"></i></li>`;\n }\n }", "function addAMove(){\n moves++;\n moveCounter.innerHTML = moves;\n //game displays a star rating from 1 to at least 3 stars - after some number of moves, star rating lowers\n if (moves > 8 && moves < 12) {\n numStars = 4;\n stars.innerHTML = `<li class=\"star\"><i class=\"fa fa-star\"></i></li><li class=\"star\"><i class=\"fa fa-star\"></i></li><li class=\"star\"><i class=\"fa fa-star\"></i></li><li class=\"star\"><i class=\"fa fa-star\"></i></li>`;\n }\n if (moves >= 12 && moves < 20) {\n numStars = 3;\n stars.innerHTML = `<li class=\"star\"><i class=\"fa fa-star\"></i></li><li class=\"star\"><i class=\"fa fa-star\"></i></li><li class=\"star\"><i class=\"fa fa-star\"></i></li>`;\n }\n if (moves >= 20 && moves < 30) {\n numStars = 2;\n stars.innerHTML = `<li class=\"star\"><i class=\"fa fa-star\"></i></li><li class=\"star\"><i class=\"fa fa-star\"></i></li>`;\n }\n if (moves > 30) {\n numStars = 1;\n stars.innerHTML = `<li class=\"star\"><i class=\"fa fa-star\"></i></li>`;\n }\n}", "function rateStars(clicks_score) {\n if (clicks_score <= 25 && clicks_score > 20) {\n $('.rating').text('★★☆');\n return '★★☆';\n }\n else if (clicks_score > 25) {\n $('.rating').text('★☆☆');\n return '★☆☆';\n }\n else {\n return '★★★';\n }\n}", "function getMovieUserRating() {\n requestService.getMovieUserRating().then(\n\n // success function\n function(data) {\n $log.debug('movieCommentsController -> getMovieUserRating success', data);\n $scope.userRating = data.user_rating.rating;\n },\n\n // error function\n function() {\n $log.debug('movieCommentsController -> getMovieUserRating error');\n }\n\n );\n }", "function updateScore() {\n $('.moves').text(movesCounter);\n if (movesCounter > 10 && movesCounter <= 15 ) {\n $('#thirdStar').removeClass('fa fa-star');\n $('#thirdStar').addClass('fa fa-star-o');\n starsCounter = 2;\n }\n else if (movesCounter > 15) {\n $('#secondStar').removeClass('fa fa-star');\n $('#secondStar').addClass('fa fa-star-o');\n starsCounter = 1;\n }\n // you should have at least 1 star\n}", "function adjustRating() {\n const oneStar = document.querySelector(\".fa-star\").parentNode;\n if (moveCount == 28) {\n oneStar.parentNode.removeChild(oneStar);\n } else if (moveCount == 38) {\n oneStar.parentNode.removeChild(oneStar);\n }\n}", "function addMove(){\n moves++;\n movesCounter.textContent = moves;\n //Set Rating:\n rating();\n}", "function doUpdateRating() {\n var power = (oppRating - myRating)/400;\n var expectedScore = 1/(1 + Math.pow(10, power));\n var actualScore = 1; //win\n if (result === 'draw') actualScore = 0.5; //draw\n if (result === 'lose') actualScore = 0; //lose\n var k = 32; //k-factor\n\n var adjustedRating = myRating + k*(actualScore - expectedScore);\n console.log(\"oppRating:\", oppRating);\n console.log(\"myRating:\", myRating);\n console.log(\"my new rating:\", adjustedRating);\n console.log(\"net gain:\", adjustedRating - myRating);\n\n firebase.database().ref('leaderboard/'+gametype+'/'+userkey).update({ rating: adjustedRating});\n }", "function handleRatingChange() {\n var newReviewRating = $(this).val();\n getReviews(newReviewRating);\n }", "function rating(num){\n\tprefix = num.id.substr(0,num.id.length-1 );\n\tsMax[prefix] = 0;\t// Isthe maximum number of stars\n\tfor(n=0; n<num.parentNode.childNodes.length; n++){\n\t\tif(num.parentNode.childNodes[n].nodeName == \"A\"){\n\t\t\tsMax[prefix]++;\t\n\t\t}\n\t}\n\t\n\t// if(!rated[prefix]){\n\t\ts = num.id[num.id.length-1]; // Get the selected star\n\t\ta = 0;\n\t\t\n\t\tfor(i=1; i<=sMax[prefix]; i++){\t\t\n\t\t\tif(i<=s){\n\t\t\t\tdocument.getElementById(prefix+i).className = \"on\";\n\t\t\t\t// document.getElementById(\"rateStatus\").innerHTML = num.title;\t\n\t\t\t\tholder[prefix] = a+1;\n\t\t\t\ta++;\n\t\t\t}else{\n\t\t\t\tdocument.getElementById(prefix+i).className = \"\";\n\t\t\t}\n\t\t}\n\t// }\n}", "function addMove(){\n moves += 1;\n $(\"#moves\").html(moves);\n if (moves === 14 || moves === 20){\n finalRating();\n }\n}", "function getRatings(userId){\n\tgetCurrentRatingAction(userId, function(data){ \n\t\tsetMyRatings(data.selfEvaluation, data.managerEvaluation, data.score, data.selfEvaluationSubmitted, data.managerEvaluationSubmitted);\n\t});\n}", "function addRatings() {\n OMDBProvider.getMovie(vm.film.imdb_id).then(movie => {\n vm.film.ratings = movie.Ratings;\n getTrailers();\n })\n }", "function calculateNewRatingScore(newRating) {\n\tlet currentRating = getCurrentRating()\n\tlet currentVotes = getCurrentVotes()\n\tlet newVotes = currentVotes+1\n\tlet calc = (currentRating*currentVotes+newRating)/newVotes\n\tcalc = calc.toFixed(2)\n\t\n\tupdateNewVotes(newVotes)\n\tupdateNewRating(calc)\n\toutputStars(calc)\n}", "getAverageStarRating(comments){\n let numberOfPeopleRating = comments.length;\n var totalStars = 0;\n\n if(numberOfPeopleRating == 0) {\n\t\treturn (\n\t\t\t<div><RaisedButton\n\t\t\t\tonTouchTap={ this.navigate( 'rate-point' )}\n label=\"Be the first to rate this point!\"/><br/><br/><br/></div>\n\n\t\t\t\t//primaryText={ \"Be the first to rate!\"} /></div>\n\t\t); // EARLY RETURN (not yet rated)\n }\n\n //loop over the comments to get the length of the array (aka how mant ratings are there).\n for (var i = 0; i < comments.length; i++) {\n // add the total stars\n totalStars += comments[i].rating;\n }\n\n var averageStars = 0;\n //calculating the average star ratings.\n averageStars = (totalStars*1.0)/numberOfPeopleRating;\n //Round to get the nearest int\n averageStars = Math.round(averageStars);\n\n\n const style = { fontSize: '16px' };\n const average = (\n <RatingSelector disabled\n rating={ averageStars }\n style={ style } />\n );\n\n return (\n <div><RaisedButton\n onTouchTap={ this.navigate( 'rate-point' )}\n label=\"View Ratings\"\n labelPosition=\"before\">\n {average}&nbsp;&nbsp;&nbsp;&nbsp;\n </RaisedButton><br/><br/><br/></div>\n );\n\n }", "function rateMovie(args) {\n\tconsole.log(\"Rating movie \"+movie_id+\" with a rating of \"+args[4]);\n\tvar req = new XMLHttpRequest();\n\treq.open(\"PUT\", request_path+\"/recommendations/\"+user_id, true);\n\treq.onload = function() {\n\t\tconsole.log(\"Added rating to db\");\n\t\tgetNewMovie(args);\n\t}\n\tvar data = { \"movie_id\": movie_id, \"rating\": args[4], \"apikey\": \"AaD72Feb3\" };\n\treq.send(JSON.stringify(data));\n}", "function rateMovie(id){\n\n var ration = prompt(\"Zahl zwischen 0 und 5\");\n\n //Check if input is alright\n if(ration >= 0 & ration <= 5){\n var imagesource = \"img/\" + ration + \"stars.png\";\n var generatedHtml = \"<img src='\" + imagesource + \"' alt='\" + ration + \" Sterne'/>\";\n //Ration as number\n ration = parseInt(ration);\n\n updateRationOnParse(id, generatedHtml, ration);\n\n var imageId = id.replace(/rowId_/g, \"imageId_\");\n updateRation(generatedHtml, imageId);\n }else{\n alert(\"Üngültige Eingabe, sie müssen eine Zahl zwischen 0 und 5 eingeben!\");\n }\n}", "function howManyStars() {\n\tif (Number(movesMade.innerText) < 20) {\n\t\treturn \"3 stars\";\n\t}\n\tif (Number(movesMade.innerText) > 19 && Number(movesMade.innerText) < 29) {\n\t\treturn \"2 stars\";\n\t}\n\tif (Number(movesMade.innerText) > 28) {\n\t\treturn \"1 star\";\n\t}\n}", "function rateSong(user, songId, score) {\n // \"if\" statement differentiates between who is rating\n if (user === \"pilot\") {\n const ratingData = {\n id: songId,\n pilot_rating: score,\n };\n $.ajax({\n method: \"PUT\",\n url: \"/api/songs\",\n data: ratingData,\n }).then(function() {\n window.location.reload();\n getAverage();\n });\n } else if (user === \"coPilot\") {\n const ratingData = {\n id: songId,\n copilot_rating: score,\n };\n $.ajax({\n method: \"PUT\",\n url: \"/api/songs\",\n data: ratingData,\n }).then(function() {\n window.location.reload();\n getAverage();\n });\n }\n }", "function starRating() {\n if((score > 9) && (score <= 16)) {\n star3.style.visibility = 'hidden';\n starTally = 2;\n }\n if((score >16) && (score <=28)) {\n star3.style.visibility = 'hidden';\n star2.style.visibility = 'hidden';\n tarTally = 1;\n }\n if(score >28) {\n star3.style.visibility = 'hidden';\n star2.style.visibility = 'hidden';\n star1.style.visibility = 'hidden';\n starTally = 0;\n }\n}", "function handleRatingUpdate(event, currentRating, addedRating, totalRatings){\n event.preventDefault();\n var newTotalRatings = totalRatings + 1\n var updatedRating = (currentRating * totalRatings) / newTotalRatings;\n \n\n var updatedRatingInfo = {\n rating : updatedRating,\n totalRatings : newTotalRatings\n }\n \n updateRating(updatedRatingInfo);\n \n }", "function stars() {\n starsNumber = 3;\n if (moves >= 10 && moves < 18) {\n thirdStar.classList.remove('fa-star', 'starColor');\n thirdStar.classList.add('fa-star-o');\n starsNumber = 2;\n } else if (moves >= 18) {\n secondStar.classList.remove('fa-star', 'starColor');\n secondStar.classList.add('fa-star-o');\n starsNumber = 1;\n }\n}", "function calcRating(score){\n var starimg = document.getElementById(\"rating-img\");\n starimg.style.display = \"block\";\n // divide score into 5 sections (consider a score out of 100 points)\n if(score <= 86){ //1 star\n starimg.src = \"media/Utilities/1star.png\";\n } else if(score <=173) {//2 star\n starimg.src = \"media/Utilities/2stars.png\";\n } else if(score <=260) {//3 star \n starimg.src = \"media/Utilities/3stars.png\";\n } else if(score <=299) {//4 star\n starimg.src = \"media/Utilities/4stars.png\";\n } else {//5 star\n starimg.src = \"media/Utilities/5stars.png\";\n }\n outputstr += \"</br></br>\";\n document.getElementById(\"item-feedback\").innerHTML = outputstr;\n}", "function calculateStars(avgStarRatings, numStarRatings) {\n if (numStarRatings == 0) {\n displayStars(0, 0);\n // 0 for # reviews\n } else if ((1 <= avgStarRatings) && (avgStarRatings < 1.25)) {\n displayStars(1, 0);\n } else if ((1.25 <= avgStarRatings) && (avgStarRatings < 1.75)) {\n displayStars(1, 1);\n } else if ((1.75 <= avgStarRatings) && (avgStarRatings < 2.25)) {\n displayStars(2, 0);\n } else if ((2.25 <= avgStarRatings) && (avgStarRatings < 2.75)) {\n displayStars(2, 1);\n } else if ((2.75 <= avgStarRatings) && (avgStarRatings < 3.25)) {\n displayStars(3, 0);\n } else if ((3.25 <= avgStarRatings) && (avgStarRatings < 3.75)) {\n displayStars(3, 1);\n } else if ((3.75 <= avgStarRatings) && (avgStarRatings < 4.25)) {\n displayStars(4, 0);\n } else if ((4.25 <= avgStarRatings) && (avgStarRatings < 4.75)) {\n displayStars(4, 1);\n } else {\n displayStars(5, 0);\n }\n}", "function ratingImage (rating) {\n const starDict = {\n 0: '[email protected]',\n 1: '[email protected]',\n 1.5: '[email protected]',\n 2: '[email protected]',\n 2.5: '[email protected]',\n 3: '[email protected]',\n 3.5: '[email protected]',\n 4: '[email protected]',\n 4.5: '[email protected]',\n 5: '[email protected]'\n };\n return (starDict[rating]);\n }", "function trackMovesAndScore () {\n\tgameData.moves++;\n\t$('.moves').text(gameData.moves);\n\n\tif (gameData.moves > 15 && gameData.moves < 20) {\n\t\t$('.stars').html(gameData.starsHTML + gameData.starsHTML);\n\t} else if (gameData.moves >= 20) {\n\t\t$('.stars').html(gameData.starsHTML);\n\t}\n}", "function ratings() {\n\tif(moveCounter > 12 && moveCounter <= 16) {\n\t\tsStar[0].style.cssText = 'opacity: 0';\n\t\tcStar[0].style.cssText = 'display: none';\n\t}\n\tif(moveCounter > 16) {\n\t\tsStar[1].style.cssText = 'opacity: 0';\n\t\tcStar[1].style.cssText = 'display: none';\t\n\t}\n}", "function starCount() {\n\n if(numMoves < 16) {\n numStars = 3;\n }else if (numMoves >= 16 && numMoves < 25) {\n numStars = 2;\n }else {\n numStars = 1;\n };\n\n printStars();\n}", "function moveCounter() {\n moveCount ++;\n moves.textContent = moveCount;\n // star Rating:\n let starRating = document.getElementsByClassName(\"stars\")[0];\n if (moveCount > 20) {\n starRating.innerHTML = \"<li><i class=\\\"fa fa-star\\\"></i></li> <li><i class=\\\"fa fa-star\\\"></i></li>\";\n } else if (moveCount > 30) {\n starRating.innerHTML = \"<li><i class=\\\"fa fa-star\\\"></i></li>\";\n }\n}", "function calculateRating() {\n const allLocations = [\n \"location1\",\n \"location2\",\n \"location3\",\n \"location4\",\n \"location5\"\n ];\n /** ITERATE LOCATIONS OVER THESE FUNCTIONS TO RETURN EACH SCORE*/\n for (let loc of allLocations) {\n let score = 0;\n score += weekendRainScore(loc);\n score += weekendCloudsScore(loc);\n score += weekendWindScore(loc);\n score += weekendHumidityScore(loc);\n score += weekendTempScore(loc);\n weekendWeather[loc].score = Math.floor(calculatePercent(score));\n }\n /** HIGHEST ACHIEVABLE SCORE BASED ON A TEMP OF 40 DEG CELSIUS IS 702\n tEMPS IN EXCESS OF 40 ARE SUBJECT TO DEDUCTIONS AND AS A RESULT\n DO NOT EXCEED THIS SCORE OR 702*/\n const weekendWeatherSerial = JSON.stringify(weekendWeather);\n localStorage.setItem(\"weekendWeather\", weekendWeatherSerial);\n}", "ratingStars(vote){\n return Math.ceil(vote/2);\n }" ]
[ "0.78940636", "0.78329915", "0.77787524", "0.7774005", "0.7739763", "0.77269536", "0.769004", "0.7676076", "0.76703954", "0.763949", "0.760653", "0.7389732", "0.73660254", "0.723577", "0.71886635", "0.7159756", "0.7139172", "0.70582867", "0.70310605", "0.70205367", "0.7017559", "0.70124555", "0.7004652", "0.6976862", "0.6957841", "0.69490665", "0.6937341", "0.6916826", "0.6856241", "0.6832669", "0.6829098", "0.6828739", "0.67572963", "0.6657236", "0.6631129", "0.6630964", "0.6608399", "0.6583745", "0.6581763", "0.65787756", "0.655283", "0.655107", "0.65453416", "0.6542643", "0.65307623", "0.6499764", "0.64912117", "0.6481001", "0.64582694", "0.6444907", "0.64350617", "0.63730526", "0.63526744", "0.6314498", "0.62998337", "0.62891024", "0.6288756", "0.6286423", "0.62809825", "0.62633467", "0.62464815", "0.6244546", "0.62403494", "0.6210066", "0.62048423", "0.62024945", "0.6168253", "0.6159416", "0.61418164", "0.6139621", "0.6138819", "0.6135446", "0.6134205", "0.61238515", "0.6119278", "0.61097884", "0.60991615", "0.60982066", "0.6093999", "0.6092011", "0.60914224", "0.60800785", "0.60784024", "0.60659236", "0.6062219", "0.6054163", "0.60403067", "0.6039788", "0.6038733", "0.6031491", "0.60208434", "0.6017846", "0.6014021", "0.6012102", "0.60112166", "0.6006893", "0.60019237", "0.5987833", "0.595762", "0.5949804" ]
0.7537224
11
Toggline the congratulation modal
function modalToggle() { 'use strict'; // turn on Strict Mode congoModal.classList.toggle('hide'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCongratulationModal() {\n let template = `\n were ${scorePanel.playTime} seconds on a ${deckConfig.numberOfcards === difficulty.easy ? 'easy' : 'hard'} level, \n with ${scorePanel.moveCounter} moves and ${scorePanel.starCounter} star(s).`;\n\n $(\"#congratulationScore\").text(template);\n $(\"#congratulationModal\").modal({ show: true, backdrop: 'static', keyboard: false });\n}", "function abrirCreditos() {\r\n\td3.select(\"#modal\").style(\"display\", \"inline\");\r\n}", "function ouvrir() {\n creationModal();\n }", "function confirmerSuppression() {\n let n = new Noty({\n text: 'Confirmer la suppression du frais ',\n layout: 'center',\n theme: 'sunset',\n modal: true,\n type: 'info',\n animation: {\n open: 'animated lightSpeedIn',\n close: 'animated lightSpeedOut'\n },\n buttons: [\n Noty.button('Oui', 'btn btn-sm btn-success marge ', function () {\n supprimer();\n n.close();\n }),\n Noty.button('Non', 'btn btn-sm btn-danger', function () {\n n.close();\n })\n ]\n }).show();\n}", "function addImagetoAssignment() {\r\n \r\n //Show success Modal and start confetti\r\n document.getElementById('modal3').style.display = 'block';\r\n\r\n\r\n }", "function modalNoUnStake(){\n swal({\n title: \"Nothing to Unstake\",\n text: \"You need to Stake EDNA to use this feature.\",\n type: \"info\",\n showCancelButton: false,\n cancelButtonClass: 'btn-secondary waves-effect',\n confirmButtonClass: 'btn-danger waves-effect waves-light',\n confirmButtonText: 'Close'\n });\n\n }", "function carritoVacio() {\n\n $(\".modal-body-aviso\").text(\"Debes tener al menos un producto en el carrito para poder registrarte y confirmar la compra.\");\n $(\".btnRevisar\").hide();\n $(\"#modalAviso\").modal(\"show\");\n\n}", "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "function Congratulation() {\n console.log(\"we win!\");\n\n swal({\n title: \"Congratulation!!\",\n confirmButtonText: 'Reset',\n showCancelButton: true\n }, function() {\n location.reload();\n \n });\n }", "activateModalPanel() {\n this.modalPanel = atom.workspace.addModalPanel({\n item: this.warnBeforeQuittingView.getElement(),\n visible: false\n });\n }", "function openModal(){\n modal.style.display = 'block';\n modalp.innerHTML = `Congrats! You saved ${moveCount} stars in ${min} minutes and ${second} seconds. Click on &times; to close modal box and <i class=\"fas fa-redo-alt\"></i> button on the top right side of the page to replay` ;\n }", "openCateringModal() {\n console.log('Open Catering Modal');\n }", "openCateringModal() {\n console.log('Open Catering Modal');\n }", "function modalNoClaim(){\n swal({\n title: \"Nothing to Claim\",\n text: \"You tried to claim before your next reward\",\n type: \"info\",\n showCancelButton: false,\n cancelButtonClass: 'btn-secondary waves-effect',\n confirmButtonClass: 'btn-danger waves-effect waves-light',\n confirmButtonText: 'Close'\n });\n\n }", "mostrarModal() {\n this.mostrarmodal = !this.mostrarmodal\n \n }", "function nuvoInscPreli(){ \n $(\".modal-title\").html(\"Nueva incripción\"); \n $('#formIncPreliminar').modal('show');\n}", "function winningEffects () {\t\t\t\t\t\n\t\t$('.reel-container').addClass('orange-border');\n\t\t$('.bs-example-modal-sm').modal();\t\t\n\t}", "function winMessage() {\n \tMODAL.style.display = 'block';\n }", "function notificaDecline()\n{\n\t$('#modalHeader').html('Preventivo rifiutato');\n\t$('#modalBody').html('<p>Il preventivo da lei inviato non \\&eacute; stato accettato dal cliente. Grazie comunque!</p>');\n\t$('#modalFooter').html('<a href=\"javascript:tornaHome()\" class=\"btn btn-primary\" data-dismiss=\"modal\">Chiudi</a>');\n\t$('#panelNotifiche').modal('show');\n\tspegniSeNotifica();\n}", "function PopUpInstruction(){\n ClearCanvas();\n let webcamElem = document.getElementById('webcamElementId');\n let clone = document.getElementById('controlHeader').cloneNode(true);\n swal({\n content: webcamElem,\n closeOnClickOutside: false,\n text: \"Smile! Make sure your face is in the center of the square and that it is detected\",\n buttons:{\n confirm: true,\n }\n }).then(isConfirm =>{\n $('#webcamElementId').appendTo('#controlHeader');\n swal({\n icon: 'info',\n title:\"Calibration\",\n text: \"Please keep your head very still and follow the Red Dot. Try not to blink during this process\",\n buttons:{\n cancel: false,\n confirm: true\n }\n }).then(isConfirm =>{\n RunCalibration();\n });\n\n});\n}", "function terminaTurnoProduzione(){\r\n \"use strict\";\r\n var spostamentiTot= getSommaSpostamenti();\r\n\tif(spostamentiTot===0){\r\n\t\t$(\"#fineTurnoPBody\").html(\"Hai terminato gli spostamenti da effettuare.\");\r\n\t}else{\r\n\t\t$(\"#fineTurnoPBody\").html(\"Hai ancora \"+spostamentiTot+\" spostamenti che potresti effettuare: <br>sei sicuro di terminare il turno?\");\r\n\t}\r\n\t\r\n $(\"#fineTurnoPDialog\").modal();\r\n}", "function modalAnimation() {}", "show() {\n const panel = this.modal.makePanel(`settings`);\n panel.innerHTML = `<h3>Change the game theme</h3>`;\n const options = this.getOptions();\n const table = this.modal.buildPanelContent(options);\n this.addFormControls(panel, table, options);\n this.modal.addFooter(panel, \"Close\");\n }", "function addTransaction(e) {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "function notificaAnswer()\n{\n\t$('#modalHeader').html('Nuova offerta di intervento');\n\t$('#modalBody').html('<p>Un professionista ti ha inviato il preventivo. Vuoi visualizzare la sua offerta?</p>');\n\t$('#modalFooter').html('<a href=\"javascript:accendiSeNotifica()\" class=\"btn\" data-dismiss=\"modal\">Annulla</a>'+\n\t\t\t\t\t\t '<a href=\"mostraQualcosa.html\" class=\"btn btn-primary\">Visualizza</a>');\n\t$('#panelNotifiche').modal('show');\n\tspegniSeNotifica();\n}", "function notificaInfo()\n{\n\t$('#modalHeader').html('Preventivo accettato');\n\t$('#modalBody').html('<p>Un cliente ha accettato il tuo preventivo. Attende che lo contatti, vuoi visualizzare i suoi dati?</p>');\n\t$('#modalFooter').html('<a href=\"javascript:accendiSeNotifica()\" class=\"btn\" data-dismiss=\"modal\">Annulla</a>'+\n\t\t\t\t\t\t '<a href=\"mostraQualcosa.html\" class=\"btn btn-primary\">Visualizza</a>');\n\t$('#panelNotifiche').modal('show');\n\tspegniSeNotifica();\n}", "function modalShown(o){\n\t\t/*\n\t\tif(o.template){\n\t\t\t//show spinner dialogue\n\t\t\t//render o.template into o.target here\n\t\t}\n\t\t*/\n\t\tsaveTabindex();\n\t\ttdc.Grd.Modal.isVisible=true;\n\t}", "function openMoadal(e){\n console.log(e);\n modal.style.display = 'block';\n \n}", "function mostrarModal () {\n modalContacto.style.display = \"block\";\n }", "function congratsPopup() {\n stopTimer();\n\n popup.style.visibility = 'visible'; //popup will display with game details//\n //display moves taken on the popup//\n document.getElementById(\"totalMoves\").innerHTML = moves;\n //display the time taken on the popup//\n finishTime = timer.innerHTML;\n document.getElementById(\"totalTime\").innerHTML = finishTime;\n //display the star rating on the popup//\n document.getElementById(\"starRating\").innerHTML = stars;\n console.log(\"Modal should show\"); //testing comment for console//\n }", "function uncoretModal(){\n $(\"#uncoretModal .modal-body\").html(\"Yakin kembalikan \"+currentProfile.tec_regno+\" (\"+currentProfile.name+\") ?\")\n $('#uncoretModal').modal('show');\n}", "function congratulate_win() {\n $.toast({ \n heading: 'You Won',\n icon: 'success',\n text: 'Congratulations. You won. Good job',\n textAlign : 'center',\n textColor : '#fff',\n bgColor : '#0da114',\n hideAfter : false,\n stack : false,\n position : 'mid-center',\n allowToastClose : true,\n showHideTransition : 'fade',\n loader: false,\n });\n}", "function showChatMessageModal(chatMessageModalModalSelctor) {\n chatMessageModalModalSelctor.style.display = 'block';\n $scope.chatMessageStatus.save = false;\n $scope.chatMessageStatus.delete = false;\n $scope.chatMessageStatus.duplicate = false;\n }", "function gameDraw(){\n $(\"#winMsg\").html(\"Game is a draw!! Play Again!\");\n $(\"#winModal\").modal(\"show\");\n }", "openSettingsModal() {\n if (!this.settingsModal) {\n let settingsModal = bis_webutil.createmodal('CPM Settings', 'modal-sm');\n let settingsObj = Object.assign({}, this.settings);\n\n let listObj = {\n 'kfold' : ['3', '4', '5', '6', '8', '10'],\n 'numtasks' : ['0', '1', '2', '3'],\n 'numnodes' : ['3', '9', '268']\n };\n\n let container = new dat.GUI({ 'autoPlace' : false });\n container.add(settingsObj, 'threshold', 0, 1);\n container.add(settingsObj, 'kfold', listObj.kfold);\n container.add(settingsObj, 'numtasks', listObj.numtasks);\n container.add(settingsObj, 'numnodes', listObj.numnodes),\n container.add(settingsObj, 'lambda', 0.0001, 0.01);\n\n settingsModal.body.append(container.domElement);\n $(container.domElement).find('.close-button').remove();\n\n\n let confirmButton = bis_webutil.createbutton({ 'name' : 'Confirm', 'type' : 'btn-success' });\n confirmButton.on('click', () => {\n console.log('settings obj', settingsObj);\n this.settings = Object.assign({}, settingsObj);\n settingsModal.dialog.modal('hide');\n });\n\n let cancelButton = bis_webutil.createbutton({ 'name' : 'Close', 'type' : 'btn-default' });\n cancelButton.on('click', () => {\n for (let key of Object.keys(settingsObj)) {\n settingsObj[key] = this.settings[key];\n }\n\n //do this on modal hide to avoid the controllers being moved while the user can see it\n settingsModal.dialog.one('hidden.bs.modal', () => {\n for (let i in container.__controllers) {\n container.__controllers[i].updateDisplay();\n }\n });\n\n settingsModal.dialog.modal('hide');\n });\n \n settingsModal.footer.empty();\n settingsModal.footer.append(confirmButton);\n settingsModal.footer.append(cancelButton);\n\n this.settingsModal = settingsModal;\n }\n\n this.settingsModal.dialog.modal('show');\n }", "function actualizar_oi(){\n $('#confirmar_actualizar_oi').modal('show');\n}", "function walkthrough() {\n let modal = UIkit.modal(\"#welcome-modal\");\n modal.show();\n\n document.getElementById(\"modal-button-1\").onclick = function () {\n modal.hide();\n }\n\n document.getElementById(\"modal-button-2\").onclick = function () {\n modal.hide();\n tippy(\".tutorial-tooltip1\", {\n content:\n \"<p>Set which sites should receive a Do Not Sell signal<p> <button class='uk-button uk-button-default'>Next</button>\",\n allowHTML: true,\n trigger: \"manual\",\n placement: \"right\",\n offset: [0, -600],\n duration: 1000,\n theme: \"custom-1\",\n onHide(instance) {\n trigger2();\n },\n });\n let tooltip = document.getElementsByClassName(\"tutorial-tooltip1\")[0]\n ._tippy;\n tooltip.show();\n };\n\n function trigger2() {\n tippy(\".tutorial-tooltip2\", {\n content:\n \"<p>Import and export your customized list of sites that should receive a signal<p> <button class='uk-button uk-button-default'>Next</button>\",\n allowHTML: true,\n trigger: \"manual\",\n duration: 1000,\n theme: \"custom-1\",\n placement: \"right\",\n offset: [0, 60],\n onHide() {\n trigger3();\n },\n });\n let tooltip = document.getElementsByClassName(\"tutorial-tooltip2\")[0]\n ._tippy;\n tooltip.show();\n }\n\n function trigger3() {\n tippy(\".tutorial-tooltip3\", {\n content:\n \"<p>Toggle this switch to change the color theme of OptMeowt<p> <button class='uk-button uk-button-default'>Finish</button>\",\n allowHTML: true,\n trigger: \"manual\",\n duration: 1000,\n theme: \"custom-1\",\n placement: \"bottom\",\n offset: [-100, 20],\n onHide() {\n trigger4();\n },\n });\n let tooltip = document.getElementsByClassName(\"tutorial-tooltip3\")[0]\n ._tippy;\n tooltip.show();\n }\n\n function trigger4() {\n let modal = UIkit.modal(\"#thank-you-modal\")\n modal.show()\n document.getElementById(\"modal-button-3\").onclick = () => {\n chrome.tabs.create(\n { url: \"https://privacytechlab.org/optmeowt\" },\n function (tab) {}\n );\n }\n }\n}", "function btnOpenAdd() {\r\n //confirm(\"click\");\r\n document.querySelector('.bg-modal').style.display = 'flex'\r\n}", "function showProperPopup(e) {\n var cloneClone;\n\n // prevent to add sharp to URL after clicking on Cancel job btn (because it's link)\n // TODO: make it button not link\n if ($(e.target).is(modalCancelBtn)) {\n e.preventDefault();\n }\n\n // if user clicks on wihraw btn\n if ($(e.target).is(modalWithdrawBtn)) {\n // if job status is applied we show popup without reason\n if (chatData.status === \"applied\") {\n cloneClone = simpleWithdrawPopupClone.clone(true);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n } else if (chatData.status === \"rewarded\") {\n // if job status is rewarded we show popup with reason\n cloneClone = withdrawPopupReasonClone.clone(true);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n };\n // if user clicks on apply btn\n } else if ($(e.target).is(modalApplyBtn)) {\n // we take hardcoded person's standart price and cut of currency and text\n // TODO: how can we make this value not hardcoded?\n var price = parseInt($(\".js-person-standart-price\").val());\n\n cloneClone = applyPopupClone.clone(true);\n // if user clicks on custom apply\n if ($(e.target).hasClass(\"is-custom-apply\")) {\n // we insert provided reason to appropriate element in popup\n cloneClone.find(\".js-custom-apply-reason\").html($(\".js-custom-reason\").val());\n // and take provided price from input\n price = parseInt($(\".js-custom-price-input\").val());\n }\n // then we insert interpreter's price into element in popup and add currency\n // TODO: how can we make currency and fee not hardcoded?\n cloneClone.find(\".js-applied-price\").html(price + \" NOK\");\n if (chatData.commissions) {\n // add skiwo fee text\n cloneClone.find(\".js-apply-fee-text\").html(\"+\" + (parseFloat(chatData.commissions.fee) * 100) + \"%\");\n // show skiwo fee value that received from backend\n cloneClone.find(\".js-apply-fee\").html(parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2) + \" NOK\");\n // add skiwo VAT text\n cloneClone.find(\".js-apply-vat-text\").html(\"+\" + (parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0) * 100) + \"%\");\n // show skiwo VAT value that received from backend\n cloneClone.find(\".js-apply-vat\").html(parseFloat((parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2)) * parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0)).toFixed(2) + \" NOK\");\n }\n var fee = Number(parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2));\n var vat = Number(parseFloat((parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2)) * parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0)).toFixed(2));\n // and insert total price to popup\n cloneClone.find(\".js-total-apply-price\").html((price + fee + vat) + \" NOK\");\n // then we show popup with apply block\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n $(mainModalContentCont).addClass(\"is-apply\");\n // if user clicks on reward btn\n } else if ($(e.target).is(modalRewardBtn)) {\n // we pull clear and total price from clicked btn\n var clearPrice = $(e.target).attr(\"data-clear-price\");\n var name = $(e.target).attr(\"data-person-name\");\n var price = parseInt(clearPrice);\n\n cloneClone = rewardPopupClone.clone(true);\n // then we fill in this popup with prices\n cloneClone.find(\".js-applied-price\").html(clearPrice);\n if (chatData.commissions) {\n // add skiwo fee text\n cloneClone.find(\".js-apply-fee-text\").html(\"+\" + (parseFloat(chatData.commissions.fee) * 100) + \"%\");\n // show skiwo fee value that received from backend\n cloneClone.find(\".js-apply-fee\").html(parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2) + \" NOK\");\n // add skiwo VAT text\n cloneClone.find(\".js-apply-vat-text\").html(\"+\" + (parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0) * 100) + \"%\");\n // show skiwo VAT value that received from backend\n cloneClone.find(\".js-apply-vat\").html(parseFloat((parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2)) * parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0)).toFixed(2) + \" NOK\");\n }\n var fee = Number(parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2));\n var vat = Number(parseFloat((parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2)) * parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0)).toFixed(2));\n cloneClone.find(\".js-total-apply-price\").html((price + fee + vat) + \" NOK\");\n cloneClone.find(\".js-inter-name\").html(name);\n // and show popup\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n $(mainModalContentCont).addClass(\"is-apply\");\n // if user clicks on decline btn\n } else if ($(e.target).is(modalDeclineBtn)) {\n // we receive array of person that business in talking now\n var currentPersonArray = chatData.chat_section.filter(function(obj) {\n return Number(currentActiveDiscussionId) === Number(obj.inter_id);\n });\n // then we get his name\n var currentPersonName = currentPersonArray[0].inter_first_name;\n // and try to get awarded person array\n var awardedPersonArray = chatData.chat_section.filter(function(obj) {\n return obj.last_method_status === \"Awarded\";\n });\n\n // if we have awarded person\n if (awardedPersonArray.length) {\n // we get his id\n var awardedPersonId = awardedPersonArray[0].inter_id;\n // if this id matches with current discussion id\n if (Number(currentActiveDiscussionId) === Number(awardedPersonId)) {\n // we create popup with declining reason and show it\n cloneClone = declineReasonPopupClone.clone(true);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n }\n // if we don't have awarded person\n } else {\n // we create usual decline popup and show it\n cloneClone = declinePopupClone.clone(true);\n cloneClone.find(\".js-decline-person-name\").html(currentPersonName);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n }\n // if we click cancel job btn\n } else if ($(e.target).is(modalCancelBtn)) {\n // we try to check which status was before canceling\n var jobStatus = 0;\n var awardedName;\n\n // if we'he already rewarded someone\n if (chatData.status === \"rewarded\") {\n // we set job status variable to 2 and look for awarded person\n jobStatus = 2;\n for (var i = 0, lim = chatData.chat_section.length; i < lim; i += 1) {\n if (chatData.chat_section[i].last_method_status === \"Awarded\") {\n awardedName = chatData.chat_section[i].inter_first_name;\n break\n }\n }\n // if we have some applies or simple msgs\n } else if (chatData.status === \"replied\") {\n // we look for applies\n for (var i = 0, lim = chatData.chat_section.length; i < lim; i += 1) {\n if (chatData.chat_section[i].last_method_status === \"Applied\") {\n // if we find minimum one we set job status variable to 1\n jobStatus = 1;\n break\n }\n }\n // if we don't have applies or awards we set 0 to job status variable\n } else {\n jobStatus = 0;\n }\n // then we make action according to job satus variable\n switch (jobStatus) {\n // if we don't have applies or awards we just cancel assignment and no one cares\n case 0:\n cancelAssignment();\n break;\n // if we have applies we show cancel popup\n case 1:\n cloneClone = cancelSimpleClone.clone(true);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n break;\n // if we have award we show popup that sayed that an interpreter will be sad after it\n case 2:\n cloneClone = cancelSevereClone.clone(true);\n cloneClone.find(\".js-cancel-person-name\").html(awardedName);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n break;\n }\n }\n }", "function ModConfirmOpen(mode, el_input) {\n console.log(\" ----- ModConfirmOpen ----\")\n // values of mode are : \"prelim_excomp\", \"payment_form\", \"download_invoice\"\n\n // ModConfirmOpen(null, \"user_without_userallowed\", null, response.user_without_userallowed);\n console.log(\" mode\", mode )\n\n// --- create mod_dict\n mod_dict = {mode: mode};\n\n// --- put text in modal form\n const show_modal = (mode === \"prelim_excomp\") ? true :\n (mode === \"payment_form\") ? (permit_dict.requsr_role_corr && permit_dict.permit_pay_comp) :\n (mode === \"download_invoice\") ? (permit_dict.requsr_role_corr && permit_dict.permit_view_invoice) : false;\n const header_text = (mode === \"prelim_excomp\") ? loc.Preliminary_compensation_form :\n (mode === \"payment_form\") ? loc.Download_payment_form :\n (mode === \"download_invoice\") ? loc.Download_invoice : null;\n\n let msg_list = [];\n let hide_save_btn = false;\n\n if(show_modal){\n el_confirm_header.innerText = header_text;\n el_confirm_loader.classList.add(cls_visible_hide)\n el_confirm_msg_container.classList.remove(\"border_bg_invalid\", \"border_bg_valid\");\n const cpt = (mode === \"prelim_excomp\") ? loc.The_preliminary_compensation_form :\n (mode === \"payment_form\") ? loc.The_payment_form :\n (mode === \"download_invoice\") ? loc.The_invoice : \"-\";\n const msg_list = [\"<p>\", cpt, loc.will_be_downloaded_sing, \"</p><p>\",\n loc.Do_you_want_to_continue, \"</p>\"];\n const msg_html = (msg_list.length) ? msg_list.join(\"\") : null;\n el_confirm_msg_container.innerHTML = msg_html;\n\n const caption_save = loc.OK;\n el_confirm_btn_save.innerText = caption_save;\n add_or_remove_class (el_confirm_btn_save, cls_hide, hide_save_btn);\n\n add_or_remove_class (el_confirm_btn_save, \"btn-primary\", (mode !== \"delete\"));\n add_or_remove_class (el_confirm_btn_save, \"btn-outline-danger\", (mode === \"delete\"));\n\n const caption_cancel = loc.Cancel;\n el_confirm_btn_cancel.innerText = caption_cancel;\n\n // set focus to cancel button\n set_focus_on_el_with_timeout(el_confirm_btn_cancel, 150);\n\n// show modal\n $(\"#id_mod_confirm\").modal({backdrop: true});\n };\n }", "function displayStudentModalPrefect() {\n if (student.isPrefect === true) {\n clone.querySelector(\".prefect\").textContent = \"Revoke prefect\";\n modalCredentials.querySelector(\"p:nth-child(6)\").textContent = `Prefect status: ${student.firstName} is prefect!`;\n } else {\n modalCredentials.querySelector(\"p:nth-child(6)\").textContent = `Prefect status: ${student.firstName} is not prefect!`;\n clone.querySelector(\".prefect\").textContent = \"Prefect student\";\n }\n }", "onCropperInstantiate() {\n // Display the confirm btn of the modal\n this.setState({modalShowConfirmBtn: true});\n }", "function showInstructions() {\r\n\tconst INSTRUCTIONS = \"1. Identify the morphological boundaries. \" \r\n\t\t\t\t\t + \"When you mouse over the word, grey slashes will appear in the spaces between the letters, indicating possible morphological boundaries. <br><br>\"\r\n\t\t\t\t\t + \"a. To mark a morphological boundary, click on the space where you think the boundary is using your mouse. <br><br> \" \r\n\t\t\t\t\t + \"b. Once you've made your selection, click on the check button to see whether you've identified the boundaries correctly. <br><br>\"\r\n\t\t\t\t\t + \"c. If you've selected your boundaries correctly, the morphological categories of the word's components will automatically appear above the word.\"\r\n\t\t\t\t\t + \"If you haven't, you will be given the opportunity to try again \"\r\n\t\t\t\t\t + \"(remember, after three tries, the program will provide the correct answer).\"; \r\n\tshowModal(INSTRUCTIONS, false);\r\n}", "openRecurrenceModal() {\n console.log('Open Recurrence Modal');\n }", "openRecurrenceModal() {\n console.log('Open Recurrence Modal');\n }", "function warn() {\n modal.style.display = 'block';\n}", "function compWinner() {\n //Player can't click on any more squares //\n $(\".box\").css({\n \"pointer-events\": \"none\"\n});\n //\n $(\".modal-content p\").append(\"Computer wins!\");\n $(\"#myModal\").delay(1400).fadeIn(600);\n}", "function confirmUser() {\n resetOutput();\n let confirmDialogID = document.getElementById(\"confirmCustomDialog\");\n confirmDialogID.showModal();\n}", "function setFullPosit(titulo, cuerpo) {\n var textoTitulo = document.getElementById(\"texto-titulo\");\n var textoCuerpo = document.getElementById(\"texto-cuerpo\");\n textoTitulo.innerText = titulo;\n textoCuerpo.innerText = cuerpo;\n //Mostramos el modal\n document.getElementById(\"modal-postit\").style.display = \"block\";\n}", "function attShowModal() {\n setShowModal(!showModal);\n }", "function viewModal( data, icon , style ){\n Swal.fire({\n html: `<h2 style=\"color: ${style}\">${data}</h2>`,\n icon: `${icon}`,\n width: '40rem',\n showConfirmButton: false,\n timer: 2000,\n timerProgressBar: true\n });\n }", "function coretModal(){\n $(\"#deleteModal .modal-body\").html(\"Yakin coret \"+currentProfile.tec_regno+\" (\"+currentProfile.name+\") ?\")\n $('#deleteModal').modal('show');\n}", "function viewPendInv() {\n let updateMessage =\n 'These changes will not be saved, are you sure you want to leave the screen?';\n let createMessage =\n 'This Pending Invoice will not be added, are you sure you want to leave this screen?';\n let displayedMessage;\n\n if (PENDINV_ACTION == 'createPendInv') displayedMessage = createMessage;\n else displayedMessage = updateMessage;\n\n if (confirm(displayedMessage)) {\n document.getElementById('pendingInvoiceInformation').style.width = '100%';\n $('#pendingInvoiceCreationZone').hide();\n $('#pendingInvoiceDisplay').show();\n }\n}", "function triggerModal () {\n modal.style.display = 'block';\n\n if (turn !== 1) {\n winner.innerHTML = 'Player 1 Wins!';\n console.log ('Player 1 Wins!');\n }\n if (turn === 1) {\n winner.innerHTML = 'Player 2 Wins!';\n console.log ('Player 2 Wins!');\n }\n }", "function showModal() {\n\t\ttimer.className = 'modalTimer' ;\n\t\tmodal.className = 'modal-visible' ;\n\t}", "function show_modal() {\n \t$('#promoModal').modal();\n }", "function aperturaAnnullamentoConciliazione(conciliazione) {\n $('#spanElementoSelezionatoModaleEliminazione').html(regexTagContent.exec(conciliazione.stringaClassificatore)[1]);\n $('#pulsanteSiModaleEliminazione').substituteHandler('click', annullaConciliazione.bind(undefined, conciliazione));\n $('#modaleEliminazione').modal('show');\n }", "function showConfirmationModal(arg) {\n\tjQuery('#modal_message_confirm_generic_title').text(arg.title);\n\tjQuery('#modal_message_confirm_generic_body').text(arg.message);\n\tjQuery('#modal_message_confirm_generic').modal('show');\n}", "function showStatus() {\n\n if ((reporteSeleccionado == 13) || (reporteSeleccionado == 14)) {\n\n if (banderas.banderaTodoSeleccionado == 0) {\n if (Calles.length == 0) {\n ngNotify.set('Seleccione al menos una calle', { type: 'error' });\n }\n else {\n modalStatus();\n }\n }\n else if (banderas.banderaTodoSeleccionado == 1) {\n modalStatus();\n }\n }\n }", "function modalCerrado() {\n toastr.info(\"Usted cancelo la eliminacion!\", \"Aviso!\");\n}", "function MandaMessaggioInserimento(testo) {\n jQuery(\"#testo-modal\").html(testo);\n jQuery(\"#modal-accettazione\").modal(\"toggle\");\n}", "function display_modal_confirmation() {\n let modal_environment = document.createElement(\"div\");\n modal_environment.className = \"modal_environment\"\n let modal_box = document.createElement(\"div\");\n modal_box.className = \"box modal_box\";\n let msg_div = document.createElement(\"div\");\n msg_div.append(\"¿Está seguro de que desea enviar esta información?\");\n let buttons_row = document.createElement(\"flex-row\");\n let accept = document.createElement(\"button\");\n accept.type = \"button\";\n accept.className = \"accept_button\";\n accept.append(\"Sí, estoy total y absolutamente seguro.\")\n accept.addEventListener('click', async function () {\n if (is_valid_form()) { // last validation check\n await add_hidden_photo_counter_input();\n form.submit();\n //$.post('', $('nuevos_avistamientos').serialize());\n //document.getElementById('nuevos_avistamientos').innerHTML=\"\";\n //display_success_msg();\n }\n // else: the form contains errors for some reason.\n // In any case we remove the modal environment\n document.body.removeChild(modal_environment);\n })\n\n let decline = document.createElement(\"button\");\n decline.type = \"button\";\n decline.className = \"decline_button\";\n decline.append(\"No estoy seguro, quiero volver al formulario\");\n decline.addEventListener('click', function () {\n document.body.removeChild(modal_environment); // remove this confirmation box and go back to the form\n })\n buttons_row.append(accept, decline);\n modal_box.append(msg_div, buttons_row);\n modal_environment.append(modal_box);\n modal_environment.id = \"modal_env\";\n document.body.append(modal_environment);\n}", "function congratsMessage(){\n\tif (matchedCards.length === 16){\n\t\tsetTimeout(function(){\n\t\t\ttoggleModal();\n\t\t\t},1000);\n\t\tstopTimer();\n\t}\n}", "customShowModalPopup() { \n this.customFormModal = true;\n }", "function showDoorbellModal() \r\n{ doorbell.show(); // The doorbell object gets created by the doorbell.js script \r\n}", "function makePopupSolicitud(){ \n\n}", "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "function display_success_msg() {\n let modal_environment = document.getElementById(\"success_msg\");\n modal_environment.className = \"modal_environment\";\n let modal_box = document.createElement(\"div\");\n modal_box.className = \"headband modal_box\";\n let msg_div = document.createElement(\"div\");\n msg_div.append(\"Su formulario ha sido enviado correctamente.\")\n let continue_button = document.createElement(\"button\");\n continue_button.type = \"button\";\n continue_button.className = \"accept_button\";\n continue_button.append(\"Continuar\");\n continue_button.addEventListener('click', function () {\n modal_environment.innerHTML = \"\";\n modal_environment.className = \"\";\n location.href = \"index.py\";\n })\n modal_box.append(msg_div, continue_button);\n modal_environment.append(modal_box);\n}", "function encrypt() {\n\n modal[0].style.display = \"none\";\n modal[1].style.display = \"none\";\n modal[2].style.display = \"block\";\n modal[3].style.display = \"none\";\n\n move();\n\n \n setTimeout(() => {\n modal[1].style.display = \"block\";\n modal[2].style.display = \"none\"; \n }, 3400);\n \n outputText(\"yourMsgTextarea\", \"encryptedModalBody\");\n document.getElementById(\"yourMsgTextarea\").value = \"\";\n}", "modalBgClick() {\n PubSub.publish('modal.bgClick');\n }", "function asignarCentroC() {\n $('#a_centrocmodal').modal({ backdrop: 'static', keyboard: false });\n $('#a_empleadosCentro').prop(\"disabled\", true);\n $('#a_todosEmpleados').prop(\"disabled\", true);\n listasDeCentro();\n}", "function orderCancleButtonClick() {\n $('#orderCancleModal').modal('show');\n}", "function showViewFacturar() {\n Swal.fire({\n title: '',\n grow: 'fullscreen',\n html: '<h3>Espere un momento...</h3>',\n onOpen: () => {\n Swal.showLoading();\n checkClientRFC(dataOrder.order.clientId);\n },\n confirmButtonText: 'Cerrar'\n });\n}", "function showModal() {\n\t\t \tvar action = $(\"#myModal\").attr(\"action\");\n\t\t \n\t\t \tif (action == 'update' || action == 'create') {\n\t\t \t\t$(\"#myModal\").modal(\"show\");\n\t\t \t}\n\t\t \t\n\t\t \tshowContractEndDateSelect();\n\t\t \tshowHidePassword();\n\t\t \tshowHideConfirmPassword();\n\t\t }", "show () {\n super.show();\n this.el.querySelector('.modal-confirm').focus();\n }", "function notification_modal_confirm() {\n\n header_style = 'style=\"background-color: #1DB198; color: #ffffff;\"';\n\n var modal = '<div class=\"modal fade\" id=\"modal_div\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">';\n modal += '<div class=\"modal-dialog\">';\n modal += '<div class=\"modal-content\">';\n\n modal += '<div class=\"modal-header\" ' + header_style + '>';\n modal += '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>';\n modal += '<h4 class=\"modal-title\" id=\"myModalLabel\">' + \"Confirmation\" + '</h4>';\n modal += '</div>';\n\n modal += '<div class=\"modal-body\"><br />';\n modal += \"Are you sure you want to save this configuration?\";\n modal += '</div>';\n\n modal += '<div class=\"modal-footer\" style=\"text-align:center;\">';\n modal += '<button type=\"button\" class=\"btn btn-success\" onclick=\"save();\">OK</button>';\n modal += '<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cancel</button>';\n\n modal += '</div>';\n\n modal += '</div>';\n modal += '</div>';\n modal += '</div>';\n\n $(\"#notification_modal\").html(modal);\n $(\"#modal_div\").modal(\"show\");\n $(\"#modal_div\").css('z-index', '1000002');\n\n $(\"body\").css(\"margin\", \"0px\");\n $(\"body\").css(\"padding\", \"0px\");\n}", "function hintModal () {\n planetModalContainer.style.display = 'block'\n hintButtonClose.style.display = 'block'\n planetModalButton.style.display = 'none'\n questionDiv.style.display = \"none\"\n buttonDiv.style.display = \"none\"\n planetHomeButton.style.display = \"none\"\n planetModalImageDiv.style.display = \"none\"\n planetModalFact.innerText = \"\"\n planetModalHeader.innerText = `${planetInformation[counter]['hint']}`\n hintButtonClose.innerText = \"Close\"\n}", "function roller(){\n var modal = document.getElementById('roller');\n\n modal.style.display = 'block';\n}", "function showNotificationModal(mesgg) {\n\n\n modal = document.getElementById(\"alert_modal\").style.display = \"block\";//opens the modal\n document.getElementById(\"errorMesg_1\").innerHTML = mesgg;\n}", "function bcd() {\n console.log(\"bcd ----\");\n modal.style.display = \"none\";\n}", "function displayCompanionVegetables(e){\n\tvar left = e.clientX + \"px\";\n var top = e.clientY + \"px\";\n var vegetable=e.currentTarget.title;\n\tvar vegetabletext = companionVegetableContent(vegetable);\n\t//check for most right border and bottom border of the screen\n\tif (e.clientX >= 1370 && e.clientY <936 ) {\n\t\t\ttop = parseInt(e.clientY,10) - 100\n\t\t\tleft = parseInt(e.clientX,10) - 250\n\t\t\tmodal.style.display = \"block\";\n\t\t\tmodal.style.left = left.toString() + \"px\";\n\t\t\tmodal.style.top= top.toString() + \"px\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (e.clientY <936) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(left + \" \" +top);\n\t\t\t\t\t\t\t\t\t\t\t\t\ttop = parseInt(e.clientY,10)-50\n\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(left + \" \" +top);\n\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.display = \"block\";\n\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.left = left;\n\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.top= top.toString() + \"px\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse if (e.clientX >= 1370){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"made it here\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft = parseInt(e.clientX,10) - 250\n\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.display = \"block\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.left = left.toString() + \"px\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.top = top;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.display = \"block\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.left = left;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmodal.style.top = top;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\tmodalcontent.innerHTML = vegetabletext;\n\t\n \n return false;\n\t \n}", "function openModal() {\n document.getElementById(\"myModal\").style.display = \"inline-grid\";\n document.getElementById(\"return-to-top\").style.display = \"none\"\n document.getElementById(\"return-to-top\").style.property=\"value\"\n }", "function showMessage() {\n modal.style.display = \"block\";\n }", "function abc() {\n console.log(\"abc exec\")\n modal.style.display = \"block\";\n}", "function modalCheque()\n{\n $('#agregar_cheque').modal('show');\n}", "function vacationAccept() {\n $(\"#confirmModelOk\").css(\"margin-top\", \"7%\");\n $('#confirmModelOk').modal('show');\n //nextStep(20, $('#acceptNote').val());\n $('#acceptNote').val('');\n}", "function showModal(){\n gamePaused=true;\n let container=$QS('.gameDisplayDiv');\n let modal=$CESC('div', 'msg-modal');\n \n let h2=$CESC('h2', 'modal-heading');\n h2.innerText='pause';\n //continue game , restart, quit game\n let continueBtn=$CESC('button', 'modal-btn continue-btn');\n continueBtn.innerText='continue game';\n continueBtn.onclick=continueGame;\n\n let resetBtn=$CESC('button', 'modal-btn reset-btn');\n resetBtn.innerText='Restart';\n resetBtn.onclick=resetGame;\n\n let quitBtn=$CESC('button', 'modal-btn quit-btn');\n quitBtn.innerText='quit btn';\n quitBtn.onclick=goToHomePage;\n \n $ACP(modal, h2);\n $ACP(modal, continueBtn);\n $ACP(modal, resetBtn);\n $ACP(modal, quitBtn);\n\n $ACP(container, modal);\n}", "function openModal(coverage) {\n _data.status = true;\n _data.coverage = coverage;\n}", "function onShowBsModal() {\n isModalInTransitionToShow = true;\n isModalVisible = true;\n }", "function displayConfirmation() {\n Toast.show({\n style: { backgroundColor: \"green\", justifyContent: \"center\" },\n position: \"top\",\n text: \"Meal(s) successfully recorded.\",\n textStyle: {\n textAlign: 'center',\n },\n duration: 1500\n });\n }", "function confirm() {\n\n ctrl.data.successHandler(ctrl.project);\n $uibModalInstance.dismiss('cancel');\n\n }", "function display() {\n swal({\n title: \"😊congratulations successfully completion of Game\\n😁👍\",\n type: \"success\",\n confirmButtonText: \"play again\"\n },\n //we reload the game after game completion wee use reload function\n function reload() {\n window.location.reload();\n\n }\n )\n}", "function showConfig() {\n $(\"#configModal\").modal({ show: true, backdrop: 'static', keyboard: false });\n clearInterval(scorePanel.intervalManager);\n}", "function modals_correo_admin(titulo,mensaje){\n\n\tvar modal='<!-- Modal -->';\n modal+='<div id=\"myModal3\" class=\"modal2 hide fade\" style=\"margin-top: 5%; background-color: rgb(41, 76, 139); color: #fff; z-index: 900000; behavior: url(../../css/PIE.htc);width: 80%; left: 40%;\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\" data-backdrop=\"true\">';\n modal+='<div class=\"modal-header\" style=\"border-bottom: 0px !important;\">';\n modal+='<button type=\"button\" class=\"close\" style=\"color:#fff !important;\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>';\n modal+='<h4 id=\"myModalLabel\">'+titulo+'</h4>';\n modal+='</div>';\n modal+='<div class=\"modal-body\" style=\"max-width: 92% !important; background-color:#fff; margin: 0 auto; margin-bottom: 1%; border-radius: 8px; behavior: url(../../css/PIE.htc);\">';\n modal+='<p>'+mensaje+'</p>';\n modal+='</div>';\n \n modal+='</div>';\n $(\"#main\").append(modal);\n \n $('#myModal3').modal({\n keyboard: false,\n backdrop: \"static\" \n });\n \n $('#myModal3').on('hidden', function () {\n $(this).remove();\n });\n \n}", "function openModal() {\n setQuesFlag(false);\n setIsModalVisible(true); \n }", "function modalRegistrar() {\n sent = false;\n $('#r_centrocmodal').modal({ backdrop: 'static', keyboard: false });\n $('#r_rowEmpleado').hide();\n}", "function initConfirmationWindow(event) {\r\n let contentString = '<div style=\"color:black\" id=\"helperNotification\">'+\r\n '<h2>Thank you for your help!</h2>'+\r\n '<p>Cick \"Undo\" if this was a mistake or click \"Continue\" '+\r\n ' to confirm.</p><button style=\"padding-right:4px\" id=\"undoButton\">Undo</button>' +\r\n '<button id=\"confirmButton\">Continue</button></div>';\r\n infoWindow.setContent(contentString);\r\n}", "function setModal() {\n toastr.options.timeOut = 0;\n toastr.options.extendedTimeOut = 0;\n toastr.options.closeButton = true;\n toastr.options.closeHtml = '<button><i class=\"icon-off\"></i></button>';\n }", "function openAdjustGapRulesModal() {\n //TODO openAdjustGapRulesModal\n}", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-li-1\").text(\"Generation: \" + data.generation.name)\n $(\".modal-li-2\").text(\"Effect: \" + data.effect_changes[0].effect_entries[1].effect)\n $(\".modal-li-3\").text(\"Chance: \" + data.effect_entries[1].effect)\n $(\".modal-li-4\").text(\"Bonus Effect: \" + data.flavor_text_entries[0].flavor_text)\n }", "function nuevoMostrar(){\n document.getElementById(\"modalNuevo\").style.display = \"block\";\n}" ]
[ "0.6729323", "0.66939205", "0.65758806", "0.65140384", "0.6500626", "0.6443051", "0.63722503", "0.63673633", "0.6337035", "0.631825", "0.6234612", "0.62173873", "0.62173873", "0.6192255", "0.6189544", "0.61855483", "0.61756074", "0.61730677", "0.6167182", "0.61467", "0.61421555", "0.6123274", "0.61204666", "0.6106401", "0.6048471", "0.60393363", "0.60364807", "0.60303193", "0.6030047", "0.60295576", "0.60293865", "0.6014793", "0.5998781", "0.5997316", "0.5984798", "0.59728116", "0.59629077", "0.59587264", "0.5945228", "0.5934797", "0.59313315", "0.5930873", "0.5927308", "0.59272397", "0.59272397", "0.5926181", "0.59146196", "0.5913376", "0.59055406", "0.5904983", "0.59019077", "0.5900841", "0.58883667", "0.5888196", "0.58830786", "0.5873376", "0.58704716", "0.5863503", "0.58529824", "0.5845131", "0.5844685", "0.58427113", "0.58340716", "0.583262", "0.58296585", "0.5823238", "0.5821248", "0.58208984", "0.5819344", "0.581807", "0.5816978", "0.58132905", "0.5807483", "0.5806195", "0.58052814", "0.5801138", "0.5797483", "0.57971895", "0.5795681", "0.57876444", "0.5787377", "0.57856584", "0.5784829", "0.5783333", "0.5779774", "0.57697487", "0.5769053", "0.5761813", "0.5760502", "0.57596564", "0.5758611", "0.5755509", "0.5746295", "0.5743321", "0.57369226", "0.5731136", "0.5727381", "0.572528", "0.57230854", "0.5708821", "0.5706114" ]
0.0
-1
Congratulation Modal, after user sucessfully matched all the cards
function isOverModal() { 'use strict'; // turn on Strict Mode if (matchedCards.length === cards.length) { clearInterval(timerInterval); //Defined variable let endTimer = timerCounter.innerHTML; modalToggle(); //Assigning stars, time and moves document.getElementById('endTime').innerHTML = endTimer; document.getElementById('endMoves').innerHTML = moves + 1; document.getElementById('endRatings').innerHTML = starsRating + ' Out Of 3 Stars'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setmatchscreen(){\n cardcount= 0; //var to hold all the match cards\n let modal = document.getElementById('modal');\n let span = document.getElementsByClassName(\"close\")[0];\n for(i=0; i<cardarray.length;i++){ //loops through all cards\n if (cardarray[i].outerHTML.includes('card match')){\n cardcount++ //if there is cards has match class increment cardcount\n }\n else{\n }\n }\n if (cardcount >=16){ //if all 16 cards are matched\n // const myfragment = document.createDocumentFragment();\n\n modal.style.cssText= 'display: block';// makes modal visable\n let newElement= document.createElement('p')// create p element to be attached ot modal with message\n newElement.innerText='Congradulations!!! your score is '+stararray.childElementCount+ ' stars which was done in '+counterint +' moves in ' +mins+' minutes and '+secs+ ' seconds!!!'\n // myfragment.appendChild(newElement);\n newElement.setAttribute('id', 'congratsmsg');// used to set set match condition\n newElement.style.display='block';\n\n //newElement.style.cssText='position: fixed; z-index: 1; width: 100%; height: 100%; background-color: blue; padding-top: 100px; display: none';\n // myfragment.style.display='block';\n\n document.getElementById('modal').appendChild(restart);// adds restart buttton to modal\n document.getElementById('modal').appendChild(newElement);// add p element to modal\n\n //create new element and append it to the body with message and score\n }\n else{\n }\n }", "function openCard() {\n openedCards.push(this);\n\n const modal = document.querySelector('.overlay');\n\n if (openedCards.length == 2) {\n // Compare the 2 cards\n testMatching();\n movesCounter();\n }\n if (matchedCards.length === 16) {\n\n modal.classList.toggle('show');\n\n stopTimer();\n messageScore();\n\n }\n}", "function congratsMessage(){\n\tif (matchedCards.length === 16){\n\t\tsetTimeout(function(){\n\t\t\ttoggleModal();\n\t\t\t},1000);\n\t\tstopTimer();\n\t}\n}", "function fillCards(rows)\n{\n let content = '';\n //Se recorren las filas para armar el cuerpo de la tabla y se utiliza comilla invertida para escapar los caracteres especiales\n rows.forEach(function(row){\n (row.estado == 1) ? icon = 'visibility' : icon = 'visibility_off';\n content += `\n <div class=\"card white\">\n <input class='validate' type=\"hidden\" value=\"${row.idComentario}\"/>\n <div class=\"card-content white-text hoverable\">\n <p class=\"black-text\">\n <strong class=\"blue-text\">Producto:</strong> ${row.producto}</p>\n <p class=\"black-text\">\n <strong class=\"blue-text\">Cliente:</strong> ${row.cliente}</p> \n <p class=\"black-text\"> \n <strong class=\"blue-text\">Comentario:</strong> ${row.comentario}</p>\n <p class=\"black-text\"> \n </div>\n </div>\n `;\n });\n $('#modal-content').html(content);\n $('select').formSelect();\n $('.tooltipped').tooltip(); \n $('.materialboxed').materialbox();\n}", "function congratulations() {\n if (matchedCard.length == 16) {\n clearInterval(interval);\n finalTime = timer.innerHTML;\n\n // CONGRATULATIONS\n modal.classList.add(\"show\");\n\n //MOVES AND TIME\n document.getElementById(\"finalMove\").innerHTML = moves;\n document.getElementById(\"totalTime\").innerHTML = finalTime;\n\n //EXIT POP UP\n closeModal();\n }\n}", "function dealCard() {\n\n // If the deck is disabled, warn users\n if (isDeckDisabled || cardPurchased) {\n\n if (actingPlayer !== turnOf) {\n showModal('not your turn');\n return;\n\n } else {\n\n if (cardPurchased) {\n showModal('phase two');\n return;\n } else {\n showModal('deck disabled');\n return;\n }\n }\n\n } else {\n\n // If there are no more cards in the deck...\n if (deck.length <= 0) {\n shuffleCards(discardPile); // Shuffle the discard pile\n deck.push(...discardPile); // Copy discard pile cards into deck\n discardPile.length = 0; // Clear discard pile\n getDiscardCount.innerHTML = discardPile.length; // Update the discard pile count\n }\n\n // ...if there ARE cards in the deck:\n\n board.push(deck.pop());\n\n let dealtCard = board[board.length - 1];\n console.log('card dealt: ' + dealtCard.name);\n\n // Render and animate the added card\n getBoard.innerHTML += composeCard(dealtCard);\n tippy('[data-tippy-content]');\n \n oneCardDrawn = true;\n isNewTurn = false;\n calcPlayerSwords();\n updateCardsRemaining();\n\n if (dealtCard.type === 'expedition') {\n // Move it to expedition array\n expeditions.push(board.pop());\n displayBoards();\n }\n\n if (dealtCard.type === 'tax') {\n collectTaxes(dealtCard);\n discardPile.push(board.pop());\n displayBoards();\n taxCard = dealtCard;\n showModal('tax');\n }\n\n if (dealtCard.type === 'ship') {\n\n // If player has enough swords, trigger modal\n if (players[actingPlayer].getSwords() >= dealtCard.swords) {\n shipToDefeat = dealtCard;\n showModal('defeat ship'); // Trigger modal\n\n // Need to put something here that waits for the result of the modal\n } else {\n checkForDuplicates(board);\n }\n }\n\n checkForAdmiralBonus();\n // displayBoards();\n calcMovesBonus();\n shipToDefeat = null;\n\n anime({\n targets: `#board-card-${dealtCard.id}`,\n translateX: -50,\n direction: 'reverse',\n opacity: 0,\n duration: 500,\n easing: 'easeInQuad'\n });\n }\n}", "function completeFlashCard(el) {\n // Remove current card\n el.parentNode.parentNode.parentNode.parentNode.remove();\n\n // Show the next card\n let cards = document.querySelectorAll(\".flash-card\");\n\n // If that was the last card, show the \"Finito\" message\n if(cards.length > 0) {\n cards[0].style.display = \"block\";\n } else {\n document.getElementById(\"flashcard-modal-content\").innerHTML = \"<h1 class='text-center display-1 font-italic'>Finito</h1>\";\n }\n}", "async function clickHandler(event) {\n const currentCard = getCard(event);\n if (!currentCard || currentCard.isFlipped()) return;\n\n if (!timer.isRunning()) {\n timer.start();\n }\n\n let allCardsMatched = false;\n\n clickedCards.push(currentCard);\n\n if (clickedCards.length == 2) {\n numberOfMoves++;\n updateScore();\n const previousCard = clickedCards[0];\n clickedCards = [];\n if (currentCard.id() === previousCard.id()) {\n numberOfMatched++;\n if (numberOfMatched === NUMBER_OF_CARDS) {\n timer.stop();\n allCardsMatched = true;\n }\n await currentCard.show();\n await Promise.all([\n currentCard.markAs('matched'),\n previousCard.markAs('matched')\n ]);\n if (allCardsMatched) {\n updateWinMessage(numberOfMoves);\n showModal('win');\n }\n } else {\n await currentCard.show();\n await Promise.all([\n currentCard.markAs('not-matched'),\n previousCard.markAs('not-matched')\n ]);\n currentCard.hide();\n previousCard.hide();\n }\n } else {\n currentCard.show();\n }\n }", "function win() {\n if (cardList.length === liMatch.length) {\n stopTimer();\n displayModal();\n }\n}", "function openModal() {\n if (matchedCards === 8){\n modal.style.display = \"block\";\n clearInterval(interval);\n finalTime = timer.innerHTML;\n finalMove = moves.textContent;\n finalMove++;\n const starRating = document.querySelector(\".stars\").innerHTML;\n document.getElementById(\"finalMove\").innerHTML = finalMove;\n document.getElementById(\"starRating\").innerHTML = starRating;\n document.getElementById(\"totalTime\").innerHTML = finalTime;\n }\n }", "function displayModal() {\n\t\t\t\t$(\"#user-name\").text(newPerson.name);\n\t\t\t\t$(\"#match-name\").text(matchName);\n\t\t\t\t$(\"#match-img\").attr(\"src\", matchImage);\n\t\t\t\t$(\"#myModal\").modal();\n\t\t\t}", "function allMatched() {\n //makes modal visible\n modal.style.display = \"block\";\n //final number of moves\n finalMoves.innerHTML = moves;\n //final star rating\n finalStars.innerHTML = numStars;\n //final time\n finalTime.innerHTML = seconds;\n}", "function cardsMatched() {\n openedCards[0].classList.add(\"match\", \"disable\");\n openedCards[1].classList.add(\"match\", \"disable\");\n matched++;\n if (matched == 8) { //set at 1 for testing purposes\n congratsPopup();\n }\n openedCards = [];\n console.log(\"Match function working\");\n console.log(matched);\n }", "function congruts() {\n if (matchedCards === 8){\n clearTimeout(interval);\n let finalTime = timer.innerHTML;\n //show congratulations popup\n model.className = 'overlay show';\n //declare star rating variable\n let starRating = document.querySelector(\".stars\").innerHTML;\n //showing move, rating, time on modal\n document.getElementById(\"finalMove\").innerHTML = counts;\n document.getElementById(\"starRating\").innerHTML = starRating;\n document.getElementById(\"totalTime\").innerHTML = finalTime;\n //close icon on popup\n closeModelExitIcon();\n closeModelAgainButton();\n }\n\n}", "function clickedCard() {\n$('li.card').on('click', function() {\n\tlet openCard = $(this);\n\ttoggleOpenShow(openCard);\n\tif(openCard.hasClass('open show disabled')\n\t\t&& allOpenedCards.length < 2) {\n\t\tallOpenedCards.push(openCard);\t\t\n\t}\t\t\n\tmatchedCard();\n\t});\n}", "function congratulationsPopup(){\n\tif(matchedCards.length == 16) {\n\t\tstopTimer();\n\n\t\t//Displaying the total moves\n\t document.getElementById(\"total-moves\").innerHTML = numberOfMoves;\n\n\t // declare star rating variable\n\t var starRating = document.querySelector(\".stars\").innerHTML;\n\t // Displaying star rating and total time taken\n\t document.getElementById(\"star-rating\").innerHTML = starRating;\n\n\t\t// Displaying total time taken\n\t finalTime = timerClock.innerHTML;\n\t document.getElementById(\"total-time\").innerHTML = finalTime;\n\n\t // show congratulations popup\n popupCongratulation.classList.add(\"show-overlay\");\n closeCongratulationsPopup();\n\t}\n}", "function processClick(card) {\n //if card is not open/matched: open/flip it\n if (!card.classList.contains(\"card-open\") && !card.classList.contains(\"card-matched\")) {\n toggleCard(card);\n openCards.push(card);\n ++moves;\n displayMoves();\n dispStars();\n }\n //if two consecutive open cards do not match: flip them back over/close them\n if (openCards.length === 2 && !card.classList.contains(\"card-matched\")) {\n setTimeout(function() {\n for (let card = 0; card < openCards.length; card++) {\n toggleCard(openCards[card]);\n }\n openCards = [];\n }, 650);\n }\n //check if two open cards match: mark them as matched\n if (checkMatch(openCards[0], openCards[1])) {\n addClass(openCards[0], \"card-matched\");\n addClass(openCards[1], \"card-matched\");\n numMatchedCards += 2;\n openCards = [];\n //check if all cards have been matched: show modal if true\n if (numMatchedCards === 16) {\n setTimeout(function() {\n stopTimer();\n displayModal();\n }, 500);\n }\n } else { //display unmatched cards effects\n addClass(openCards[0], \"card-unmatched\");\n addClass(openCards[1], \"card-unmatched\");\n unmatchedCards = document.querySelectorAll('.card-unmatched');\n setTimeout(function() {\n for (let card = 0; card < unmatchedCards.length; card++) {\n removeClass(unmatchedCards[card], \"card-unmatched\");\n }\n }, 500);\n }\n}", "function byClickCreateModal (dataResults) {\n const arrCard = document.querySelectorAll('.card');\n for (let i = 0; i < arrCard.length; i++) {\n arrCard[i].addEventListener ('click', el => {\n createModal (dataResults[i], dataResults);\n });\n }\n}", "function cardsMatch() {\n\n // add match class\n openCards[0].classList.add('match');\n openCards[1].classList.add('match');\n\n // allow clicks again & remove 'open', 'show' classes\n for (let i = 0; i <= initialArray.length - 1; i++) {\n \tlistOfCards[i].classList.remove('no-click', 'open', 'show');\n }\n\n // empty openCards array\n openCards = [];\n\n // count the number of card pairs matched\n correctPairs++\n\n // if all cards are matched, show this success message\n if (correctPairs == initialArray.length / 2) {\n \tcongratulations();\n }\n}", "function cardClickHandler(event) {\n $(this).attr('class','open card show click'); /* Card shows open when clicked */\n let cardcount = $('ul').find('.click').length; /*Keep count of cards that have been clicked*/\n\n//Array to check class of cards that are open once two are picked and turn them a color\n if (cardcount == 2) {\n $('.card').off('click', cardClickHandler); /*this ensures that only two cards can be seen*/\n//Setup array and specific class for each card selected to see if they match\n let openClass = $('.click').find('i');\n let classone = openClass[0].className;\n let classtwo = openClass[1].className;\n\n//increment the moves variable and update the count in html so user can see the moves as they happen\n moves++;\n document.getElementById(\"moves\").innerHTML = moves;\n\n//Remove one star after 13 moves, but before 19 moves\n if (moves > 13 && moves < 19) {\n $('.stars').find('#twostar').attr('class','star');\n }\n\n //Remove two stars after 19 moves\n if (moves >= 19) {\n $('.stars').find('#twostar').attr('class','star');\n $('.stars').find('#onestar').attr('class','star');\n }\n\n //If function when the two cards are a match\n if (classone == classtwo){\n $('.click').attr('class','open card show match'); /*new class to show the card green if it matches*/\n $('.card').on('click', cardClickHandler); /*turn the click handler back on so new cards can be selected*/\n $('.match').off('click', cardClickHandler); /*turn click handler off for cards that have the class match so they aren't selected*/\n\n //If statement to fire the modal when 16 cards have been matched\n if (($('.match').length)==16) {\n modalfire ();\n }\n return moves;\n }\n\n//Else function if the cards do not match\n else {\n $('.click').attr('class','open card show miss click'); /*show the cards as red cards*/\n\n //function to have the cards turn back over in just under 1 second.\n setTimeout(function() {\n $('.click').attr('class','card'); /*change the class back to a card to flip it back over*/\n $('.card').on('click', cardClickHandler);/*turn the click handler back on so new cards can be selected*/\n $('.match').off('click', cardClickHandler); /*ensure matched cards still aren't able to be selected after a miss*/\n }, 999);\n return moves;\n }\n }\n}", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function fillCardsValuations(rows)\n{\n let content = '';\n //Se recorren las filas para armar el cuerpo de la tabla y se utiliza comilla invertida para escapar los caracteres especiales\n rows.forEach(function(row){ \n content += `\n <div class=\"col s12 m6 l4\">\n <div class=\"card white\"> \n <div class=\"card-content white-text hoverable\">\n <p class=\"black-text\">\n <strong class=\"blue-text\">Producto:</strong> ${row.producto}</p>\n <p class=\"black-text\">\n <strong class=\"blue-text\">Cliente:</strong> ${row.cliente}</p> \n <p class=\"black-text\"> \n <strong class=\"blue-text\">Puntuacion:</strong> ${row.valoracion}</p>\n <p class=\"black-text\"> \n </div>\n </div>\n </div> \n `;\n });\n $('#modal-content').html(content);\n $('select').formSelect();\n $('.tooltipped').tooltip(); \n $('.materialboxed').materialbox();\n}", "function addCardToScrap(card) {\n // add to modal and scrap array\n //console.log(card);\n $('#scrapModalCards').append('<img src=\"/assets/images/cards/' + card + '.png\" class=\"gamecard\">');\n scrap.push(card);\n\n // set onclick for modal card\n $('#scrapModalCards .gamecard:last').click(function() {\n //clicking on card in scrap modal returns to top of forge faceup\n\n let num = getCardNum($(this) ); // card number\n deck.push(num); // add to top of deck\n updateCard('forge', num); // display on top of deck\n $(this).remove(); // remove from modal\n\n // remove from scrap arr\n let idx = scrap.indexOf(num);\n scrap.splice(idx, 1);\n\n // display correct card in scrap\n if(scrap.length==0) {\n updateCard('scrap', 'none');\n } else {\n updateCard('scrap', scrap[scrap.length-1] );\n }\n\n });\n}", "function matchedCardsAction() {\n twoCardsClicked = false;\n matchAttempts++;\n cardMatches++;\n gameWinConditionCheck();\n clearCardsClicked();\n}", "function addCards(){\n if (model.getCardObjArr().length >= 3) {\n controller.addMoreCards();\n } else {\n displayNoCardPopup();\n }\n }", "function compareCards(newCard) {\n const firstCardValue = previousCard.dataset.value;\n const secondCardValue = newCard.dataset.value;\n\n if (firstCardValue !== secondCardValue) {\n previousCard.addEventListener('click', dispalyCard);\n previousCard.classList.remove('open');\n newCard.classList.remove('open');\n }\n else {\n //if two cards were the same\n previousCard.removeEventListener('click', dispalyCard);\n newCard.removeEventListener('click', dispalyCard);\n matchCard.push(previousCard);\n matchCard.push(newCard);\n if (matchCard.length === 16){\n document.getElementById('pop-up').style.display= 'block';\n }\n }\n \n // empty the game memory\n previousCard = null;\n\n}", "function afterClick() {\n let nameOfcard = this.id;\n id(\"start-btn\").classList.remove(\"hidden\");\n qs(\"#p1 .name\").id = nameOfcard;\n let getinfo = URL_POKE + \"?pokemon=\" + nameOfcard;\n fetch(getinfo)\n .then(checkStatus)\n .then((resp) => resp.json())\n .then((resp) => getCard(resp, \"#p1\"))\n .catch(console.error);\n }", "function checkCards(){\n if(matchCards.length == 2){\n\n //variables to hold the elements from the array\n firstCard = matchCards[0];\n secondCard = matchCards[1];\n\n //Call moves counter to update number of moves made\n movesCounter();\n\n //Check if the elements match\n if(firstCard.className == secondCard.className){\n //Loop through matched cards and push them to finalArray\n for(let populate in matchCards){\n finalArray.push(matchCards[populate]);\n //if Array has 16 Elements, call showModal function\n if(finalArray.length == 16){\n showModal();\n }\n }\n //Call macth functions if the cards are the same\n match();\n }\n else{\n //If cards dont match, call unmatched function\n unmatched();\n }\n //Clear the array because we only want to elements in at a time\n matchCards = [];\n }\n}", "function nextCard(e){\n //console.log(\"In the function\");\n const cards = document.querySelectorAll(\".card\");\n if(position < userList.length-1){\n //console.log(\"In the statement\");\n closeModal();\n cards[position+1].click();\n }\n}", "function continueGame() {\n // clear modal\n $(\".modal\").removeClass(\"bg-modal\");\n $(\".modal-inner\").removeClass(\"modal-content\").html(\"\");\n // has endgame condition been reached\n if (selectedGlyphs.length === numQuestionsPerGame) {\n endCondition_gameOver();\n } else {\n selectGlyph();\n }\n }", "function updateCard() {\n cardFactory.update(cardID, $scope.selectedCard, function (data) {\n if (data.status === 200) {\n Flash.create('success', \"Record updated successfully.\", 5000, {container: 'main'});\n $mdDialog.hide();\n $route.reload();\n }\n });\n }", "function displayPokemonCard(resp) {\n $(\".modal\").addClass(\"is-active\")\n $(\"#pokemon-stats\").empty(); \n $(\"#pokemon-card\").show();\n $(\"#search-term\").val(\"\");\n $(\"#pokemon-name\")\n .text(resp.name.toUpperCase())\n .append(`<span> ${resp.types} </span>`);\n $(\"#pokemon-img\").attr(\"src\", resp.image);\n for (stat of resp.stats) {\n $(\"#pokemon-stats\").append(`<p>${stat.stat_name} | ${stat.base_stat}</p>`);\n }\n $(\"#add-btn\").show();\n}", "function gamedone() {\n\tif (matchedCards.length === 16) {\n\t\tstopTimer();\n\t\tconsole.log(\"Game Complete!\")\n\t\twriteGameStats();\n\t\ttogglePopup();\n\t\t//need to add toggle popup\n\t}\n}", "function randomCard() {\r\n for (let i = 0; i < card.length; i++) {\r\n card[i].addEventListener('click', function() {\r\n modalWindow(i);\r\n $('.modal-container').show();\r\n })\r\n\r\n }\r\n}", "function cardboard() {\n modal1.style.display = \"block\";\n}", "function finish(){\n if (matchedCardsArray.length==16){\n let results = document.getElementById(\"results\");\n let time = document.getElementById(\"timer\").textContent;\n results.textContent=moves.toString()+\" moves, your time was: \"+time+\" and your star rating was \"+starRating+\" !!\";\n $('#myModal').modal('show');\n stopTimer=true;\n }\n}", "function display() {\n swal({\n title: \"😊congratulations successfully completion of Game\\n😁👍\",\n type: \"success\",\n confirmButtonText: \"play again\"\n },\n //we reload the game after game completion wee use reload function\n function reload() {\n window.location.reload();\n\n }\n )\n}", "function matchFound() {\n totalMatchFound++;\n if (totalMatchFound === 8) {\n timer.pause();\n $.dialog({\n title: 'Awesome!',\n content: `You were able to match all the cards in <h3>${totalMoves}\n moves</h3> with <h3>${starRating} star rating</h3> in <h3>${timer.getTimeValues().toString()} time</h3>\n </h1><a href=\"\">Replay&nbsp&nbsp<i class=\"fa fa-refresh\"></i></a></h1>`,\n theme: 'supervan',\n escapeKey: true,\n backgroundDismiss: true,\n onClose: function () {\n timer.stop();\n }\n });\n }\n}", "function activatedCards() {\r\n var cardsAll = document.querySelectorAll('.card');\r\n console.log(cardsAll);\r\n\r\n cardsAll.forEach(function(card) {\r\n card.addEventListener('click', function() {\r\n turnOnGame();\r\n // defensive condition to secure that all card can be opened when clicked\r\n if (!card.classList.contains('open') && !card.classList.contains('match')) {\r\n card.classList.add('open', 'show');\r\n card.classList.add('stop-clickable'); // prevent card to match itself \r\n }\r\n // the condition for the second click only\r\n if (cardOpened) {\r\n cardsAll.forEach(function(card) {\r\n // when 2 cards opened freeze the other cards for a while until the animation and the checking finish\r\n card.classList.add('stop-clickable');\r\n });\r\n // if cards match, both remain opened \r\n if (cardOpened.querySelector('i').classList.item(1) == card.querySelector('i').classList.item(1)) {\r\n setTimeout(function() {\r\n card.classList.remove('open', 'show');\r\n card.classList.add('match', 'stop-clickable');\r\n cardOpened.classList.remove('open', 'show');\r\n cardOpened.classList.add('match', 'stop-clickable');\r\n // clear the variable \r\n cardOpened = null;\r\n // count the move\r\n moveCount();\r\n // check if the number of move exceed the level if exceed 1star lost\r\n lostStar();\r\n // the number of pairs of card match\r\n cardMatches++;\r\n // check if all card matches activate the modal to see the result\r\n\r\n checkEndGame();\r\n //delay \r\n }, 500);\r\n // if cards not match, close both cards\r\n } else {\r\n setTimeout(function() {\r\n card.classList.remove('open', 'show');\r\n cardOpened.classList.remove('open', 'show');\r\n // release the first clicked card from unclickable state\r\n cardOpened.classList.remove('stop-clickable');\r\n cardOpened = null;\r\n moveCount();\r\n lostStar();\r\n // delay to let the card animate\r\n }, 500);\r\n }\r\n // release the other cards from freezing so the game can be continued \r\n setTimeout(function() {\r\n cardsAll.forEach(function(card) {\r\n card.classList.remove('stop-clickable');\r\n });\r\n }, 500);\r\n // the is no card open yet then let's open the card!! \r\n } else {\r\n //stored the first card \r\n cardOpened = card;\r\n }\r\n\r\n\r\n\r\n });\r\n });\r\n}", "function findCardMatch(selectedCard) {\n let matchFound = false;\n\n for (let i = 0; i < openCards.length; i++) {\n //check if card symbol name matches any open cards; if so,\n //leave them flipped and lock them.\n if (selectedCard.name == openCards[i].name && selectedCard != openCards[i]) {\n selectedCard.lock();\n openCards[i].lock();\n openCards = [];\n matchFound = true;\n\n if (allCardsMatched()) {\n //stop timer\n clearTimeout(gameTimer);\n //display message with the final score once all cards have been matched\n //alert('All Cards Matched in ' + moveCount + ' moves!');\n $('.modal-content p').remove();\n $('.modal-content').prepend(\"<p>Congratulations! You won in \" + moveCount + \" moves and \" + gameTimeCount + \" seconds! \" +\n \" You earned \" + getStarRating() + \" star(s).\");\n $('#myModal').css(\"display\", \"block\");\n }\n }\n }\n\n return matchFound;\n}", "function gameComplete() {\n if (app.matchedCards.length === app.gameCards) {\n clearInterval(app.interval);\n congratsModal();\n gameCompleteSound();\n }\n}", "function checkForMatch() {\n if (firstCard.dataset.framework === secondCard.dataset.framework) {\n countMatch ++;\n // In case all of the matches are found ==> Congratulation you win the game\n if( countMatch === 8){\n //if the matches are 8 then popUp the messagge of win!\n congratulation();\n\n }\n disableCards();\n return;\n }\n\n unflipCards();\n }", "function result(){\t\n\tif(noOpenCard>=16){\n\t\tsetTimeout(function(){\t\n\t\t\tif (confirm(\"Congratulations! You won! \\nStars \"+ noStar+'\\nMoves '+noMoves+'\\nTime '+ \n\t\t\t\tFormatMe(hr)+':'+FormatMe(min)+':'+FormatMe(sec)+'\\n Do you want to try again?'\n\t\t\t\t)) {\n\n\t\t\t}\n\t\t\tdocument.querySelector(\".deck\").remove();\n\t\t\tnoOpenCard=0;\n\t\t\tinitialization();\n\t \thr=0;min=0;sec=-1;\n\t\t},1000)\n\t}\n}", "function cardClick() {\n cards = document.querySelectorAll('.card');\n for (let i = 0; i < cards.length; i++) {\n cards[i].addEventListener('click', () => createModal(people[i]));\n }\n}", "function cardMatch(listOfCards) {\n $(\".open\").removeClass(\"noDuplicate\");\n let cardOne = $(listOfCards[0]).html();\n let cardTwo = $(listOfCards[1]).html();\n if (cardOne === cardTwo) {\n $(\".open\").addClass(\"match\");\n cardMatchCounter ++;\n gameFinishCheck(cardMatchCounter);\n } else {\n /** counts how many failed attempts have been made to match cards */\n numberOfMisses ++;\n moveCounter(numberOfMisses);\n /** if the cards do not match, remove the cards from the list and hide\n * the card's symbol (put this functionality in another function\n * that you call from this one) */\n allFaceDown();\n }\n}", "function cardListener (data) {\n const cards = document.querySelectorAll('.card');\n for (let i = 0; i < cards.length; i += 1) {\n cards[i].addEventListener('click', (e) => displayModal(data, i))\n }\n}", "function redoFlashCard(el) {\n // Copy the card and send it to the back\n let card = el.parentNode.parentNode.parentNode.parentNode;\n card.style.display = \"none\";\n card.querySelector(\".answer\").style.opacity = \"0\";\n\n document.getElementById(\"flashcard-modal-content\").insertBefore(card, null);\n\n // Show the next card\n let cards = document.querySelectorAll(\".flash-card\");\n\n cards[0].style.display = \"block\";\n}", "function showCompleteMessage() {\n var dialog = $(\"<div>\")\n .attr({\n \"class\":\"completeDialog d-flex flex-column align-item-center justify-content-center\",\n \"id\":\"completionDialog\"\n });\n var message = $(\"<div>\")\n .attr({\n \"class\":\"card rounded d-inline-block m-4\"\n })\n .html(\n `<div class=\"card-header\">`\n +`<h2 class=\"card-title\">Simulation Complete</h2>`\n +`</div>`\n +`<div class=\"card-body\">`\n +`<p class=\"lead\">All viruses were eliminated by the white blood cells.</p>`\n +`</div>`\n +`<div class=\"card-footer\">`\n +`<div class=\"btn-group w-100\">`\n +`<button class=\"btn btn-warning\" id=\"dialogOptionsButton\">Options</button>`\n +`<button id=\"dialogRestartButton\" class=\"btn btn-info\">Restart</button>`\n +`</div>`\n +`</div>`\n )\n $(dialog).hide();\n $(message).appendTo(dialog);\n $(dialog).appendTo(\"body\");\n $(dialog).fadeIn();\n }", "function congrats(){\n if (matchCards.length === 16){\n clearInterval(interval);\n finalTime = timer.innerHTML;\n\n // Shows modal\n congratsModal.classList.add(\"show-modal\");\n\n // Declare star rating\n var starRating = document.querySelector(\".stars\").innerHTML;\n\n //Display move, rating, time on modal\n document.getElementById(\"finalMove\").innerHTML = moves;\n document.getElementById(\"starRating\").innerHTML = starRating;\n document.getElementById(\"totalTime\").innerHTML = finalTime;\n\n // Play again\n closeModal();\n };\n}", "function bindClickEvent() {\n cardDeck.cards.forEach(card => {\n card.node.addEventListener(\"click\", (e) => {\n if (isClosingCard || card.isOpened() || card.isMatched()) {\n return;\n }\n \n card.open();\n \n if (state.isMatching) {\n if (state.matchingCard.getValue() === card.getValue()) {\n \n card.match()\n state.matchingCard.match();\n \n if (cardDeck.cards.filter(x => x.isMatched()).length === cardDeck.cards.length) {\n state.isGameOver = true;\n saveState();\n updateScreenMode(true);\n return;\n }\n \n state.isMatching = false;\n state.matchingCard = null;\n increaseMoveCounter();\n saveState();\n } else {\n isClosingCard = true;\n window.setTimeout(function() {\n card.closeCard()\n if (state.matchingCard !== null) {\n state.matchingCard.closeCard()\n }\n \n increaseMoveCounter();\n \n state.isMatching = false;\n state.matchingCard = null;\n saveState();\n isClosingCard = false;\n }, 500);\n }\n } else {\n state.isMatching = true;\n state.matchingCard = card;\n saveState();\n }\n }, false);\n });\n }", "function gameOver() {\n if (matchedCards.length === icons.length) {\n stopTimer();\n showModal();\n }\n}", "function individual(data) {\n const card = document.querySelectorAll('.card');\n for (let i=0; i<data.length; i++) {\n card[i].addEventListener('click', (e)=> {\n createModal(data[i]) \n })\n }\n}", "function verifyCards() {\n if (openCards.length === 2) {\n if (checkCard()) {\n match.push(...openCards);\n for (let card of openCards) {\n card.className = 'card match';\n }\n openCards = [];\n } else {\n //animates the cards then close them.\n animate();\n setTimeout(closeCards, 1000);\n\n }\n countMoves();\n }\n}", "function clickCard() {\n\n // add open class\n this.classList.add('open');\n\n // add class to open array\n openCards.push(this.id);\n\n // check if total items in open array is 2\n if (openCards.length === 2) {\n\n // get the unique items in this array\n let unique = openCards.filter(onlyUnique);\n\n // if total is equal to 1, a match was found, add to matched array.\n if (unique.length === 1) {\n matchedCards.push(this.id);\n }\n\n // if total matched cards is total cards, reset game by removing all matched cards\n if (matchedCards.length === cards.length / 2) {\n\n // game finshed.\n\n window.setTimeout(() => {\n victory();\n matchedCards = [];\n }, 500);\n }\n\n // reset cards, with a short delay\n window.setTimeout(() => {\n resetCards();\n }, 500);\n }\n}", "function isOver() {\n\tif(matchedCards.length === icons.length) {\n\t\tstopTimer();\n\t\tupdateModal();\n\t\tmodal.style.display = \"block\";\n\n\t }\n\t}", "function cardModal() {\n for (var i = 0; i < modalBtn.length; i++) {\n modalBtn[i].addEventListener('click', function() {\n \n for (var i = 0; i < modal.length; i++) {\n \n if(this.id === modal[i].id) {\n modal[i].classList.add('open');\n \n } \n }\n \n })\n }\n}", "function doesCardMatch(card) {\n\tif (card.length === 2) {\n\t\tif (openCards[0][0].firstChild.className === openCards[1][0].firstChild.className) {\n\t\t\topenCards[0].addClass('match animated bounce');\n\t\t\topenCards[1].addClass('match animated bounce');\n\t\t\topenCards = [];\n\t\t\tplayerMatches++;\n\t\t\t // if all cards have matched, display a modal with the final score\n\t\t\tif (playerMatches === totalMatches) {\n\t\t\t\tgameEnd();\n\t\t\t\tconsole.log('Game Finish');\n\t\t\t}\n\t\t} else { \n\t\t\topenCards[0].addClass('animated shake wrong');\n\t\t\topenCards[1].addClass('animated shake wrong');\n\t\t\tsetTimeout(function() \n\t\t\t\t{ openCards[0].removeClass('open show wrong animated shake'); \n\t\t\t\t openCards[1].removeClass('open show wrong animated shake');\n\t\t\t\t openCards = [];}, 700);\n\t\t}\n\t\tdisplayMoves();\n\t}\n}", "function showCongratulationModal() {\n let template = `\n were ${scorePanel.playTime} seconds on a ${deckConfig.numberOfcards === difficulty.easy ? 'easy' : 'hard'} level, \n with ${scorePanel.moveCounter} moves and ${scorePanel.starCounter} star(s).`;\n\n $(\"#congratulationScore\").text(template);\n $(\"#congratulationModal\").modal({ show: true, backdrop: 'static', keyboard: false });\n}", "function handleCardClick(event) {\n if(isCardShown(event.target) || tempFaceUp.length >= CARDS_TO_MATCH){\n return;\n }\n\n tempFaceUp.push(event.target);\n showCard(event.target);\n\n\n\n if(tempFaceUp.length >= CARDS_TO_MATCH){\n\n if(hasFoundMatch()){\n tempFaceUp = [];\n\n if(gameIsWon()){\n endGame();\n }\n \n }\n else{\n score ++;\n document.querySelector(\"#score\").innerText = score;\n\n setTimeout(() => {\n shown = 0;\n tempFaceUp.forEach( card => {\n hideCard(card);\n });\n tempFaceUp = [];\n }, 1000);\n }\n }\n}", "function onCardClicked() {\n //get the card that was clicked\n let selectedId = $(this).attr('id').replace('card-','');\n let selectedCard = cards[selectedId];\n\n if (selectedCard.isDisplayed() || openCards.length >= 2) {\n return;\n } else {\n //increment click counter\n moveCount++;\n $('.moves').text(moveCount);\n\n //check move count and decrement stars if needed.\n if (moveCount == 20) {\n $('#star-3').removeClass('fa-star');\n $('#star-3').addClass('fa-star-o');\n } else if (moveCount == 30) {\n $('#star-2').removeClass('fa-star');\n $('#star-2').addClass('fa-star-o');\n }\n\n //display the card.\n selectedCard.flip();\n\n //after short delay, check if there is a match.\n //this is done so that the cards do not immediately flip back\n //preventing you from seeing the 2nd card.\n setTimeout(function() {\n if (!findCardMatch(selectedCard)) {\n //add selected card to list of open cards\n openCards.push(selectedCard);\n\n if (openCards.length == 2) {\n //hide both cards\n openCards[0].flip();\n openCards[1].flip();\n openCards = [];\n }\n }\n }, 800);\n }\n}", "showSavedData() {\n if (this.selectedCard && this.selectedCard.cardNumber) {\n this.dataLoaded = true;\n this.isEditable = false;\n this.addNewCard = false;\n this.isButtonDisabled = false;\n this.cardSelected.cardNumber = this.selectedCard.cardNumber\n ? this.selectedCard.cardNumber.match(/\\d+/)[0]\n : '';\n this.cardSelected.cardType = this.selectedCard.cardType.name;\n this.cardSelected.label = `<${this.selectedCard.cardType.name}> <${\n this.selectedCard.cardNumber\n }> <${this.selectedCard.expiryMonth}/${\n this.selectedCard.expiryYear\n }> <${this.selectedCard.accountHolderName}>`;\n this.cardSelected.paymentId = this.selectedCard.id;\n this.cardSelected.billingAddress = this.selectedCard.billingAddress;\n this.cardSelected.address = this.setAddress(this.selectedCard);\n this.cardSelected.accountHolderName = this.selectedCard.accountHolderName;\n this.$refs.cardDropdown.setDropdownLabel(this.cardSelected.label);\n this.$refs.cardRadioButton.setSelectedByValue(\n this.cardRadioButton[0].value,\n );\n checkoutEventBus.$emit('payment-method-added');\n } else {\n this.getPaymentDetails();\n }\n }", "function openCard(selectCard) {\n selectCard.classList.add('open');\n console.log('Open class has been added to card')\n const id = selectCard.id;\n const cardNumber = id.slice(0, 5);\n\n if (cardsOpen.length === 2) {\n\n checkMatch(selectCard);\n\n\n } else {\n cardsOpen.push(cardNumber);\n cardsOpen.push(id);\n console.log(\"the card is put into cardsOpen array\")\n};\n}", "function doCardsMatch(event) {\n if (clickedCards.length === 2) {\n if (clickedCards[0].innerHTML === clickedCards[1].innerHTML) {\n clickedCards[0].classList.add('match');\n clickedCards[0].classList.remove('open', 'show');\n clickedCards[1].classList.add('match');\n clickedCards[1].classList.remove('open', 'show');\n matchedCards.push(clickedCards);\n clickedCards.length = 0;\n moveCounter();\n gameComplete();\n } else {\n setTimeout(function() {\n clickedCards[0].classList.remove('open', 'show');\n clickedCards[1].classList.remove('open', 'show');\n clickedCards.length = 0;\n moveCounter();\n }, 800);\n }\n }\n}", "function openedCard() {\n\tvar len = openedCards.length;\n\tif (len == 2) {\n\t\tunmatched();\n\t}\n}", "function success() {\n\n Modal.success({\n okText:\"Done\",\n title: 'Submit successful!',\n // content: 'View your requests to see your new entry.',\n onOk() {\n doneRedirect();\n }\n });\n }", "checkMatch (card)\r\n {\r\n if (this.getCardType (card) == this.getCardType (this.cardToCheck))\r\n {\r\n //console.log (\"checked\");\r\n this.matchedCards.push(card);\r\n this.matchedCards.push(this.cardToCheck);\r\n //card.classList.add(\"revealed\");\r\n //this.cardToCheck.classList.add(\"revealed\");\r\n if (this.matchedCards.length == 16)\r\n {\r\n this.overlayOn ();\r\n }\r\n }\r\n else\r\n {\r\n //console.log (\"busy: \" + this.busy);\r\n this.misMatched (card, this.cardToCheck);\r\n //setTimeout (function () {console.log (\"go!\");}, 500);\r\n }\r\n }", "function loadCardsConfirmHome() {\n\t loadTemplate(\"cardConfirm\", templates.cardConfirmIntership, {\n\t title: \"¿Recibiste tu beca?\",\n\t message: \"Meses pendientes de confirmar:\"\n\t });\n\t if(scholar.confirm.length == 0 && $(\"#pendingCard > .card\").length == 0) {\n\t \tif(scholar.scholarship.confirmDispersion.length != 0){\n\t \t\tloadTemplate(\"messageThanks\",templates.confirmAll,{\n\t \t thanks: \"Gracias\",\n\t \t message: \"Por confirmar tus dep\\u00f3sitos\"\n\t \t })\n\t \t}else {\n\t \t\tloadTemplate(\"messageThanks\",templates.confirmAll,{\n\t \t thanks: \"¡Bienvenido!\",\n\t \t message: \"Aqu\\u00ed aparecer\\u00e1n tus dep\\u00f3sitos por confirmar\"\n\t \t\t});\n\t \t}\n\t \t $(\"#btnSendConfirm\").hide();\n\t\t $(\"p[name='pending']\").hide();\n\t }\n\t if(scholar.confirm.length == 0 && $(\"#pendingCard > .card\").length == 1) $(\"#cardConfirm\").hide();\n\t loadPendingCards();\n\t fn_comboConfirmacionDepo();\n}", "function ok() {\n\n // TODO Don't add checks until they clear\n $rootScope.currentUser.balance += $ctrl.total;\n\n $uibModalInstance.close();\n }", "function isOver() {\n if(matchedCards.length === icons.length) {\n stopTimer();\n toggleModal();\n }\n }", "function GetCardsById() {\r\n\tconst queryString = window.location.search;\r\n\tconst urlParams = new URLSearchParams(queryString);\r\n\tvar memberid = urlParams.get('member_ID');\r\n\tvar hiddencard = \"\";\r\n\tvar activateCard = \"\";\r\n\t\r\n swal({\r\n title: \"Loading...\",\r\ntext: \" Please Wait....\",\r\nicon: \"resources/images/loader.gif\",\r\nbutton: false,\r\ncloseOnClickOutside: false,\r\ncloseOnEsc: false\r\n});\r\n\r\n\r\n \r\n\r\n\r\n $.ajax({\r\n\r\n type: \"GET\",\r\n url: \"/walletInfo\",\r\n data: {member_Id:memberid},\r\n timeout: 100000,\r\n success: function(data) {\r\n swal.close()\r\n var obj = JSON.parse(data);\r\n\r\n if (obj['isError'] == true) {\r\n\r\n swal(\"Sorry!\", \"Wallet Not Found\")\r\n GetCardsById.abort();\r\n } else {\r\n var respoObj = obj['responseObject'];\r\n\r\n if (respoObj['cards'] != null) {\r\n\r\n\r\n var cardId = respoObj['cards'];\r\n /*hiddencard = cardId[0]['id'];*/\r\n /*alert(hiddencard);*/\r\n for (var a=0; a < cardId.length; a++) {\r\n var Cardval = cardId[a];\r\n document.getElementById('hiddencardid').value = Cardval['id'];\r\n\r\n\r\n var hiddencard = document.getElementById(\"hiddencardid\").value;\r\n $.ajax({\r\n\r\n type: \"POST\",\r\n url: \"/mmcustomercardsid\",\r\n data: {hiddencard:hiddencard},\r\n timeout: 100000,\r\n\r\n success: function(data) {\r\n\r\n var obj = JSON.parse(data);\r\n if (obj['isError'] == true) {\r\n\r\n swal(\"Here's a message!\", \"Card Not Found\")\r\n GetCardsById.abort();\r\n\r\n } else if (obj['status'] == 400) {\r\n swal(\"Here's a message!\", \"Card Not Found\")\r\n GetCardsById.abort();\r\n } else {\r\n\r\n var respObj = obj['responseObject'];\r\n var cardDate = respObj['date'];\r\n\r\n var cardHolder = respObj['holder'];\r\n\r\n var cardType = respObj['type'];\r\n\r\n var cardStatus = respObj['status'];\r\n\r\n var table = $('#usercardlist');\r\n /* $('#usercardlist').empty()*/ //clear the table\r\n if (cardType['name'] == 'StyloPay Virtual Card') {\r\n\r\n\r\n\r\n var tab = '<tr><td align=\"left\" valign=\"middle\" id=\"holderName' + a + '\" value=\"' + cardHolder['name'] + '\" >' + cardHolder['name'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\"id=\"maskedcard' + a + '\" value=\"' + respObj['number'] + '\">' +\r\n respObj['number'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"cardName' + a + '\" value=\"' + cardType['name'] + '\">' + cardType['name'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"cardStatus>' +\r\n \"<span class='statusActiveCard'>Active</span>\" + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"createdAt' + a + '\" value=\"' + cardDate['issued'] + '\">' +\r\n cardDate['issued'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n \"<a href='#' onclick='return select(\" + '\"' + respObj['id'] + '\"' + ',' + '\"' + respObj['activation_code'] + '\"' + ','+ '\"' + cardStatus['text'] + '\"' +\")' class='actionActivateCard' data-toggle='modal' data-target='#blockCardButton'>Activated</a> </td></tr>\";\r\n\r\n if (respObj['number']) {\r\n document.getElementById('addbutton').style.display = 'none';\r\n document.getElementById('addbutton').style.display = 'block';\r\n }\r\n document.getElementById('usercardid').value = respObj['id'];\r\n \r\n \r\n \r\n } else if (cardType['name'] == 'StyloPay Physical Card' && cardStatus['text'] == 'pending activation') {\r\n var tab = '<tr><td align=\"left\" valign=\"middle\" id=\"holderName' + a + '\" value=\"' + cardHolder['name'] + '\" >' + cardHolder['name'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\"id=\"maskedcard' + a + '\" value=\"' + respObj['number'] + '\">' +\r\n respObj['number'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"cardName' + a + '\" value=\"' + cardType['name'] + '\">' + cardType['name'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"cardStatus>' +\r\n \"<span class='statusInactiveCard'>Active</span>\" + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"createdAt' + a + '\" value=\"' + cardDate['issued'] + '\">' +\r\n cardDate['issued'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n \"<a href='#' onclick='return select(\" + '\"' + respObj['id'] + '\"' + ',' + '\"' + respObj['activation_code'] + '\"' + \")' class='actionBlockCard' data-toggle='modal' data-target='#blockCardButton'>Activate</a> </td></tr>\";\r\n\r\n document.getElementById('activatecard').value = respObj['activation_code'];\r\n document.getElementById('usercardid').value = respObj['id'];\r\n \r\n \r\n \r\n } else if (cardType['name'] == 'StyloPay Physical Card' && cardStatus['text'] == 'inactive') {\r\n var tab = '<tr><td align=\"left\" valign=\"middle\" id=\"holderName' + a + '\" value=\"' + cardHolder['name'] + '\" >' + cardHolder['name'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\"id=\"maskedcard' + a + '\" value=\"' + respObj['number'] + '\">' +\r\n respObj['number'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"cardName' + a + '\" value=\"' + cardType['name'] + '\">' + cardType['name'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"cardStatus>' +\r\n \"<span class='statusInactiveCard'>Active</span>\" + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"createdAt' + a + '\" value=\"' + cardDate['issued'] + '\">' +\r\n cardDate['issued'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n \"<a href='#' onclick='return select(\" + '\"' + respObj['id'] + '\"' + ',' + '\"' + respObj['activation_code'] + '\"' + \")' class='actionBlockCard' data-toggle='modal' data-target='#blockCardButton'>Activate</a> </td></tr>\";\r\n\r\n document.getElementById('activatecard').value = respObj['activation_code'];\r\n document.getElementById('usercardid').value = respObj['id'];\r\n }\r\n \r\n \r\n \r\n \r\n \r\n else if (cardType['name'] == 'StyloPay Physical Card' && cardStatus['text'] == 'active') {\r\n\r\n var tab = '<tr><td align=\"left\" valign=\"middle\" id=\"holderName' + a + '\" value=\"' + cardHolder['name'] + '\" >' + cardHolder['name'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\"id=\"maskedcard' + a + '\" value=\"' + respObj['number'] + '\">' +\r\n respObj['number'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"cardName' + a + '\" value=\"' + cardType['name'] + '\">' + cardType['name'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"cardStatus>' +\r\n \"<span class='statusActiveCard'>Active</span>\" + \"\\n\" + '</td><td align=\"left\" valign=\"middle\" id=\"createdAt' + a + '\" value=\"' + cardDate['issued'] + '\">' +\r\n cardDate['issued'] + \"\\n\" + '</td><td align=\"left\" valign=\"middle\">' +\r\n\t \"<a href='#' onclick='return select(\" + '\"' + respObj['id'] + '\"' + ',' + '\"' + respObj['activation_code'] + '\"' + ','+ '\"' + cardStatus['text'] + '\"' +\")' class='actionActivateCard' data-toggle='modal' data-target='#blockCardButton'>Activated</a> </td></tr>\";\r\n\r\n\r\n document.getElementById('usercardid').value = respObj['id'];\r\n } else {\r\n\r\n }\r\n\r\n\r\n /*document.getElementById('usercardid').value = respObj['id'];*/\r\n\r\n $('#usercardlist').append(tab)\r\n\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\t\r\n\r\n );\r\n\r\n }\r\n } else {\r\n swal(\"Sorry!\", \"Failed! While Fetching Card Info\")\r\n \r\n }\r\n } \r\n }\r\n\r\n });\r\n }", "'click #cb-initial-dialog'( e, t ) {\n e.preventDefault();\n // SET PAGE COUNTS\n t.page.set( 1 );\n t.total.set( 1 );\n let credits = t.$( '#course-builder-credits' ).val()\n , name = t.$( '#course-builder-name' ).val()\n , percent = t.$( '#course-builder-percent' ).val()\n , keys = t.$( '#tags' ).val()\n , role\n , creator_id = Meteor.userId()\n , cid = Meteor.user() &&\n Meteor.user().profile &&\n Meteor.user().profile.company_id\n , roles = Meteor.user() &&\n Meteor.user().roles;\n \n if ( percent == '' ) percent = 1001; //completion is passing\n if ( name == '' || credits == '' ) {\n Bert.alert(\n 'BOTH Course Name AND Credits MUST be filled out!',\n 'danger',\n 'fixed-top',\n 'fa-frown-o'\n );\n return;\n }\n if ( Courses.findOne({ name: name }) != undefined )\n {\n Bert.alert(\n 'There is already a course with that name!',\n 'danger',\n 'fixed-top',\n 'fa-grown-o'\n );\n return;\n }\n if ( roles && roles.teacher ) role = 'teacher';\n if ( roles && roles.admin ) role = 'admin';\n if ( roles && roles.SuperAdmin ) role = 'SuperAdmin';\n \n if ( keys == null ) keys = [\"\"];\n \n Session.set('cinfo', {\n cname: name,\n credits: Number(credits),\n passing_percent: Number(percent),\n keywords: keys,\n icon: \"/img/icon-4.png\",\n company_id: cid,\n creator_type: role,\n creator_id: creator_id\n });\n let my_id = pp.insert({ pages: [] });\n Session.set( 'my_id', my_id );\n t.$( '#intro-modal' ).modal( 'hide' );\n//-----------------------------------------------/INITIAL DIALOG------\n }", "function placeCards(tubbieList, putWhere, tubbieStatus) {\n var buttonLabel = '';\n var hideButton = false;\n var buttonColor = 'btn-outline-secondary';\n switch(tubbieStatus) {\n case 0:\n buttonLabel = 'Select';\n break;\n case 1:\n buttonLabel = 'Battle';\n buttonColor = 'btn-warning';\n\n break;\n case 2:\n buttonLabel = 'Attack';\n buttonColor = 'btn-danger';\n break;\n case 3:\n hideButton = true;\n break; \n default:\n buttonLabel = 'Select';\n }\n for (var i = 0; i < tubbieList.length; i++) {\n $( `.row.${putWhere}` ).append( $( `\n <div class=\"col-md-3\">\n <div class=\"card mb-3 box-shadow\">\n <img src=\"${tubbieList[i].pic}\" class=\"card-img-top tt-pics\" alt=\"${tubbieList[i].name}\">\n <div class=\"card-body\"><h4>${tubbieList[i].name}</h4>\n <p class=\"card-text\">Energy: ${tubbieList[i].energy}\n <br>Attack: ${tubbieList[i].minAtk}-${tubbieList[i].maxAtk}</p>\n <div class=\"d-flex justify-content-between align-items-center ${tubbieList[i].sname}\">\n </div>\n </div>\n </div>\n </div>\n </div>`));\n if (hideButton===false) { // Only show button when it's time to pick a tubbie\n $( `.d-flex.justify-content-between.align-items-center.${tubbieList[i].sname}` ).append( $( `<div class=\"btn-group\"><button type=\"button\" class=\"btn ${buttonColor} btn-sm ${tubbieList[i].id}\">${buttonLabel}</button></div>`));\n }\n }\n}", "markOpenCardsAsMatch() {\n this.matchedCards.push(this.openCards[0], this.openCards[1]);\n this.openCards.forEach((card) => {\n setTimeout(this.markCardAsMatch.bind(this, card), 500);\n });\n if (this.matchedCards.length === 16) {\n setTimeout(() => {\n this.hideDeck();\n this.displaySuccessMessage();\n }, 2000);\n this.scoringHandler.stopTimer();\n }\n\n this.openCards = [];\n }", "function winGame() {\n if(matchedCards.length === 8) {\n swal({\n closeOnClickOutside: false,\n closeOnEsc: false,\n title: \"You win!\",\n text: \"You matched all 8 pairs in \" + seconds + \" seconds, \" + moveCount + \" moves, and with \" + starResult + \" stars remaining.\",\n icon: \"success\",\n button: \"Play again!\"\n }).then(function(isConfirm) {\n if (isConfirm) {\n $('.deck, .moves').empty();\n reset();\n }\n });\n clearInterval(countSeconds);\n }\n}", "function acceptAnswer() {\n // if this was the last card, don't replace it (must be done on client side, to avoid Async DB inconsistencies.)\n lookupCardsRemainingInCurrentLevel()\n .then(cardsRemaining => {\n rankUpCard();\n\n /// only load another card, if there are still cards left.\n if (cardsRemaining == 0)\n window.location.href = \"/polyglot/\";\n else {\n animateReplace();\n loadCard();\n }\n });\n}", "function matchCard() {\n\tif(openedCards[0].firstElementChild.getAttribute('class') === openedCards[1].firstElementChild.getAttribute('class')) {\n\t\topenedCards.map(function(card) {\n\t\t\tcard.className = 'card match disable';\n\t\t\tdeck.className = 'deck disable';\n\t\t\tsetTimeout(function(){\n\t\t\t\tdeck.classList.remove('disable');\t\n\t\t\t},850);\n\t\t\tmatchedCards.push(card);\n\t\t});\n\t\topenedCards = [];\n\t} else {\n\t\topenedCards.map(function(card) {\n\t\t\tcard.className = 'card fail disable';\n\t\t\tdeck.className = 'deck disable';\n\t\t\tsetTimeout(function(){\n\t\t\t\tcard.classList.remove('open','show','disable','fail');\n\t\t\t\tdeck.classList.remove('disable');\t\n\t\t\t},700);\n\t\t});\n\t\topenedCards = [];\n\t}\n}", "function checkCard() {\n\t\tconst openList = document.querySelectorAll('.open.show:not(.match)');\n\n\t\tif (openList[0].innerHTML === openList[1].innerHTML) {\n\t\t\topenList[0].classList.toggle(\"match\");\n\t\t\topenList[1].classList.toggle(\"match\");\n\t\t}\n\t\telse {\n\n\t\t\topenList[0].className = 'card';\n\t\t\topenList[1].className = 'card';\n\t\t}\n\t}", "function clickResponse() {\n const card = this;\n // check for game start on first click\n if (!gameStarted) {\n gameStarted = true;\n stopWatch();\n }\n setTimeout(function() {\n showCard(card);\n}, 200);\n}", "cardMatch(card1, card2) {\n this.matchedCards.push(card1);\n this.matchedCards.push(card2);\n card1.classList.add('matched');\n card2.classList.add('matched');\n this.soundControl.matched();\n if(this.matchedCards.length === this.cardsArray.length)\n \n this.winner();\n }", "openModal(card) {\n this.setState({\n showModal: true,\n cardOut: card\n });\n }", "async function showRecipeDetail(rec) {\n if (!rec.strCategory) {\n rec = await getRecipeById(rec.idMeal);\n }\n const heartClass = await getLikeClass(rec);\n $(`\n <div id=${rec.idMeal} class=\"card mb-3 \" style=\"width: 950px;\">\n <div class=\"row no-gutters justify-content-center\">\n <div class=\"col-md-4 text-right mt-4\">\n <img src=\"${rec.strMealThumb}\" class=\"card-img\" alt=\"Loading picture\">\n </div>\n <div class=\"col-md-6\">\n <div class=\"card-body\">\n <h4 class=\"card-title text-center mt-4 mb-4\">${rec.strMeal}</h4>\n <div class=\"row justify-content-center mb-4\">\n <div class=\"col-3\">\n <div>\n <button class=\"backBtn btn btn-sm btn-outline-success mt-2\">Back</button> \n </div>\n </div>\n <div class=\"col-7\">\n <i data-recid=${rec.idMeal} class=\"like ${heartClass} fa-heart fa-lg mt-2 mr-3\">\n </i> \n \n <!-- Trigger the modal with a button -->\n <button type=\"button\" class=\"addToMealPlanBtn btn btn-sm btn-warning mt-2\" data-toggle=\"modal\" data-target=\"#addToMealPlanFormModal\">Add to My Meal Plan</button>\n <button class=\"backToMealPlanBtn btn btn-warning mt-2 d-none\">My Meal Plan</button>\n <!-- Modal -->\n <div class=\"modal fade\" id=\"addToMealPlanFormModal\" role=\"dialog\">\n <div class=\"modal-dialog\"> \n <!-- Modal content-->\n <div class=\"modal-content\">\n <div class=\"modal-header\"> \n <h4 class=\"modal-title text-center\">Add <span class=\"text-danger\">${rec.strMeal} </span>to My Meal Plan</h4>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>\n </div>\n <div class=\"modal-body\">\n <form action=\"\">\n <input type=\"hidden\" id=\"mealId\" name=\"mealId\" value=${rec.idMeal}>\n <div class=\"form-group\">\n <label for=\"day\"><b>Select Day</b></label>\n <select class=\"form-control\" id=\"day\"></select>\n </div>\n <div class=\"form-group\">\n <label for=\"mealType\"><b>Select Meal Type</b></label>\n <select class=\"form-control\" id=\"mealType\"></select>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n <button class=\"add-to-mealplan-btn btn btn-success\">Add</button>\n </div>\n </form>\n </div> \n </div> \n </div>\n </div>\n <!-- end Modal -->\n\n </div>\n </div>\n <div class=\"row justify-content-center mb-2\">\n <div class=\"col-3\">\n <p class=\"card-text\"><b>Category: </b></p>\n </div>\n <div class=\"col-7\">\n <p class=\"card-text\">${rec.strCategory}</p>\n </div>\n </div>\n <div class=\"row justify-content-center mb-2\">\n <div class=\"col-3\">\n <p class=\"card-text\"><b>Area: </b></p>\n </div>\n <div class=\"col-7\">\n <p class=\"card-text\">${rec.strArea}</p>\n </div>\n </div>\n <div class=\"row justify-content-center mb-2\">\n <div class=\"col-3\">\n <p class=\"card-text\"><b>Tags: </b></p>\n </div>\n <div class=\"col-7\">\n <p class=\"card-text\">${rec.strTags}</p>\n </div>\n </div>\n <div class=\"row justify-content-center mb-2\">\n <div class=\"col-3\">\n <p class=\"card-text\"><b>Viedo: </b></p>\n </div>\n <div class=\"col-7\">\n <a class=\"card-text vedioLink font-italic\" href=\"${rec.strYoutube}\" target=\"_blank\">Watch the recipe vedio on YouTube</a>\n </div>\n </div> \n </div>\n </div>\n </div>\n\n <div class=\"row no-gutters justify-content-center mt-4\">\n <div class=\"col-10\">\n <p class=\"card-text font-italic\"><b>Ingredients: </b></p>\n <p>${getIngredients(rec)}</p>\n </div>\n </div>\n\n <div class=\"row no-gutters justify-content-center mt-4\">\n <div class=\"col-10\">\n <p class=\"card-text font-italic\"><b>Instruction: </b></p>\n <p>${rec.strInstructions}</p>\n </div>\n </div>\n </div> \n `).appendTo($recipeDetail);\n\n generateMealPlanFormOptions();\n }", "function showPlayerCardHit(source) {\n for (let i = 0; i < 1; i++) {\n const cardToShow = cardsDealtPlayer[i];\n const $newCard = $(\"<div></div>\");\n $(\"#player-jumbotron\").append(`<img class=\"playerCard\" src=${cardsDealtPlayer[cardsDealtPlayer.length - 1].cardImageSource}>`);\n }\n }", "function farmData() {\n let modal1HTML = \"\";\n let card1 = document.querySelector('#card1');\n let card2 = document.querySelector('#card2');\n let card3 = document.querySelector('#card3');\n let card4 = document.querySelector('#card4');\n let animalCards = [card1, card2, card3, card4];\n if (animals == true) {\n for (let i = 0; i < critterInfo.length; i++) {\n $(animalCards[i]).on('click', function () {\n fadeIn()\n modal1HTML =\n `<h3 class=\"name\">${critterInfo[i].critter}</h3> <div class=\"latin\"> ${critterInfo[i].latin}</div>\n <div class=\"facts1\"> ${critterInfo[i].fact1}</div> <div class=\"facts2\"> ${critterInfo[i].fact2}</div> <div class=\"orb-1\"></div>`\n $(modal1).html(modal1HTML)\n $('.orb-1').on('click', function () {\n modal1HTML = `<div class=\"myths\"> ${critterInfo[i].myth}</div> <div class=\"symbols\">${critterInfo[i].symbolism}</div> <div class=\"orb-1\"></div>`\n $(modal1).html(modal1HTML)\n $('.orb-1').on('click', function () {\n fadeOut()\n })\n })\n })\n }\n } else if (plants == true) {\n let modal1HTML = \"\";\n let plantCards = [card1, card2, card3, card4]\n console.log(\"plant\")\n for (let i = 0; i < cropInfo.length; i++) {\n console.log('plant2')\n $(plantCards[i]).on('click', function () {\n fadeIn()\n modal1HTML =\n `<h3 class=\"name\">${cropInfo[i].crop}</h3> <div class=\"latin\"> ${cropInfo[i].latin}</div> <div class=\"origin\">${cropInfo[i].nativeTo}</div>\n <div class=\"facts1\"> ${cropInfo[i].historicalFact}</div> <div class=\"orb-1\"></div>`\n $(modal1).html(modal1HTML)\n $('.orb-1').on('click', function () {\n modal1HTML = `<div class=\"facts2\">${cropInfo[i].medicinal}</div>\n <div class=\"myths\"> ${cropInfo[i].myth}</div> <div class=\"orb-1\"></div>`\n $(modal1).html(modal1HTML)\n $('.orb-1').on('click', function () {\n fadeOut()\n })\n })\n })\n }\n } else if (about == true){\n let modal1HTML = \"\";\n let aboutCards = [card1, card2, card3, card4]\n for (let i = 0; i < aboutInfo.length; i++) {\n $(aboutCards[i]).on('click', function (){\n fadeIn()\n modal1HTML = \n `<h3 class=\"name\">${aboutInfo[i].name}</h3> <div class=\"meaning\">${aboutInfo[i].meaning}</div> \n <div class=\"origin\">${aboutInfo[i].origin}</div> <div class=\"profile-link\">${aboutInfo[i].link} <div class=\"orb-1\"></div>`\n $(modal1).html(modal1HTML)\n $('.orb-1').on('click', function(){\n fadeOut()\n })\n })\n }\n }\n }", "function guessedAllCharacters() {\n modelState = \"win\";\n document.getElementById(\"modal-text\").append(\"You got that!\");\n modal.style.display = \"block\";\n modalisDisplayed = true;\n }", "function guessedAllCharacters() {\n modelState = \"win\";\n document.getElementById(\"modal-text\").append(\"You got that!\");\n modal.style.display = \"block\";\n modalisDisplayed = true;\n }", "function handleMatchedCards() {\n let matchCardsArray = Array.prototype.slice.call(matchCardsHC);\n matchCardsArray.forEach(function (card) {\n card.classList.remove('open', 'show');\n });\n}", "function checkWinCondition() {\n debug(\"checkWinCondition\");\n if (cardListMatch.length === 16) {\n stopTime();\n createModal();\n showModal();\n cardListMatch.splice(0, 50);\n }\n }", "function displayemployeeCards() {\n for (let i = 0; i < employeeCards.length; i++) {\n gallery.appendChild(employeeCards[i]);\n employeeCards[i].addEventListener(\"click\", (e) => {\n cardClickedId = e.target.closest(\".card\").id;\n displayModal(cardClickedId);\n });\n }\n}", "checkForAllComplete() {\n if (this.state.personCount === this.state.meals.length && (this.state.personCount !== 0 && this.state.meals.length !== 0)) {\n return (\n <button className=\"button\" onClick={() => this.toggleModal(true)}>Confirm Reservation</button>\n );\n }\n }", "function dispalyCard(e) {\n const newCard = this;\n newCard.classList.toggle('open');\n\n if(previousCard != null) {\n setTimeout(function() { compareCards(newCard); }, 1000);\n }\n else {\n previousCard = newCard;\n newCard.removeEventListener('click', dispalyCard);\n }\n}", "function newGame() {\r\n if ($(\".card\").length == $(\".match\").length) {\r\n $(\"#overlay\").css(\"visibility\", \"visible\");\r\n $(\"#startOver\").css(\"visibility\", \"visible\");\r\n function startOver() {\r\n document.location.reload();\r\n }\r\n $(\"#startOver\").on(\"click\", startOver);\r\n }\r\n}", "Match() {\n // if there are two cards with the classes clicked\n if ($('.clicked').length === 2) {\n// Than seeing if they match\n if ($('.clicked').first().data('value') == $('.clicked').last().data('value')){\n $('.clicked').each(function() {\n $(this).css({\"background-color\": \"green\",}).animate({ opacity: 0 }).removeClass('unmatched');\n });\n $('.clicked').each(function() {\n $(this).removeClass('clicked');\n });\n\n game.checkWin();\n // using a time out function to make the to flip the cards back \n } else {\n setTimeout(function() {\n $('.clicked').each(function() {\n $(this).html('').removeClass('clicked');\n \n });\n }, 1000);\n }\n }\n }", "function showGameResult () {\n if ($( \".flippable\" ).length === 2 && $('.show').length === 12) { // we pop up a winner modal\n $('.modal-body').html(\n `\n <div class=\"score-item\">Your Time: ${$('.Timer').text()}</div>\n <div class=\"score-item\">Your Score: ${$('.stars').html()}<div>\n `\n );\n $('#endGameModalLabel').text('You Win!');\n $('#endGameModal').modal('show');\n clearInterval(timer);\n resetBoard();\n } else if (moves === 0) { // else we pop up a loser modal\n $('.modal-body').html(\n `\n <div class=\"score-item\">Your Time: ${$('.Timer').text()}</div>\n `\n );\n $('#endGameModalLabel').text('You Lose!');\n $('#endGameModal').modal('show');\n clearInterval(timer);\n resetBoard();\n } else { // not the end of the game!\n return;\n }\n}", "function coretModal(){\n $(\"#deleteModal .modal-body\").html(\"Yakin coret \"+currentProfile.tec_regno+\" (\"+currentProfile.name+\") ?\")\n $('#deleteModal').modal('show');\n}", "function createModal() {\n RequestNewCardModal().then((json) => {\n const modal = document.querySelector('body').prepend(getChild(json));\n document.querySelector('.modal-container #close').addEventListener('click', closeModal);\n document.querySelector('.modal-container').addEventListener('click', closeModal);\n document.querySelector('.modal-container .button').addEventListener('click', requestNewCard);\n });\n}", "function addCardToList(ele){\n\n cardList.push(ele);\n console.log(\"pushing card to list\");\n //create a function that compares the cards to each other as long as there are two cards added to the list\n if(cardList.length > 0 && cardList.length % 2 === 0){\n let cardsMatch = cardCompare(cardList[cardList.length-1], cardList[cardList.length-2]);\n incrementTurn();\n //if the cards do not match, then set the CSS properties to hidden and remove them from the list \n if(cardsMatch === false){\n setTimeout(matchNegative, 1000);\n }else{\n matchPositive();\n //bring up a modal if all the cards are matched \n if(cardList.length == 16){\n modalShow();\n }\n } \n }\n}", "function template_card(modalContent, question, answer) {\n\n // 50/50 chance to swap Answer and Question to switch things up! yeet!\n let tempAnswer = answer;\n let tempQuestion = question;\n let lang = \"lang-it\";\n\n let languageNote = \"<div><img src='/images/language/flag-united-states.png' alt='United States Flag' class='img-fluid' style='max-width: 30px;'></div>\";\n\n if(Math.random() < 0.5) {\n question = tempAnswer;\n answer = tempQuestion;\n lang = \"lang-en\";\n\n languageNote = \"<div><img src='/images/language/flag-italy.png' alt='Italian Flag' class='img-fluid' style='max-width: 30px;'></div>\";\n }\n\n let template = `\n <div class='flash-card mx-auto w-100' data-lang='${lang}' style=\"max-width: 500px; display: none;\">\n ${languageNote}\n <div class='question display-4'>${question}</div>\n <div class='answer' style='opacity: 0;'>\n <div class='display-3 font-weight-bolder mb-4'>${answer}</div>\n </div>\n\n <div class='actions mb-5'>\n <button class='btn btn-primary w-100 d-block mb-3 check-answer' style=\"padding: 30px 0;\">Check</button>\n\n <div class='row'>\n <div class='col-6'>\n <button class='btn btn-success w-100 d-block correct-answer' disabled style=\"padding: 30px 0;\">Correct!</button>\n </div>\n <div class='col-6'>\n <button class='btn btn-danger w-100 d-block wrong-answer' disabled style=\"padding: 30px 0;\">Dang</button>\n </div>\n </div>\n </div>\n </div>`;\n\n modalContent.insertAdjacentHTML(\"beforeend\", template);\n}", "async loadCardInfo() {\n const userData = await this.userRepository.getAll();\n const userAlert = $(\".users\");\n for (let i = 0; i < 1; i++) {\n let infoUser = `<div class=\"h2\">${userData.length}</div>`;\n\n\n userAlert.prepend(infoUser);\n }\n\n const forumData = await this.forumRepository.getAll();\n const forumAlert = $(\".forumalert\");\n for (let i = 0; i < 1; i++) {\n let infoForum = `<div class=\"h2\">${forumData.length}</div>`;\n\n\n forumAlert.prepend(infoForum);\n }\n\n const eventData = await this.eventRepository.getAll();\n const eventAlert = $(\".event\");\n for (let i = 0; i < 1; i++) {\n let infoEvent = `<div class=\"h2\">${eventData.length}</div>`;\n\n eventAlert.prepend(infoEvent);\n }\n\n const reportData = await this.reportRepository.getAll();\n const reportAlert = $(\".reports\");\n for (let i = 0; i < 1; i++) {\n let infoReport = `<div class=\"h2\">${reportData.length}</div>`;\n\n reportAlert.prepend(infoReport);\n }\n\n }", "function respondToTheClick(evt) {\n if (evt.target.classList.contains('card') && !evt.target.classList.contains('match') && matchedCards.length < 3 && !evt.target.classList.contains('open')) {\n if (matchedCards.length === 0) {\n toggleClass(evt.target);\n matchedCards.push(evt.target);\n } else if (matchedCards.length === 1) {\n toggleClass(evt.target);\n matchedCards.push(evt.target);\n matchedOrNot();\n }\n } if (timerOff) {\n startTimer();\n timerOff = false;\n } if (cards.length === openCards) {\n stopTimer(); \n writeStats(); \n toggleModal(); \n }\n}", "function misMatchedCardsAction() {\n const cardFlipBackDelay = [1500, 1000, 500];\n matchAttempts++;\n setTimeout(function() { // resetting after card mismatch (delay)\n twoCardsClicked = false;\n firstCardClicked.removeClass(\"isFlipped\");\n secondCardClicked.removeClass(\"isFlipped\");\n clearCardsClicked();\n clearClickedCardsImageURLs();\n }, cardFlipBackDelay[currentDifficulty]); // as user progresses difficulty levels the delay for flipping the cards back over will decrease\n}", "function activateCards() {\n allCards.forEach(function(card) {\n card.addEventListener('click', function(e) {\n console.log(\"A card was clicked!\"); \n if (!card.classList.contains('open') && !card.classList.contains('show') && !card.classList.contains('match')) {\n openCards.push(card);\n if (openCards.length < 3) {\n card.classList.add('open', 'show');\n // If cards match, show!\n if (openCards.length == 2) {\n if (openCards[0].dataset.card == openCards[1].dataset.card) {\n openCards[0].classList.add('match');\n openCards[0].classList.add('open');\n openCards[0].classList.add('show');\n\n openCards[1].classList.add('match');\n openCards[1].classList.add('open');\n openCards[1].classList.add('show');\n\n openCards = [];\n matched++;\n } else { \n // If they do not match, hide\n setTimeout(function(){\n openCards.forEach(function(card) {\n card.classList.remove('open', 'show');\n });\n\n openCards = [];\n }, 800);\n }\n addMove();\n checkScore();\n checkForGameOver();\n }\n }\n }\n });\n }); \n}" ]
[ "0.68357116", "0.67636406", "0.6718432", "0.66461164", "0.6480009", "0.6472404", "0.6469817", "0.6429782", "0.6428735", "0.6400441", "0.63152534", "0.62675756", "0.6245581", "0.6233706", "0.6215076", "0.62050474", "0.62028915", "0.61839455", "0.6178714", "0.61627567", "0.6160655", "0.6154342", "0.6152166", "0.6147484", "0.6134738", "0.61240613", "0.6123192", "0.60984105", "0.60902363", "0.6088126", "0.60821337", "0.6077333", "0.6074158", "0.60652107", "0.60600567", "0.6051118", "0.6033495", "0.6015255", "0.60065806", "0.5986564", "0.59857416", "0.59845567", "0.59776926", "0.5977566", "0.59645206", "0.5961012", "0.59605974", "0.59552836", "0.5954182", "0.5950033", "0.59453887", "0.59426737", "0.592807", "0.592677", "0.59206873", "0.59097683", "0.59082866", "0.5906343", "0.590091", "0.58964574", "0.58825594", "0.5880138", "0.58510906", "0.5838737", "0.58356416", "0.5832229", "0.5828637", "0.5819263", "0.5817626", "0.58131146", "0.58119684", "0.5805408", "0.58037436", "0.57990736", "0.57970715", "0.5795007", "0.5788813", "0.5787982", "0.57876086", "0.57855904", "0.57837844", "0.5779504", "0.5778897", "0.577757", "0.577757", "0.5776175", "0.5775898", "0.5774634", "0.57738435", "0.5772132", "0.5771936", "0.5769487", "0.5765714", "0.5765658", "0.5764014", "0.57612944", "0.5760466", "0.5755309", "0.57547903", "0.5750553", "0.57493305" ]
0.0
-1
Function for restarting the game
function playAgain() { 'use strict'; // turn on Strict Mode modalToggle(); init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restart() {\n game.state.restart();\n}", "function restartGame() {\n playGame();\n }", "function restartGame()\n{\n\tSnake.reset();\n\tMouse.changeLocation();\n\tScoreboard.reset();\n\t\n\tenterState(\"countdown\");\n}", "function restart() {}", "function restartGame() {\n\tthis.game.stats.setStats();\n\t//TODO figure out how to restart the game to reset all variables.\n\tthis.game.state.start(\"Preload\");\n}", "function restartGame() {\n state = STATES.READY;\n timer = 20;\n gameScore = 0;\n}", "function onRestart() {\n setGame({\n cards: helpers.generateCards(),\n firstCard: undefined,\n });\n setStartTime(0);\n setElapsedTime(0);\n timeoutIds.current.forEach((id) => clearTimeout(id));\n timeoutIds.current = [];\n setWin(false);\n setScoreCanBeSaved(false);\n }", "function restart(){\n myGameArea.reset();\n}", "function restartGame() {\n\tallOpenedCards.length = 0;\n\tresetTimer();\n\tresetMoveCount();\n\tresetStar();\n\tresetCards();\n\ttoggleModal();\n\tinit();\n}", "function restart() {\n clearInterval(timerId);\n clearInterval(moveTimer);\n gameIsOver = false;\n $tiles\n .show()\n .removeClass('active wrongTarget');\n $ready.show();\n $btn.show();\n lives = 5;\n $livestxt.html(lives);\n score = 0;\n $score.html(score);\n time = 30;\n $timer.html(time);\n }", "function restartGame() {\n stopGameClock();\n resetGameClock();\n resetMoves();\n resetStars();\n resetCards();\n shuffle();\n dealTheCards();\n hidePopUp();\n gameStart = 0;\n gameTime = 0;\n moveCount = 0;\n flippedCards = [];\n matchedCards = [];\n}", "function gameRestart () {\n location.reload();\n }", "function restartGame() {\r\n location.reload();\r\n}", "function restart_game(){\n document.location.reload();\n }", "function restartGame() {\n\tstart = false;\n}", "function restartGame() {\n player.restart();\n hearts = [new Lives(0, 534), new Lives(33, 534), new Lives(66, 534)];\n life = 3;\n points = 0;\n gameEnd.css('display', 'none');\n}", "function restartGame(){\n resetStars();\n initializeVariables();\n shuffleCards(cards);\n displayCards(cards);\n listenForCardFlip();\n $('.odometer').html(score);\n $('.resultsPopUp').hide();\n $('.placeholder').show();\n $(\"#timer\").TimeCircles().restart();\n $('#overlay').css('display', 'none');\n $(\"#try-again\").click(function(){\n restartGame();\n });\n}", "function restartGame() {\n pipesGroup.clear(true, true);\n pipesGroup.clear(true, true);\n gapsGroup.clear(true, true);\n scoreboardGroup.clear(true, true);\n player.destroy();\n gameOverBanner.visible = false;\n restartButton.visible = false;\n\n const gameScene = game.scene.scenes[0];\n prepareGame(gameScene);\n\n gameScene.physics.resume();\n}", "function playAgain(){\r\n restart();\r\n}", "function restart() {\n level = 1;\n gamePattern = [];\n userClickedPattern = [];\n startGame = false;\n //console.log(\"restarted\");\n}", "function restart() {\n //uccide i nemici prima di iniziare la nuova partita\n firstEnemy.callAll('kill');\n game.time.events.remove(enemyLaunchTimer);\n game.time.events.add(1000, Enemy);\n\n //resuscita il 'player'\n player.revive();\n player.health = 20;\n\n //il testo del punteggio totale torna visibile e viene aggiornato lo 'score'\n scoreText.visible = true;\n score = 0;\n scoreText.render();\n\n //nasconde entrambi i testi di fine gioco\n gameOver.visible = false;\n gameOver_victory.visible = false;\n\n win = false;\n }", "function restart() {\n\tplayer.stage = 0; // reset stage counter\n\tplayer.sprite = player.playerChar[player.stage];// reset player character\n\tplayer.resetPos(); //reset player position\n\twindow.open(\"#close\", \"_self\"); // close popup\n}", "function restartGame() {\n\twindow.location.reload();\n}", "function restartGame() {\n //Clear the CPU sequence\n cpuSequence = [];\n //Reset count\n count = 0;\n startCpuSequence();\n }", "function restart() {\n grid = createGrid(currentLevel);\n stepCount = 0;\n requestAnimationFrame(drawCanvas);\n win = false;\n scoreSet = false; //Set boolean to false\n}", "function restartGame()\r\n{\r\n console.log(\"restart called\"); \r\n gameMessage= \"\";\r\n backpack = [];\r\n mapLocation=4;\r\n item=\"\";\r\n render(); \r\n}", "function restartGame () {\n \n whoa.play();\n \n lives -= 1;\n \n xPos = 50;\n yPos = height/2;\n \n block1X = width - 5;\n block1Y = height /2;\n \n block2X = width - 5;\n block2Y = height /3;\n \n block3X = width - 5;\n block3Y = height - 50;\n \n counter = 0;\n Block1();\n updateMenu( myMenu );\n \n}", "function restartGame() {\n\n\tgGamerPos = { i: 2, j: 9 };\n\tgBoard = buildBoard();\n\tgBallsToCollect = 2;\n\tgColector.innerText = 0;\n\tgAddBallInterval = setInterval(addBall, 5000);\n\tgIsGameOn = false;\n\telBtn = document.querySelector('.restart');\n\t// elBtn.classList.toggle('restart');\n\telBtn.style.display = 'none';\n\trenderBoard(gBoard);\n}", "function restartgame(){\n location.reload();\n}", "function restart() {\n grid = [null, null, null, null, null, null, null, null, null]\n player = 1\n }", "function restartGame() {\n togglePanel(panel.POSTGAME)\n togglePanel(panel.PREGAME)\n}", "function restartgame(){\n\twindow.location.reload();\n}", "function restartGame() {\r\n clearInterval(timerId);\r\n createDeck();\r\n}", "function restartGame() {\n GAME_OVER = false;\n GAME_COMPLETE = false;\n GAME_CONTINUE = false;\n NUM_ENEMIES = -1; \n CUR_LEVEL = 0;\n LEVEL_OBJ.level = 1;\n SCORE_OBJ.score = 0;\n console.log(\"restarting...\");\n reset_store();\n $('#winner').hide();\n gwhOver.hide();\n $('.snowball').remove();\n $('.projectile').remove();\n $('.bunker').remove();\n $('#store').hide();\n $('#levelScreen').show();\n\n setTimeout(function() {\n\t if (!PROJECTILES_FALLING) {\n\t\tcr_prj_id = setInterval(function() {\n\t\t\tcreateProjectile();\n\t\t}, PROJECTILE_SPAWN_RATE[CUR_LEVEL]);\n\t\tPROJECTILES_FALLING = true;\n\t }\n gwhGame.show();\n $('#levelScreen').hide();\n\t ENEMY_DIRECTION = \"right\";\n ENEMY_SPEED = LEVEL_SPEED[CUR_LEVEL];\n threshold = Math.ceil(ENEMY_DOUBLE_RATIO * ENEMY_PATTERN[CUR_LEVEL][0] * ENEMY_PATTERN[CUR_LEVEL][1]);\n \tNUM_ENEMIES = ENEMY_PATTERN[CUR_LEVEL][1] * ENEMY_PATTERN[CUR_LEVEL][0];\n \tmaxEnemyPosX += ENEMY_SIZE;\n \tENEMY_SIZE = Math.min(100, 100 * 8 / (ENEMY_PATTERN[CUR_LEVEL][0] + 1));\n \tmaxEnemyPosX -= ENEMY_SIZE;\n createEnemies(ENEMY_SIZE);\n createBunkers();\n GAME_PAUSED = false;\n }, 7000);\n}", "function restart() {\n\t\t//hide anything on stage and show the score\n\t\tstage.removeAllChildren();\n\t\tscoreField.text = (0).toString();\n\t\tstage.addChild(scoreField);\n\n\t\t//new arrays to dump old data\n\t\trockBelt = new Array();\n\t\tbulletStream = new Array();\n\n\t\t//create the player\n\t\talive = true;\n\t\tship = new Ship();\n\t\tship.x = canvas.width / 2;\n\t\tship.y = canvas.height / 2;\n\n\t\t//log time untill values\n\t\ttimeToRock = ROCK_TIME;\n\t\tnextRock = nextBullet = 0;\n\n\t\t//reset key presses\n\t\tshootHeld =\tlfHeld = rtHeld = fwdHeld = dnHeld = false;\n\n\t\t//ensure stage is blank and add the ship\n\t\tstage.clear();\n\t\tstage.addChild(ship);\n\n\t\t//start game timer \n\t\tif (!createjs.Ticker.hasEventListener(\"tick\")) { \n\t\t\tcreatejs.Ticker.addEventListener(\"tick\", tick);\n\t\t} \n\t}", "function restartButton(k) {\n resetGame(k);\n }", "function restartGame() {\n\t// Delete all cards\n\tcardsContainer.innerHTML = '';\n\t// Reset rating\n\tstarsContainer.innerHTML = `<li><i class='fa fa-star'></i></li>\n\t\t\t\t\t\t\t\t<li><i class='fa fa-star'></i></li>\n\t\t\t\t\t\t\t\t<li><i class='fa fa-star'></i></li>`;\n\t//Hide modal window\n\tmodal.classList.remove('ShowModal');\n\t// Reset moves\n\tmovesContainer.innerHTML = 0;\n\t// Reset timer to 0\n\ttimer.innerHTML = '0 <i class=\"fa fa-clock-o\"></i>';\n\t// Call shuffle\n\tshuffle(cards);\n\t// Call 'init' to create new cards\n\tinit();\n\t// clear interval for timer\n\tclearInterval(intervalId);\n\t// Start a new timer\n\tshowTime();\n\t// Reset all related letiables\n\topenCards = [];\n\tmatchedCards = 0;\n\tmoves = 0;\n\tstars = 3;\n\tseconds = 0;\n}", "function restartTheGame () {\n window.location.reload();\n}", "function restartGame() {\n state = 0;\n body.innerHTML = '';\n buildGame();\n gameOver = false;\n}", "function restart() {\r\n hello();\r\n i = 0;\r\n health = 4;\r\n happiness = 4;\r\n hunger = 4;\r\n timer = setInterval(timePassed, 1000);\r\n }", "function restartGame() {\n clear();\n sceneQueue = new Queue();\n sceneQueue.enqueue(\"intro1\");\n sceneQueue.enqueue(\"intro2\");\n sceneQueue.enqueue(\"intro3\");\n sceneQueue.enqueue(\"eden1\");\n sceneQueue.enqueue(\"eden2\");\n sceneQueue.enqueue(\"eden3\");\n sceneQueue.enqueue(\"forbiddenFruitScene\");\n sceneQueue.enqueue(\"playgrounds1\");\n sceneQueue.enqueue(\"playgrounds2\");\n\n gameOver = false;\n prefallenState = true;\n currentScene = \"intro1\"; // By default start at intro1\n playIntroduction = true; // Pass the intro cinematic canvas screen to the actual game\n playedIntro1 = false;\n playedIntro2 = false;\n playedIntro3 = false;\n playAsAdam = true;\n playAsEve = false;\n\n if (backgroundMusic.isLooping()) {\n backgroundMusic.stop();\n setTimeout(backgroundMusic.loop(), 3000);\n }\n setupPlayer();\n setupOtherGender();\n}", "function restart() {\n firstClick = true;\n playerAlive = true;\n \n placedFlags = [];\n numPlacedFlags = 0;\n \n time = 0;\n \n createBoard();\n}", "function restartGame() {\n console.log('trying to restart game');\n /*Set no of stars back to 5*/\n resetStars();\n /*Reshuffle cards and close all cards*/\n hideCard(myOpenedCards);\n deleteFromMyOpenedCards();\n deleteFromMyLastTwoCards();\n setTimeout(shuffle, 500);\n /*Reset no of moves back to zero*/\n document.querySelector('.moves').textContent = '0';\n /*Reset time elapsed back to 0 seconds*/\n document.querySelector('.timeElapsed').textContent = `0 sec`;\n seconds = 0;\n mins = 0;\n}", "function restart(){\n\tmarioGame.enStatus = enStep.nInit;\n\t$(\"#gameover\").unbind();\n\t//if(isCompatible() == true){\n\t\t$(\"#gameover\").addClass(\"character-removed\");\n\t\t$(\"#gameover\").bind(\"webkitTransitionEnd\", removeDiv);\n\t\t$(\"#gameover\").bind(\"oTransitionEnd\", removeDiv);\n\t\t$(\"#gameover\").bind(\"otransitionend\", removeDiv);\n\t\t$(\"#gameover\").bind(\"transitionend\", removeDiv);\n\t\t$(\"#gameover\").bind(\"msTransitionEnd\", removeDiv);\n\t/*}\n\telse\n\t{\n\t\t$(\"#gameover\").empty();\n\t\t$(\"#gameover\").remove();\n\t}*/\n\tmarioGame.nTurn = 0;\n\tmarioGame.nFrame = 0;\n}", "function restartGame() {\n openCards = 0;\n clearTimer();\n clearMoves();\n clearStars();\n clearBoard();\n shuffleCards();\n\n}", "function restart(){\n speed = 1;\n score = 0;\n appleY = 200;\n}", "function restartGame() {\n initGame();\n moves = 0;\n counter.innerHTML = moves;\n timer.innerHTML = \"0 mins 0 secs\";\n clearAllFunction();\n clearInterval(interval);\n timerActive = false\n}", "function restartGame() {\n\t//display all cards in closed condition\n\tfor (const element of allCardsClosedArray) {\n\t\telement.classList.remove('open', 'show', 'match', 'wrong');\n\t}\n\t//empty the openCards array\n\topenCards = [];\n\t//stop the timer and set to zero\n\tstopTimer();\n\tresetTimer();\n\tdocument.querySelector('.moves').innerText = '0';\n\t//reset star rating back to three stars\n\tupdateStarCounter();\n\tshuffle();\n}", "function restartGame() {\r\n\r\n\tplayer.lives = 3;\r\n\tplayer.health = 3;\r\n\t\r\n\t// Resets gameOver variable, gravity and the presents to collect count\r\n\tgameOver = false;\r\n\tgravity = 0.3;\r\n\tpresentsToCollect = 4;\r\n\t\r\n\t// Clear \"Game Over\" text\r\n\ttextctx.clearRect(0,0, canvasWidth,canvasHeight);\r\n\t\r\n\t// Reset player position on the screen\r\n\tplayer.init(-25, 546);\r\n\t\r\n\t\r\n\t// Hide the restart textBox display\r\n\ttextBox.style.display = \"none\";\r\n\t\r\n\t// Remove everything from the boxes array, then re-initialize it\r\n\tboxes = [];\r\n\tinitializeObstacles();\r\n\t\r\n}", "function actionOnResetClick () {\n gameRestart();\n }", "function RestartGame() {\r\n UIEvent(\"RestartGame\", \"\");\r\n}", "function restart(){\n\tstartGame();\n\tgameStart = true;\n\tnewEnemy=true;\n\tcanAttack = false;\n\tgameOver = false;\n\tplayerPower=0;\n\n\tenemyNum=[];\n\tcurrentEnemy=\"\";\n\tfor(var i = 0 ;i< 4;++i){\n\t\t$(\"#enemyContainer_\"+i).css({\"display\":\"none\"});\n\t}\n\t$(\"#currentEnemyContainer\").css({\"display\":\"none\"});\n\t$(\"#playerText\").html(\"\");\n\t$(\"#cpuText\").html(\"\");\n\n\t//return images to normal after deaths in previous game\n\t$(\"#avatar_IMG_0\").removeClass(\"dead\");\n\t$(\"#currentEnemy_IMG\").removeClass(\"dead\");\n\n}", "restart() {\r\n console.clear();\r\n this.curPos = [];\r\n [...this.curPos] = [...this._startPos];\r\n this.grid = [];\r\n \r\n if(!this.isAlive) {\r\n console.log(`You died...`);\r\n }\r\n else if (this.won){\r\n console.log(`You found your hat!`);\r\n }\r\n\r\n let ans = prompt('Do you want to play again?(y/n)');\r\n \r\n if (ans === 'y' && !this.isAlive) {\r\n this.isAlive = true;\r\n this.copyGrid(this.oGrid, this.grid);\r\n this.update();\r\n }\r\n else if (ans === 'y' && this.won) {\r\n this.won = false;\r\n let test = this.generateAndTestMap();\r\n\r\n if(test != null) {\r\n this.oGrid = [];\r\n this.copyGrid(this.grid, this.oGrid);\r\n [...this.curPos] = [...this._startPos];\r\n this.update();\r\n }\r\n }\r\n }", "Restart() {\n\n }", "function restart() {\n loadLevel(level0);\n}", "function restartGame(){\n\tspawnBall(1);\n\tcenterBall();\n\tsetTimeout(spawnBall, 2200, 1);\n\tspawnPlayerOne();\n\tspawnPlayerTwo();\n\tupdateScore();\n}", "function restartGame() {\n // hides game & score page\n gamePageEl.classList.add(\"hide\");\n scorePageEl.classList.add(\"hide\");\n // resets question array\n currentQuestionIndex = 0;\n // resets timer\n clearInterval(timerInterval);\n secondsLeft = 76;\n // restarts game\n startGame();\n}", "function restartGame() {\n time = 0; \n player.x = 2 * 101; // initial x position\n player.y = 5 * 83 - 20; // initial y position\n gameCompleted =false;\n gameStatus[0].innerHTML = '';\n timer[0].innerText = '0:0';\n}", "function restart() {\n debug(\"restart\");\n let reset = document.querySelector('.restart');\n\n reset.addEventListener('click', function(){\n clearBoard();\n resetMoves();\n clearStars();\n createStars();\n clearTimer();\n createTimer();\n createBoard();\n })\n }", "restart() {\n if (this.gamestate === GAMESTATE.GAMEOVER) {\n this.ctx.clearRect(0, 0, this.gamewidth, this.gameheight);\n this.timePassed = 0;\n this.score = 0;\n this.collided = false;\n this.player.position = {\n x: 20,\n y: this.gameheight / 2 - this.player.height / 2\n };\n this.player.image = document.getElementById(\"falcon\");\n this.player.jumpSpeed = -10;\n this.gravity = 0.5;\n this.gameObjects = [];\n this.gameObjects.push(this.player);\n this.start(this.ctx);\n }\n }", "function restart() {\n if (window.confirm(`Are you sure? You'll lose all progress.`)) {\n resetToInitialState()\n setState(generatePlayers(state, INITIAL_PLAYERS_COUNT))\n }\n}", "function restartGame() {\n currentLevel = 1;\n grid = createGrid(currentLevel);\n win = false;\n stepCount = 0;\n scoreSet = false; //Set boolean to false\n document.getElementById(\"finish\").style.visibility = \"hidden\";\n document.getElementById(\"score\").innerHTML = \"\";\n requestAnimationFrame(drawCanvas);\n}", "function restartGame()\n{\n startScene.visible = true;\n gameOverScene.visible = false;\n gameScene.visible = false;\n pauseMenu.visible = false;\n level = 1;\n score = 0;\n buttonSound.play();\n}", "function restartGame() {\n\tfs.readFile(DATA_FILENAME, function(err, data) {\n\t \tif (err) {\n\t\t\tconsole.log(err);\n\t\t\treturn;\n\t\t}\n\t\tvar newData = JSON.parse(data);\n\t\tloadData(newData);\n\t\tif(!listening){\n\t\t\tbot.on('message',listenForWords);\n\t\t\tbot.on('message',newChatMembers);\n\t\t\tlistening = true;\n\t\t}\n\t\tif(automaticHints == true) {\n\t\t\tstartAutomaticHints();\n\t\t}\n\t});\n}", "function restart() {\n game = new Battleship(8, 8);\n game.updateDisplay();\n $(\"#resetButton\").toggleClass(\"hidden\");\n $(\"#startButton\").toggleClass(\"hidden\");\n saveGame();\n}", "restartGame(button, groupName, index, pointer, event){\n button.scene.board.setHighScore();\n button.scene.scene.start(\"GameScene\", button.scene.gameData);\n }", "restart_game()\n {\n if(this.gameStart)\n {\n if(this.gameOver)\n {\n this.score = 0;\n this.health=3;\n this.gameOver=false;\n this.enemy_pos = [];\n this.laser_pos = [];\n this.bullet_pos = [];\n this.sound.gameOver.pause();\n this.sound.gameOver.currentTime = 0;\n this.sound.bgm.currentTime = 0;\n }\n }\n else\n {\n var element = document.getElementById(\"startScreen\");\n element. parentNode.removeChild(element);\n this.gameStart = true;\n this.gameOver = false;\n }\n \n }", "function restart () {\n\n randomNumberGoal ();\n numbers ();\n count = 0;\n randomCrystals ();\n\n }", "function restartGame() {\n\n // Inquire info with the following prompt\n inquirer\n .prompt([\n {\n type: \"list\",\n message: \"Would you like to play again?\",\n choices: [\"Yes\", \"No\"],\n name: \"restart\"\n }\n ])\n\n // then return the following information\n .then(function (input) {\n if (input.restart === \"Yes\") {\n requireNewWord = true;\n incorrectLetters = [];\n correctLetters = [];\n guessesLeft = 10;\n initGame();\n } else {\n return\n }\n })\n}", "function restart(event) {\r\n if (event.type == 'click')\r\n matchedCards = [];\r\n cardInPlay = null;\r\n flippedCards = [];\r\n cardsInPlay = [];\r\n checkDoubleClick = [];\r\n // Call functions to clear the timer using clearInterval and to start the game\r\n clearInterval();\r\n startGame();\r\n}", "function restartGame (){\n themeSong.pause();\n while (grid.firstChild) {\n grid.removeChild(grid.firstChild)\n }\n grid.removeAttribute('class');\n score = 0;\n totalGemsCollected = 0;\n currentGems = 0;\n gemDisplay.textContent = currentGems;\n angrySlimesHit = 0;\n timeLeft = 60;\n endDisplay.style.display = 'none';\n startDisplay.classList.add('show');\n}", "restart() {\n\n this.snake.reset();\n this.food.reset();\n this.score = 0;\n this.scoreCounter.innerText = 0;\n this.controls.classList.remove('playing');\n this.controls.classList.remove('in-menu');\n this.board.classList.remove('game-over');\n this.board.classList.remove('leaderboard');\n\n }", "function restartGame() {\n $('#restartButton').remove();\n $('#gameMessageText').text('');\n attackCount = 0;\n defeatedEnemyCount = 0;\n for (var i = 0; i < 4; i++) {\n starWarsChar[i].healthPoints = originalHealthPoints[i];\n }\n\n initialPageSetup();\n\n }", "restartGame() {\n\t\tthis.registry.destroy(); // destroy registry\n\t\tthis.events.off(); // disable all active events\n\t\tthis.scene.restart(); // restart current scene\n\t}", "function restart(){\n\n document.getElementById('restart').innerHTML = '';\n scores[0] = 0;\n scores[1] = 0;\n board[0][0] = 4;\n board[0][1] = 4;\n board[0][2] = 4;\n board[0][3] = 4;\n board[0][4] = 4;\n board[0][5] = 4;\n board[1][0] = 4;\n board[1][1] = 4;\n board[1][2] = 4;\n board[1][3] = 4;\n board[1][4] = 4;\n board[1][5] = 4;\n turn = 1;\n displayTurn();\n populateBoard();\n}", "function gameOver() {\n game.paused = true;\n statoDolci = 2;\n dolciCompari();\n //restart on click function\n game.input.onTap.addOnce(function () {\n game.paused = false;\n game.state.restart();\n time = 0;\n ordine = 0;\n statoDolci = 1;\n dolciCompari();\n });\n}", "function restartGame() {\n\n\n // reset DOM to original status\n clearInterval(myTimer); // stop time counter\n myTimer = null;\n cardFaceUpCount = 0;\n $('#timer').text('0 Seconds'); // reset counter text\n $('.deck').find('i').remove(); // remove all icons\n $('.card').removeClass('flip faceup matched'); //remove previously added classes\n $('#moves').text(0); // reset move counter\n $('#star-score').find('i').text('star'); // reset stars value\n \n\n // start game again\n startGame();\n\n}", "function restart () {\n quiz.isGameOver = false\n quiz.currentQuestion = 0\n quiz.player1Score = 0\n quiz.player2Score = 0\n}", "function restart() {\n\t if (direction === 'up') {\n\t PARAMS.elevation = 0;\n\t } else {\n\t PARAMS.elevation = elevationMax;\n\t }\n\n\t pane.refresh();\n\n\t generateScene();\n\t startRide();\n\t}", "function restartGame() {\n //clear all playing pieces\n gameboard = [[null, null, null], [null, null, null], [null, null, null]];\n console.log('[restartGame] resetting gameboard');\n //clear up images\n for(let box of boxes) {\n box.innerHTML = '';\n }\n turn = 1;\n gameover = false;\n}", "restart() {\n $('#player_turn').text('Red')\n const $board = $(this.selector)\n $board.empty()\n this.drop_btn()\n this.create_board()\n this.turn = 0\n this.game_over = false\n }", "restartGame() {\n score=5;\n $('#restart-button').on('click', () => {\n $('.modal').hide();\n $('.game-container').css('display', 'block');\n $('.mushroom-container').css('display', 'block');\n setUpRound();\n $('#restart-button').off();\n });\n }", "function restart() {\n\t$('.card').removeClass('open show match animated bounce');\n\t$('.card').remove();\n\t$('#stars1').html('');\n\t$('#stars2').html('');\n\t$('.score-panel').show();\n\tinitStars();\n\tmakeCardHTML();\n\tmoves = -1;\n\tplayerMatches = 0;\n\tstopTimer();\n\t$(\".seconds\").html('00');\n\t$(\".minutes\").html('00');\n\tclickCards();\n\tdisplayMoves();\n\topenCards = [];\n}", "restartGame () {\n this.scene.start('gameScene')\n this.gameOver = false\n this.gameReset = true\n this.energy = 50\n this.energyText.setText('Energy: ' + this.energy.toString())\n this.score = 0\n this.scoreText.setText('Score: ' + this.score.toString())\n this.monsterDelay = 15000\n this.monsterYPositions = []\n this.defenderPositions = []\n console.log('Game Reset')\n\n // (extra)\n this.numberOfWaves = 0\n this.defenderType = 1\n \n }", "gameRestart() {\n this.destroy();\n this.render();\n }", "function init() {\n startGame();\n $(\".restart\").click(function () {\n location.reload();\n });\n\n}", "static restartGame(){\n $(\"#restart\").on('click', function(){\n window.location.reload(true)\n })\n }", "function restart(){\n\tlog = [];\n\tcardsInPlay = [];\n\tcurrentPlayer = 0;\n\tplayerScores = [0, 0];\n \ttrackedCards = [];\n \tseconds = 10;\n \tgameBoardSetup();\n \t$(\".playerScore\").empty().append(\"0\");\n \t$(\".playerOne\").css('color', 'red');\n \t$(\".playerTwo\").css('color', 'black');\n \tcountDownTimer();\n}", "function restartGame(){\r\n\t\ti++;\r\n\t\tstopInterval();\r\n\t\tif(i < questions.length){\r\n\t\t\tsecondsValue=20\r\n\t\t\t$(\"#timeremaining\").html(originalSecondsValueHTML);\t\r\n\t\t\tquestionAnswers();\r\n\t\t\tmyInterval = setInterval(function(){\r\n\t\t\t\ttriviaGame();\r\n\t\t\t},1000);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstopInterval();\r\n\t\t\t$(\"#timeremaining, #question, .answers, ol\").hide();\r\n\t\t\tnewDialog.html(\"Game Over<br>You answered \" + correctAnswersCount + \" question(s) correctly<br>You answered \" + wrongAnswersCount + \" question(s) incorrectly<br>Press any key to restart\");\r\n\t\t\t$(\"#result-box\").prepend(newDialog);\r\n\t\t\tnewDialog.show();\r\n\t\t\t$(document).one(\"keypress\", function(){\r\n\t\t\t\tnewDialog.remove();\r\n\t\t\t\t$(\"#timeremaining, #question, .answers, ol\").show();\t\t\t\t\t\r\n\t\t\t\ti = -1;\r\n\t\t\t\tcorrectAnswersCount = 0;\r\n\t\t\t\twrongAnswersCount = 0;\r\n\t\t\t\trestartGame();\r\n\t\t\t});\r\n\t\t}\r\n\t}", "restart() {\r\n\r\n this.snake.reset();\r\n this.controls.classList.remove('game-over');\r\n this.board.classList.remove('game-over');\r\n\r\n }", "function restartApp() {\n questionIndex = 0;\n score = 0;\n countdownTime = 3;\n userAnswers = [];\n moveScoreboardOut();\n showAppDescr();\n moveDescriptionIn();\n showStartButton();\n}", "restart() {\n return this.play(this.currentActions, 0)\n }", "function restart() {\n\n\t\t// Shows generic image\n\t\tanswerImage.innerHTML = '<img src=\"assets/images/ironthrone.jpg\" width=\"400px\" height=\"400px\">';\n\n\t\t// Resets blanks for word and letters already guessed\n\t\tblankWord = [];\n\t\tguessedLetters = [];\n\n\t\t// Resets remaining guesses counter\n\t\tlives = 9;\n\n\t\t// Randomly chooses a word from the words array. This is the hangmanWord.\n\t\thangmanWord = words[Math.floor(Math.random() * words.length)];\n\t\thangmanWord = hangmanWord.toLowerCase();\n\n\t\t// Splits hangmanWord into an array of individual characters\n\t\thangmanWordLetters = hangmanWord.split(\"\");\n\n\t\t// Stores the length of the hangmanWord\n\t\twordLength = hangmanWordLetters.length;\n\n\t\tfor (var i = 0; i < wordLength; i++) {\n\t\t\tblankWord.push(\"_\");\n\t\t}\n\n\t\tscore.innerHTML = \"<h2> \" + wins + \"</h2>\";\n\t\tlossCount.innerHTML = \"<h2> \" + losses + \"</h2>\";\n\t\tcurrentWord.innerHTML = \"<h1> \" + blankWord.join(\" \") + \"</h1>\";\n\t\tguessesRemaining.innerHTML = \"<h2> \" + lives + \"</h2>\";\n\t\tlettersGuessed.innerHTML = \"<h2> \" + guessedLetters + \"</h2>\";\n\n\t}", "function restart(){ \n restart_button_press_color=0;\n exit_button_press_color=0;\n endsound=0;\n on_off_ingame_click(which_player);\n document.getElementById(\"tictactoegame\").removeEventListener('mousedown',pressrestartcolor);\n document.getElementById(\"tictactoegame\").removeEventListener('mouseup',pressrestart);\n document.getElementById(\"tictactoegame\").removeEventListener('mousedown',pressExitcolor);\n document.getElementById(\"tictactoegame\").removeEventListener('mouseup',pressExit);\n endcard();\n //socket.emit('endgame');\n }", "function restartGame() {\n inquirer\n .prompt([\n {\n type: \"list\",\n message: \"Would you like to:\",\n choices: [\"play Again\", \"Exit\"],\n name: \"restart\"\n }\n ]).then(function(input) {\n if (input.restart === \"Play Again\") {\n requireNewWord = true;\n incorrectLetters = [];\n correctLetters = [];\n guessesLeft = 10;\n Logic();\n } else {\n return;\n };\n });\n}", "function resumeGame() {\n pauseBoard.kill();\n pauseBoardText.kill();\n resumeButton.kill();\n restartLevelButton.kill();\n mainMenuButton.kill();\n this.deerTimer = 0;\n this.cowTimer = 1200;\n this.rockTimer = 2300;\n game.pause = false;\n}", "function restart() {\n $(\".pause, .over\").css(\"display\", \"none\");\n\n clearInterval(interval);\n reset();\n\n main();\n}", "function gameLost(){\n setTimeout(alert('You Lose'), 2000);\n restart()\n}", "function restartGame() {\n\n questionIndex = 0;\n Score = 0;\n resp = \"\";\n secondsLeft = 20;\n result.style.display = \"none\";\n foote.style.display = \"none\";\n Inici.style.display = \"block\";\n arrayHSInverso();\n}", "function resetGame() {\n location.reload()\n}", "function resetGame() {\n location.reload();\n }" ]
[ "0.87297684", "0.8581637", "0.842008", "0.8373883", "0.8325835", "0.8300972", "0.81533444", "0.81125796", "0.8107974", "0.8104296", "0.80926013", "0.8089746", "0.80254537", "0.8019161", "0.8008237", "0.80007124", "0.79995066", "0.79843736", "0.79833364", "0.79829985", "0.7967444", "0.79368347", "0.79352766", "0.79339427", "0.79163516", "0.78954864", "0.7854334", "0.78489083", "0.7847906", "0.7846894", "0.78451055", "0.78420544", "0.7839861", "0.78306574", "0.782253", "0.7807081", "0.7786011", "0.7776725", "0.777231", "0.77712625", "0.77405196", "0.7732975", "0.7732788", "0.77327603", "0.7718879", "0.7692368", "0.7680612", "0.76704454", "0.7656917", "0.765345", "0.7653221", "0.7649198", "0.7640877", "0.7624487", "0.7608557", "0.7593995", "0.7593061", "0.7591489", "0.7590807", "0.7586893", "0.75664794", "0.7554928", "0.7552884", "0.75496894", "0.75468004", "0.7523669", "0.7509662", "0.7478056", "0.7468954", "0.74668944", "0.7460284", "0.74596083", "0.7445515", "0.7442211", "0.74376273", "0.74299604", "0.74226767", "0.7419638", "0.7419512", "0.741566", "0.7402418", "0.7392776", "0.7391878", "0.7384216", "0.7383911", "0.73821753", "0.7377963", "0.7365736", "0.7365535", "0.7356095", "0.73501605", "0.73489344", "0.7303674", "0.72992265", "0.72933424", "0.729062", "0.7289717", "0.7280349", "0.7279328", "0.72688246", "0.7265998" ]
0.0
-1
Reset function All time, moves and rating will be reset to the their default values
function reset() { 'use strict'; // turn on Strict Mode //Resetting timer timerCounter.innerHTML = "0 Minute 0 Second"; clearInterval(timerInterval); //Resetting moves moves = 0; movesCounter.innerHTML = moves; //Reseting stars stars[1].classList.add("fa-star"); stars[1].classList.remove("fa-star-o"); stars[2].classList.add("fa-star"); stars[2].classList.remove("fa-star-o"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n state.moves = [];\n state.turnCount = 0;\n state.playbackSpeed = 700;\n chooseMove();\n }", "function fullReset() {\n reset();\n score.DROITE = 0;\n score.GAUCHE = 0;\n }", "function reset() { }", "function reset() {\n\t\t\tclear_board()\n\t\t}", "reset(){\n this.live = 3;\n this.score = 0;\n this.init();\n }", "function reset() {\n resetGrid();\n resetLives();\n resetScore();\n generateRandomPath(width);\n}", "function reset() {\n generateLevel(0);\n Resources.setGameOver(false);\n paused = false;\n score = 0;\n lives = 3;\n level = 1;\n changeRows = false;\n pressedKeys = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }", "function reset() {\n cardsArray.forEach(function(card) {\n card.classList.remove('match', 'unmatched', 'selected', 'disabled');\n });\n starsArray.forEach(function(star) {\n star.style.visibility = 'visible';\n });\n\n // Resets moves\n count = 0;\n moves = 0;\n counter.innerHTML = moves;\n\n // Resets timer\n clearInterval(interval);\n seconds = 0;\n minutes = 0;\n hours = 0;\n timer.innerHTML = minutes + ' min(s) ' + seconds + ' secs(s)';\n\n // Shuffles the cards\n shuffleCards();\n}", "function reset() {\n\textraliv = 0;\n\tliv = maxliv;\n\tmissed = 0;\n\tscore = 0;\n\tfrugter = [];\n\tmodifiers = [];\n\ttimeToNextEnemy = Random(enemyInterval[0], enemyInterval[1]);\n\ttimeToNextModifier = Random(modifierInterval[0], modifierInterval[1]);\n\tspilIgang = true;\n\tspilWon = false;\n}", "function reset () {\n\t\tfillZero(xs,9);\n\t\tfillZero(os,9);\n\t\tremoveSelected(circles);\n\t\tcurrent = null;\n\t\tcounter = null;\n\t\twin = false;\n\t\tdisplay.textContent = \"tic tac toe\";\n\t}", "function resetGame() {\n resetClockAndTime();\n resetMoves(); \n resetRatings();\n startGame();\n}", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 5;\n maxBet = 20;\n winNumber = 0;\n lossNumber = 0;\n winRatio = false;\n\n resetText();\n\n setEnableSpin();\n}", "function reset() {\n\n }", "function reset() {\n $holder.children().remove();\n $(\"#boardLine\").children().remove();\n boardLine = createBoardLine();\n\n // create an array of tiles\n tiles = createRandomTiles(7, json);\n // changed my mind, didnt want to reset highscore but kept functionality\n // highScore = 0;\n // $highScore.text(`High Score: ${highScore}`);\n score = updateScore(boardLine);\n $score.text(`Score: ${score}`);\n }", "function resetGame() {\n stopTimer();\n openCardsList = [];\n matchedCounter = 0;\n movesCounter = 0;\n starRating = 3;\n resetStarRating();\n timer = \"0m 0s\";\n timerElement.innerText = timer;\n}", "function resetGame() {\n resetTimer();\n resetMoves();\n resetStars();\n shuffleDeck();\n resetCards();\n}", "function reset(){\n\t\trandomScore();\n\t\trandomVal();\n\t\tmainScore = 0;\n\t\t$('.score').text('Score: ' + mainScore);\n\n\t}", "function reset(){\n wins = 0;\n loses = 0;\n i = 0;\n $(\".reset\").remove();\n displayQuestionAndSelections();\n }", "function resetAllStates() {\n // Set the timer back to 75\n time = 75;\n // Show the timer to the user\n shownTime.text(time);\n // Set endQuiz variable to false\n quizEnded = false;\n // Set the userAnswers array to be empty\n userAnswers = [];\n // Set the scoreboard input value to be empty\n userNameInput.val('');\n}", "reset(){\n //set position x and y back to 100\n this._posX = 100;\n this._posY = 100;\n //set score back to 0\n this._score = 0;\n }", "function reset() {\n $('.game-field').html('');\n game.moves = 1;\n $('.game-field').attr('onClick', 'icon(this.id)');\n $('.win').removeClass('win');\n setTimeout(firstMove, 200);\n }", "function reset() {\n // reset the player (puts him at starting tile)\n player.reset();\n // reset the enemies - they will begin off screen to the left\n allEnemies.forEach(function(enemy) {\n enemy.reset();\n });\n // reset the game clock - I'm not really using this timer for now but good to have\n gameTimeElapsed = 0;\n // redraw the background of the scoreboard if the high score changed. We try to \n // draw this as seldom as possible to be more efficient. \n if ( currentScore > highScore ) {\n highScore = currentScore;\n scoreboardBG.setForceDraw();\n }\n // reset the current score to zero\n currentScore = 0;\n\n }", "function reset() {\r\n localStorage.setItem(\"score1\", '0');\r\n localStorage.setItem(\"score2\", '0');\r\n CONSTS.gameSpeed = 20;\r\n CONSTS.score1 = 0;\r\n CONSTS.score2 = 0;\r\n CONSTS.stick1Speed = 0;\r\n CONSTS.stick2Speed = 0;\r\n CONSTS.ballTopSpeed = 0;\r\n CONSTS.ballLeftSpeed = 0;\r\n CSS.stick1.top = 253;\r\n CSS.stick2.top = 253;\r\n $(\"#score1-div\").remove();\r\n $(\"#score2-div\").remove();\r\n $(\"#score1-val\").remove();\r\n $(\"#score2-val\").remove();\r\n $(\"#pong-game\").remove();\r\n $(\"#pong-line\").remove();\r\n $(\"#pong-ball\").remove();\r\n clearInterval(window.pongLoop);\r\n start();\r\n }", "function reset(){\n\n theme.play();\n\n gameState = PLAY;\n gameOver.visible = false;\n restart.visible = false;\n \n monsterGroup.destroyEach();\n \n Mario.changeAnimation(\"running\",MarioRunning);\n\n score=0;\n\n monsterGroup.destroyEach();\n\n \n}", "function resetAll() {\n credits = 1000;\n winnerPaid = 0;\n jackpot = 5000;\n turn = 0;\n bet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n\n showPlayerStats();\n}", "function resetBoard() {\n\t\"use strict\";\n\t// Mark all cells as empty and give default background.\n\tfor (var i = 0; i < size; i++) {\n\t\tfor (var j = 0; j < size; j++) {\n\t\t\tvar cell = getCell(i, j);\n\t\t\tcell.style.backgroundColor = background;\n\t\t\tcell.occupied = false;\n\t\t\tcell.hasFood = false;\n\t\t}\n\t}\n\t// Reset snake head node.\n\tsnakeHead = null;\n\t// Reset curent direction.\n\tcurrDirection = right;\n\t// Reset direction lock.\n\tdirectionLock = false;\n\t// Reset difficulty level.\n\tmoveInterval = difficultyLevels[level];\n\t// Reset points and time.\n\tpoints = -10;\n\taddPoints();\n\ttime = 0;\n\t// Reset countdown label\n\t$(\"#countdown\").html(\"The force is strong with this one...\");\n}", "function reset() {\n\n // Reset the variable storing the current time remaining to its initial value\n _timeRemaining = _timeTotal;\n _hasPlayerMoved = false;\n\n // Release the player's character if it has been frozen in place\n unfreezePlayer();\n\n // Inform other code modules to reset themselves to their initial conditions\n Frogger.observer.publish(\"reset\");\n }", "function reset() {\n\tcardsContainer.innerHTML = \"\";\n\n\t//Call startGame to create new cards\n\tstartGame();\n\t\n\t//Reset any related variables like matchedCards\n\tmatchedCards = [];\n\topenedCards = [];\n\n\tmoves = 0;\n\tmovesContainer.innerHTML = 0;\n\n\tstarsContainer.innerHTML = star + star + star;\n\n\tresetTimer();\n\tstopTimer();\n\n\tshuffle(icons);\n}", "function reset() {\n setSeconds(0);\n setIsActive(false);\n }", "function reset() {\n clear();\n initialize(gameData);\n }", "function reset(){\n trainName = \"\";\n destination = \"\";\n startTime = \"\";\n frequency = 0;\n}", "function resetDefault(){\n fillDefault();\n}", "function resetEverything(){\n resetImages();\n resetPlay();\n resetPause();\n }", "function reset() {\n timesPlayed = -1;\n right = 0;\n wrong = 0;\n startGame ();\n }", "function resetEverything() {\n coords = [];\n cellMap = new Map();\n showMaze = false;\n showSoln = false;\n solnSet = [];\n countMoves = 0;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n user = new User();\n}", "function reset() {\n x = 20;\n y = 35;\n level = 1;\n lost = false;\n won =false;\n game = false;\n loseColor =0;\n winColor=1;\n}", "function reset()\n\t\t{\n\t\t\tif(sw != 0)\n\t\t\t{\n\t\t\t\tsw = 0;\n\t\t\t\tmouse = 0;\n\t\t\t\tmotionDialog('total', sw);\n\t\t\t}\n\n\t\t\ti = 0;\n\t\t\tclearInterval(timer);\n\t\t\t$(\"#dadmin\").animate({\"left\":\"48px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dprogram\").animate({\"left\":\"161px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#ddesign\").animate({\"left\":\"286px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dmedia\").animate({\"left\":\"406px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dproject\").animate({\"left\":\"513px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dphoto\").animate({\"left\":\"633px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#ddeload\").animate({\"left\":\"766px\", \"top\":\"530px\"}, \"slow\");\n\t\t\t$(\".match\").css(\"z-index\", \"2\");\n\t\t}", "function resetGame() {\n // reset the global variables\n cardsCollected = [];\n DeckOfCards = [];\n cardOneElement = null;\n cardTwoElement = null;\n startTime = null;\n currentTurn = 0;\n gameWon = false;\n seconds = 0;\n moves = 0;\n stars = 3;\n}", "function reset(){\n score=0;\n gameTime=0;\n updateScore();\n}", "function reset()\n {\n _pos = {};\n _first = false;\n _fingers = 0;\n _distance = 0;\n _angle = 0;\n _gesture = null;\n }", "function reset() {\n // noop\n }", "reset() {\n this.board.reset();\n this.nextPlayer = x;\n this.winner = ' '; // needs to be like this (recursion)\n this.history = [];\n\n this.valid_plays = this.board.all_valid_plays();\n }", "function resetActions(){\n report('resetActions ran');\n SCORE=0;\n QUESTION=0;\n RAND = [];\n updateScore();\n updateQuestion();\n clearAnswers();\n randomGenerator();\n}", "function resetGame() {\n clearGameCards();\n resetMoves();\n resetTimer();\n}", "function reset() {\n time = 120;\n gameRun = false;\n }", "resetGame() {\n\t\t//stop game\n\t\tthis.running = false\n\t\tclearInterval(this.loop);\n\n\t\t//set original values\n\t\tthis.aliens = [1, 3, 5, 7, 9, 23, 25, 27, 29, 31];\n\t\tthis.direction = 1;\n\t\tthis.ship = [104, 114, 115, 116];\n\t\tthis.missiles = [];\n\t\tthis.level = 1;\n\t\tthis.currentLevel = 1;\n\t\tthis.speed = 512;\n\t\tthis.score = 0;\n\n\t\tconsole.log(\"Game reset.\");\n\t}", "function NewGameReset(){\n\t\tconsole.log(\"Game Reset\");\n\n\t\t\n\t\t//Clear Score value and color\n\t\tUtil.one(\"#score\").innerHTML = 0;\n\t\tUtil.one(\"#points\").setAttribute(\"class\", \"grey_background\");\n\t\tUtil.one(\"#score\").setAttribute(\"class\", \"grey_background\");\n\t\tUtil.one(\"#point_text\").setAttribute(\"class\", \"grey_background\");\n\t\t\n\t\t\n\t\t//Reset all event flags\n\t\tcrushing_in_progress = false;\n\t\tshowing_hint = true;\n\t\tlastmove = new Date().getTime();\n\t\t\n\t\t\n}", "reset() {\n\t\t// Keys\n\t\tthis.keys \t\t= {};\n\n\t\t// State\n\t\tthis.state \t\t= \"\";\n\n\t\t// Score\n\t\tthis.score \t\t= 0;\n\n\t\t// Health\n\t\tthis.health \t= 100;\n\t}", "function resetGame() {\n resetClockAndTime();\n resetMoves();\n resetStars();\n initGame();\n activateCards();\n startGame();\n}", "function resetGame() {\n\n // reset the matched cards array\n matchedCards = [];\n // shuffle cards\n cards = shuffle(cards);\n // remove all classes from each card\n removeClasses();\n // reset moves\n moves = 0;\n counter.innerHTML = moves;\n // reset rating\n for (var i = 0; i < stars.length; i++) {\n stars[i].style.visibility = \"visible\";\n }\n // reset timer\n resetTimer();\n // start timer\n startTimer();\n}", "function reset() {\n playerOneScore = 0;\n playerTwoScore = 0;\n updateScoreDisplay( \"playerOne\" );\n updateScoreDisplay( \"playerTwo\" );\n setMaxScore( 5 );\n playerOneScoreDisplay.classList.remove( \"winner\" );\n playerTwoScoreDisplay.classList.remove( \"winner\" );\n}", "function resetAll() {\n flippedCards = [];\n matchedCards = [];\n timerOff = true;\n stopTime();\n clearTime();\n resetCards();\n resetMoves();\n resetStars();\n}", "function Reset() {\n boxesTaken = 0;\n won = false;\n displayMessage = false;\n twoNoMovesInARow = 0;\n initializeBoard();\n}", "function resetValues()\n{\n\t//empty cell counter\n\tcounter = 0;\n\n\t//All the cell entries\n\tstar[0] = 0;\n\tstar[1] = 0;\n\tstar[2] = 0;\n\tstar[3] = 0;\n\tstar[4] = 0;\n\tstar[5] = 0;\n\tstar[6] = 0;\n\tstar[7] = 0;\n\tstar[8] = 0;\n\n\t//Winner array\n\twinnerArray[0] = -1;\n\twinnerArray[1] = -1;\n\twinnerArray[2] = -1;\n\n\tgameWinner = 0;\n\n\t//Reset the cell images\n\t$('.gameCell').css('background-color', 'white');\n\t$('.gameCell').css('background-image', '');\n\n\t\n}", "function reset() {\r\n // noop\r\n }", "reset() {\n this.playerContainer.players.forEach(x => x.clearHand())\n this.winner = undefined;\n this.incrementState();\n this.clearSpread();\n this.deck = new Deck();\n this.clearPot();\n this.clearFolded();\n }", "reset() {\n this.yPos = this.groundYPos;\n this.jumpVelocity = 0;\n this.jumping = false;\n this.ducking = false;\n this.update(0, Trex.status.RUNNING);\n this.midair = false;\n this.speedDrop = false;\n this.jumpCount = 0;\n this.crashed = false;\n }", "function resetGame() {\n // Position of prey and player will reset\n setupPrey();\n setupPlayer();\n // movement and speed of prey will reset\n movePrey();\n // sound will replay\n nightSound.play();\n // Size and color of player will reset\n playerRadius = 20;\n firegreen = 0;\n // score will reset\n preyEaten = 0;\n // prey speed will reset\n preyMaxSpeed = 4\n // All of this when game is over\n gameOver = false;\n}", "function reset() {\n\t$snake.off(\"keydown\");\n\tdeleteSnake();\n\t\n\tmakeSnake();\n\tupdateScores();\n\tassignKeys();\n\tplayGame();\n}", "function reset(){\n\t\tquestionIndex = 0;\n\t\toptionIndex = 0;\n\t\t$(\"#option0, #option1, #option2, #option3\").show();\n\t\t$('#timeclock').show();\n\t\ttime();\n\t\tunanswered = 0;\n\t\twrongoption = 0;\n\t\ttotalscore = 0;\n\t\tgamestart();\n\t}", "function resetGame() {\n gameStart();\n stopTimer();\n resetStars();\n resetCards();\n moves = 0;\n movesText.innerHTML = '0';\n second = 0;\n minute = 0;\n hour = 0;\n clock.innerHTML = '0:00';\n}", "function resetGame () { \n\t\t\t\t\t\t\tblueNum = 0;\n\t\t\t\t\t\t greenNum = 0;\n\t\t\t\t\t\t\tredNum = 0;\n\t\t\t\t\t\t\tyellowNum = 0;\n\t\t\t\t\t\t scoreResult=0;\n\t\t\t\t\t\t\ttargetScore = 0;\n\t\t\t\t\t\t\tgetNumber(); // Restart the game and assigns new traget number\n\t\t\t\t\t\t\tscoreBoard(); // Update the score board with new values.\n\t\t}", "resetDefaults() {\n this.checked = false;\n this.blocked = false;\n this.start = false;\n this.inShortestPath = false;\n this.end = false;\n }", "function reset() {\n //RESET EVERYTHING\n console.log(\"RESETTING\")\n entering = 0;\n leaving = 0;\n a = 0;\n b = 0;\n}", "function resetGame() {\n matched = 0;\n resetTimer();\n resetMoves();\n resetStars();\n resetCards();\n shuffleDeck();\n}", "resetState() {\n this._movements = 0;\n }", "function reset() {\n target.moodScore = 0;\n target.healthScore = 100;\n target.hits = 0;\n modsTotal = 0\n target.healthHelps = [];\n foodCount = 0;\n waterCount = 0;\n coffeeCount = 0;\n scoreDraw();\n loseElement.classList.remove(\"end-game\");\n loseElement.textContent = `Stella has had just a little too much de-stressing. Time for her to sleep so she can start over.`;\n}", "function reset() {\n\t\tplayerCtx.clearRect(0, 0, 512, 480);\n ctx.clearRect(0,0,512,480);\n color.clearRect(0,0,512,480);\n\t\tplayer1 ={\n\t\t\tspeed: 256, // movement in pixels per second\n\t\t\tx: 16,\n\t\t\ty: 16,\n\t\t\tpaint: true,\n\t\t\tscore: 0,\n\t\t\tdead: false\n\t\t};\n\t\tplayer2 = {\n\t\t\tspeed: 256,\n\t\t\tx: 60,\n\t\t\ty: 60,\n\t\t\tpaint: true,\n\t\t\tscore: 0,\n\t\t\tdead: false\n\t\t};\n\t\tdocument.getElementById('red-results').innerHTML = '';\n\t\tdocument.getElementById('green-results').innerHTML = '';\n\t\tdocument.getElementById('winner').innerHTML = '';\n\t}", "function reset()\n {\n Parameters.container = $.extend(true, {}, defaultContainer);\n Parameters.counter = 0;\n Parameters.timeId = null;\n }", "function reset() {\n graphics.clearAll();\n for (var i = 0; i < grid.length; i++) {\n for (var j = 0; j < grid[i].length; j++) {\n $(\"#\" + grid[i][j]).parent().removeClass(\"red\");\n squares[grid[i][j]] = \"empty\";\n p2Move = false;\n }\n }\n timesPlayed = 0;\n $(\"#screen3\").children().hide();\n $(\"#screen1\").children().show();\n talker.notice(\"start up\");\n}", "function reset () {\n stopTimerAndResetCounters();\n setParamsAndStartTimer(currentParams);\n dispatchEvent('reset', eventData);\n }", "function reset_all(){\n input = \"\";\n result = \"0\";\n history = \"0\";\n answer = \"\";\n setResult(\"0\");\n setHistory(\"0\");\n }", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function resetme(){\n\tinitiateBoard();\n\tmode=0;\n\tdisplay(0);\n}", "function reset() {\n userData.t = 0.0;\n userData.done = false;\n userData.lastBits = bits1;\n }", "function reset() {\n document.querySelector(\".infinity-type-area\").disabled = true;\n document.querySelector(\".start\").disabled = false;\n document.querySelector(\".start\").style.backgroundColor =\n \"var(--primary-color)\";\n document.querySelector(\".start\").style.cursor = \"pointer\";\n document.querySelector(\".infinity-type-area\").style.borderColor = \"#A1A1AA\";\n clearInterval(clocking);\n document.querySelector(\".infinity-min\").innerText = \"00\";\n document.querySelector(\".infinity-sec\").innerText = \"00\";\n min = 0;\n sec = 0;\n document.querySelector(\".infinity-type-area\").value = \"\";\n document.querySelector(\"#timer-wpm-inf\").innerText = \"0\";\n document.querySelector(\"#timer-cpm-inf\").innerText = \"0\";\n document.querySelector(\"#timer-accuracy-inf\").innerText = \"0\";\n document.querySelector(\".infinity-user-type\").innerText = samples[random];\n}", "function reset() {\n\tupdateWins();\n\tremaining();\n\tanswer();\n}", "function reset() {\n setGuesses([]);\n setGuess(\"\");\n setHints([]);\n setStatus(\"\");\n setSecret(generateSecret);\n }", "function reset() {\n chessboard = new Set();\n for(i = 0; i < 9; i++) {\n chessboard.add(i);\n place(i, \"\");\n }\n playerO = new Set();\n playerX = new Set();\n lock = false;\n setState(\"YOUR TURN\");\n}", "function reset() {\n setPieces(round);\n }", "function reset() {\n player.activeMods.splice(0);\n totalPts = 0;\n activeModRate = 0;\n for (const key in mods) {\n if (mods.hasOwnProperty(key)) {\n const element = mods[key];\n element.qty = 0;\n element.available = false;\n element.cost = element.resetCost;\n }\n }\n updateMods();\n drawModTotals();\n drawModButtons();\n drawTotalScore();\n drawActiveModRate();\n drawRank();\n}", "function reset(){\n $(':input').val('');\n $(\"#clock\").text('00:00');\n checkArr = [];\n score = 0;\n }", "function resetear() {\n eliminarIntegrantesAnteriores();\n ocultarbotonCalculo();\n ocultarIntegrantes();\n ocultarTextoResultado();\n vaciarValorInput();\n}", "function reset(){\r\n winnerRound.id = \"score-descr\";\r\n winnerRound.textContent = \"start playing\";\r\n score.textContent = \"0 : 0\";\r\n playerPoints = 0;\r\n computerPoints = 0;\r\n buttons.forEach(btn => btn.disabled = false);\r\n resetBtn.textContent = \"RESET\";\r\n}", "function reset(){\n sendObj.Player = null;\n sendObj.Board = [[\"white\", \"white\",\"white\"], [\"white\", \"white\",\"white\"], [\"white\", \"white\",\"white\"]];\n sendObj.info = \"\";\n Players = [];\n turn = 0;\n sendObj.movingString.visible = false;\n sendObj.movingString.word = \"\";\n}", "function resetGame() {\n account.score = 0;\n account.lines = 0;\n account.level = 0;\n board.reset();\n time = { start: 0, elapsed: 0, level: LEVEL[account.level] };\n}", "function reset() {\n round = 0;\n global_nums = [];\n history = [];\n germanProvinces = [];\n britishProvinces = [];\n fleets = [];\n gold = 275;\n points = 0;\n goldPerTurn = 0;\n guessedNums=[];\n }", "function reset() {\n frc = false;\n load(DEFAULT_POSITION);\n }", "reset(){\n this.isFiring = false;\n this.y = 431;\n }", "reset() {\n this.isFiring = false;\n this.y = 431;\n }", "function resetAll() {\n\t\ttimers.forEach(function(timer){\n\t\t\ttimer.reset();\n\t\t});\n\t\tcrewSet();\n\t\tloadCrews();\t\t\n\t\tstation2.noCrew();\n\t\tstation3.noCrew();\t\t\n\t\t$(\"#next\").prop(\"disabled\", false);\n\t\t$(\"#go\").prop(\"disabled\", false);\n\t\t$(\".play\").prop(\"disabled\", false);\n\t\t$(\"#pauseAll\").prop(\"disabled\", true);\t\n\t\t$(\"#add-min-button\").prop(\"disabled\", false);\t\n\t}", "reset(){\n this.playing = false;\n this.die = 0;\n this.players[0].spot = 0;\n this.players[1].spot = 0;\n this.currentTurn.winner = false;\n this.currentSpot = null;\n this.spot = null;\n this.currentTurn = this.players[0];\n \n }", "function resetGame() {\n\tresetClockAndTime();\n\tresetMoves();\n\tresetStars();\n\tshuffleDeck();\n\tresetCards();\n\tmatched = 0;\n\ttoggledCards = [];\n}", "function reset() {\r\n firstMove = true;\r\n secondMove = true;\r\n turnX = false;\r\n turnO = false;\r\n pPosArr = [];\r\n aiPosArr = [];\r\n ai_Id, playerId;\r\n endGame = false;\r\n winner = undefined;\r\n nextMove = false;\r\n check = 0;\r\n \r\n $(\"#a1\").text(\"\");\r\n $(\"#a2\").text(\"\");\r\n $(\"#a3\").text(\"\");\r\n $(\"#b1\").text(\"\");\r\n $(\"#b2\").text(\"\");\r\n $(\"#b3\").text(\"\");\r\n $(\"#c1\").text(\"\");\r\n $(\"#c2\").text(\"\");\r\n $(\"#c3\").text(\"\");\r\n $(\"#a1\").css(\"color\", \"white\");\r\n $(\"#a2\").css(\"color\", \"white\");\r\n $(\"#a3\").css(\"color\", \"white\");\r\n $(\"#b1\").css(\"color\", \"white\");\r\n $(\"#b2\").css(\"color\", \"white\");\r\n $(\"#b3\").css(\"color\", \"white\");\r\n $(\"#c1\").css(\"color\", \"white\");\r\n $(\"#c2\").css(\"color\", \"white\");\r\n $(\"#c3\").css(\"color\", \"white\");\r\n // reset changes made to #game after winning \r\n $(\"#game\").css(\"margin-top\", \"100px\");\r\n $(\"#displayWinner\").text(\"\");\r\n $(\"#restartCounter\").css(\"display\", \"none\");\r\n $(\"#currentPlayer\").css(\"display\", \"block\");\r\n }", "function reset()\n\t{\n\t\tsetValue('')\n\t}", "function reset(){\n GMvariables.devil = false;\n GMvariables.interval = 2000;\n GMvariables.timerSecs = 2; \n GMvariables.points = 0;\n GMvariables.live = 10;\n}", "function resetGame () {\n resetBricks ();\n store.commit ('setScore', 0);\n store.commit ('setLives', 3);\n resetBoard ();\n draw ();\n}", "function reset () {\n noty.clear();\n resetTimeout();\n }", "function reset (){\n $(\".card\").removeClass(\"match\").removeClass(\"open\").removeClass(\"show\");\n document.getElementById(\"numberMoves\").innerText = 0;\n $(container).addClass(\"fa fa-star\");\n list_cards = shuffle(list_cards);\n shuffle_cards(list_cards);\n match_list = [];\n document.getElementById(\"minutes\").innerHTML='00';\n document.getElementById(\"seconds\").innerHTML='00';\n click = false;\n clearInterval(countDown);\n}", "function resetGame() {\n deck.innerHTML = '';\n openCards = [];\n matchedCards = [];\n moves = 0;\n clickCounter = 0;\n clearInterval(timer);\n seconds = 0;\n minutes = 0;\n timer = 0;\n time.textContent = '00:00';\n generateStar(starsLost);\n starsLost = 0;\n initGame();\n}" ]
[ "0.8027952", "0.7669807", "0.76210487", "0.7611284", "0.7604743", "0.76007974", "0.7590081", "0.7580365", "0.75753236", "0.7570899", "0.752332", "0.7498892", "0.74797004", "0.7467668", "0.743186", "0.7416143", "0.7406773", "0.7398435", "0.7393521", "0.738837", "0.7373027", "0.7357773", "0.7349641", "0.73446673", "0.73417974", "0.73351413", "0.7334458", "0.73302346", "0.73173344", "0.73109984", "0.73083663", "0.730132", "0.7301054", "0.7301012", "0.7296555", "0.728401", "0.728028", "0.7279042", "0.7271089", "0.72582155", "0.7251244", "0.7248091", "0.72455513", "0.7239311", "0.72259843", "0.7224383", "0.7217037", "0.7216017", "0.72144645", "0.7213064", "0.72099656", "0.7209965", "0.7209747", "0.7187647", "0.71856844", "0.71853167", "0.7177308", "0.71763813", "0.71632034", "0.7157265", "0.7149867", "0.7145556", "0.7144879", "0.71361154", "0.71315604", "0.7125813", "0.71255046", "0.7124128", "0.7122076", "0.7120286", "0.71171856", "0.71108866", "0.71038043", "0.70951", "0.7095035", "0.70941436", "0.7093411", "0.7091131", "0.7087719", "0.7084519", "0.708142", "0.70696586", "0.7066449", "0.7065331", "0.70605665", "0.7057236", "0.70555437", "0.7055117", "0.7049007", "0.7048047", "0.7045506", "0.70452756", "0.7044702", "0.704342", "0.70425445", "0.7039165", "0.70385677", "0.7033817", "0.7024818", "0.7020424" ]
0.7133154
64
>>>>>> bug <<<<<customerList refresh
function PurchaseSimilarInventory() { const { setTopHeading } = useContext(TopBarContext); const [flow, setFlow] = useState("basic"); const [calculate, setCalculate] = useState(false); const [datecalculate, setDateCalculate] = useState(false); const [calnum, setCalnum] = useState(-1); const thebval = { purchtype: "", vendor: "", invnumber: "", invdate: "", location: "Trivandrum", invtype: "", gstno: "", panno: "", aadharno: "", purchlocation: "Local", }; const [basevalues, setBaseValues] = useState(thebval); const invdetails = { type: "", name: "", // assetsIdHistory: "", // assetId: "", sno: "", condition: "Good", taxcategory: "", taxperc: "", rate: "", igst: "0", cgst: "0", sgst: "0", nettax: "0", amount: "0", tcs: "0", invamount: "0", wty: "", expirydate: "", //------------------------- purchtype: "", vendor: "", invnumber: "", invdate: "", location: "", invtype: "", gstno: "", panno: "", aadharno: "", purchlocation: "", brand:"", model:"", systype:"part", //------- caseId:"", }; const [values, setValues] = useState([invdetails]); const [err, setErr] = useState({ type: "", name: "", sno: "", condition: "", location: "", invnumber: "", }); const submitItems = async () => { if (values.name === "" || values.sno === "" || values.invnumber === "") { // setIsReqFieldModal(true); console.log("missing inputs"); return; } console.log("Submission Start"); const newitems = [...values]; newitems.map((item) => { item.purchtype = basevalues.purchtype; item.vendor = basevalues.vendor; item.invnumber = basevalues.invnumber; item.invdate = basevalues.invdate; item.location = basevalues.location; item.invtype = basevalues.invtype; item.gstno = basevalues.gstno; item.panno = basevalues.panno; item.aadharno = basevalues.aadharno; item.purchlocation = basevalues.purchtype; }); console.log(newitems); await Axios({ url: `${API}/inventory/${Emp.getId()}/createitems`, method: "POST", data: newitems, }) .then((data) => { console.log("Added", data._id); // setIsReviewModalOpen(true); setValues([invdetails]); setBaseValues(thebval); setErr({ type: "", name: "", sno: "", condition: "", location: "", invnumber: "", }); }) .catch((err) => { console.log("err", err); setErr({ ...err }); }); }; // ----------------------Heading Use Effect------------- useEffect(() => { setTopHeading("Purchase Similar Inventory"); return () => { setTopHeading(""); }; }, []); // ------------------- Calculations---------------------------------- useEffect(() => { // console.log("hello"); // console.log(calnum); let newlist = [...values]; if (basevalues.purchlocation == "Local" && calnum != -1) { newlist[calnum].sgst = parseInt(newlist[calnum].rate) * (parseInt(newlist[calnum].taxperc) / 200); newlist[calnum].cgst = parseInt(newlist[calnum].rate) * (parseInt(newlist[calnum].taxperc) / 200); newlist[calnum].nettax = parseInt(newlist[calnum].sgst) + parseInt(newlist[calnum].cgst); newlist[calnum].amount = parseFloat(newlist[calnum].rate) + parseFloat(newlist[calnum].nettax); // setValues(newlist); } else if (calnum != -1) { newlist[calnum].igst = parseInt(newlist[calnum].rate) * (parseInt(newlist[calnum].taxperc) / 100); newlist[calnum].nettax = newlist[calnum].igst; newlist[calnum].sgst = 0; newlist[calnum].cgst = 0; newlist[calnum].amount = parseFloat(newlist[calnum].rate) + parseFloat(newlist[calnum].nettax); // setValues(newlist); } if (calnum != -1) { newlist[calnum].tcs = parseFloat(newlist[calnum].amount) * 0.001; newlist[calnum].invamount = parseFloat(newlist[calnum].amount) + parseFloat(newlist[calnum].tcs); newlist[calnum].expirydate = moment().format("DD-MM-YYYY"); } setValues(newlist); return () => { console.log("Calculations done!"); }; }, [calculate]); // const handleChange = (name) => (e) => { // setValues({ ...values, [name]: e.target.value }); // }; // ---------Date Calculations ------------ useEffect(() => { // console.log("hello"); // console.log(calnum); let newlist = [...values]; if (calnum != -1) { switch (newlist[calnum].wty) { case "3M": newlist[calnum].expirydate = moment() .add(3, "M") .format("DD-MM-YYYY"); break; case "6M": newlist[calnum].expirydate = moment() .add(6, "M") .format("DD-MM-YYYY"); break; case "1Y": newlist[calnum].expirydate = moment() .add(1, "Y") .format("DD-MM-YYYY"); break; case "2Y": newlist[calnum].expirydate = moment() .add(2, "Y") .format("DD-MM-YYYY"); break; case "3Y": newlist[calnum].expirydate = moment() .add(3, "Y") .format("DD-MM-YYYY"); break; case "4Y": newlist[calnum].expirydate = moment() .add(4, "Y") .format("DD-MM-YYYY"); break; case "5Y": newlist[calnum].expirydate = moment() .add(5, "Y") .format("DD-MM-YYYY"); break; default: break; } } setValues(newlist); return () => { console.log("Calculations done!"); }; }, [datecalculate]); const handleBaseChange = (name) => (e) => { setBaseValues({ ...basevalues, [name]: e.target.value }); }; // const ReviewSubmit = () => { // return ( // <> // <Modal // isOpen={isReviewModalOpen} // onClose={() => setIsReviewModalOpen(false)} // > // <ModalHeader>Information updated Successfully!</ModalHeader> // <ModalBody></ModalBody> // <ModalFooter> // <Button // className="w-full sm:w-auto" // // onClick={() => setIsReviewModalOpen(false)} // onClick={() => setIsReviewModalOpen(false)} // > // Okay! // </Button> // </ModalFooter> // </Modal> // </> // ); // }; // const ReqFieldErrModal = () => { // return ( // <> // <Modal // isOpen={isReqFieldModal} // onClose={() => setIsReqFieldModal(false)} // > // <ModalHeader>Required fields are not filled!</ModalHeader> // <ModalBody></ModalBody> // <ModalFooter> // <Button // className="w-full sm:w-auto" // onClick={() => setIsReqFieldModal(false)} // > // Okay! // </Button> // </ModalFooter> // </Modal> // </> // ); // }; // Basic Form const BasicForm = () => { return ( <div className="px-4 py-3 mt-4 mb-2 bg-white rounded-lg shadow-md dark:bg-gray-800"> <Label className="font-bold"> <span>Purchase Information</span> </Label> <hr className="mb-5 mt-2" /> {/* -----Row 1 --------- */} <div className="flex-row flex space-x-3"> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Purchase Type*</span> <Input className="mt-1" type="text" value={basevalues.purchtype} onChange={handleBaseChange("purchtype")} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Vendor Name*</span> <Input className="mt-1" type="text" value={basevalues.vendor} onChange={handleBaseChange("vendor")} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Invoice Number*</span> <Input className="mt-1" type="text" value={basevalues.invnumber} onChange={handleBaseChange("invnumber")} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Invoice Date*</span> <Input className="mt-1" type="date" value={basevalues.invdate} onChange={handleBaseChange("invdate")} /> </Label> </div> </div> {/* ------------------------Row 2-------------------------- */} <div className="flex-row flex space-x-3"> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Location*</span> <Select className="mt-1" onChange={(e) => { setBaseValues({ ...basevalues, location: e.target.value }); }} > <option value="Trivandrum">Trivandrum</option> <option value="Kottayam">Kottayam</option> <option value="Kozhikode">Kozhikode</option> </Select> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Invoice Type*</span> <Input className="mt-1" type="text" value={basevalues.invtype} onChange={handleBaseChange("invtype")} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>GST Number*</span> <Input className="mt-1" type="text" value={basevalues.gstno} onChange={handleBaseChange("gstno")} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Pan No*</span> <Input className="mt-1" type="text" value={basevalues.panno} onChange={handleBaseChange("panno")} /> </Label> </div> </div> {/* -------------------------ROw 3-------------------- */} <div className="flex-row flex space-x-3"> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Aadhar No*</span> <Input className="mt-1" type="text" value={basevalues.aadharno} onChange={handleBaseChange("aadharno")} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Purchase Location*</span> <Select className="mt-1" onChange={(e) => { setBaseValues({ ...basevalues, purchlocation: e.target.value, }); let newlist = [...values]; newlist.map((item, i) => { item.taxcategory = ""; item.taxperc = ""; }); setValues([invdetails]); }} > <option value="Local">Local</option> <option value="IGST">IGST</option> </Select> </Label> </div> </div> </div> ); }; const ItemForm = (num) => { return ( <div className="px-4 py-3 my-2 bg-white rounded-lg shadow-md dark:bg-gray-800"> <Label className="font-bold"> <span>Item Number : {num + 1},<span className="ml-10"> Net Tax:{values[num].nettax} ,Invoice Amount: {values[num].invamount} </span> </span> </Label> <hr className="mb-5 mt-2" /> {/* ------------------------Row 1-------------------------- */} <div className="flex-row flex space-x-3"> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Select Type*</span> <Select className="mt-1" onChange={(e) => { let newlist = [...values]; newlist[num].systype = e.target.value; setValues(newlist); }} > <option value="part" selected > Part </option> <option value="system">System</option> </Select> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Select Category*</span> <Select className="mt-1" onChange={(e) => { let newlist = [...values]; newlist[num].type = e.target.value; setValues(newlist); }} > <option value="" selected disabled> Select Category </option> {values[num].systype=="part"?<> <option value="Mouse">Mouse</option> <option value="Keyboard">Keyboard</option> <option value="Monitor">Monitor</option> <option value="Cpu">Cpu</option> <option value="Ram">Ram</option> <option value="Fan">Fan</option> <option value="Motherboard">Motherboard</option> <option value="SMPS">SMPS</option> <option value="HDD">HDD</option> <option value="GCard">Gcard</option> <option value="EnetCard">Enet Card</option> <option value="SerialCard">Serial Card</option> <option value="ParalellCard">Paralell Card</option> <option value="OpticalDrive">Optical Drive</option> <option value="Others">Others</option> </>:<> <option value="console">Console</option> <option value="DMP">DMP</option> <option value="inkjet">Inkjet</option> <option value="KVM">KVM</option> <option value="laptop">Laptop</option> <option value="laser">Laser</option> <option value="LMP">LMP</option> <option value="module">Module</option> <option value="router">Router</option> <option value="scanner">Scanner</option> <option value="server">Server</option> <option value="desktop">Desktop</option> <option value="storage">Storage</option> <option value="switch">Switch</option> <option value="UPS">UPS</option> <option value="others">Others</option> </>} </Select> </Label> </div> {values[num].systype=="part"? <> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Product Name*</span> <Input className="mt-1" type="text" value={values[num].name} onChange={(e) => { let newlist = [...values]; newlist[num].name = e.target.value; setValues(newlist); }} /> </Label> <HelperText valid={false}>{err.name}</HelperText> </div> </> :<> <> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Brand*</span> <Input className="mt-1" type="text" value={values[num].brand} onChange={(e) => { let newlist = [...values]; newlist[num].brand = e.target.value; setValues(newlist); }} /> </Label> <HelperText valid={false}>{err.brand}</HelperText> </div> </> <> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Model*</span> <Input className="mt-1" type="text" value={values[num].model} onChange={(e) => { let newlist = [...values]; newlist[num].model = e.target.value; setValues(newlist); }} /> </Label> <HelperText valid={false}>{err.name}</HelperText> </div> </> </> } <div className="flex flex-col w-full"> <Label className="w-full"> <span>Serial Number*</span> <Input className="mt-1" type="text" value={values[num].sno} onChange={(e) => { let newlist = [...values]; newlist[num].sno = e.target.value; setValues(newlist); }} /> </Label> <HelperText valid={false}>{err.sno}</HelperText> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Select Condition*</span> <Select className="mt-1" onChange={(e) => { let newlist = [...values]; newlist[num].condition = e.target.value; setValues(newlist); }} > <option value="Good">Good</option> <option value="Bad">Bad</option> </Select> </Label> </div> </div> {/* -------------Row 2 --------- */} <div className="flex-row flex space-x-3"> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Warranty*</span> <Select className="mt-1" value={values[num].wty} onChange={(e) => { let newlist = [...values]; newlist[num].wty = e.target.value; setValues(newlist); setCalnum(num); setDateCalculate(!datecalculate); }} > <option value="" selected disabled> Select Category </option> <option value="3M">3 Months</option> <option value="6M">6 Months</option> <option value="1Y">1 Year</option> <option value="2Y">2 Year</option> <option value="3Y">3 Year</option> <option value="4Y">4 Year</option> <option value="5Y">5 Year</option> </Select> </Label> </div> <> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Expiry Date</span> <Input className="mt-1" type="text" value={values[num].expirydate} readOnly={true} /> </Label> <HelperText valid={false}>{err.name}</HelperText> </div> </> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Tax Category*</span> <Select className="mt-1" value={values[num].taxcategory} onChange={(e) => { let newlist = [...values]; let thestring = e.target.value; let theperc = thestring.slice(-3, -1); newlist[num].taxcategory = e.target.value; newlist[num].taxperc = theperc; setValues(newlist); // calculate trigger setCalnum(num); setCalculate(!calculate); }} > {basevalues.purchlocation == "Local" ? ( <> <option value="" selected disabled> Select Tax Category </option> <option value="GST 18%">GST 18%</option> <option value="GST 28%">GST 28%</option> </> ) : ( <> <option value="" selected disabled> Select Tax Category </option> <option value="IGST 18%">IGST 18%</option> <option value="IGST 28%">IGST 28%</option> </> )} </Select> </Label> </div> {/* <div className="flex flex-col w-full"> <Label className="w-full"> <span>Tax Percentage*</span> <Input className="mt-1" type="text" readOnly="true" value={values[num].taxperc} /> </Label> <HelperText valid={false}>{err.invnumber}</HelperText> </div> */} <div className="flex flex-col w-full"> <Label className="w-full"> <span>Rate*</span> <Input className="mt-1" type="text" value={values[num].rate} onChange={(e) => { let newlist = [...values]; newlist[num].rate = e.target.value; setValues(newlist); setCalnum(num); setCalculate(!calculate); }} /> </Label> </div> </div> {/* --------Row 4 ------------- */} {/* <div className="flex-row flex space-x-3 my-2"> {basevalues.purchlocation == "Local" ? ( <> {" "} <div className="flex flex-col w-full"> <Label className="w-full"> <span>CGST*</span> <Input className="mt-1" type="text" readOnly="true" value={values[num].cgst} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>SGST*</span> <Input className="mt-1" type="text" readOnly="true" value={values[num].sgst} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Net Tax*</span> <Input className="mt-1" type="text" readOnly="true" value={values[num].nettax} /> </Label> </div> </> ) : ( <> {" "} <div className="flex flex-col w-full"> <Label className="w-full"> <span>IGST</span> <Input className="mt-1" type="text" readOnly="true" value={values[num].igst} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Net Tax*</span> <Input className="mt-1" type="text" readOnly="true" value={values[num].nettax} /> </Label> </div> </> )} </div> */} {/* ----row 4------ */} {/* <div className="flex-row flex space-x-3"> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Amount</span> <Input className="mt-1" type="text" value={values[num].amount} onChange={(e) => { let newlist = [...values]; newlist[num].amount = e.target.value; setValues(newlist); }} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>TCS</span> <Input className="mt-1" type="text" value={values[num].tcs} onChange={(e) => { let newlist = [...values]; newlist[num].amount = e.target.value; setValues(newlist); }} /> </Label> </div> <div className="flex flex-col w-full"> <Label className="w-full"> <span>Invoice Amount</span> <Input className="mt-1" type="text" value={values[num].invamount} onChange={(e) => { let newlist = [...values]; newlist[num].invamount = e.target.value; setValues(newlist); }} /> </Label> </div> </div> */} {/* <Label className="font-bold mt-5 mb-2"> <span>Additional Information</span> </Label> */} {/* <hr /> */} </div> ); }; const BottomCard = () => { return ( <Card className="mb-4 shadow-md "> <CardBody> <div className="flex flex-row flex-wrap"> <Button onClick={() => { let newitem = [...values]; let add = values[0]; console.log(add) newitem.push(add); setValues(newitem); }} aria-label="Notifications" aria-haspopup="true" layout="outline" className=" mx-2 " > Add Item </Button> <Button onClick={() => { let newitem = [...values]; if (newitem[1]) { newitem.pop(); setValues(newitem); } }} aria-label="Notifications" aria-haspopup="true" layout="outline" className=" mx-2 " > Remove Item </Button> <Button onClick={submitItems} aria-label="Notifications" aria-haspopup="true" layout="outline" className=" mx-2 " > Submit </Button> </div> </CardBody> </Card> ); }; return ( <> {BasicForm()} {values.map((item, i) => { return ItemForm(i); })} {BottomCard()} </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCustomerList() {\n\t// TODO: add logic to call backend system\n\n\n}", "function ResetCustomerList() {\n BindOrReloadCustomerTable('Reset');\n}", "get customersList() {\n\t\treturn this._customersList;\n\t}", "function severRefresh(newValue) {\n if (newValue) {\n if (datacontext.updateList().customer()) {\n refreshPage();\n }\n datacontext.completedRefresh();\n }\n }", "setCustomersList(state, payload) {\n state.customersList = payload;\n }", "getListOfCustomers () {\n fetch(this.ROUTING_URL+\"getCustomersList\")\n .then(response=>response.json())\n .then(json=>json.map(c=>[customer(c), false])).then(json=>{\n this.listOfCustomers = json; // assigning json response to list of customer global array.\n const customerListDiv = select(\"customerListView\");\n setAnElementClassToVisible(\"customerListContainer\");//making div visible\n customerListDiv.innerHTML = this.showCustomersResult(); // drawing html table element\n });\n }", "updateCustomer() {\r\n\t\treturn null\r\n\t}", "function renderCustomerList(data) {\n console.log('9');\n if (!data.length) {\n window.location.href = \"/customers\";\n }\n $(\".hidden\").removeClass(\"hidden\");\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createCustomerRow(data[i]));\n }\n customerSelect.empty();\n console.log(rowsToAdd);\n console.log(customerSelect);\n customerSelect.append(rowsToAdd);\n customerSelect.val(customerId);\n }", "set customersList(customersList) {\n\t\treturn this._customersList = customersList;\n\t}", "getCustomersList(state) {\n return state.customersList;\n }", "function updateConnectedUsersListUI() {\n var htmlContent = \"\";\n\n connectedSession.getContactsArray(\"Customer\").forEach((contact) => {\n htmlContent += \"<li>\" + contact.getUsername() + \"</li>\";\n });\n\n document.getElementById(\"connected-customer-list\").innerHTML = htmlContent;\n\n return;\n}", "function customerListSuccess(customers) {\n $.each(customers, function (index, customer) {\n customerAddRow(customer);\n });\n}", "function updatecustomerList(transaction, results) {\n debugger\n //initialise the listitems variable\n var listitems = \"\";\n //get the car list holder ul\n var listholder = document.getElementById(\"datacus\");\n //clear cars list ul\n listholder.innerHTML = \"\";\n //Iterate through the results\n for (var i = 0; i < results.rows.length; i++) {\n //Get the current row\n var row = results.rows.item(i);\n\n listholder.innerHTML += \"<tr>\" + \"<td>\" + row.customerName + \" </td>\" + \"<td>\" + row.Address + \" </td>\" +\n \"<td>\" + row.Mobile + \"</td>\" + \"<td>\" + row.Phone + \" </td>\" +\n \"<td>\" + row.Email + \"</td>\" + \"<td>\" + row.Gender + \" </td>\" +\n \"<td>\" + \"<button type='button' class='btn btn-success btn-sm'>\" +\n \"<i class='bi bi-pencil-square'></i>\" + \"</button>\" +\n \"<a class='btn btn-danger btn-sm' href='javascript:void(0)' role='button' onclick='deletecustomerlist(\" + row.id + \")'><i class='bi bi-trash'></i></a>\"\n + \"</td>\" + \"</tr>\";\n\n }\n\n}", "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, 10, null, null, 'customerPaymentID desc'),\n datacontext.getEntityList(customerList, datacontext.entityAddress.customer, false, null, null, 10, null, null, 'customerID desc'),\n datacontext.getEntityList(achievedlist, datacontext.entityAddress.customer, false, null, where, null, null, null, 'customerID desc')]);\n }", "function getCustomers() {\n console.log('8');\n $.get(\"/api/customers\", renderCustomerList);\n }", "function loadCustomerData(){\n\t\t$.ajax({\n\t\t\tdataType: \"json\",\n type: 'GET',\n data:{},\n url: getAbsolutePath() + \"customer/list\",\n success: function (data) {\n \t$.each(data.list, function( key, value ) {\n \t\tif(value.status == \"Active\")\n \t\t{\n\t $(\"#sltCustomer\").append($('<option>', { \t\n\t value: value.customercode,\n\t text: value.shortname\n\t }));\n \t\t}\n });\n },\n error: function(){\n \t\n }\n\t\t});\n\t}", "function buildCustomerList(data) {\n /* \n * variables that predefined in embedded js in template customerlist.html:\n * row_tmpl\n * empty_row_tmpl\n */\n var htmls = [];\n var list = $('#customer_list');\n var header = $('#clst_header');\n var customers = data.customers;\n if (customers.length > 0) {\n for (var i=0; i<customers.length; i++) {\n var row = row_tmpl.compose({\n 'C_ID': customers[i].id,\n 'NAME_IMG': customers[i].img,\n 'C_FIRST_NAME': customers[i].first_name,\n 'C_LAST_NAME': customers[i].last_name,\n 'C_STATE': customers[i].state,\n 'C_EMAIL': customers[i].email,\n 'C_PHONE': customers[i].phone,\n 'C_CREATED': customers[i].created\n });\n htmls.push(row);\n }\n } else {\n htmls.push(empty_row_tmpl.compose({'COLCNT': data.colcnt}));\n }\n header.after(htmls.join('\\n'));\n list.show();\n load_table_events();\n}", "function loadCustomerFromForDuplicateSize()\n\t{\n\t\t$.ajax({\n\t\t\tdataType: \"json\",\n type: 'GET',\n data:{},\n url: getAbsolutePath() + \"customer/list\",\n success: function (data) {\n\t \t$.each(data.list, function( key, value ) {\n\t \t\tif(value.status == \"Active\")\n\t \t\t{\n\t\t $(\"#sltDuplicateFrom\").append($('<option>', { \t\n\t\t value: value.customercode,\n\t\t text: value.shortname\n\t\t }));\n\t \t\t}\n\t });\n \t\t\n },\n error: function(){ \n \tCanNotGetDataDialogMessageDialog();\n }\n\t\t});\n\t}", "function putCustomers(dt) {\n cust = dt;\n $('.finder_list-customer ul').html('');\n $.each(cust, function (v, u) {\n if (u.cut_id == 1) {\n let H = ` <li id=\"C${u.cus_id}\" class=\"alive\" data-element=\"${v}|${u.cut_name}|${u.cus_name}\">${u.cus_name}</li>`;\n $('.finder_list-customer ul').append(H);\n }\n });\n selectCustomer();\n}", "function customerList() {\n $.ajax({\n url: '/api/Customers/getCustomers',\n type: 'GET',\n dataType: 'json',\n success: function (customers) {\n customerListSuccess(customers);\n },\n error: function (request, message, error) {\n handleException(request, message, error);\n }\n });\n}", "function manageDataCustomer() {\n $.ajax({\n dataType: 'json',\n url: '/customer/show',\n data:{page:page}\n }).done(function(data){\n manageRow(data.data);\n });\n }", "function getCustomers() {\n var pagina = 'ProjectPlans/listCustomers';\n var par = `[{\"prm\":\"\"}]`;\n var tipo = 'json';\n var selector = putCustomers;\n fillField(pagina, par, tipo, selector);\n}", "function getCustomers() {\n CustomerService.getCustomers()\n .success(function(custs) {\n $scope.gridOpts.data = custs;\n })\n .error(function(error) {\n $scope.status = 'Unable to load customer data: ' + error.message;\n });\n }", "getListSiteByCustomer() {\n let self = this, curItem = this.state.curItem, params = {\n id_customer: !Libs.isBlank(this.user) ? this.user.id_user : null\n };\n CustomerViewService.instance.getListSiteByCustomer(params, (data, total_row) => {\n if (Libs.isArrayData(data)) {\n var findItem = Libs.find(data, 'site_default', true);\n if (!Libs.isObjectEmpty(findItem)) {\n curItem = Object.assign(curItem, findItem);\n } else {\n if (!Libs.isObjectEmpty(data[0]) && !Libs.isBlank(data[0].id)) {\n curItem = Object.assign(curItem, data[0]);\n } else {\n curItem = {};\n }\n }\n\n self.setState({ dataListSite: data, curItem: curItem }, () => {\n self.getCustomerViewInfo();\n });\n } else {\n curItem = {};\n self.setState({ dataListSite: [], curItem: curItem });\n }\n })\n }", "removeFromCustomers() {\n KebapHouse.customers.splice(0, 1);\n }", "list() {\n return this.iugu.makePagedRequest('GET', '/customers');\n }", "updateCustomers(state, payload){\n state.customers = payload;\n }", "function viewcustomer(a) {\n $(\".inventorydisp .unactivate\").toggleClass(\"deactivate unactivate\");\n $(\"#customer-list .deactivate\").toggleClass(\"deactivate\");\n /*$(\".customerdisp .unactivate\").toggleClass(\"deactivate\")*/\n $(\"li.actparent\").toggleClass(\"actparent\");\n if ($(\".inventorydisp .tab1\").css(\"display\") == \"none\") {\n $(\".inventorydisp .tab1\").toggle();\n $(\".inventorydisp .tab2\").toggle();\n }\n $(\".customer_name.act\").toggleClass(\"act\");\n //name = $(\".username.act\").html()\n $(a).find(\".customer_name\").toggleClass(\"act\");\n $(a).toggleClass(\"actparent\");\n name = $(\".customer_name.act\").html();\n console.log(name);\n $(\".customername\").text(name);\n $(\"#customerhistorypane\").css(\"opacity\", \"0\");\n dbOperations(\"inventory\", \"select_operation\", [\"customerinvoice\", \"customer\", String($(\".customername\").html())]);\n check_for_active_row(\"customer_name\", \"inventory\");\n $(\"#customerhistorypane\").animate({\n opacity: 1\n });\n}", "function refreshListOfAddedUsers(l) { User.downloadListOfAddedUsers(l); }", "function updateGrid(result) {\n customersTableView.set_dataSource(result);\n customersTableView.dataBind();\n if (result.length > 0) {\n customersTableView.selectItem(0);\n EMP_ID = result[0][\"EMP_ID\"];\n }\n else {\n EMP_ID = \"\";\n }\n if (customersCommandName == \"Filter\" || customersCommandName == \"Load\") {\n CRM.WebApp.webservice.EmployeeWebService.GetCustomersCount(updateVirtualItemCount);\n }\n //loadOrders();\n}", "function refresh() {\n\tgetAllOrders();\n\tsetTimeout(refresh, 500);\n}", "getAllCustomers() {\n this.CustomerService.fetchAll()\n .then(data => {\n dataTable = data; // set received data to dataTable so that\n if (data !== undefined) {\n dataTable.sort(function (a, b) {\n return a.id > b.id\n });\n this.initData(); // initData() method can init table with it. \n }\n });\n }", "function refresh() {\n // trigger the before refresh event\n lListManager$.trigger('apexbeforerefresh');\n\n // remove everything\n lListManagerAdd$.val(\"\");\n $('option', lListManager$).remove();\n lListManager$.change();\n\n // trigger the after refresh event\n lListManager$.trigger('apexafterrefresh');\n } // refresh", "function init() {\n $scope.customers = customersService.getCustomers();\n }", "_changeCustomer() {\n this.customerRenderer.showCustomerSearch();\n }", "function showCustomers() {\n var app = new CustomerDB();\n var resources = app.getResources();\n for(i=0;i<resources.length;i++) {\n var resource = resources[i];\n if(resource instanceof Customers) {\n customersObj = resource;\n var customers = customersObj.getItems();\n var headers = new Array();\n headers[0] = 'ID';\n headers[1] = 'Name';\n headers[2] = 'Email';\n headers[3] = 'Address';\n headers[4] = 'Action';\n var node = document.getElementById('vw_pl_content');\n node.innerHTML = createCustomersTable(headers, customers) ;\n doShowContent('vw_pl');\n }\n } \n}", "fetchCMCListings(store) {\n fetchCMCListings((data) => {\n store.commit('setCMCListings', data);\n store.dispatch('fetchOwnListings');\n });\n }", "async getAllCustomers() {\n\n try {\n let allCustomers = await customers.findAll();\n\n if (allCustomers.length <= 0) {\n return {\n msg: 'No customers found..',\n payload: 1\n }\n }\n\n let customerList = allCustomers.map((item, index, arr) => {\n return {\n customer: item.dataValues,\n index: index\n };\n });\n\n return {\n msg: 'Success',\n payload: 0,\n customerList: customerList\n }\n\n } catch (e) {\n return {\n msg: 'An error occurred while trying to get the customer list.',\n payload: 1\n }\n }\n\n }", "function refreshMyList(result) {\n\t\tresetSelect();\n\t\trenderResults(result);\n\t}", "function loadCustomers() {\n $.ajax({\n url: \"/Customers\",\n type:\"GET\"\n }).done(function (resp) {\n self.Customers(resp);\n }).error(function (err) {\n self.ErrorMessage(\"Error!!!!\" + err.status);\n });\n }", "get eligCustomersList() {\n\t\treturn this._eligCustomersList;\n\t}", "function refresh() {\n fetchNewestLists();\n}", "goToCustomerListPage(){\n this.getListOfCustomers();//calling function that will retrieve list of customers with server\n }", "function refreshList() {\n axios.get(url + HoldRoute + \"/withtools/json\").then((response) => {\n setList(response.data);\n });\n }", "async fetchCustomerList(){\n const response = await getCustomerList();\n const data = response.data.values;\n console.log('Data ');\n console.log(data);\n this.setState({customers: data})\n }", "async getCustomersList(_data) {\r\n\t\tlet return_result = {};\r\n\t\t_data.columns = {\r\n\t\t\tcustomer_id: \"customers.id\",\r\n\t\t\tfirst_name: knex.raw(\"CAST(AES_DECRYPT(customers.first_name,'\" + encription_key + \"') AS CHAR(255))\"),\r\n\t\t\tlast_name: knex.raw(\"CAST(AES_DECRYPT(customers.last_name,'\" + encription_key + \"') AS CHAR(255))\"),\r\n\t\t\temail: knex.raw(\"CAST(AES_DECRYPT(customers.email,'\" + encription_key + \"') AS CHAR(255))\"),\r\n\t\t\toam_commission: \"customers.oam_commission\",\r\n\t\t\towner_commission: \"customers.owner_commission\",\r\n\t\t\tgain_commission: \"customers.gain_commission\",\r\n\t\t\tdob: \"customers.dob\",\r\n\t\t\tgender: \"customers.gender\",\r\n\t\t\tcreated_at: knex.raw(\"DATE_FORMAT(customers.created_at,'%b %d,%Y, %h:%i:%S %p')\"),\r\n\t\t\tphone: knex.raw(\"CAST(AES_DECRYPT(customers.phone,'\" + encription_key + \"') AS CHAR(255))\"),\r\n\t\t\tcustomer_unique_id: knex.raw(\"CAST(AES_DECRYPT(customers.customer_unique_id,'\" + encription_key + \"') AS CHAR(255))\")\r\n\t\t};\r\n\r\n\t\tlet obj = customerModel.getCustomersList(_data);\r\n\t\treturn obj.then(async (result) => {\r\n\t\t\tif (result.length > 0) {\r\n\t\t\t\treturn_result.customer_list = result;\r\n\t\t\t\tdelete _data.limit;\r\n\t\t\t\tdelete _data.offset;\r\n\t\t\t\tdelete _data.columns;\r\n\t\t\t\tlet countData = await customerModel.getCustomersList(_data);\r\n\t\t\t\treturn_result.total_records = countData[0].total_records\r\n\r\n\t\t\t\treturn response.response_success(true, status_codes.customer_found, messages.customer_found, (return_result));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\"customers_not_found\")\r\n\t\t\t}\r\n\t\t}).catch((err) => common_functions.catch_error(err));\r\n\t}", "function updateContactList() {\r\n\tsupervisorsStore.load( {params: { method: \"loadSupervisors\"} } );\r\n\texpertsStore.load( {params: { method: \"loadExperts\"} } );\r\n\tpeersStore.load( {params: { method: \"loadPeers\"} } );\r\n agentsStore.load( {params: { method: \"loadFavorites\"} } );\r\n}", "function finish() {\n const customer = {\n fullName: fullName.value,\n identifyCard: identifyCard.value,\n birthday: birthday.value,\n email: email.value,\n address: address.value,\n customerType: customerType.value,\n discount: discount.value,\n quantityInclude: quantityInclude.value,\n rentDays: rentDays.value,\n typeOfService: typeOfService.value,\n typeOfRoom: typeOfRoom.value,\n totalPay: totalPay.innerHTML,\n };\n customers.push(customer);\n console.log(customers);\n displayCustomer();\n editData();\n}", "function listCustomers() {\n let customersList;\n db.getAll('customers', (succ, data) => {\n customersList = data;\n });\n\n var tblString = '';\n for (var i = 0; i < customersList.length; i++) {\n tblString += '<tr class=\"main-container\">';\n tblString += '<td>' + customersList[i].name + '</td>';\n tblString += '<td>' + customersList[i].address + '</td>';\n tblString += '<td>' + customersList[i].id + '</td>';\n tblString += '<td><a class=\"btn btn-default\" href=\"#\" id=\"' + customersList[i].id + '\" onclick=\"showCustomerDetails(this)\">Details</a></td>';\n tblString += '</tr>';\n }\n\n document.getElementById('table-customers').innerHTML = tblString;\n}", "function repopulateList() {\n instruments_list_obj.clear();\n populateList(instruments_list_obj);\n}", "function refreshList(data){\n $('#payment-body').empty();\n\n data.forEach(function(element){\n $('#payment-body').append(\"<tr>\"\n +\"<td>\"+element.date+\"</td>\"\n +\"<td>\"+element.value+\"</td>\"\n +\"<td>\"+element.receptor+\"</td>\"\n +\"</tr>\");\n });\n \n }", "function refreshListOfUsersWhoHaveAddedYou(l) { User.downloadListOfUsersWhoHaveAddedYou(l); }", "function _triggerRefresh() {\n lListManager$.trigger('apexrefresh');\n } // triggerRefresh", "function getCustomers(res, mysql, context, complete){\n \tmysql.pool.query(\"SELECT C.cust_id, f_name, l_name, total FROM Shopping_cart SC INNER JOIN Customer C ON SC.cust_id = C.cust_id\", function(error, results, fields){\n \t\tif(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.customer = results;\n complete();\n \t});\n }", "getCustomersThisCompany(params) {\n // Don't get more than once\n if (this.displayData.customers.length) {\n return new Promise(resolve => resolve());\n }\n return Resource.get(this).resource('Employee:getAllCustomersThisCompany', params)\n .then(res => {\n this.displayData.customers = res.filter(customer => customer.firstName !== '__default__');\n });\n }", "function updateTransferView(customerData) {\n var customer = customerData.customers[0];\n transferSection.find('.glyphicon-customer-id').css(\"display\", \"\");\n transferSection.find('.searchButton').css(\"margin-left\", \"10px\");\n transferSection.find('#cancelReasonDropdown').css(\"display\", \"\");\n transferSection.find('#customerInfoPlaceholder').css(\"display\", \"\").text(\"\");\n if (typeof customer.email !== 'undefined' && customer.email !== null) {\n transferSection.find('#customerInfoPlaceholder').append(customer.name + \"<br>\" + customer.email + \n \"<br>\" + customer.address + \"<br>\" + customer.postNumber + \" \" + customer.postOffice);\n } else {\n transferSection.find('#customerInfoPlaceholder').append(customer.name + \"<br>\" + customer.address + \n \"<br>\" + customer.postNumber + \" \" + customer.postOffice);\n }\n \n }", "function refreshData() {\n DailyInOutReportService.GetInOutDetailsOfEmployee($scope.timeZone, $scope.filterData.date, $scope.EmpData.EmployeeId).then(function (result) {\n $scope.EmployeeInOutDetailList = result.data.DataList;\n })\n }", "function removeCurrentCustomer (successResult) {\n\t\t\t\tfor (var idx = 0;idx < successResult.data.length ; idx++) {\n\t\t\t\t\tif ($scope.customerID === successResult.data[idx].id) {\n\t\t\t\t\t\tsuccessResult.data.splice(idx, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function refreshTodoList(){\n jsonOverHttp({uri: '/db/item', method: 'GET'}).then(function(response){\n var todos = response.body;\n element.empty();\n element.append(templateService.template(todoLayout, [elementObserver, creatorObserver], {'todos':todos}));\n \n element.find(\"input.new-todo\").focus();\n });\n }", "function customerView () {\n common.openConnection(connection);\n let querySQL = 'SELECT item_id, product_name, stock_quantity, price FROM products where stock_quantity > 0'; // exclude from \"where\" to premit out-of-stock items\n connection.query(querySQL, (error, result) => {\n if (error) throw error;\n let msg = ''; \n let title = 'LIST OF PRODUCTS FOR SALE';\n common.displayProductTable(title, result) // pass title and queryset to function that will print out information\n console.log('\\n');\n customerSelect();\n });\n \n}", "function refreshContactList (contacts) {\n pageContents.contacts = contacts;\n\n if (contacts.length === 0) {\n $(\".rolodex\").addClass(\"block\");\n }\n else {\n $(\".rolodex\").removeClass(\"block\");\n }\n $(\".rolodex\").html(listTemplate(pageContents));\n }", "setupCustomersListbox(){\r\n\t\t//console.log(this.CustomersData);\r\n\t\tvar Customers = this.CustomersData['customers'];\r\n\t\tvar index = this.CustomersData['element'];\r\n\t\tvar tdObj = document.getElementById('CompanyName');\r\n\t\tvar len = Customers.length;\r\n\t\tvar s = '', opt = '';\r\n\t\t\r\n\t\tfor(let i = 0; i < len; i += 1){\r\n\t\t\t\r\n\t\t\tlet aCustomer = Customers[i];\r\n\t\t\tlet custName = aCustomer['CompanyName'];\r\n\t\t\tlet custId = aCustomer['CustomerID'];\r\n\t\t\topt += '<option value=\"' + custId + '\"';\r\n\t\t\t\r\n\t\t\t//Select the default customer\r\n\t\t\tif(index == i){\r\n\t\t\t\topt += ' selected'\r\n\t\t\t}\r\n\t\t\topt += '>' + custName + '</option>';\t\t\r\n\t\t}\r\n\t\ts = '<select id=\"custList\" onChange=changeCustomer(this);>' + opt + '</select>';\r\n\t\ttdObj.innerHTML = s;\r\n\t\tvar aCustomer = Customers[index];\r\n\t\tthis.setIdValue('Address', aCustomer['Address']);\r\n\t\tthis.setIdValue('City', aCustomer['City']);\r\n\t\tthis.setIdValue('PostalCode', aCustomer['PostalCode']);\r\n\t\tthis.setIdValue('Country', aCustomer['Country']);\r\n\r\n\t\treturn 0;\r\n\t}", "async getCustomers() {\n const customers = await this.request('/vehicles', 'GET');\n let customersList = [];\n if (customers.status === 'success' && customers.data !== undefined) {\n customersList = customers.data\n .map(customer => customer.ownerName)\n .filter((value, index, self) => self.indexOf(value) === index)\n .map(customer => ({\n label: customer,\n value: customer\n }));\n }\n return customersList;\n }", "function refresh() {\n getPersonList();\n getLabels(appConfig.CULTURE_NAME);\n\n }", "function refreshMCLCount() {\n NonMutantCellLineMCLCountAPI.search(vm.results[vm.selectedIndex].cellLineKey, function(data) {\n vm.mcl_count = data.total_count;\n });\n }", "function refreshContacts() {\n client.contacts.refresh()\n}", "function refresh() {\n // trigger the before refresh event\n gAutoComplete.trigger( \"apexbeforerefresh\" );\n\n // Clear the autocomplete field\n $s(gAutoComplete[0], \"\", \"\");\n\n // clear the auto complete select list\n gAutoComplete.flushCache();\n\n // trigger the after refresh event\n gAutoComplete.trigger( \"apexafterrefresh\" );\n } // refresh", "function getCustomers()\n {\n var url = \"http://localhost:8080/Customer_Restful/webresources/entities.customer\";\n //console.log('Start!');\n $.ajax\n ({\n type: 'GET', //Request Data Type\n contentType: 'application/json', //Request Content Type\n url: url, //RESTful Service URL\n dataType: \"json\", //Response Data Type\n \n success: function(data)\n {\n document.write(\"<a href='search.html'>Search Criteria</a>\");\n document.writeln(\"<h2>Javascript client for CustomerDB Restful Web Service</h2><br>\");\n document.writeln(\"<h4>Resources for CustoermDBRest:</h4>\");\n document.writeln(\"<h5>Customers</h5>\");\n document.writeln(\"<table style='border: 1px solid black;'>\");\n document.writeln(\"<tr>\");\n document.write(\"<th style='border: 1px solid black;'>custID</th>\");\n document.write(\"<th style='border: 1px solid black;'>dis-code</th>\");\n document.write(\"<th style='border: 1px solid black;'>name</th>\");\n document.write(\"<th style='border: 1px solid black;'>address</th>\");\n document.write(\"<th style='border: 1px solid black;'>city</th>\");\n document.write(\"<th style='border: 1px solid black;'>state</th>\");\n document.write(\"<th style='border: 1px solid black;'>zip</th>\");\n document.write(\"<th style='border: 1px solid black;'>phone</th>\");\n document.write(\"<th style='border: 1px solid black;'>fax</th>\");\n document.write(\"<th style='border: 1px solid black;'>email</th>\");\n document.write(\"</tr>\");\n outputCustRowsHtml(data);\n document.write(\"</table>\");\n discountwithCustId(data);\n getDiscountInfo();\n\n }\n });\n }", "function customerAddSuccess(customer) {\n customerAddRow(customer);\n formClear();\n}", "getCustomers() {\r\n\t\tvar that = this;\r\n\t\t$.ajax({\r\n\t\t method: \"POST\",\r\n\t\t url: \"/ajaxgetcustomers\",\r\n\t\t data: { OrderID: that.orderId }\r\n\t\t})\r\n\t\t.done(function( resp ) {\r\n\t\t\tthat.CustomersData = resp;\r\n\t\t\tthat.setupCustomersListbox();\r\n\t\t\tthat.CustomersDone = true;\r\n\t\t\tthat.error = false;\r\n\t\t\treturn that.getOrder();\r\n\t\t\t\r\n\t\t})\r\n\t\t.fail(function(){\r\n\t\t\talert(\"Ajax Failed in getCustomers()\");\r\n\t\t\tthat.CustomersDone = false;\r\n\t\t\tthat.error = true;\r\n\t\t\treturn false;\r\n\t\t});\r\n\r\n }", "function refreshStoredUsers() {\n getStoredUsers();\n refreshTableUsers();\n}", "function getCustomers(res, mysql, context, complete){\n mysql.pool.query(\"SELECT Customers.customerID as id, customerName, customerType, customerEmail FROM Customers\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.customers = results;\n complete();\n });\n }", "function select(customer){\n if (vm.selectedCustomer === customer ) {return;} // no change\n vm.selectedCustomer = customer;\n var id = customer && customer.id;\n if (id && id !== customerState.selectedCustomerId){\n // customer changed, get its orderHeaders and update customerState\n customerState.selectedCustomerId = id;\n getCustomerOrderHeaders(customer);\n }\n }", "function severRefresh(newValue) {\n if (newValue) {\n if (datacontext.updateList().delivery()) {\n refreshPage();\n }\n datacontext.completedRefresh();\n }\n }", "function refresh() {\n\n widget.util.cascadingLov(\n gSelectList$,\n gOptions.ajaxIdentifier,\n {\n pageItems: $( gOptions.pageItemsToSubmit, apex.gPageContext$ )\n },\n {\n optimizeRefresh: gOptions.optimizeRefresh,\n dependingOn: $( gOptions.dependingOnSelector, apex.gPageContext$ ),\n success: _addResult,\n clear: _clearList\n });\n\n } // refresh", "function ImportCustomerData() {\n BindOrReloadCustomerTable('Export');\n}", "function emptyCustomerList() {\n $('#customer_list table').find(\"tr:gt(0)\").remove();\n}", "function getCandateList() {\n var obj = {\n p: $scope.page,\n ps: 10\n };\n\n CandidatePoolService.getCandidatesByNetwork(obj).then(function(res) {\n $scope.candidateListSumary = res;\n $scope.candidateListSumary.IsSelectingStatus = '';\n });\n\n }", "function filterClientsAndUpdate() {\n if (!doNotFilterListOnUpdate) {\n var clientName = ($scope.form.searchField != null && $scope.form.searchField != \"\") ? $scope.form.searchField : 'Гост';\n $scope.currentClient = {\n id: 0,\n name: clientName\n };\n $scope.chooseClient(0);\n if ($scope.form.searchField.length == 0) {\n if ($scope.fullClientsList != null && $scope.fullClientsList.length > 0) $scope.list = JSON.parse(JSON.stringify($scope.fullClientsList));\n } else {\n\n var tmpList = $scope.fullClientsList.filter(function (el) {\n return el.name.toLowerCase().indexOf($scope.form.searchField.toLowerCase()) == 0\n });\n $scope.list = tmpList.concat($scope.fullClientsList.filter(function (el) {\n return el.name.toLowerCase().indexOf($scope.form.searchField.toLowerCase()) > 0\n }))\n }\n }\n doNotFilterListOnUpdate = false;\n\n }", "function get_customer_list(user_id) {\n //login user id\n var url = base_url + 'customers';\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: {\n user_id: user_id\n },\n success: function (response) {\n console.log(response);\n if (response.status == 'success') {\n var customer_list = '<option value=\"\">--select--</option>';\n if (response.data.length > 0) {\n $.each(response.data, function (key, value) {\n customer_list += '<option value=\"' + value.id + '\">' + value.display_name + '</option>';\n });\n $(\"#customer-list\").html(customer_list);\n }\n else {\n $(\"#customer-list\").html(customer_list);\n }\n\n\n }\n\n }\n });\n} //end function customer list", "function severRefresh(newValue) {\n if (newValue) {\n if (datacontext.updateList().product() || datacontext.updateList().incident()) {\n refreshPage();\n }\n datacontext.completedRefresh();\n }\n }", "function renderCus(customerArray){\n\nfor(let customer of customerArray) {\n\n //SELECT SECTION TO ADD INFO FROM JS TO HTML PAGE//\n let customerList = document.querySelector('.customer-list');\n\n //CREATED LIST ITEM FOR CUSTOEMR LIST//\n let customerLi = document.createElement('li');\n\n //ADDING INFO TO THE LIST ITEM CREATED VIA JS//\n let customerText = document.createTextNode(`${customer.name.first}`);\n\n //PUTTING CONTENT INTO LIST ITEM//\n customerLi.appendChild(customerText)\n\n //PUT LIST ITEM INTO SECTON//\n customerList.append(customerLi)\n\n } \n}", "function fillOrderList(data) {\n var list = data == null ? [] : (data instanceof Array ? data : [data]);\n $('#itemList').find('li').remove();\n $.each(list, function (index, item) {\n $('#itemList').append('<li><a href=\"#\" data-identity=\"' + item.id + '\">' + item.customer + '</a></li>');\n });\n}", "function generateCustomerList(){\n var customerData = JSON.parse(sessionStorage.getItem(\"customerInfo\"))\n document.getElementById('custList').innerHTML += '<a href=\"./itemSelect.html\" class=\"list-group-item list-group-item-action pText p-4 background\" >' + customerData.firstName + \" \" + customerData.lastName + '</a>'\n}", "function getAllCustomers() {\n return datacontext.get('Product/GetAllCustomers');\n }", "function reload(){ // reload datatable after adding customer\n if( $.fn.dataTable.isDataTable( '#manageTicketsTable' ) ){ // make sure table is active\n console.log(\"table is alive here\");\n $('#manageTicketsTable').DataTable().ajax.reload();\n }\n else{\n console.log(\"table is dead here\");\n }\n return;\n }", "function reload(){ // reload datatable after adding customer\n if( $.fn.dataTable.isDataTable( '#manageTicketsTable' ) ){ // make sure table is active\n console.log(\"table is alive here\");\n $('#manageTicketsTable').DataTable().ajax.reload();\n }\n else{\n console.log(\"table is dead here\");\n }\n return;\n }", "function getCustomers(){\n $scope.customer.action = \"fetchAll\";\n $http.post('/customerActions',$scope.customer).success(function(response){\n if(response == \"fail\"){\n $timeout(function (){\n $scope.isLoading = null; \n }, 2000);\n $scope.user = \"Guest\";\n $scope.isLoading = \"Error in fetching customers!\";\n }\n else if(response == \"connection_error\"){\n // when the service connection was not successful\n $scope.isLoading = \"Error in fetching customers!\";\n swal({title: \"Connection Error!\", text: \"Connection could not be established! Please Refresh\", type: \"error\", confirmButtonText: \"ok\" });\n swal.close();\n }\n else{\n $scope.isLoading = null;\n $scope.customers =response;\n }\n });\n }", "function getSCustomers () {\n console.log ('Get all sender customers');\n $.ajax ({\n type: 'GET',\n url: rootURL + \"/customer/senders\",\n dataType: \"json\", // data type of response\n success: function (data) {\n sCustomers = data;\n rederDataList (sCustomers, 'sendPhoneList', \"sendNameList\");\n },\n error: function (data) {\n console.log (\"failed to load or render senders\", data);\n }\n });\n}", "function refreshUserList() {\n db.transaction((tx) => {\n tx.executeSql(\"select * from userlist\", [], (_, { rows: { _array } }) => {\n console.log(\"useDB: Getting userlist from database!\");\n dispatch(setUserData({ list: _array }));\n console.log(_array);\n });\n });\n }", "function reload(){ // reload datatable after adding customer\n if( $.fn.dataTable.isDataTable( '#manageTicketsTable' ) ){ // make sure table is active\n console.log(\"table is alive here\");\n $('#manageTicketsTable').DataTable().ajax.reload();\n }\n else{\n console.log(\"table is dead here\");\n }\n return;\n }", "function updateCustomerTable() {\n \n $.ajax({\n type: \"GET\",\n url: \"/Customers/GetCustomers\",\n contentType: \"application/json; charset=utf-8\",\n error: function (xhr, statusText, error) {\n alert(\"Error: \" + statusText + \" \" + error);\n },\n success: function (data) {\n \n $(\"#customerTable tr td\").remove();\n\n for (var i = 0; i < data.length; i++) {\n \n updateCustomerRow(i, data[i]);\n }\n }\n });\n}", "_onCustomerSearch() {\n EventEmitter.on(eventMap.customerSearched, (response) => {\n this.activeSearchRequest = null;\n this.customerRenderer.hideSearchingCustomers();\n\n if (response.customers.length === 0) {\n EventEmitter.emit(eventMap.customersNotFound);\n\n return;\n }\n\n this.customerRenderer.renderSearchResults(response.customers);\n });\n }", "function refreshData() {\n\t\tlistTasks({ category });\n\t\tlistTodayTasks({ category });\n\t}", "set eligCustomersList(eligCustomersList) {\n\t\treturn this._eligCustomersList = eligCustomersList;\n\t}", "function findAllCustomers (custType) {\n console.log ('find all senders');\n $.ajax ({\n type: 'GET',\n url: rootURL + '/customer/' + custType,\n dataType: \"json\", // data type of response\n success: function (data, textStatus, jqXHR) {\n renderCustomerTableData (null, data, custType);\n var phonelist=\"\";\n var namelist=\"\";\n if (custType==\"senders\") {\n sCustomers = data;\n phonelist=\"sendPhoneList\";\n namelist=\"sendNameList\";\n } else if (custType ==\"receivers\") {\n rCustomers = data;\n phonelist=\"receiverPhoneList\";\n namelist=\"receiverNameList\";\n }\n rederDataList (data, phonelist, namelist);\n },\n error: function (data) {\n console.log (\"failed\", data);\n }\n });\n}", "function refreshGrid() {\n ConstCemDataServices.getDnc($scope.dnc.masterId, false)\n .then(function (result) {\n //console.log(result);\n StoreData.addDncList(result,filterConstituentData(result));\n $scope.dnc.gridOptions = ConstCemServices.refreshGridData($scope.dnc.gridOptions, StoreData.getDncList());\n $scope.dnc.togglePleaseWait = false;\n $scope.dnc.toggleDetails = true;\n $scope.dnc.totalItems = StoreData.getDncList().length;\n if (StoreData.getDncList().length > 0) {\n $scope.dnc.distinctRecordCount = StoreData.getDncList()[0].distinct_records_count;\n }\n },\n function (error) {\n $scope.dnc.togglePleaseWait = false;\n HandleResults(error);\n });\n }", "updateList() {\n console.warn( 'List could not be updated; it has not yet been initialized.' );\n }", "function updateCustomer() {\n var cust = $scope.customer;\n\n CustomerService.save(cust)\n .success(function() {\n $location.path('/customer');\n $scope.status = 'Updated Customer! Refreshing customer list.';\n })\n .error(function(error) {\n $scope.status = 'Unable to update customer: ' + error.message;\n });\n }", "function initOrderList() {\n webservice.call($rootScope.baseURL + \"/order/all_open_orders\", \"get\").then(function (response) {\n vm.openOrders = response.data.dataRows;\n vm.openOrderCount = response.data.entries;\n console.log(response);\n // vm.categoriesList = response.data.dataRows;\n });\n }", "_saveCustomer(){\n if (Object.keys(this.customer).length === 7) {\n this.storage.setData('customers', this.customer, this.formState);\n this._cancel();\n }\n }" ]
[ "0.70704305", "0.69736576", "0.69008005", "0.68298393", "0.68096864", "0.67783123", "0.67059684", "0.66040456", "0.65784174", "0.65544456", "0.64780205", "0.64742035", "0.64562523", "0.6421873", "0.6312858", "0.6308224", "0.62962306", "0.62312764", "0.62229043", "0.6176786", "0.6172285", "0.6147193", "0.6135083", "0.609247", "0.6082591", "0.6049476", "0.60491854", "0.6045794", "0.5991977", "0.5988293", "0.5926578", "0.5903021", "0.5892839", "0.58841056", "0.5878719", "0.5876124", "0.58657724", "0.58279705", "0.5825801", "0.5819652", "0.58159035", "0.5804275", "0.57984364", "0.5784402", "0.5780837", "0.57691395", "0.5761198", "0.5756886", "0.57533455", "0.5752564", "0.57317615", "0.5727341", "0.57204074", "0.5719339", "0.5712969", "0.57073545", "0.57031274", "0.56994355", "0.56939745", "0.5678985", "0.5659243", "0.5656493", "0.564486", "0.56447786", "0.56416804", "0.5640615", "0.563952", "0.56386906", "0.5628296", "0.5619634", "0.56137717", "0.5611908", "0.56097114", "0.56093603", "0.5608935", "0.5597404", "0.55892307", "0.5585544", "0.55758935", "0.55663836", "0.55647546", "0.55568683", "0.5547434", "0.55436194", "0.5541978", "0.55344427", "0.55344427", "0.5532685", "0.5531994", "0.55308104", "0.55298406", "0.55270094", "0.552409", "0.55200344", "0.5514574", "0.5504355", "0.5502671", "0.5499477", "0.5490951", "0.54906815", "0.54678375" ]
0.0
-1
Used to toggle the menu on small screens when clicking on the menu button
function toggleFunction() { var x = document.getElementById("navDemo"); //alert(x.className.indexOf("show")); if (x.className.indexOf("show") == -1) { x.className += " show"; } else { x.className = x.className.replace(" show", ""); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function menuForSmallScreen() {\n navMenuList.hide();\n\n hideMenuBtn.addClass(ClassName.NONE);\n showMenuBtn.removeClass(ClassName.NONE);\n\n function toggleSmallMenu() {\n navMenuList.fadeToggle();\n toggleButtons();\n }\n\n function toggleMenuEventHandler(event) {\n event.preventDefault();\n toggleSmallMenu();\n }\n\n hideMenuBtn.click(toggleMenuEventHandler);\n showMenuBtn.click(toggleMenuEventHandler);\n menuEl.click(function () {\n setTimeout(toggleSmallMenu, 600);\n });\n }", "function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span></a></div>\");\n\t\t// Add expand class for toggle menu and adds + or - symbol depending on nav bar toggle state\n\t\t$('.menu-toggle a').click(function() {\n\t\t\t$('.main-nav').toggleClass('expand');\n\t\t\tvar newValue = $(this).find('span.indicator').text() == ' -' ? ' +' : ' -';\n\t\t\t$(this).find('span.indicator').text(newValue);\n\t\t});\n\t\t// Set window state\n\t\tvar windowState = 'small';\n\t}", "function toggleMobileMenu() {\n let wrapper = $(\".m-menu-wrapper\");\n wrapper.toggleClass(\"active\");\n $(\"body\").toggleClass(\"locked\");\n }", "function responsive_menu() {\n if(is_tablet_and_down()) {\n $('.mobile-menu .lines-button').on('click', function() {\n $(this).toggleClass('active');\n $('.mobile-side-menu').toggleClass('open');\n $('.mobile-menu-push').toggleClass('mobile-menu-push-to-left');\n });\n } else {\n $('.mobile-menu .lines-button').off('click');\n $('.pill-container').off('click');\n $('.reaction-list li').off('click');\n }\n}", "function toggleMenu(el) {\n if(screen.width <= 768) {\n var listView = document.querySelector('.list-view');\n var menuContainer = document.querySelector('.menu-container');\n\n menuContainer.classList.toggle('change');\n if(window.getComputedStyle(listView).display === 'none') {\n listView.style.display = 'block';\n } else if(window.getComputedStyle(listView).display === 'block') {\n listView.style.display = 'none';\n }\n }\n}", "static toggleMenu() {\n var win = $(\"#window\")[0];\n\n if (win.classList.contains(MENU_ACTIVE)) {\n this.menuOff();\n }\n else {\n this.menuOn();\n }\n }", "toggleMenuInMobile () {\n try {\n const windowWidth = window.innerWidth\n if (windowWidth > MENU_HIDE_WIDTH) return\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {}\n }", "function handleSmallScreens() {\r\n document.querySelector('.navbar-toggler')\r\n .addEventListener('click', () => {\r\n let navbarMenu = document.querySelector('.navbar-menu')\r\n\r\n if (navbarMenu.style.display === 'flex') {\r\n navbarMenu.style.display = 'none'\r\n return\r\n }\r\n\r\n navbarMenu.style.display = 'flex'\r\n })\r\n}", "function handleSmallScreens() {\n document.querySelector('.navbar-toggler')\n .addEventListener('click', () => {\n let navbarMenu = document.querySelector('.navbar-menu')\n\n if (navbarMenu.style.display === 'flex') {\n navbarMenu.style.display = 'none'\n return\n }\n\n navbarMenu.style.display = 'flex'\n })\n}", "function handleSmallScreens() {\n document.querySelector('.navbar-toggler')\n .addEventListener('click', () => {\n let navbarMenu = document.querySelector('.navbar-menu')\n\n if (navbarMenu.style.display === 'flex') {\n navbarMenu.style.display = 'none'\n return\n }\n\n navbarMenu.style.display = 'flex'\n })\n}", "function toggleMobileMenu() {\n if (mobileMenuVisible) {\n //close menu\n nav.style.removeProperty(\"top\");\n burgerMenuSpan.forEach(span => {\n span.style.removeProperty(\"background\");\n });\n } else {\n //open menu\n nav.style.top = \"0px\";\n burgerMenuSpan.forEach(span => {\n span.style.background = \"#e9e9e9\";\n });\n }\n mobileMenuVisible = !mobileMenuVisible;\n}", "function openMobileMenu() {\n\t\tsetClick(!click);\n\t}", "function toggleMenu() {\n document.querySelector('.main-nav').classList.toggle('display-menu');\n document.querySelector('.screen').toggleAttribute('hidden');\n}", "function togglemenu(){\n this.isopen = !this.isopen;\n }", "function toggleMobileMenu() {\n\t\tvar menuCont \t= $('.mobileMenu'), \n\t\t\t\ttoggle \t\t= $('.mobileMenuToggle'),\n\t\t\t\tclose\t\t\t= $('.mobileMenuClose');\n\t\ttoggle.on('click', function() {\n\t\t\tmenuCont.toggleClass('mobileMenu--vis');\n\t\t});\n\t\tclose.on('click', function() {\n\t\t\tmenuCont.toggleClass('mobileMenu--vis');\n\t\t});\n\t}", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function toggleMobileMenu() {\n \ttoggleIcon.addEventListener('click', function(){\n\t\t this.classList.toggle(\"open\");\n\t\t mobileMenu.classList.toggle(\"open\");\n \t});\n }", "function onToggleMobileMenu(e){\n\t\t$(e.currentTarget).toggleClass(\"active\");\n\t\t$(\"#main-container\").toggleClass(\"mobile-menu-on\");\n\t\t$(\"#main-footer\").toggleClass(\"mobile-menu-on\");\n\t}", "function toggleMobileMenu(e) {\n e.preventDefault();\n toggleButtonIcon();\n if (!navListOpen) {\n navListOpen = true;\n gsap.to(\".navbar__list\", 0.5, {\n height: \"auto\",\n });\n } else {\n navListOpen = false;\n gsap.to(\".navbar__list\", 0.5, {\n height: \"0\",\n });\n }\n}", "function toggle() {\n if (window.innerWidth < 751) {\n menuStyle.removeAttribute(\"class\", \"responsive-style\"); \n }\n}", "function menuToggle() {\n if (window.innerWidth < 768) {\n $(\".dropdown\").slideToggle(\"400\");\n }\n }", "function displayMobileMenu($btn) {\n $btn.addEventListener('click', function () {\n document.querySelector('.nav__menu__overlay').classList.toggle('opacity');\n document.querySelector('body').classList.toggle('no_scroll');\n if ($btn === btnOpen) {\n changeTabIndex(btnClose, 0);\n changeTabIndex(menuLink, 0);\n for (let i = 0; i < menuLinks.length; i++) {\n let delay = \"move__in--\" + i;\n menuLinks[i].classList.toggle('move__in');\n menuLinks[i].classList.toggle(delay);\n }\n } else {\n changeTabIndex(btnClose, -1);\n changeTabIndex(menuLink, -1);\n for (let i = 0; i < menuLinks.length; i++) {\n let delay = \"move__in--\" + i;\n menuLinks[i].classList.toggle('move__in');\n menuLinks[i].classList.toggle(delay);\n }\n }\n });\n }", "function menuResponsive() {\n\tdocument.getElementById('contentNav').classList.toggle('active');\n\t//document.getElementById('button-menu').classList.toggle('active');\n\tdocument.getElementById('button-menu').classList.toggle('is-active');\n}", "function clickOnMobileMenu() {\n /* toggle the mobile nav menu */\n $('.js--mobile-menu').click(function() {\n const mainNav = $('.js--main-nav');\n mainNav.slideToggle(200);\n\n /* toggle the mobile menu icon */\n if ($('.js--menu-outline').hasClass('icon-hidden')) {\n $('.js--menu-outline').removeClass('icon-hidden');\n $('.js--close-outline').addClass('icon-hidden');\n } else {\n $('.js--menu-outline').addClass('icon-hidden');\n $('.js--close-outline').removeClass('icon-hidden');\n }\n\n });\n}", "function toggleMenu() {\n document.querySelector('.mobile-menu').classList.toggle('active')\n}", "function menuForLargeScreen() {\n navMenuList.show();\n\n timerObj = setTimeout(function () {\n menuPanel.addClass(ClassName.MENU_PANEL__COMPRESSED);\n hideMenuBtn.addClass(ClassName.NONE);\n showMenuBtn.removeClass(ClassName.NONE);\n }, 5000);\n\n function toggleMenuEventHandler(event) {\n event.preventDefault();\n toggleButtons();\n menuPanel.toggleClass(ClassName.MENU_PANEL__COMPRESSED);\n }\n\n hideMenuBtn.click(toggleMenuEventHandler);\n showMenuBtn.click(toggleMenuEventHandler);\n\n menuPanel.mouseenter(function () {\n clearTimeout(timerObj);\n menuPanel.removeClass(ClassName.MENU_PANEL__COMPRESSED);\n hideMenuBtn.removeClass(ClassName.NONE);\n showMenuBtn.addClass(ClassName.NONE);\n });\n menuPanel.mouseleave(function () {\n if (!menuPanel.hasClass(ClassName.MENU_PANEL__COMPRESSED)) {\n timerObj = setTimeout(function () {\n menuPanel.addClass(ClassName.MENU_PANEL__COMPRESSED);\n toggleButtons();\n }, 2000);\n }\n });\n }", "toggleMobileMenu() {\n this.setState({ isMobileMenuOpen: !this.state.isMobileMenuOpen })\n }", "function toggleMenu()\n{\n\t// Get the left panel\n\tvar menu = document.getElementById(\"mobile-menu\");\n\t\n\t// If the panel is visible (displayed), remove it\n\tif(menu.style.display == \"block\")\n\t{\n\t\tmenu.style.display = \"none\";\n\t}\n\t\n\t// If the panel is not displayed, display it\n\telse\n\t{\n\t\tmenu.style.display = \"block\";\n\t\tmenu.style.width = \"100%\";\n\t\t\n\t\tdocument.body.scrollTop = document.documentElement.scrollTop = 0;\n\t}\n}", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "showMobilemenu() {\n document.getElementById('main-wrapper').classList.toggle('show-sidebar');\n }", "function toggleMenu(){\n var isDisplay = $j('.menu').css('display');\n\n if (isDisplay == 'none'){\n $j('.menu').show(500);\n }else if (isDisplay == 'block'){\n $j('.menu').hide(500);\n }\n\n if ($j(window).width() <= 720) {\n $j('nav').width($j('header').width());\n } else {\n $j('nav').css('width','');\n }\n}", "function toggleMenuLinks () {\n\t\tif (sitenavMinWidth < $(window).width()) {\n\t\t\t$(\"body\").removeClass(\"ibm-sitenav-menu-hide\");\n\t\t}\n\t\telse {\n\t\t\t$(\"body\").addClass(\"ibm-sitenav-menu-hide\");\n\t\t}\n\t}", "function toggleMenu() {\r\n //console.log('menu clicked');\r\n if ($menuList.hasClass('menu-active')) {\r\n $menuList.removeClass('menu-active');\r\n $areaCloseMenu.removeClass('menu-active');\r\n $buttonOpenMenu.removeClass('menu-not-active');\r\n $buttonCloseMenu.removeClass('menu-active');\r\n } else {\r\n $menuList.addClass('menu-active');\r\n $areaCloseMenu.addClass('menu-active');\r\n $buttonOpenMenu.addClass('menu-not-active');\r\n $buttonCloseMenu.addClass('menu-active');\r\n }\r\n}", "showMobilemenu() {\n document.getElementById(\"main-wrapper\").classList.toggle(\"show-sidebar\");\n }", "function openMobileMenu(){\n menuButton.classList.add(\"isOpen\");\n menuO.style.display=\"none\";\n menuX.style.display=\"block\";\n mobileMenu.style.display = \"block\";\n activateScrollMenu()\n }", "function toggleSiteMenu ( )\r\n{\r\n\tif ($('#menuControl').hasClass('menuVisible'))\r\n\t{\r\n\t\t$('#menuControl').removeClass('menuVisible');\r\n\t\t$('#siteMenu').css('display','none');\r\n\t\tviewContainer.onResize();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$('#menuControl').addClass('menuVisible');\r\n\t\t$('#siteMenu').css('display','block');\r\n\t\tviewContainer.onResize();\r\n\t}\r\n}", "function toggleMenu(menu) {\n menu.toggleClass('show');\n}", "function mobileMenu() {\n hamburger.classList.toggle(\"active\");\n navMenu.classList.toggle(\"active\");\n}", "function mobileMenu() {\n \"use strict\";\n if (jQuery(window).width() < 768) {\n jQuery('.mega-menu .mega').attr('id', 'menu-menu');\n jQuery('#menu-all-pages').removeClass('mega');\n jQuery('.mega-menu > ul').removeClass('mega');\n } else {\n jQuery('.mega-menu .mega > ul').addClass('mega');\n jQuery('.mega-menu .mega > ul').attr('id', 'menu-menu');\n }\n jQuery(\".main-navigation\").addClass('toggled-on');\n jQuery('.menu-toggle').click(function() {\n if (jQuery(this).parent().hasClass('active')) {\n jQuery(this).parent().removeClass('active');\n } else {\n jQuery('.menu-toggle').parent().removeClass('active');\n jQuery(this).parent().addClass('active');\n }\n });\n}", "function openHeaderMenuOnMobile() {\n $('#nav-icon-menu').click(function(){\n $(this).toggleClass('open');\n $('body').toggleClass('navigation-opened');\n });\n}", "function toggleMenu(event) {\n\tif (event.type === \"touchstart\") event.preventDefault();\n\n\n\tconst navigationMenu = document.querySelector(\".c-menu\");\n\n\tnavigationMenu.classList.toggle(\"is-menu--active\");\n\n\tconst activeNavigation = navigationMenu.classList.contains(\n\t\t\"is-menu--active\"\n\t);\n\tevent.currentTarget.setAttribute(\"aria-expanded\", activeNavigation);\n\n\n\tif (activeNavigation) {\n\t\tevent.currentTarget.setAttribute(\"aria-label\", \"Fechar Menu\");\n\t\t\n\t} else {\n\t\tevent.currentTarget.setAttribute(\"aria-label\", \"Abrir Menu\");\n\t}\n}", "function toggle() {\n const state = isActiveMenuState();\n const burgerMenuMarketingImage = document.querySelector('.js-burger-menu-marketing-widget__img');\n\n initLayeredMenuState();\n\n if (state) { // closing the menu\n switchClass(document.body, 'nav-is-closed-body', 'nav-is-open-body');\n switchClass(getContentWrapper(), 'nav-is-closed', 'nav-is-open');\n switchClass(getCurtain(), 'nav-is-closed-curtain', 'nav-is-open-curtain');\n switchClass(getButton(), INACTIVE_STATE_CLASS, ACTIVE_STATE_CLASS);\n } else { // opening the menu\n switchClass(document.body, 'nav-is-open-body', 'nav-is-closed-body');\n switchClass(getContentWrapper(), 'nav-is-open', 'nav-is-closed');\n switchClass(getCurtain(), 'nav-is-open-curtain', 'nav-is-closed-curtain');\n switchClass(getButton(), ACTIVE_STATE_CLASS, INACTIVE_STATE_CLASS);\n\n // lazyload the image for the burger-menu-marketing widget\n if (burgerMenuMarketingImage) {\n lazyLoading.lazyLoadImage(burgerMenuMarketingImage);\n }\n }\n\n triggerMenuStateEvent(state);\n}", "function showMenu() {\n scope.menu = !scope.menu;\n $document.find('body').toggleClass('em-is-disabled-small', scope.menu);\n }", "function togglemenu(){\r\n\t\tvar menuToggle = document.querySelector('.toggle');\r\n\t\tvar menu = document.querySelector('.menu');\r\n\t\tmenuToggle.classList.toggle('active');\r\n\t\tmenu.classList.toggle('active');\r\n\t}", "function hideMenu() {\n if (isMobile()) {\n $('.menu-bar').toggleClass('menu-open');\n $('.menu').toggleClass('menu-list-open');\n }\n}", "function toggleMenuOn() {\n if ( menuState !== 1 ) {\n menuState = 1;\n menu.classList.add( contextMenuActive );\n }\n }", "function toggleMenuOn() {\n if (menuState !== 1) {\n menuState = 1;\n menu.classList.add(contextMenuActive);\n }\n}", "toggleMenu(){\n this.menuContent.toggleClass('site-nav--is-visible');\n this.siteHeader.toggleClass('site-header--is-expanded');\n this.menuIcon.toggleClass('site-header__menu-icon--close-x');\n this.siteHeaderLogo.toggleClass ('site-header__logo--transparent');\n }", "function lgMenu() {\n\t\t// unbind click events\n\t\t$('.menu-toggle a').off('click');\n\n\t\t// remove dynamic classes and span tags\n\t\t$('.main-nav').find('span.indicator').remove();\n\t\t$('.menu-toggle a').remove();\n\n\t\t// return windowState\n\t\twindowState = 'large';\n\t}", "function toggleMenuOn() {\n if (menuState !== 1) {\n menuState = 1;\n menu.classList.add(contextMenuActive);\n }\n }", "function setMenuToggler() {\n var menuButton = document.getElementById('menu');\n var responsiveMenu = document.getElementById('responsive-menu');\n var showMenu = false;\n\n function toggle(show) {\n show ? responsiveMenu.classList.add('show')\n : responsiveMenu.classList.remove('show');\n }\n\n function handleToggle() {\n showMenu = !showMenu\n toggle(showMenu);\n }\n menuButton.onclick = handleToggle;\n}", "function showMobileMenu(event){\n\n $ = jQuery;\n\n $(event).toggleClass('close-mobile-menu');\n $(event).find('.fa').toggleClass('fa-bars fa-close');\n $(event).closest('.topNav').find('ul').first().slideToggle(200);\n return false;\n\n}", "toggleMenu(){\n const toggleButton = document.querySelector('.header-toggle-menu')\n const headerMenu = document.querySelector('.header-menu')\n\n toggleButton.classList.toggle('clicked-toggle')\n headerMenu.classList.toggle('display-menu')\n }", "function toggle()\n {\n menuBtn.classList.toggle(\"open\");\n menuItems.classList.toggle(\"open\");\n }", "function toggleMenu(){\n if(onNewsPost == \"yes\"){\n goBackToTabs();\n return;\n }\n console.log(\"Toggle Menu\");\n $(\".mdl-layout__drawer-button\").click();\n}", "function toggleMenu() {\n $(\".menu-content\").toggleClass(\"show\");\n}", "function menuToggler() {\r\n\t\tif ($('.mobile-menu-closer').length) {\r\n\t\t\t$('.mobile-menu-closer').on('click', function () {\r\n\t\t\t\t$('.mobile-menu').css({\r\n\t\t\t\t\t'right': '-150%'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t\tif ($('.mobile-menu-opener').length) {\r\n\t\t\t$('.mobile-menu-opener').on('click', function () {\r\n\t\t\t\t$('.mobile-menu').css({\r\n\t\t\t\t\t'right': '0%'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t}", "function toggleMenu() {\n\t// checks if menu is open or close\n\tif(!showMenu) { \n\t\t// adds close class to menu button and open clase to menu navigation\n\t\tmenuBtn.classList.add('close');\n\t\tmainNav.classList.add('open');\n\t\tmenuList.classList.add('open');\n\n\t\t// sets new menu state to be opened\n\t\tshowMenu = true;\n\t} else {\n\t\t// removes close class from menu button and open class from menu naigation\n\t\tmenuBtn.classList.remove('close');\n\t\tmainNav.classList.remove('open');\n\t\tmenuList.classList.remove('open');\n\n\t\t// sets menu state to be closed\n showMenu = false;\n }\n}", "function toggleHorizontalMobileMenu() {\n vm.bodyEl.toggleClass('ms-navigation-horizontal-mobile-menu-active');\n }", "function toggleMenu() {\n menuNav.classList.toggle('menu-toggle');\n }", "function toggleHorizontalMobileMenu() {\n vm.bodyEl.toggleClass('ms-navigation-horizontal-mobile-menu-active');\n }", "toggleMenu() {\n this.tl.reversed(!this.tl.reversed());\n\n if (!this.state.isMenuExpanded) {\n this.showTargetElement();\n }\n else {\n\n }\n\n this.setState({ isMenuExpanded: !this.state.isMenuExpanded });\n }", "function mobileDetect() {\n if( $('.menu-button').css('display')==='inline-block') {\n isMobile = true; \n }\n \n if (isMobile === true) {\n $('#toggle1').click();\n } \n}", "function toggleMenu() {\n if(!showMenu){\n // Add relevant classes to each of the components\n menuBtn.classList.add('close');\n menu.classList.add('show');\n menuPortrait.classList.add('show');\n menuList.classList.add('show');\n menuItems.forEach(item => item.classList.add('show'));\n // Set state of the Menu\n showMenu = true;\n\n } else{\n menuBtn.classList.remove('close');\n menu.classList.remove('show');\n menuPortrait.classList.remove('show');\n menuList.classList.remove('show');\n menuItems.forEach(item => item.classList.remove('show'));\n // Set the state of the Menu\n showMenu = false;\n }\n \n}", "handleMouseDownOnMenu(e) {\n if (window.innerWidth <= 768) {\n this.toggleMenu();\n }\n e.stopPropagation();\n }", "toggleMobileMenu() {\n const now = new Date();\n\n // debouncing\n if (now.getTime() - 700 < this.menuLastToggled.getTime()) {\n return false;\n } else {\n this.menuLastToggled = new Date();\n }\n\n // toggling\n if (this.$navbar.hasClass('mobile open')) {\n this.closeMobileMenu();\n } else {\n this.openMobileMenu();\n }\n }", "function toggleMenuDesktop () {\r\n\tif($(\"#toggle_menu_wrapper\").length) {\r\n\t\t$(\".toggle_button\").on('click', function() {\r\n\t\t\t$('.toggle_dropdown').addClass(\"open_toggle\");\r\n\t\t\t$('.toggle_dropdown .main_menu').fadeIn(1300);\r\n\t\t});\r\n\t\t$(\".toggle_button.dismiss\").on('click', function() {\r\n\t\t\t$('.toggle_dropdown').removeClass(\"open_toggle\");\r\n\t\t\t$('.toggle_dropdown .main_menu').fadeOut(100);\r\n\t\t});\r\n\t} \r\n}", "function toggleMobileMenu() {\n\n\t// get the html and menu\n\tconst menu = document.getElementById('mobile-menu');\n\tconst body = document.body;\n\n\t// check if open\n\tif(menu.classList.contains(\"mobile-menu--active\")) {\n\n\t\t// close the menu\n\t\tmenu.classList.remove('mobile-menu--active');\n\t\tbody.classList.remove(\"no-scroll\");\n\n\t\t// enable scroll\n\t\tstopBodyScrolling(false);\n\n\t} else {\n\n\t\t// close the menu\n\t\tmenu.classList.add('mobile-menu--active');\n\t\tbody.classList.add(\"no-scroll\");\n\n\t\t// disable scroll\n\t\tstopBodyScrolling(true);\n\n\t}\n\n}", "function toggleMenu() {\n\t\t$('.header__burger').toggleClass('active');\n\t\t$('.header__menu').toggleClass('active');\n\t\t$('body').toggleClass('lock');\n\t}", "toggleMenu() {\n if (!Foundation.MediaQuery.atLeast(this.options.hideFor)) {\n /**\n * Fires when the element attached to the tab bar toggles.\n * @event ResponsiveToggle#toggled\n */\n if(this.options.animate) {\n if (this.$targetMenu.is(':hidden')) {\n Foundation.Motion.animateIn(this.$targetMenu, this.animationIn, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n this.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');\n });\n }\n else {\n Foundation.Motion.animateOut(this.$targetMenu, this.animationOut, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n });\n }\n }\n else {\n this.$targetMenu.toggle(0);\n this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');\n this.$element.trigger('toggled.zf.responsiveToggle');\n }\n }\n }", "function onClickMenu(){\n\tdocument.getElementById(\"menu\").classList.toggle(\"change\");\n\tdocument.getElementById(\"nav\").classList.toggle(\"change\");\n\tdocument.getElementById(\"menu-bg\").classList.toggle(\"change-bg\");\n}", "function mobileMenu() {\n $('button.menu').click(() => {\n // Ajout de la classe open et animating qui sert pour la durée de la transition\n $('header nav').toggleClass('open animating');\n\n // Blocage de la fermeture le temps de la transition\n $('header nav').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', () => {\n $('header nav').removeClass('animating');\n });\n });\n\n $('.overlay').click(() => {\n $('header nav.open:not(.animating)').removeClass('open');\n });\n}", "toggleTheMenu() {\n\t\t// alert(this);\n\t\tthis.menuContent.toggleClass(\"site-header__menu-content--is-visible\");\n\t\tthis.siteHeader.toggleClass(\"site-header--is-expanded\");\n\t\tthis.menuIcon.toggleClass(\"site-header__menu-icon--close-x\");\n\t}", "function toggleMenu() {\n document.getElementById(\"nav-menu\").classList.toggle(\"show-menu\");\n}", "function hamburgerMenu(){\n\tdocument.getElementsByClassName(\"menu\")[0].classList.toggle(\"responsive\");\n}", "function toggle() {\n if ($scope.menuState === openState) {\n close();\n } else {\n open();\n }\n }", "function toggleMenu(e) {\n if (menu.classList.contains('show')) {\n menu.classList.remove('show')\n } else {\n menu.classList.add('show')\n }\n}", "function toggleMenu() {\n if(!showmenu) {\n menubtn.classList.add('close');\n menu.classList.add('show');\n menunav.classList.add('show');\n menuitem.forEach(item => item.classList.add('show'));\n \n //set menu state\n showmenu = true;\n\n } else {\n menubtn.classList.remove('close');\n menu.classList.remove('show');\n menunav.classList.remove('show');\n menuitem.forEach(item => item.classList.remove('show'));\n \n //set menu state\n showmenu = false;\n \n }\n}", "function showNav() {\n \n if (this.wasClicked == false) {\n menuStyle.setAttribute(\"class\", \"responsive-style\");\n this.wasClicked = true;\n } else if (this.wasClicked == true) {\n menuStyle.removeAttribute(\"class\", \"responsive-style\");\n this.wasClicked = false;\n } \n}", "function onClickMenu() {\n document.getElementById(\"menu\").classList.toggle(\"change\");\n \n document.getElementById(\"nav\").classList.toggle(\"change\");\n \n document.getElementById(\"menu-bg\").classList.toggle(\"change-bg\");\n }", "function menuChange(status) {\n status == 'enable' ? mobileInit() : desktopInit();\n}", "function menu() {\n html.classList.toggle('menu-active');\n }", "function toggleMenu(){\r\n\t\tlet navigation = document.querySelector('.navigation');\r\n\t\tnavigation.classList.toggle('opensidebar');\r\n\t}", "function toggleMenu() {\n if (nav.classList.contains(\"show-menu\")) {\n nav.classList.remove(\"show-menu\")\n } else {\n nav.classList.add(\"show-menu\")\n }\n}", "function toggleMobileNavi() {\n\n\tif (isMobile == 1) {\n\t\t$('.touchclick').parent().removeClass('hover');\n\t\t$('.nav-primary').show();\n\t\t$('.hamburger').toggleClass('is-active');\n\t\t$('nav').toggleClass('on');\n\t\t$('#navi-lightbox').toggleClass('on');\n\t} else if (isMobile == 0) {\n\t\ttoggleMainNavi();\n\t}\n}", "function switchMenu() {\n let menu = document.getElementById(\"menu\");\n\n if (menu.style.display === \"block\")\n {\n showSide();\n menu.style.display = \"none\";\n }\n else\n {\n hideSide();\n menu.style.display = \"block\";\n }\n}", "function mobileMenu() {\n var x = document.getElementById(\"myLinks\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n }", "function toggleScreen() {\n var x = document.getElementById(\"changeIcon\");\n if (x.className === \"fas fa-expand-arrows-alt\") {\n x.className = \"fas fa-compress-arrows-alt\";\n openFullscreen();\n } else {\n x.className = \"fas fa-expand-arrows-alt\";\n closeFullscreen();\n }\n }", "function expandMenu() {\n var windowsize = $window.width();\n if (windowsize < hamburgerWidth) {\n // hamburger menu\n $(\".ked-navigation .sidebar\").css(\"height\", \"100vh\");\n $(\".sv-grid-ksgs12\").first().addClass('hamburger'); // So CSS can adjust padding rule accordingly\n pinIcon.hide(); // Don't support pinning when in hamburger menu yet.\n } else {\n // normal menu\n $(\".ked-navigation .sidebar\").css(\"width\", \"290px\");\n $(\".sv-grid-ksgs12\").first().removeClass('hamburger'); // So CSS can adjust padding rule accordingly\n }\n timeoutId = null;\n if (!pinned) pinIcon.css(\"opacity\", 0.5);\n $(\".ked-navigation .logo span\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a .state-indicator\").css(\"opacity\", \"1\");\n $(\".ked-navigation .search .search-field\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"1\");\n }", "function toggleMenu(menu) {\n\tmenu.classList.toggle(\"active\");\n}", "function mobileMenu() {\n //check if mobile menu button is shown\n if ($mobileButton.css(\"display\") === \"block\") {\n //if mobile menu button is shown then hide menu links\n $subMenu.removeClass(\"sub-menu\");\n $subMenu.addClass(\"menu-slideIn\");\n $(\".mobile_third ul\").addClass(\"menu-slideIn\");\n $mobileLinkContain.hide();\n } else if ($mobileButton.css(\"display\") === \"none\") {\n //if mobile menu button is hidden then show menu links\n $mobileLinkContain.show();\n $subMenu.removeClass(\"menu-slideIn\");\n $(\".mobile_third ul\").removeClass(\"menu-slideIn\");\n $subMenu.addClass(\"sub-menu\");\n }\n }//end mobileMenu function", "function toggleMenu () {\n\tvar menu = $('.menu');\n\tvar menubtn = $('.open-menu');\n\tif (menubtn.hasClass('opened')) {\n\t\tmenubtn.removeClass('opened');\n\t\tmenu.height(0);\n\t} else {\n\t\tmenubtn.addClass('opened');\n\t\tmenu.height($(window).height());\n\t}\n}", "showMenu() {\n this.$('jira-sidebar__menu').removeClass('jira-hidden');\n this.animate('in', width.sidebarSmall);\n }", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function togglemenu() {\n var vw = $(window)[0].innerWidth;\n if ($(\".pcoded-navbar\").hasClass('theme-horizontal') == false) {\n if (vw <= 1200 && vw >= 992) {\n $(\".pcoded-navbar\").addClass(\"navbar-collapsed\");\n }\n if (vw < 992 || vw > 1200) {\n $(\".pcoded-navbar\").removeClass(\"navbar-collapsed\");\n }\n }\n}", "function toggleMenu(x) {\r\n x.classList.toggle(\"change\");\r\n //if change class is present, show nav-item\r\n if(menu.className === \"menu change\") {\r\n for(let i=0; i<navItem.length; i+=1) {\r\n navItem[i].style.display = \"block\";\r\n mainHeader.style.height = \"46%\";\r\n box.style.marginTop = \"0\";\r\n }\r\n } else { //if not, return to initial by calling checkQuery\r\n checkQuery(query768);\r\n }\r\n\r\n}", "function my_toggle_menudropdown(){\n\n $('.js-toggle-menu-dropdown').off();\n $('.js-toggle-menu-dropdown').click(function(){\n $('.js-menu-dropdown').toggleClass('is-active');\n $('.js-header').toggleClass('is-active');\n });\n\n }", "function togglemenu() {\r\n var vw = $(window)[0].innerWidth;\r\n if ($(\".pcoded-navbar\").hasClass('theme-horizontal') == false) {\r\n if (vw <= 1200 && vw >= 992) {\r\n $(\".pcoded-navbar\").addClass(\"navbar-collapsed\");\r\n }\r\n if (vw < 992) {\r\n $(\".pcoded-navbar\").removeClass(\"navbar-collapsed\");\r\n }\r\n }\r\n}", "toggleMenu() {\n return this._menuOpen ? this.closeMenu() : this.openMenu();\n }" ]
[ "0.86165327", "0.8036715", "0.780012", "0.77065015", "0.75995696", "0.7574694", "0.75403684", "0.7524451", "0.75068945", "0.75068945", "0.7503618", "0.7501699", "0.74886316", "0.7467993", "0.746118", "0.7406113", "0.7406113", "0.74043226", "0.73866475", "0.73753613", "0.7348218", "0.73376256", "0.73281986", "0.7314451", "0.73052883", "0.7302974", "0.72853166", "0.7272426", "0.7252583", "0.72385746", "0.7238419", "0.72309256", "0.7228532", "0.722598", "0.72251576", "0.72243315", "0.7213873", "0.7211032", "0.7183936", "0.716383", "0.7147881", "0.71465737", "0.7134331", "0.7126751", "0.7109491", "0.7096974", "0.7092233", "0.708645", "0.7078181", "0.70770663", "0.7077017", "0.7067912", "0.70608187", "0.7059264", "0.7054843", "0.70501596", "0.7044823", "0.70293945", "0.70256", "0.70230174", "0.70158005", "0.70117867", "0.70082265", "0.70002085", "0.69981164", "0.6997512", "0.6990846", "0.6990211", "0.6987727", "0.698683", "0.6980942", "0.69787174", "0.6972072", "0.6971874", "0.69580495", "0.69474745", "0.6928687", "0.6924587", "0.69193727", "0.6915685", "0.69154507", "0.69148874", "0.6909548", "0.6908328", "0.6908206", "0.690685", "0.68915564", "0.6887303", "0.6872708", "0.68710935", "0.6869527", "0.68613154", "0.6854004", "0.68477273", "0.6844612", "0.6844612", "0.68442446", "0.6842931", "0.68234533", "0.68195", "0.68191683" ]
0.0
-1
Drop in replacement of the `Radio`, `Switch` and `Checkbox` component. Use this component if you want to display an extra label.
function FormControlLabel(props, context) { var checked = props.checked, classes = props.classes, classNameProp = props.className, control = props.control, disabledProp = props.disabled, inputRef = props.inputRef, label = props.label, name = props.name, onChange = props.onChange, value = props.value, other = (0, _objectWithoutProperties3.default)(props, ['checked', 'classes', 'className', 'control', 'disabled', 'inputRef', 'label', 'name', 'onChange', 'value']); var muiFormControl = context.muiFormControl; var disabled = disabledProp; if (typeof control.props.disabled !== 'undefined') { if (typeof disabled === 'undefined') { disabled = control.props.disabled; } } if (muiFormControl) { if (typeof disabled === 'undefined') { disabled = muiFormControl.disabled; } } var className = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.disabled, disabled), classNameProp); return _react2.default.createElement( 'label', (0, _extends3.default)({ className: className }, other), _react2.default.cloneElement(control, { disabled: disabled, checked: typeof control.props.checked === 'undefined' ? checked : control.props.checked, name: control.props.name || name, onChange: control.props.onChange || onChange, value: control.props.value || value, inputRef: control.props.inputRef || inputRef }), _react2.default.createElement( _Typography2.default, { component: 'span', className: classes.label }, label ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Label(_ref) {\n var htmlFor = _ref.htmlFor,\n label = _ref.label,\n required = _ref.required;\n return _react.default.createElement(\"label\", {\n style: {\n display: \"block\"\n },\n htmlFor: htmlFor\n }, label, \" \", required && _react.default.createElement(\"span\", {\n style: {\n color: \"red\"\n }\n }, \" *\"));\n}", "function Label({\n children,\n className,\n disabled,\n hide,\n id,\n invalid,\n required,\n}) {\n if (hide) {\n return (\n <label\n id={`${id}Label`}\n htmlFor={id}\n style={{ position: 'relative' }}\n >\n <VisuallyHidden>{children}</VisuallyHidden>\n </label>\n );\n }\n\n const labelClasses = classNames(\n 'db',\n 'mb-2',\n 'fs-6',\n 'fw-700',\n {\n 'neutral-500': disabled,\n red: invalid,\n },\n className,\n );\n\n return (\n <Block direction=\"column\">\n <label id={`${id}Label`} htmlFor={id} className={labelClasses}>\n <span className={classNames({ 'required-input': required })}>\n {children}\n </span>\n </label>\n </Block>\n );\n}", "function FormControlLabel(props, context) {\n var checked = props.checked,\n classes = props.classes,\n classNameProp = props.className,\n control = props.control,\n disabledProp = props.disabled,\n inputRef = props.inputRef,\n label = props.label,\n name = props.name,\n onChange = props.onChange,\n value = props.value,\n other = (0, _objectWithoutProperties3.default)(props, ['checked', 'classes', 'className', 'control', 'disabled', 'inputRef', 'label', 'name', 'onChange', 'value']);\n var muiFormControl = context.muiFormControl;\n\n var disabled = disabledProp;\n\n if (typeof control.props.disabled !== 'undefined') {\n if (typeof disabled === 'undefined') {\n disabled = control.props.disabled;\n }\n }\n\n if (muiFormControl) {\n if (typeof disabled === 'undefined') {\n disabled = muiFormControl.disabled;\n }\n }\n\n var className = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.disabled, disabled), classNameProp);\n\n return _react2.default.createElement(\n 'label',\n (0, _extends3.default)({ className: className }, other),\n _react2.default.cloneElement(control, {\n disabled: disabled,\n checked: typeof control.props.checked === 'undefined' ? checked : control.props.checked,\n name: control.props.name || name,\n onChange: control.props.onChange || onChange,\n value: control.props.value || value,\n inputRef: control.props.inputRef || inputRef\n }),\n _react2.default.createElement(\n _Typography2.default,\n {\n component: 'span',\n className: (0, _classnames2.default)(classes.label, (0, _defineProperty3.default)({}, classes.disabled, disabled))\n },\n label\n )\n );\n}", "function Label(props) {\n const {\n attached, children, color, corner, className, circular, detail, detailLink, floating, horizontal, icon,\n image, link, onClick, onClickDetail, onClickRemove, pointing, removable, ribbon, size, tag, text,\n ...rest,\n } = props\n\n const handleClick = e => onClick && onClick(e, props)\n const handleClickRemove = e => onClickRemove && onClickRemove(e, props)\n const handleClickDetail = e => onClickDetail && onClickDetail(e, props)\n\n const _component = image || link || onClick ? 'a' : 'div'\n\n const classes = cx('sd-label ui',\n size,\n color,\n useKeyOnly(floating, 'floating'),\n useKeyOnly(horizontal, 'horizontal'),\n useKeyOnly(tag, 'tag'),\n useValueAndKey(attached, 'attached'),\n useValueAndKey(corner, 'corner'),\n useKeyOrValueAndKey(pointing, 'pointing'),\n useKeyOrValueAndKey(ribbon, 'ribbon'),\n circular && (children && 'circular' || 'empty circular'),\n // TODO how to handle image child with no image class? there are two image style labels.\n (image || someChildType(children, Image) || someChildType(children, 'img')) && 'image',\n 'label',\n className\n )\n\n const _props = {\n className: classes,\n onClick: handleClick,\n ...rest,\n }\n\n const _detail = detail || detailLink\n const detailComponent = (detailLink || onClickDetail) && 'a' || detail && 'div'\n\n const _children = createFragment({\n icon: iconPropRenderer(icon),\n image: imagePropRenderer(image),\n text,\n children,\n detail: _detail && createElement(detailComponent, { className: 'detail', onClick: handleClickDetail }, _detail),\n remove: (removable || onClickRemove) && <Icon className='delete' onClick={handleClickRemove} />,\n })\n\n // Do not destructure createElement import\n // react-docgen only recognizes a stateless component when React.createElement is returned\n return React.createElement(_component, _props, _children)\n}", "function renderLabel({ labelName, uid }) {\r\n return <Label className=\"mb-5\" htmlFor={uid} labelName={labelName} />;\r\n }", "set _label(value) {\n Helper.UpdateInputAttribute(this, \"label\", value);\n }", "set _label(value) {\n Helper.UpdateInputAttribute(this, \"label\", value);\n }", "addLabel(component) {\nthis\n.addInfoToComponent(component, formEditorConstants.COMPONENT_TYPE_LABEL)\n.addProperty(component, 'name', this._componentList.findComponentText(component.type, 'name', 'Label'))\n.addProperty(component, 'zIndex', 0)\n.addProperty(component, 'fontSize', 16)\n.addProperty(component, 'text', component.text || component.name)\n.addProperty(component, 'hAlign', 'left');\nreturn component;\n}", "@readOnly\n @computed('label', 'opened')\n ariaLabel (label, opened) {\n const verb = opened ? 'Hide' : 'Show'\n\n if (label) {\n return `${verb} ${label} combobox`\n }\n\n return `${verb} combobox`\n }", "function VLabel(value, name, isMandatory, isADControl) {\n value = value != null ? value.replace(\"[&]\", \"\") : \"\";\n var strFor = ' for=\"' + name + '\"';\n if (isADControl)\n strFor = '';\n\n var $ctrl = $('<label ' + strFor + '></label>');\n\n IControl.call(this, $ctrl, VIS.DisplayType.Label, true, isADControl ? name : \"lbl\" + name);\n if (isMandatory) {\n $ctrl.text(value).append(\"<sup>*</sup>\");\n }\n else {\n $ctrl.text(value);\n }\n\n this.disposeComponent = function () {\n $ctrl = null;\n self = null;\n }\n }", "function FieldLabel({ model }) {\n const { label, isMandatory } = model;\n\n if (!label || label.length === 0) {\n return null;\n }\n return (\n <div className=\"ff-field-label\" >\n {label}\n {(isMandatory) && (\n <span className=\"ff-field-mandatory\">*</span>\n )}\n </div>\n );\n}", "labelClass () {\n let klass = ''\n\n if (this.state.error) {\n klass += ' usa-input-error-label'\n }\n\n if (this.state.checked) {\n klass += ' checked'\n }\n\n if (this.state.focus) {\n klass += ' usa-input-focus'\n }\n\n return klass.trim()\n }", "formatDefaultLabel(text) {\n const { disabled, onFocus, onBlur, onClick } = this.props\n const { value, open } = this.state\n return (\n disabled ?\n <DropDownLabel disabled>\n {text}\n </DropDownLabel>\n : <DropDownLabel \n onFocus={onFocus} \n onBlur={onBlur} \n isPlaceHolder={value === ''} \n onClick={\n () => {\n this.toggleOpen(!open)\n if (onClick) onClick()\n }\n }>\n {text}\n </DropDownLabel>\n )\n }", "get escapeLabelHTML() {\n return false;\n }", "function _updateLabelFor(){\n\t\tvar aFields = this.getFields();\n\t\tvar oField = aFields.length > 0 ? aFields[0] : null;\n\n\t\tvar oLabel = this._oLabel;\n\t\tif (oLabel) {\n\t\t\toLabel.setLabelFor(oField); // as Label is internal of FormElement, we can use original labelFor\n\t\t} else {\n\t\t\toLabel = this.getLabel();\n\t\t\tif (oLabel instanceof Control /*might also be a string*/) {\n\t\t\t\toLabel.setAlternativeLabelFor(oField);\n\t\t\t}\n\t\t}\n\t}", "function CheckBox(props) {\n return (\n <div className=\"p-2\">\n <label className=\"custom-control custom-checkbox\">\n <span className=\"custom-control-description\">{props.title}</span>\n <input type=\"checkbox\" className=\"custom-control-input check\" onChange={props.onChange}/>\n \n \n <span className=\"custom-control-indicator\"></span>\n</label>\n </div>\n );\n}", "addLabel(label) {\n if ('labels' in this.fieldNode) {\n this._givenLabels = this.fieldNode.labels.__childNodes.map(labelNode => labelNode._value);\n if (this._givenLabels.indexOf(label) === -1) {\n this.fieldNode.labels.createField({ fieldName: label, type: 'bool', _value: true });\n }\n } else {\n // attention, this is for ui only, this label will never sent back to the server\n this._addVirtualLabel(label);\n }\n }", "get label() {\n if (this.isObject(this.options)) {\n return this.options.label;\n }\n else {\n return '';\n }\n }", "renderLabel() {\n return (\n {\n Name: () => {\n if (this.state.error[0] === true) {\n return <Label bsStyle=\"danger\">Please input Name</Label>\n }\n },\n Address: () => {\n if (this.state.error[1] === true) {\n return <Label bsStyle=\"danger\">Please input Address</Label>\n }\n },\n Revenue: () => {\n if (this.state.error[2] === true) {\n return <Label bsStyle=\"danger\">Please input Revenue</Label>\n }\n },\n Phone: () => {\n if (this.state.error[3] === true || this.state.error[4] === true) {\n return <Label bsStyle=\"danger\">Please input Code & Phone Number</Label>\n }\n }\n }\n )\n }", "function NamaLabel(props) {\n return <label>{props.name}</label>;\n}", "connectedCallback() {\n super.connectedCallback();\n\n if (this.textContent) {\n this.setAttribute('aria-label', this.textContent);\n } else {\n // Describe the generic component if no label is provided\n this.setAttribute('aria-label', 'Text field');\n }\n }", "get label() {\n return this.getLabel();\n }", "function radio(el, value, label) {\n // UNDONE: template\n \n if (label.charAt(0) != ' ') label = ' '+label;\n var input = \"<input type='radio' name='\" + name + \"' value='\" + value + \"'>\";\n el.append(input, label, \"<br>\");\n }", "@readOnly\n @computed('renderLabel')\n addLabel (renderLabel) {\n return `Add ${Ember.String.singularize(renderLabel).toLowerCase()}`\n }", "function InputWithLabelElem(props) {\n return (\n <div>\n <label style={{fontSize: \"0.8em\"}}>{props.labelText}</label>\n {props.showCopy &&\n <button\n onClick={() => {\n copy(props.value)\n }}\n >\n Copy\n </button>\n }\n <TextareaElement\n {...defaultProps(props)}\n />\n </div>\n );\n}", "function LabelOptions() {}", "function FormLabel({ labelStyle, ...restProps }) {\n return (\n <RNEFormLabel labelStyle={[defaultTextStyle, labelStyle]} {...restProps} />\n );\n}", "function _updateLabelFor(){\n\n\t\tvar oField = this._getFieldRelevantForLabel();\n\n\t\tif (oField) {\n\t\t\tif (this._oLabel) {\n\t\t\t\tthis._oLabel.setLabelFor(oField); // as Label is internal of FormElement, we can use original labelFor\n\t\t\t}\n\t\t\treturn; // use SmartField logic\n\t\t}\n\n\t\tvar aFields = this.getFields();\n\t\toField = aFields.length > 0 ? aFields[0] : null;\n\n\t\tif (oField instanceof VBox) {\n\t\t\tvar aItems = oField.getItems();\n\t\t\tif (aItems[1] instanceof HBox) {\n\t\t\t\toField = aItems[1].getItems()[0];\n\t\t\t} else {\n\t\t\t\toField = aItems[1];\n\t\t\t}\n\t\t}\n\n\t\tvar oLabel = this._oLabel;\n\t\tif (oLabel) {\n\t\t\toLabel.setLabelFor(oField); // as Label is internal of FormElement, we can use original labelFor\n\t\t} else {\n\t\t\toLabel = this.getLabel();\n\t\t\tif (oLabel instanceof sap.ui.core.Control /*might also be a string*/) {\n\t\t\t\toLabel.setAlternativeLabelFor(oField);\n\t\t\t}\n\t\t}\n\n\t}", "render() {\n if (this.textContent) {\n return html`\n <label part=\"label\" for=\"${this.name}\"><slot /></label>\n ${this.renderSelect()}\n `;\n }\n return this.renderSelect();\n }", "function Label() {\n Label.super.apply(this, arguments);\n}", "connectedCallback() {\n super.connectedCallback();\n\n if (this.textContent) {\n this.setAttribute('aria-label', this.textContent);\n } else {\n // Fallback to the label if there is no text content\n this.setAttribute('aria-label', 'Radio');\n }\n }", "connectedCallback() {\n super.connectedCallback();\n\n if (this.textContent) {\n this.setAttribute('aria-label', this.textContent);\n } else {\n // Fallback to the label if there is no text content\n this.setAttribute('aria-label', 'Checkbox');\n }\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"TwoImagedRadios\">\n\t\t\t\t<input onClick={()=>{this.props.isSelected()}} type=\"radio\" id=\"First\" name=\"ImageRad\" />\n\t\t\t\t<label\n\t\t\t\t\tclassName=\"FirstImage\"\n\t\t\t\t\tstyle={{ backgroundImage: `url(${this.props.url1})`, backgroundSize: 'cover' }}\n\t\t\t\t\tfor=\"First\"\n\t\t\t\t>\n\t\t\t\t\t{/*Don't insert anything here*/}\n\t\t\t\t</label>\n\n\t\t\t\t<input onClick={()=>{this.props.isSelected()}} type=\"radio\" id=\"Second\" name=\"ImageRad\" />\n\t\t\t\t<label\n\t\t\t\t\tclassName=\"SecondImage\"\n\t\t\t\t\tstyle={{ backgroundImage: `url(${this.props.url2})`, backgroundSize: 'cover' }}\n\t\t\t\t\tfor=\"Second\"\n\t\t\t\t>\n\t\t\t\t\t{/*Don't insert anything here*/}\n\t\t\t\t</label>\n\n\t\t\t\t<div className=\"labels\">\n\t\t\t\t\t<p className=\"FirstLabel\">{this.props.Label1}</p>\n\t\t\t\t\t<p className=\"SecondLabel\">{this.props.Label2}</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n return html`\n <article>\n ${this.label}\n </article>`;\n }", "get label() {\n\t\treturn this.nativeElement ? this.nativeElement.label : undefined;\n\t}", "function Checkbox({value, title, onClick}) {\n return <Wrapper onClick={onClick}>\n <Indicator value={value} />\n {title}\n </Wrapper>\n}", "get label(){ return this.__label; }", "function Radio({ className = \"\", ...rest }) {\n return <BaseCheckbox className={`radio ${className}`} type=\"radio\" {...rest} />\n}", "settings() {\n return {\n labelOn: 'Yes',\n labelOff: 'No'\n }\n }", "function RadioButton_UpdateCaption(theHTML, theObject)\n{\n\t//override\n\tCheckBox_UpdateCaption(theHTML, theObject);\n}", "function btn(name, value, checked) {\n\t\t\tvar lbl = document.createElement(\"label\");\n\t\t\tif (name.length > 20)\n\t\t\t\tlbl.title = name;\n\n\t\t\tvar b = document.createElement(\"input\");\n\t\t\tb.type = \"radio\";\n\t\t\tb.name = \"subtitle\";\n\t\t\tb.value = value;\n\t\t\tif (checked)\n\t\t\t\tb.checked = true;\n\n\t\t\tvar txt = document.createTextNode(\" \"+name);\n\n\t\t\tlbl.appendChild(b);\n\t\t\tlbl.appendChild(txt);\n\n\t\t\treturn lbl;\n\t\t}", "render () {\n\t\treturn <>\n\t\t\t<div className=\"floating-label\">\n\t\t\t\t<input\n\t\t\t\t\tclassName={`pb-1 pt-3 ${this.props.className}`}\n\t\t\t\t\ttype={this.props.type}\n\t\t\t\t\tid={this.props.id ? this.props.id : `floating-label${parseInt(Math.random() * 1000)}`}\n\t\t\t\t\tvalue={this.state.text}\n\t\t\t\t\tonChange={event => {\n\t\t\t\t\t\tthis.handleTextChange(event);\n\t\t\t\t\t\tif (this.props.onChange) {\n\t\t\t\t\t\t\tthis.props.onChange(event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}} />\n\n\t\t\t\t<label className={`pl-3 ${this.state.isActive ? \"floating-label-active\" : \"\"}`}>\n\t\t\t\t\t{this.props.label}\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t</>;\n\t}", "_hideLabelIfEmpty() {\n const label = this._elements.label;\n\n // If it's empty and has no non-textnode children, hide the label\n const hiddenValue = !(label.children.length === 0 && label.textContent.replace(/\\s*/g, '') === '');\n\n // Toggle the screen reader text\n this._elements.labelWrapper.style.margin = !hiddenValue ? '0' : '';\n this._elements.screenReaderOnly.hidden = hiddenValue || this.labelled;\n }", "html() {\n const div = document.createElement(\"div\");\n const input = document.createElement(\"input\");\n input.type = \"radio\";\n input.name = \"theme-radio\";\n input.id = this.name;\n const label = document.createElement(\"label\");\n label.htmlFor = this.name;\n label.innerHTML = this.name;\n div.appendChild(input);\n div.appendChild(label);\n return div;\n }", "get label() {\n return this._label;\n }", "function createLabel(labelValue) {\n let generalLabel = document.createElement('label')\n if (labelValue) {\n generalLabel.innerHTML = 'So early to Heaven? huh!'\n } else {\n generalLabel.setAttribute('value', ' ')\n }\n return generalLabel\n}", "static get LABEL_NONE () {return 'none';}", "get label () {\n\t\treturn this._label;\n\t}", "function FieldCheckbox({\n className,\n disabled,\n helpText,\n hideLabel,\n id,\n isInvalid,\n isSelected,\n label,\n onChange,\n required,\n toggle,\n validationText,\n value,\n ...rest\n}) {\n const labelSpan = (\n <span className={classNames({ 'required-input': required })}>\n {label}\n </span>\n );\n const checkboxMarkup = () => {\n const ariaLabelValue = hideLabel ? label : '';\n return (\n <Checkbox\n aria-label={ariaLabelValue}\n aria-required={required}\n className={toggle ? 'toggle-input' : null}\n disabled={disabled}\n id={id}\n isInvalid={isInvalid}\n isSelected={isSelected}\n key={id}\n onChange={onChange}\n required={required}\n toggle={toggle}\n value={value}\n {...rest}\n />\n );\n };\n\n const labelMarkup = () => {\n if (toggle) {\n const labelClasses = classNames('flex', {\n 'items-center': toggle && !isInvalid,\n red: isInvalid,\n });\n\n return (\n <label className={labelClasses} htmlFor={id}>\n <div\n className=\"flex-shrink-0 toggle-switch\"\n aria-hidden=\"true\"\n >\n <div\n className=\"toggle-text-left relative text-center fw-700 text-transform-uppercase\"\n aria-hidden=\"true\"\n >\n on\n </div>\n <div\n className=\"toggle-text-right relative text-center fw-700 text-transform-uppercase\"\n aria-hidden=\"true\"\n >\n off\n </div>\n </div>\n <div className=\"ml-2\">\n {!hideLabel && labelSpan}\n {helpTextMarkup()}\n {getValidationTextMarkup()}\n </div>\n </label>\n );\n }\n\n if (!hideLabel) {\n // normal checkbox\n const labelClasses = classNames('db', {\n red: isInvalid,\n });\n return (\n <Block direction=\"column\" className=\"ml-2\" width=\"100%\">\n <label htmlFor={id} className={labelClasses}>\n {labelSpan}\n <div>{helpTextMarkup()}</div>\n <div>{getValidationTextMarkup()}</div>\n </label>\n </Block>\n );\n }\n };\n\n const helpTextMarkup = () => {\n if (helpText === undefined || helpText === '') return;\n return (\n <Text size=\"6\" className=\"db mt-1\">\n {helpText}\n </Text>\n );\n };\n\n const getValidationTextMarkup = () => {\n if (!isInvalid || validationText === undefined) return;\n\n return (\n <Text appearance=\"danger\" size=\"6\" className=\"db pt-2\">\n {validationText}\n </Text>\n );\n };\n\n const classes = classNames(\n 'relative',\n {\n toggle,\n invalid: isInvalid,\n 'o-50': disabled,\n },\n className,\n );\n\n return (\n <Block className={classes}>\n {checkboxMarkup()}\n {labelMarkup()}\n </Block>\n );\n}", "function LabeledInput( options ) {\n\t// Clone options if necessary\n\toptions = ! options ? {} : options.internal ? options : Object.create( options ) ;\n\toptions.internal = true ;\n\n\tElement.call( this , options ) ;\n\n\t// For text-input only\n\tthis.hiddenContent = options.hiddenContent ;\n\tthis.hasInputFocus = false ;\n\n\t// For SelectList, this apply temp zIndex manipulation for the children to this element\n\tthis.interceptTempZIndex = true ;\n\n\tthis.labelFocusAttr = options.labelFocusAttr || { bold: true } ;\n\tthis.labelBlurAttr = options.labelBlurAttr || { dim: true } ;\n\n\tthis.buttonBlurAttr = options.buttonBlurAttr || { bgColor: 'cyan' , color: 'white' , bold: true } ;\n\tthis.buttonFocusAttr = options.buttonFocusAttr || { bgColor: 'brightCyan' , color: 'black' , bold: true } ;\n\tthis.buttonDisabledAttr = options.buttonDisabledAttr || { bgColor: 'cyan' , color: 'gray' , bold: true } ;\n\tthis.buttonSubmittedAttr = options.buttonSubmittedAttr || { bgColor: 'brightCyan' , color: 'brightWhite' , bold: true } ;\n\tthis.turnedOnBlurAttr = options.turnedOnBlurAttr || { bgColor: 'cyan' } ;\n\tthis.turnedOnFocusAttr = options.turnedOnFocusAttr || { bgColor: 'brightCyan' , color: 'gray' , bold: true } ;\n\tthis.turnedOffBlurAttr = options.turnedOffBlurAttr || { bgColor: 'gray' , dim: true } ;\n\tthis.turnedOffFocusAttr = options.turnedOffFocusAttr || { bgColor: 'white' , color: 'black' , bold: true } ;\n\n\t// TextBufffer needs computed attr, not object one\n\tthis.textAttr = options.textAttr || { bgColor: 'blue' } ;\n\tthis.voidAttr = options.voidAttr || options.emptyAttr || { bgColor: 'blue' } ;\n\n\tif ( options.keyBindings ) { this.keyBindings = options.keyBindings ; }\n\n\tif ( this.label ) {\n\t\tthis.labelText = new Text( {\n\t\t\tinternal: true ,\n\t\t\tparent: this ,\n\t\t\tcontent: this.label ,\n\t\t\tx: this.outputX ,\n\t\t\ty: this.outputY ,\n\t\t\theight: 1 ,\n\t\t\tattr: this.labelBlurAttr ,\n\t\t\tleftPadding: this.labelBlurLeftPadding ,\n\t\t\trightPadding: this.labelBlurRightPadding ,\n\t\t\tnoDraw: true\n\t\t} ) ;\n\t}\n\n\tthis.inputType = options.type || 'text' ;\n\n\tthis.onFocus = this.onFocus.bind( this ) ;\n\tthis.onClick = this.onClick.bind( this ) ;\n\tthis.onInputSubmit = this.onInputSubmit.bind( this ) ;\n\n\tthis.initInput( options ) ;\n\tthis.updateStatus() ;\n\n\tthis.on( 'key' , this.onKey ) ;\n\tthis.on( 'focus' , this.onFocus ) ;\n\tthis.on( 'click' , this.onClick ) ;\n\n\t// Only draw if we are not a superclass of the object\n\tif ( this.elementType === 'LabeledInput' && ! options.noDraw ) { this.draw() ; }\n}", "get label() {\n return this.getAttribute(\"name\");\n }", "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label() {\n Shape.call(this);\n\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "set label(label) {\n if (typeof label == s && s.length > 0) {\n this.element.setAttribute('label', label);\n }\n }", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(circular, 'circular'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(tag, 'tag'), 'labels', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(LabelGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(LabelGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "get text(){ return this.__label.text; }", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n\n labelRefs.bind(this, 'labelTarget');\n }", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(circular, 'circular'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(tag, 'tag'), 'labels', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(LabelGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(LabelGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(circular, 'circular'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"B\" /* useKeyOnly */])(tag, 'tag'), 'labels', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(LabelGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(LabelGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_4__lib__[\"d\" /* childrenUtils */].isNil(children) ? content : children\n );\n}", "function LabelOptions() { }", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "function Label() {\n Shape.call(this);\n /**\n * The labeled element\n *\n * @name Label#labelTarget\n * @type Base\n */\n labelRefs.bind(this, 'labelTarget');\n}", "getFormLabelContent() {\n\t\tif (this.props.textDictionary.labelText && this.props.textDictionary.labelText.length !== 0) {\n\t\t\treturn (\n\t\t\t\t<label className={ClassNameUtil.getClassNames(['fbra_passwordFormInput_label', 'fbra_test_passwordFormInput_label'])}>{this.props.textDictionary.labelText}</label>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n size = props.size,\n tag = props.tag;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(circular, 'circular'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useKeyOnly */])(tag, 'tag'), 'labels', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(LabelGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(LabelGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "function InputElem({label,type,...otherProps}) {\n return (\n <div className=\"input-container\">\n {label ? <label className=\"label\">{label}</label> : null}\n <input {...otherProps} type={type} className=\"input\" />\n </div>\n )\n}", "getAddNewLabel() {\n return 'Add New';\n }", "render() {\n\n\n // Otherwise return the Login form.\n return (\n <Label as='a' basic>\n {this.props.favorites.vendor}\n </Label>\n );\n }", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n size = props.size,\n tag = props.tag;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(circular, 'circular'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"a\" /* useKeyOnly */])(tag, 'tag'), 'labels', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"b\" /* getUnhandledProps */])(LabelGroup, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"c\" /* getElementType */])(LabelGroup, props);\n\n return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "function Label(opt_options) {\n // Initialization\n this.setValues(opt_options);\n\n var div = this.div_ = document.createElement('div');\n div.style.cssText = 'position: absolute; display: none;';\n }", "connectedCallback() {\n super.connectedCallback();\n\n if (this.textContent) {\n this.setAttribute('aria-label', this.textContent);\n } else {\n // Describe the generic component if no label is provided\n this.setAttribute('aria-label', 'Text area');\n }\n }", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useKeyOnly */])(circular, 'circular'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useKeyOnly */])(tag, 'tag'), 'labels', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(LabelGroup, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(LabelGroup, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* childrenUtils */].isNil(children) ? content : children);\n}", "function toggleLabel() {\n var input = $(this);\n setTimeout(function() {\n var def = input.attr('title');\n if (!input.val() || (input.val() == def)) {\n input.prev('span').css('visibility', '');\n if (def) {\n var dummy = $('<label></label>').text(def).css('visibility','hidden').appendTo('body');\n input.prev('span').css('margin-left', dummy.width() + 3 + 'px');\n dummy.remove();\n }\n } else {\n input.prev('span').css('visibility', 'hidden');\n }\n }, 0);\n }", "render() {\n return html `\n <div part=\"container\">\n <div part=\"check\"></div>\n </div>\n <div part=\"label\"><slot></slot></div>\n `;\n }", "function Label(opt_options) {\n // Initialization\n this.setValues(opt_options);\n\n // Label specific\n var span = this.span_ = document.createElement('span');\n span.style.cssText = 'position: relative; left: 0%; top: -8px; ' +\n\t\t\t\t'white-space: nowrap; border: 0px; font-family:arial; font-weight:bold;' +\n\t\t\t\t'padding: 2px; background-color: #ddd; '+\n\t\t\t\t'opacity: .75; '+\n\t\t\t\t'filter: alpha(opacity=75); '+\n\t\t\t\t'-ms-filter: \"alpha(opacity=75)\"; '+\n\t\t\t\t'-khtml-opacity: .75; '+\n '-moz-opacity: .75;';\n\n var div = this.div_ = document.createElement('div');\n div.appendChild(span);\n div.style.cssText = 'position: absolute; display: none; z-index:100';\n}", "addLabel(labelTitle){\r\n \r\n if (this.tabLabel ===\"\"){\r\n \r\n this.tabLabel= new LabelComponent(labelTitle, \"\");\r\n this.HTMLElement.prepend(this.tabLabel.HTMLElement);\r\n \r\n } else{\r\n \r\n this.tabLabel.changeLblTxt(labelTitle);\r\n }\r\n \r\n }", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('ui', color, size, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(circular, 'circular'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(tag, 'tag'), 'labels', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(LabelGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(LabelGroup, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()('ui', color, size, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(circular, 'circular'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(tag, 'tag'), 'labels', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(LabelGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(LabelGroup, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('ui', color, size, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(circular, 'circular'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(tag, 'tag'), 'labels', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(LabelGroup, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(LabelGroup, props);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_4__[\"childrenUtils\"].isNil(children) ? content : children);\n}", "function setupLabel() \n{\n\n if (jQuery('.label_check input').length) {\n jQuery('.label_check').each(function(){ \n jQuery(this).removeClass('c_on');\n });\n jQuery('.label_check input:checked').each(function(){ \n jQuery(this).parent('label').addClass('c_on');\n }); \n};\n\n\n\nif (jQuery('.label_radio input').length) {\n jQuery('.label_radio').each(function(){ \n jQuery(this).removeClass('r_on');\n });\n jQuery('.label_radio input:checked').each(function(){ \n jQuery(this).parent('label').addClass('r_on');\n });\n};\n\n\nif (jQuery('.label_thumb input').length) {\n jQuery('.label_thumb').each(function(){\n jQuery(this).removeClass('r_on');\n });\n jQuery('.label_thumb input:checked').each(function(){ \n jQuery(this).parent('label').addClass('r_on');\n });\n};\n\n\n\nif (jQuery('.label_tick input').length) {\n jQuery('.label_tick').each(function(){ \n jQuery(this).removeClass('r_on');\n });\n jQuery('.label_tick input:checked').each(function(){ \n jQuery(this).parent('label').addClass('r_on');\n });\n};\n\n\n\n\n}", "function Radio(props) {\n const { slider, toggle, type } = props\n const rest = getUnhandledProps(Radio, props)\n // const ElementType = getElementType(Radio, props)\n // radio, slider, toggle are exclusive\n // use an undefined radio if slider or toggle are present\n const radio = !(slider || toggle) || undefined\n\n return <Checkbox {...rest} type={type} radio={radio} slider={slider} toggle={toggle} />\n}", "function addLabel(el) {\n $(\"<span></span>\").appendTo(el).html(label);\n }", "render() {\n\t\tvar labelText = undefined\n\t\t// optional props, and a default value if no props found \n\t\tif (this.props.greet) {\n\t\t\tlabelText = this.props.greet\n\t\t} else {\n\t\t\tlabelText = 'OK'\n\t\t}\n\t\treturn (\n\t\t\t\t<div><button>{labelText}</button></div>\n\t\t);\n\t}", "nameLabel() {\n if (this.state.senatorOneName !== '') {\n return <h3 className=\"senator-name\">Your Senators: {this.state.senatorOneName} and {this.state.senatorTwoName} </h3>;\n }\n }", "function WixLabel() {\n\n this.isValid = function() {\n //TODO provide slightly better validation\n return this.name !== null\n && this.description !== null;\n };\n\n this.toJSON = function() {\n var _this = this;\n return {\n name : _this.name,\n description : _this.description\n };\n };\n}", "function Label(text) {\n _super.call(this);\n this.addClass(Label.Class);\n this.addClass(porcelain.CommonClass.SmallText);\n if (text) {\n this.setText(text);\n }\n }", "function setupLabel() \r\n{\r\n\r\n if (jQuery('.label_check input').length) {\r\n jQuery('.label_check').each(function(){ \r\n jQuery(this).removeClass('c_on');\r\n });\r\n jQuery('.label_check input:checked').each(function(){ \r\n jQuery(this).parent('label').addClass('c_on');\r\n }); \r\n};\r\n\r\n\r\n\r\nif (jQuery('.label_radio input').length) {\r\n jQuery('.label_radio').each(function(){ \r\n jQuery(this).removeClass('r_on');\r\n });\r\n jQuery('.label_radio input:checked').each(function(){ \r\n jQuery(this).parent('label').addClass('r_on');\r\n\r\n });\r\n};\r\n\r\nif (jQuery('.label_thumb input').length) {\r\n jQuery('.label_thumb').each(function(){ \r\n jQuery(this).removeClass('r_on');\r\n });\r\n jQuery('.label_thumb input:checked').each(function(){ \r\n jQuery(this).parent('label').addClass('r_on');\r\n });\r\n};\r\n\r\n\r\n\r\nif (jQuery('.label_tick input').length) {\r\n jQuery('.label_tick').each(function(){ \r\n jQuery(this).removeClass('r_on');\r\n });\r\n jQuery('.label_tick input:checked').each(function(){ \r\n jQuery(this).parent('label').addClass('r_on');\r\n });\r\n};\r\n\r\n\r\n\r\n\r\n}", "function CustomField({ accepter, name, label, ...props }) {\n return (\n <FormGroup>\n <ControlLabel>{label}</ControlLabel>\n <FormControl name={name} accepter={accepter} {...props} />\n </FormGroup>\n );\n}", "function LabelGroup(props) {\n var children = props.children,\n circular = props.circular,\n className = props.className,\n color = props.color,\n content = props.content,\n size = props.size,\n tag = props.tag;\n var classes = (0,clsx__WEBPACK_IMPORTED_MODULE_1__.default)('ui', color, size, (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(circular, 'circular'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(tag, 'tag'), 'labels', className);\n var rest = (0,_lib__WEBPACK_IMPORTED_MODULE_5__.default)(LabelGroup, props);\n var ElementType = (0,_lib__WEBPACK_IMPORTED_MODULE_6__.default)(LabelGroup, props);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(ElementType, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_7__.isNil(children) ? content : children);\n}", "function appendLabel(view,label,descriptor){\n const text = document.createElement('div');\n text.setAttribute('class','signInLabel');\n text.textContent = label;\n view.appendChild(text);\n const input = document.createElement('input');\n input.setAttribute('class','signIn');\n view.appendChild(input);\n input.setAttribute('id',label+' '+descriptor+' input');\n\n switch (label){\n case 'email address':\n input.type = 'email';\n break;\n case 'password':\n input.type = 'password';\n break;\n case 'confirm password':\n input.type = 'password';\n break;\n }\n\n return input;\n}", "function ThemeSelector(props) {\n return(\n <div className=\"onoffswitch\">\n <input type=\"checkbox\" name=\"onoffswitch\" className=\"onoffswitch-checkbox\" id=\"myonoffswitch\" defaultChecked onClick={props.onClick}/>\n <label className=\"onoffswitch-label\" htmlFor=\"myonoffswitch\">\n <span className=\"onoffswitch-inner\"></span>\n <span className=\"onoffswitch-switch\"></span>\n </label>\n </div>\n )\n}", "function defineLabels() {\r\n\tsteerAssistLabel = radioLabels[0];\r\n\tbrakeAssistLabel = radioLabels[1];\r\n\tABS_label = radioLabels[2];\r\n\tTC_label = radioLabels[3];\r\n\tSC_label = radioLabels[4];\r\n\tdamageLabel = radioLabels[5];\r\n\tgearLabel = radioLabels[6];\r\n\tclutchLabel = radioLabels[7];\r\n\tlineLabel = radioLabels[8];\r\n\t\r\n\tsetupLabel = checkboxesLabels[0];\r\n\tcontrollerLabel = checkboxesLabels[1];\r\n\tcameraLabel = checkboxesLabels[2];\r\n}", "get currentLabel() {\n return this._regOrToggled(this.label, this.toggledLabel, this.isToggled);\n }", "displayRender(label) {\n return label[label.length - 1]\n }", "function createRadioInput(parent, id, name, value, labelText, def) {\n var telem = document.createElement(\"label\");\n telem.setAttribute(\"for\", id);\n telem.innerHTML = labelText;\n var telem2 = document.createElement(\"input\");\n telem2.type = \"radio\";\n telem2.id = id;\n telem2.name = name;\n telem2.value = value;\n if (def) telem2.setAttribute(\"checked\", \"checked\");\n parent.appendChild(telem2);\n parent.appendChild(telem);\n}", "function FormField(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n control = props.control,\n disabled = props.disabled,\n error = props.error,\n inline = props.inline,\n label = props.label,\n required = props.required,\n type = props.type,\n width = props.width;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_4___default()(Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useKeyOnly\"])(disabled, 'disabled'), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useKeyOnly\"])(error, 'error'), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useKeyOnly\"])(inline, 'inline'), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useKeyOnly\"])(required, 'required'), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"useWidthProp\"])(width, 'wide'), 'field', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"getUnhandledProps\"])(FormField, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"getElementType\"])(FormField, props); // ----------------------------------------\n // No Control\n // ----------------------------------------\n\n if (lodash_isNil__WEBPACK_IMPORTED_MODULE_3___default()(control)) {\n if (lodash_isNil__WEBPACK_IMPORTED_MODULE_3___default()(label)) {\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, rest, {\n className: classes\n }), _lib__WEBPACK_IMPORTED_MODULE_7__[\"childrenUtils\"].isNil(children) ? content : children);\n }\n\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, rest, {\n className: classes\n }), Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"createHTMLLabel\"])(label, {\n autoGenerateKey: false\n }));\n } // ----------------------------------------\n // Checkbox/Radio Control\n // ----------------------------------------\n\n\n var controlProps = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n content: content,\n children: children,\n disabled: disabled,\n required: required,\n type: type // wrap HTML checkboxes/radios in the label\n\n });\n\n if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, {\n className: classes\n }, react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(\"label\", null, Object(react__WEBPACK_IMPORTED_MODULE_6__[\"createElement\"])(control, controlProps), \" \", label));\n } // pass label prop to controls that support it\n\n\n if (control === _modules_Checkbox__WEBPACK_IMPORTED_MODULE_8__[\"default\"] || control === _addons_Radio__WEBPACK_IMPORTED_MODULE_9__[\"default\"]) {\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, {\n className: classes\n }, Object(react__WEBPACK_IMPORTED_MODULE_6__[\"createElement\"])(control, _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, controlProps, {\n label: label\n })));\n } // ----------------------------------------\n // Other Control\n // ----------------------------------------\n\n\n return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(ElementType, {\n className: classes\n }, Object(_lib__WEBPACK_IMPORTED_MODULE_7__[\"createHTMLLabel\"])(label, {\n defaultProps: {\n htmlFor: lodash_get__WEBPACK_IMPORTED_MODULE_2___default()(controlProps, 'id')\n },\n autoGenerateKey: false\n }), Object(react__WEBPACK_IMPORTED_MODULE_6__[\"createElement\"])(control, controlProps));\n}", "function FormField(props) {\n\t var control = props.control,\n\t children = props.children,\n\t className = props.className,\n\t disabled = props.disabled,\n\t error = props.error,\n\t inline = props.inline,\n\t label = props.label,\n\t required = props.required,\n\t type = props.type,\n\t width = props.width;\n\n\t var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(inline, 'inline'), (0, _lib.useKeyOnly)(required, 'required'), (0, _lib.useWidthProp)(width, 'wide'), 'field', className);\n\t var rest = (0, _lib.getUnhandledProps)(FormField, props);\n\t var ElementType = (0, _lib.getElementType)(FormField, props);\n\n\t // ----------------------------------------\n\t // No Control\n\t // ----------------------------------------\n\n\t if (!control) {\n\t // TODO add test for label/no label when no control\n\t if (!label) return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t children\n\t );\n\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t _react2.default.createElement(\n\t 'label',\n\t null,\n\t label\n\t )\n\t );\n\t }\n\n\t // ----------------------------------------\n\t // Checkbox/Radio Control\n\t // ----------------------------------------\n\t var controlProps = _extends({}, rest, { children: children, type: type });\n\n\t // wrap HTML checkboxes/radios in the label\n\t if (control === 'input' && (type === 'checkbox' || type === 'radio')) {\n\t return _react2.default.createElement(\n\t ElementType,\n\t { className: classes },\n\t _react2.default.createElement(\n\t 'label',\n\t null,\n\t (0, _react.createElement)(control, controlProps),\n\t ' ',\n\t label\n\t )\n\t );\n\t }\n\n\t // pass label prop to controls that support it\n\t if (control === _Checkbox2.default || control === _Radio2.default) {\n\t return _react2.default.createElement(\n\t ElementType,\n\t { className: classes },\n\t (0, _react.createElement)(control, _extends({}, controlProps, { label: label }))\n\t );\n\t }\n\n\t // ----------------------------------------\n\t // Other Control\n\t // ----------------------------------------\n\n\t // control with a label\n\t if (control && label) {\n\t return _react2.default.createElement(\n\t ElementType,\n\t { className: classes },\n\t _react2.default.createElement(\n\t 'label',\n\t null,\n\t label\n\t ),\n\t (0, _react.createElement)(control, controlProps)\n\t );\n\t }\n\n\t // control without a label\n\t if (control && !label) {\n\t return _react2.default.createElement(\n\t ElementType,\n\t { className: classes },\n\t (0, _react.createElement)(control, controlProps)\n\t );\n\t }\n\t}", "render_label(ui) {\n const content = new DOM.Element(this.content_element);\n // Create the label.\n content.add(ui.render_tex(this, UI.clear_label_for_cell(this), this.label));\n // Create an empty label buffer for flicker-free rendering.\n const buffer = ui.render_tex(this, UI.clear_label_for_cell(this, true), this.label);\n content.add(buffer);\n }", "setLabel(_label) {\n if (this.escapeLabelHTML) {\n _label = this.escapeHTML(_label);\n }\n if (_label !== this.label) {\n this.label = _label;\n this.refresh();\n }\n return this;\n }" ]
[ "0.68338424", "0.67030853", "0.6557703", "0.64623713", "0.6420008", "0.6416059", "0.6416059", "0.63771886", "0.6285889", "0.6246065", "0.6221066", "0.61106735", "0.60983837", "0.60287285", "0.60223705", "0.5996795", "0.59856206", "0.5935544", "0.59085596", "0.58794147", "0.5873126", "0.5869455", "0.58693796", "0.5847349", "0.5843832", "0.5839134", "0.5822727", "0.5811833", "0.57957476", "0.57760507", "0.57740575", "0.5766439", "0.57509845", "0.57474434", "0.57250553", "0.5708864", "0.56913793", "0.56752783", "0.5664763", "0.5650017", "0.5648201", "0.56436956", "0.5611902", "0.5593418", "0.5583832", "0.5565634", "0.55655986", "0.55644", "0.556423", "0.556147", "0.556079", "0.55484736", "0.55484736", "0.5540763", "0.5539658", "0.5536448", "0.55360717", "0.5533214", "0.5533214", "0.5531089", "0.55178374", "0.55178374", "0.55123246", "0.54950064", "0.54938024", "0.54932755", "0.54913795", "0.5484449", "0.54779726", "0.547412", "0.5472393", "0.5469757", "0.54625994", "0.54571635", "0.5453751", "0.54516953", "0.54516953", "0.54434496", "0.5442852", "0.54344517", "0.5427471", "0.54258716", "0.5416564", "0.5415572", "0.5413818", "0.54100716", "0.5407968", "0.5392783", "0.53915596", "0.5387881", "0.5384779", "0.5381175", "0.53783935", "0.53750485", "0.5368019", "0.53618944", "0.5358457", "0.5356573" ]
0.6531685
5
================= for date checking =================
function checkDates(element) { var birthDate = element.value; if(birthDate.length > 10){ alert("Invalid Date Format"); element.value = ""; element.focus(); return; } var split = birthDate.split(/[^\d]+/); var year = parseFloat(split[2]); var month = parseFloat(split[0]); var day = parseFloat(split[1]); if(birthDate != null){ if (!/\d{2}\/\d{2}\/\d{4}/.test(birthDate)) { alert("Invalid Date Format"); element.value = ""; element.focus(); return; } if(month > 13 || day > 32){ alert("Invalid Date Format"); element.value = ""; element.focus(); return; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateValidation( date ) {\n\n\t\tvar pass = /^\\d{4}-\\d{2}-\\d{2}/.test( date );\n\t\treturn pass;\n\n\t}", "function checkdate(input){\t \nvar validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}$/ // Basic check for format validity\n\t var returnval= 0\n\t if (!validformat.test(input.value)){\n\t\t input.select();\n\t\t return -1;\n\t }\n\t else{ // Detailed check for valid date ranges\n\t var monthfield=input.value.split(\"/\")[0]\n\t var dayfield=input.value.split(\"/\")[1]\n\t var yearfield=input.value.split(\"/\")[2]\n\t var dayobj = new Date(yearfield, monthfield-1, dayfield)\n\t if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))\n\t\t return -2\n\t \n\t return 0;\n}\n}", "function dateValidator() {\n var dateFormat = /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n var now = new Date(Date.now()); //get currents date\n if (!dateFormat.test(this.value)) {\n alert(\"You put invalid date format\");\n return false;\n }\n //check date\n if (this.value.substring(0, 2) != now.getDate()) {\n alert(\"You put not current day.\");\n return false;\n }\n //check month\n else if (this.value.substring(3, 5) != now.getMonth() + 1) {\n alert(\"You put not current month.\");\n return false;\n }\n //check year\n else if (this.value.substring(6, 10) != now.getFullYear()) {\n alert(\"You put not current year.\");\n return false;\n }\n return true;\n }", "checkDate(date) {\n if (date === \"N/A\") return false;\n var split = date.split('-')\n var today = (new Date().getMonth() + 1) + \"-\" + (new Date().getDate()) + \"-\" + (new Date().getFullYear());\n today = today.split('-')\n // Year\n if (split[2] < today[2]) return true;\n else if (split[2] > today[2]) return false;\n else {\n if (split[0] < today[0]) return true;\n else if (split[0] > today[0]) return false;\n else {\n if (split[1] < today[1]) return true;\n else if (split[1] > today[1]) return false;\n else return true;\n }\n }\n }", "function checkDate(date){\r\n\tvar re = /(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\\d\\d$/;\r\n\tif(re.test(date)) return true;\r\n\telse return false;\r\n}", "function checkDate(dd, mm, yyyy) {\n\tvar re_0 =/^[0]*/;\n\n\tvar monthLength = new Array(31,28,31,30,31,30,31,31,30,31,30,31);\n\tvar day = parseInt(dd.value.replace(re_0, \"\"));\n\tvar month = parseInt(mm.value.replace(re_0, \"\"));\n\tvar year = parseInt(yyyy.value);\n\n\tif (!day || !month || !year)\n\t\treturn false;\n\n\tif (month < 0 || month > 12)\n\t\treturn false;\n\n\tif (year/4 == parseInt(year/4))\n\t\tmonthLength[1] = 29;\n\n\tif (day > monthLength[month-1])\n\t\treturn false;\n\n\tmonthLength[1] = 28;\n\n\tvar now = new Date();\n\tnow = now.getTime(); //NN3\n\n\tvar dateToCheck = new Date();\n\tdateToCheck.setYear(year);\n\tdateToCheck.setMonth(month-1);\n\tdateToCheck.setDate(day);\n\tvar checkDate = dateToCheck.getTime();\n\n\treturn true;\n}", "function isDate(txtDate) {\n\n\tvar currVal = txtDate;\n\n\tif (currVal == '')\n\t\treturn false;\n\n\t//Declare Regex \n\tvar rxDatePattern = /^(\\d{1,2})(\\/|-)(\\d{1,2})(\\/|-)(\\d{4})$/;\n\n\tvar dtArray = currVal.match(rxDatePattern); // is format OK?\n\n\tif (dtArray == null)\n\t\treturn false;\n\n\t//Checks for dd/mm/yyyy format.\n\tvar dtDay = dtArray[1];\n\tvar dtMonth = dtArray[3];\n\tvar dtYear = dtArray[5];\n\n\tif (dtMonth < 1 || dtMonth > 12)\n\t\treturn false;\n\telse if (dtDay < 1 || dtDay > 31)\n\t\treturn false;\n\telse if ((dtMonth == 4 || dtMonth == 6 || dtMonth == 9 || dtMonth == 11) && dtDay == 31)\n\t\treturn false;\n\telse if (dtMonth == 2) {\n\t\tvar isleap = (dtYear % 4 == 0 && (dtYear % 100 != 0 || dtYear % 400 == 0));\n\n\t\tif (dtDay > 29 || (dtDay == 29 && !isleap))\n\t\t\treturn false;\n\t}\n\telse {\n\t\tvar param1 = new Date();\n\t\tparam1.getFullYear();\n\t\tif (param1.getFullYear() - dtYear >= 0 && param1.getFullYear() - dtYear < 110)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\treturn true;\n\n}", "isValidDate(hire_date){\n let arr = hire_date.split('-');\n let hireDate = new Date(parseInt(arr[0]), parseInt(arr[1]) - 1, parseInt(arr[2]));\n let currDate = new Date();\n\n if(hireDate.getTime() < currDate.getTime()){\n return true;\n }\n return false;\n }", "function date_checker() {\n // If date is new, added to date_tracker array\n date_only = DateTime.substr(0, 10);\n if (!date_tracker.includes(date_only)) {\n date_tracker.push(date_only);\n\n // Completes auto_transfers before CSV input transactions if date_only is new\n amendment_check(false);\n }\n }", "function dateValidation() {\n if (!leapYear()) {invalidDates.push(\"0229\")}; \n\n for (let i=0; i<invalidDates.length ;i++) {\n if (invalidDates[i].match(pnMd)) {\n return false;\n };\n }\n return true;\n }", "function Checkdate(object_value) {\r\n\r\n\t//Returns true if value is a date format or is NULL\r\n\t//otherwise returns false\r\n\r\n\tvar isplit, sMonth, sDay, sYear;\r\n\r\n\tif (object_value.length === 0) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t//Returns true if value is a date in the mm/dd/yyyy format\r\n\tisplit = object_value.indexOf('/');\r\n\r\n\tif (isplit === -1 || isplit === object_value.length) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tsMonth = object_value.substring(0, isplit);\r\n\tisplit = object_value.indexOf('/', isplit + 1);\r\n\tif (isplit === -1 || (isplit + 1 ) === object_value.length) {\r\n\t\treturn false;\r\n\t}\r\n\tsDay = object_value.substring((sMonth.length + 1), isplit);\r\n\tsYear = object_value.substring(isplit + 1);\r\n\tif (!checkInteger(sMonth)) { //check month\r\n\t\treturn false;\r\n\t}\r\n\tif (!checkRange(sMonth, 1, 12)) {//check month\r\n\t\t\treturn false;\r\n\t}\r\n\tif (sYear.length < 4) {\r\n\t\t//line added by mstein - make sure year is 4 char\r\n\t\treturn false;\r\n\t}\r\n\tif (!checkInteger(sYear)) { //check year\r\n\t\treturn false;\r\n\t}\r\n\tif (!checkRange(sYear, 0, 9999)) { //check year\r\n\t\treturn false;\r\n\t}\r\n\tif (!checkInteger(sDay)) { //check day\r\n\t\treturn false;\r\n\t}\r\n\tvar fourDigitYear = sYear;\r\n\r\n\tif (1 * fourDigitYear < 100) {\r\n\t\tfourDigitYear = (2000 + 1 * fourDigitYear).toString();\r\n\t}\r\n\tif (!checkRange(fourDigitYear, 1950, 2050)) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (!checkDay(1 * sYear, 1 * sMonth, 1 * sDay)) {// check day\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n\r\n} // Checkdate", "function check_date(date)\n{\n\tvar date_pattern=new RegExp(/^(0[1-9]|[12][0-9]|3[01])\\/(0[1-9]|1[012])\\/(19|20)\\d\\d$/);\n\treturn date_pattern.test(date);\n}", "function Checkdateformat(datecontrol) {\n var dateformat = /^(0?[1-9]|[12][0-9]|3[01])[\\/\\-](0?[1-9]|1[012])[\\/\\-]\\d{4}$/;\n var Val_date = datecontrol;\n if (Val_date.match(dateformat)) {\n var seperator1 = Val_date.split('/');\n var seperator2 = Val_date.split('-');\n\n if (seperator1.length > 1) {\n var splitdate = Val_date.split('/');\n }\n else if (seperator2.length > 1) {\n var splitdate = Val_date.split('-');\n }\n var dd = parseInt(splitdate[0]);\n var mm = parseInt(splitdate[1]);\n var yy = parseInt(splitdate[2]);\n var ListofDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if (mm == 1 || mm > 2) {\n if (dd > ListofDays[mm - 1]) {\n alert('Invalid date format!');\n\n return false;\n }\n }\n if (mm == 2) {\n var lyear = false;\n if ((!(yy % 4) && yy % 100) || !(yy % 400)) {\n lyear = true;\n }\n if ((lyear == false) && (dd >= 29)) {\n alert('Invalid date format!');\n\n return false;\n }\n if ((lyear == true) && (dd > 29)) {\n alert('Invalid date format!');\n\n return false;\n }\n }\n }\n else {\n alert(\"Invalid date format!\");\n\n return false;\n }\n}", "function isDate(input) {\n return input && input.getDate && !isNaN(input.valueOf());\n }", "function generalDateValidityCheck(date) {\r\n\r\n let validity = true;\r\n date += \"\";\r\n\r\n if (date.indexOf(\"/\") !== 2 && date.indexOf(\"/\", date.indexOf(\"/\")) !== 5 && date.indexOf(\"/\", date.indexOf(date.indexOf(\"/\"), \"/\")) === -1) {\r\n validity = false;\r\n } else {\r\n let d = date.substring(0, 2);\r\n let m = date.substring(3, 5);\r\n let y = date.substring(6);\r\n\r\n if (d.length !== 2 || m.length !== 2 || y.length !== 4) {\r\n validity = false;\r\n } else {\r\n if (parseInt(d) > 31 || parseInt(m) > 12) {\r\n validity = false;\r\n }\r\n }\r\n\r\n }\r\n\r\n return validity;\r\n}", "function CheckDate(TrDate, StDt, EdDt) {\n ////debugger\n var check = Date.parse(TrDate);\n var from = Date.parse(StDt);\n var to = Date.parse(EdDt);\n if ((check <= to && check >= from))\n return (true);\n else\n return false;\n}", "function dateCheck()\n{\n\tif(date.getUTCMonth() + dateMonthAdded > date.getUTCMonth())\n\t{\n\t\tdate.setUTCDate(1);\n\t}\n\tswitch(date.getUTCMonth())\n\t{\n\t\tcase 1://feb is a special month where every 4 years the final year is allways dividable with 4 and gets 29 days instead of 28\n\t\t\tif(date.getUTCFullYear()%4 == 0)\n\t\t\t\tdays = days - 3;\n\t\t\telse\n\t\t\t\tdays = days - 2;\n\t\t\tbreak;\n\t\tcase 3://april\n\t\t\tdays = days - 1;\n\t\t\tbreak;\n\t\tcase 5://june\n\t\t\tdays = days - 1;\n\t\t\tbreak;\n\t\tcase 8://sept\n\t\t\tdays = days - 1;\n\t\t\tbreak;\n\t\tcase 10://nov\n\t\t\tdays = days - 1;\n\t\t\tbreak;\n\t}\n}", "function date_check(date){\n\tfor (var i = 0; i < ufo_data.length; i++){\n\t\tif (ufo_data[i].datetime === date){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function validate_date(input_date) {\n\tvar dateFormat = /^\\d{1,4}[\\.|\\/|-]\\d{1,2}[\\.|\\/|-]\\d{1,4}$/;\n\tif (dateFormat.test(input_date)) {\n\t\ts = input_date.replace(/0*(\\d*)/gi, \"$1\");\n\t\tvar dateArray = input_date.split(/[\\.|\\/|-]/);\n\t\tdateArray[1] = dateArray[1] - 1;\n\t\tif (dateArray[2].length < 4) {\n\t\t\tdateArray[2] = (parseInt(dateArray[2]) < 50) ? 2000 + parseInt(dateArray[2]) : 1900 + parseInt(dateArray[2]);\n\t\t}\n\t\tvar testDate = new Date(dateArray[2], dateArray[1], dateArray[0]);\n\t\tif (testDate.getDate() != dateArray[0] || testDate.getMonth() != dateArray[1] || testDate.getFullYear() != dateArray[2]) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function isDate(txtDate)\n {\n var currVal = txtDate;\n if(currVal == '')\n return false;\n \n //Declare Regex \n var rxDatePattern = /^(\\d{1,2})(\\/|-)(\\d{1,2})(\\/|-)(\\d{4})$/; \n var dtArray = currVal.match(rxDatePattern); // is format OK?\n\n if (dtArray == null)\n return false;\n \n //Checks for mm/dd/yyyy format.\n dtMonth = dtArray[1];\n dtDay= dtArray[3];\n dtYear = dtArray[5];\n\n if (dtMonth < 1 || dtMonth > 12)\n return false;\n else if (dtDay < 1 || dtDay> 31)\n return false;\n else if ((dtMonth==4 || dtMonth==6 || dtMonth==9 || dtMonth==11) && dtDay ==31)\n return false;\n else if (dtMonth == 2)\n {\n var isleap = (dtYear % 4 == 0 && (dtYear % 100 != 0 || dtYear % 400 == 0));\n if (dtDay> 29 || (dtDay ==29 && !isleap))\n return false;\n }\n return true;\n}", "function checkDate(date) {\n let re = new RegExp(/^(0?[1-9]|[12][0-9]|3[01])[\\/](0?[1-9]|1[012])[\\/]\\d{4}[\\ ]([0][0-9]|[1][0-9]|[2][0-3]):([0][0-9]|[12345][0-9])$/);\n\n return re.test(date);\n}", "function checkScheduleDate()\n {\n var date_published_input=$(\".date_published\");\n if(date_published_input.val()!=\"\")\n {\n var now=$(\"#server_time\").val(); // server time\n var now=Date.parse(now); //parse it so it becomes unix timestamp\n\n var schedule_date=new Date(date_published_input.val()); // date from text input\n var schedule_date=Date.parse(schedule_date); //parse it so it becomes unix timestamp\n\n if(schedule_date < now)\n {\n swal(\"Oops...\", \"You cannot publish story in the past\", \"error\");\n return false;\n }\n else\n return true;\n }\n }", "function checkDates(date){\n if (dateInputInt === 0){\n return true;\n }\n else {\n if (dateCond === 'equalsdate'){\n return date === dateInputInt;\n }\n else if (dateCond === 'greaterthan'){\n return date > dateInputInt;\n }\n else if (dateCond === 'lessthan'){\n return date < dateInputInt;\n }\n }\n }", "function checkDate (yearField, monthField, dayField, labelString, OKtoOmitDay)\r\n{ // Next line is needed on NN3 to avoid \"undefined is not a number\" error\r\n // in equality comparison below.\r\n if (checkDate.arguments.length == 4) OKtoOmitDay = false;\r\n if (!isYear(yearField.value)) return warnInvalid (yearField, iYear);\r\n if (!isMonth(monthField.value)) return warnInvalid (monthField, iMonth);\r\n if ( (OKtoOmitDay == true) && isEmpty(dayField.value) ) return true;\r\n else if (!isDay(dayField.value))\r\n return warnInvalid (dayField, iDay);\r\n if (isDate (yearField.value, monthField.value, dayField.value))\r\n return true;\r\n alert (iDatePrefix + labelString + iDateSuffix)\r\n return false\r\n}", "function checkDate (yearField, monthField, dayField, labelString, OKtoOmitDay)\r\n{ // Next line is needed on NN3 to avoid \"undefined is not a number\" error\r\n // in equality comparison below.\r\n if (checkDate.arguments.length == 4) OKtoOmitDay = false;\r\n if (!isYear(yearField.value)) return warnInvalid (yearField, iYear);\r\n if (!isMonth(monthField.value)) return warnInvalid (monthField, iMonth);\r\n if ( (OKtoOmitDay == true) && isEmpty(dayField.value) ) return true;\r\n else if (!isDay(dayField.value))\r\n return warnInvalid (dayField, iDay);\r\n if (isDate (yearField.value, monthField.value, dayField.value))\r\n return true;\r\n alert (iDatePrefix + labelString + iDateSuffix)\r\n return false\r\n}", "function checkdate(input){\n\t//alert(input.value);\n\tvar validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}$/ //Basic check for format validity\n\tvar returnval=false;\n\tif (!validformat.test(input.value)){\n\t\talert(\"Invalid Date Format. Please correct and submit again.\")\n\t\tdob.focus();\n\t\treturn_val = false;\n\t\treturn false;\n\t}\n\telse{ //Detailed check for valid date ranges\n\t\tvar monthfield=input.value.split(\"/\")[0]\n\t\tvar dayfield=input.value.split(\"/\")[1]\n\t\tvar yearfield=input.value.split(\"/\")[2]\n\t\tvar dayobj = new Date(yearfield, monthfield-1, dayfield)\n\t\tif ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield)){\n\t\t\talert(\"Invalid Day, Month, or Year range detected. Please correct and submit again.\");\n\t\t\treturn_val = false;\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn true;\n}", "function checkOverdue(date) {\n var today = new Date();\n var mm = today.getMonth() + 1;\n var dd = today.getDate();\n var yyyy = today.getFullYear();\n if (parseInt(date.substr(6,4)) >= yyyy &&\n parseInt(date.substr(0,2)) >= mm &&\n parseInt(date.substr(3,2)) >= dd) {\n return false;\n } else {\n return true;\n }\n} //end checkOverdue", "function debtCheckFormatDate(dataCheck){\n var re = /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/;\n if(dataCheck == '' || dataCheck == 'dd/mm/yyyy'){\n return true;\n }else{\n if(!dataCheck.match(re)){\n return false;\n }else{\n return true;\n }\n }\n}", "function checkDate(){ \n try\n { \n //converting value of dates from day id, month id and year id into date string\n //getinputvaluebyid is a method which is used to return value using document.queryselector for particular id and returns the output.\n let dates= getInputValueById(\"#day\")+\" \"+getInputValueById(\"#month\")+\" \"+getInputValueById(\"#year\");\n //dates is parsed to date and passed to object of employee payroll data class - start date\n dates=new Date(Date.parse(dates));\n checkStartDate(dates);\n //if condition is not satisfied, then error is thrown and catched by try-catch block\n dateError.textContent=\"\";\n }\n catch(e)\n {\n dateError.textContent=e;\n }\n document.querySelector('#cancelButton').href= site_properties.home_page;\n}", "function checkDate(date) {\n if (date.getDay()== \"2\" || closeDay(date)){\n return [false, 'close'];\n } else if(date.getDay()== \"0\" || noreservationDay(date)) {\n return [false, 'noreservation'];\n } else if(fullDay(date)) {\n return [false, 'full'];\n } else if( date.getDate() == today.getDate() && date.getMonth() == today.getMonth() && date.getFullYear() == today.getFullYear() &&today.getHours() > 17) {\n return [false, ''];\n } else {\n return [true, 'valid'];\n }\n }", "function Datecheck(DateNow) {\n \n var Months = [{ month: \"Jan\", value: \"01\" },\n { month: \"Feb\", value: \"02\" },\n { month: \"Mar\", value: \"03\" },\n { month: \"Apr\", value: \"04\" },\n { month: \"May\", value: \"05\" },\n { month: \"Jun\", value: \"06\" },\n { month: \"Jul\", value: \"07\" },\n { month: \"Aug\", value: \"08\" },\n { month: \"Sep\", value: \"09\" },\n { month: \"Oct\", value: \"10\" },\n { month: \"Nov\", value: \"11\" },\n { month: \"Dec\", value: \"12\" }];\n var date = DateNow.split(\"-\");\n var day = date[0];\n var month = date[1];\n for(var i=0;i<Months.length;i++)\n {\n if(Months[i].month==month)\n {\n month = Months[i].value;\n }\n }\n var year =date[2];\n var myDate = new Date(year, month - 1, day);\n return myDate;\n}", "function isDate(date) {\n return (date && date.getDate) ? date : false;\n }", "function isDate()\n{\n\tvar yy,mm,dd;\n\tvar im,id,iy;\n\tvar present_date = new Date();\n\tyy = 1900 + present_date.getYear();\n\tif (yy > 3000)\n\t{\n\t\tyy = yy - 1900;\n\t}\n\tmm = present_date.getMonth();\n\tdd = present_date.getDate();\n\tim = document.forms[0].month.selectedIndex;\n\tid = document.forms[0].day.selectedIndex;\n\tiy = document.forms[0].year.selectedIndex;\n\tvar entered_month = document.forms[0].month.options[im].value;\n\tvar invalid_month = document.forms[0].month.options[im].value - 1; \n\tvar entered_day = document.forms[0].day.options[id].value; \n\tvar entered_year = document.forms[0].year.options[iy].value; \n\tif ( (entered_day == 0) || (entered_month == 0) || (entered_year == 0) )\n\t{\n\t\talert(\"Please enter your birhtday\");\n\t\treturn false;\n\t}\n\tif ( is_greater_date(entered_year,entered_month,entered_day,yy,mm,dd) && is_valid_day(invalid_month,entered_day,entered_year) )\n\t{\n\t\treturn true; \n\t}\n\treturn false;\n}", "function check_valid_date(date) {\n\tvar base_url = $('#base_url').val();\n\tvar check_date1 = $('#' + date).val();\n\n\t$.post(base_url + 'view/load_data/finance_date_validation.php', { check_date: check_date1 }, function (data) {\n\t\tif (data !== 'valid' && data !== '') {\n\t\t\terror_msg_alert(data);\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t});\n}", "function validateDate(data, x){\n //validate the ingest date just to be sure\n if(!data[x][15].match(/^\\d{4}-\\d{2}-\\d{2}$/)){\n return false;\n } else{\n return true;\n }\n}", "function isValidDate1(bd){\n\t/*checking if the format is corret*/\n\t/*format of YYYY-MM(M)-DD(M) is accepted*/\n\tif(!/^\\d{4}\\-\\d{1,2}\\-\\d{1,2}$/.test(bd)){\n return false;\n\t}\n\n // divide the input into year, month and date to validate\n var split_input = bd.split(\"-\");\n var year = parseInt(split_input[0], 10);\n var month = parseInt(split_input[1], 10);\n var day = parseInt(split_input[2], 10);\n \n \n\n // since it is expire date, user can still enter credit card that is expired\n if(month == 0 || month > 12)\n return false;\n /*checks for if day provided is in range*/\n var daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];\n\n if(day<=0 || day>daysInMonth[month-1])\n \treturn false;\n\n \n\n\tif (isExpired(year,month,day)){\n\t\treturn false;\n\t}\n\n return true;\n}", "function validateStartDate (date) {\n if (new Date(date) <= new Date()) {\n return false\n }\n}", "function isCorrectDate(value) {\n\t if (typeof value === \"string\" && value) { //是字符串但不能是空字符\n\t var arr = value.split(\"-\") //可以被-切成3份,并且第1个是4个字符\n\t if (arr.length === 3 && arr[0].length === 4) {\n\t var year = ~~arr[0] //全部转换为非负整数\n\t var month = ~~arr[1] - 1\n\t var date = ~~arr[2]\n\t var d = new Date(year, month, date)\n\t return d.getFullYear() === year && d.getMonth() === month && d.getDate() === date\n\t }\n\t }\n\t return false\n\t }", "function validatedate(dateString){ \n let dateformat = /^(0?[1-9]|1[0-2])[\\/](0?[1-9]|[1-2][0-9]|3[01])[\\/]\\d{4}$/; \n \n // Match the date format through regular expression \n if(dateString.match(dateformat)){ \n let operator = dateString.split('/'); \n let operator2 = dateString.split('-') \n \n // Extract the string into month, date and year \n let datepart = []; \n if (operator.length>1){ \n pdatepart = dateString.split('/'); \n } \n \n else if (operator2.length>1){ \n pdatepart = dateString.split('-'); \n } \n let month= parseInt(datepart[0]); \n let day = parseInt(datepart[1]); \n let year = parseInt(datepart[2]); \n \n // Create list of days of a month \n let ListofDays = [31,28,31,30,31,30,31,31,30,31,30,31]; \n if (month==1 || month>2){ \n if (day>ListofDays[month-1]){ \n ///This check is for Confirming that the date is not out of its range \n return false; \n } \n }else if (month==2){ \n let leapYear = false; \n if ( (!(year % 4) && year % 100) || !(year % 400)) { \n leapYear = true; \n } \n if ((leapYear == false) && (day>=29)){ \n return false; \n }else \n if ((leapYear==true) && (day>29)){ \n return false; \n } \n } \n }else{ \n return false; \n } \n return true; \n}", "function check_date(date){\n\tvar time_pattern=/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;\n\tif(!time_pattern.test(date))\n\t\treturn false;\n\treturn true;\n}", "function jsac_apply_date(elts){\n\t\tfor (var i = 0; i <elts.length; i++){\n\t\t\tvar cur = elts[i].innerHTML;\n\t\t\t/*\n\t\t\tif (cur.length != 8){ alert(\"Please check the Dates Entered\"); break;}\n\t\t\tif ((cur[2] && cur[5]) != \"/\") { alert(\"Please check the Dates Entered\"); break;}\n\t\t\tfor (var j = 0; j < elts.length; j++){\n\t\t\t\tif (j == 2 || j == 5) continue;\n\t\t\t\tif (isNaN(cur[j])) { alert(\"Please check the Dates Entered\"); break;}\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t}", "function isValidDate ( dt ) {\n\t\treturn Object.prototype.toString.call(dt) === \"[object Date]\" && !isNaN(dt.getTime());\n\t}", "function checkDate(value) {\n\tvar matches = DATETIME.exec(value);\n\tif (matches) {\n\t\treturn makeDate(matches);\n\t}\n\tmatches = DATETIME_RANGE.exec(value);\n\tif (matches) {\n\t\treturn {start: makeDate(matches), end: makeDate(matches.slice(7))};\n\t}\n\tmatches = DATEONLY.exec(value);\n\tif (matches) {\n\t\treturn makeDate(matches.concat([0, 0, 0, '']));\n\t}\n\treturn value;\n}", "function isDate(str) {\r\n\tvar re = /^(\\d{4})[\\s\\.\\/-](\\d{1,2})[\\s\\.\\/-](\\d{1,2})$/;\r\n\tif (!re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\tvar result = str.match(re);\r\n\tvar y = parseInt(result[1]);\r\n\tvar m = parseInt(result[2]);\r\n\tvar d = parseInt(result[3]);\r\n\tif (m < 1 || m > 12 || y < 1900 || y > 2100) {\r\n\t\treturn false;\r\n\t}\r\n\tif (m == 2) {\r\n\t\tvar days = ((y % 4) == 0) ? 29 : 28;\r\n\t} else {\r\n\t\tif (m == 4 || m == 6 || m == 9 || m == 11) {\r\n\t\t\tvar days = 30;\r\n\t\t} else {\r\n\t\t\tvar days = 31;\r\n\t\t}\r\n\t}\r\n\treturn (d >= 1 && d <= days);\r\n}", "function SP_CheckValidDate(day,month,year)\n{\n\tvar showErrMsg = false;\n\t\n\t// check entered year should be greater than 1900 and less than 2200. And check entered month value is in between 1 - 12\n\tif((year*1 < 1900 || year*1 >2200) || (month*1 < 1 || month*1 > 12))\n\t{\n\t\tshowErrMsg = true;\n\t\treturn showErrMsg;\n\t}\n\t\n\t//Create Date, month decremented because in JS date object month are from (0 - 11)\n\tvar oDate = new Date(year,--month);\n\tmonth = oDate.getMonth();\n\toDate.setDate(day);\n\t\n\t// Check entered day is correct as per selected month\n\t// Feburary case. total days in month are 28 or 29\n\tif(!(month*1 == oDate.getMonth()*1))\n\t{\n\t\tshowErrMsg = true;\n\t}\n\treturn showErrMsg;\n}", "function ValidateDate() {\r\n\t\r\n\t var dtValue = $('#date-mask1').val();\r\n\t var dtRegex = new RegExp(\"^([0]?[1-9]|[1-2]\\\\d|3[0-1])-(JAN|FEB|MAR|APR|MAY|JUN|JULY|AUG|SEP|OCT|NOV|DEC)-[1-2]\\\\d{3}$\", 'i');\r\n\t return dtRegex.test(dtValue);\r\n\t}", "function valid_date(date) {\n date = date.split('-');\n if (date[0] >= 1 && date[0] <= 9999\n && date[1] >= 1 && date[1] <= 12\n && date[2] >= 1 && date[2] <= 31) {\n return true;\n } else {\n return false;\n }\n}", "function isValidDate(dateStr) {\n // Date validation function courtesty of \n // Sandeep V. Tamhankar ([email protected]) -->\n \n // Checks for the following valid date formats:\n // yyyy/mm/dd \n \n var datePat = /^\\d{4}-\\d{2}-\\d{2}$/; // requires 4 digit year\n \n var matchArray = dateStr.match(datePat); // is the format ok?\n if (matchArray == null) {\n alert(\"Date is not in a valid format.\")\n return false;\n }\n month = matchArray[1]; // parse date into variables\n day = matchArray[3];\n year = matchArray[4];\n if (month < 1 || month > 12) { // check month range\n alert(\"Month must be between 1 and 12.\");\n return false;\n }\n if (day < 1 || day > 31) {\n alert(\"Day must be between 1 and 31.\");\n return false;\n }\n if ((month==4 || month==6 || month==9 || month==11) && day==31) {\n alert(\"Month \"+month+\" doesn't have 31 days!\")\n return false;\n }\n if (month == 2) { // check for february 29th\n var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));\n if (day>29 || (day==29 && !isleap)) {\n alert(\"February \" + year + \" doesn't have \" + day + \" days!\");\n return false;\n }\n }\n return true;\n}", "function validateExpiredate() {\n\t\tlet input = formTrm.inputs.fields.expiredate;\n\t\tlet expiredate = moment(input.val(), momentJsFormats['mm/dd/yyyy']);\n\t\tif (input.val().length < 8) {\n\t\t\treturn true;\n\t\t}\n\t\tif (expiredate.isValid() == false) {\n\t\t\treturn false;\n\t\t}\n\t\tlet minDate = moment();\n\t\treturn parseInt(expiredate.format(momentJsFormats['timestamp'])) > parseInt(minDate.format(momentJsFormats['timestamp']));\n\t}", "function is_legal_date(str){\n\n let date_array = get_date_array(str)\n\n if( date_array[2] < birth_year ){\n\n return false\n }\n if( date_array[1] < 1 || months_in_year < date_array[1] ){\n\n return false\n }\n \n if( date_array[0] < 1 || possible_days( date_array[1], date_array[2] ) < date_array[0] ){\n\n return false\n }\n\n return true\n}", "function checkIsDate_() {\n return $(popup_.getElementsByTagName('INPUT')[0]).hasClass('date-input');\n }", "function isValueDate(datestr) {\r\n\tif(datestr==\"\") return false;\r\n\tindex1=datestr.indexOf(\"/\");\r\n\tif (index1<1 || index1>2) return false;\r\n\r\n\tmth=datestr.substring(0,index1);\r\n\tif (!checknum(mth)) return false;\r\n\r\n\tif ( mth.length == 1 )\r\n\t\tmth1 = '0' + mth;\r\n\telse\r\n\t\tmth1 = mth;\r\n\r\n\tmth=parseInt(mth,10);\r\n\r\n\tif(mth<1 || mth>12) return false;\r\n\r\n\tindex2=datestr.indexOf(\"/\",index1+1);\r\n\tif (index2<3 || index2>5) return false;\r\n\r\n\tdt=datestr.substring(index1+1,index2);\r\n\tif (!checknum(dt)) return false;\r\n\r\n\tif ( dt.length == 1 )\r\n\t\tdt1 = '0' + dt;\r\n\telse\r\n\t\tdt1 = dt;\r\n\r\n\tdt=parseInt(dt,10);\r\n\r\n\tyr=datestr.substring(index2+1,datestr.length);\r\n\tif (!checknum(yr)) return false;\r\n\r\n\tif (yr.length!=4) {\r\n\t\tif (yr.length == 2 ) {\r\n\t\t\t yr=parseInt(yr,10);\r\n\t\t\t if ( yr < 35 ) {\r\n\t\t\t\tyr = '20' + datestr.substring(index2+1,datestr.length);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t yr = '19' + datestr.substring(index2+1,datestr.length);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tyr=parseInt(yr,10);\r\n\r\n\tif (yr%4==0){\r\n\t\tmaxdays=new Array(31,31,29,31,30,31,30,31,31,30,31,30,31);\r\n\t\tfleapyr=true;\r\n\t}\r\n\telse\r\n\t\tmaxdays=new Array(31,31,28,31,30,31,30,31,31,30,31,30,31);\r\n\r\n\tif (dt>maxdays[mth]||dt<1) return false;\r\n\r\n\treturn true;\r\n\r\n}", "function check_date(){\n\t\t//creation of the current date-time(sets the seconds to 00)\n\tvar today=new Date();\n\ttoday.setSeconds(0);\n\n\tdates.forEach(function(element, index){\n\tvar itemLine=document.getElementById(dates_id[index]);\n\tvar item=itemLine.children[1].innerHTML;\n\tvar exp_date=new Date(element);\n\t\tif(today>=exp_date && !itemLine.classList.contains(\"expired\")){\n\t\t\titemLine.classList.add(\"expired\");\n\t\t\talert(\"Please complete the following task now !!!\\n\"+item.toUpperCase());\n\t\t}\n\t})\n}", "function checkDate(){\n //get timeStamp from dates\n let beginDate = Math.round(new Date(datetimeBegin).getTime()/1000);\n let endDate = Math.round(new Date(datetimeEnd).getTime()/1000);\n\n if(beginDate < endDate && eventTitle !== \"\" && eventDescription !== \"\" && beginDate !== \"\" && endDate !== \"\"){\n return true\n }else{\n return false\n }\n }", "function checkDate(date, messages) {\r\n if (!checkNotEmpty(date)) {\r\n messages.push(\"You must enter a valid date\");\r\n }else if(!checkDigits(date) || !checkLength(date, 1, 2)) {\r\n messages.push(\"date must be the correct length\");\r\n }\r\n }", "function checkDates ( data, targetDate, callback ) {\n\tlet dateOkay = true;\n\n\t// check start date\n\tif ( typeof data.startdate !== \"undefined\" ) {\n\t\tif (! ( moment( data.startdate, config.dates.format ).isSameOrAfter( targetDate ) ) ) {\n\t\t\tdateOkay = false;\n\t\t}\n\t}\n\t// check end date\n\tif ( typeof data.enddate !== \"undefined\" ) {\n\t\tif (! ( moment( data.enddate, config.dates.format ).isBefore( targetDate ) ) ) {\n\t\t\tdateOkay = false;\n\t\t\t// send unpublish request to Drupal API\n\t\t\t// still needs to be researched\n\t\t\t// create as a separate util\n\t\t}\n\t}\n\n\t// return to scrubData\n\treturn dateOkay;\n}", "function dateFormatCheck(input) {\r\n\tif (input.length != 10) {\r\n\t\treturn false;\r\n\t}\r\n for (var i = 0; i < input.length; i++) {\r\n if (i === 2 || i === 5) {\r\n if (input.charAt(i) != \"/\") {\r\n return false;\r\n }\r\n } else {\r\n if (!/[0-9]/.test(input.charAt(i))) {\r\n return false;\r\n }\r\n }\r\n }\r\n var day = parseInt(input.substring(0,2));\r\n var month = parseInt(input.substring(3,5));\r\n var year = parseInt(input.substring(6,10));\r\n \tif (month === 1 && day <= 31) {\r\n \t\treturn true;\r\n \t}\r\n \tif (year % 4 === 0) {\r\n \t\tif (month === 2 && day <= 29) {\r\n\t \t\treturn true;\r\n\t \t}\r\n \t} else {\r\n\t \tif (month === 2 && day <= 28) {\r\n\t \t\treturn true;\r\n\t \t}\r\n\t}\r\n\tif (month === 3 && day <= 31) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 4 && day <= 30) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 5 && day <= 31) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 6 && day <= 30) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 7 && day <= 31) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 8 && day <= 31) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 9 && day <= 30) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 10 && day <= 31) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 11 && day <= 30) {\r\n \t\treturn true;\r\n \t}\r\n \tif (month === 12 && day <= 31) {\r\n \t\treturn true;\r\n \t}\r\n \treturn false;\r\n}", "function isDateOk(Y, M, D) {\n var ML = [,31,28,31,30,31,30,31,31,30,31,30,31];\n var L = ML[M]; // Improved after LRN\n \n // var msg = 'Day = '+D+', Month = '+M+', Year = '+Y;\n var valid = D>0 && !!L && (D<=L || D==29 && Y%4==0 && (Y%100!=0 || Y%400==0) );\n // alert(msg+', Is valid = '+valid);\n return valid;\n}", "checkDateRollover() {\n if (!this.date) return false\n return date.format(new Date(), 'YYYY-MM-DD') !== this.date\n }", "function validateDateNotFuture(field) {\n if (field === undefined || field === null || !validateDateFormatted(field)) {\n return true;\n }\n var split = field.split(_config_AppConfig__WEBPACK_IMPORTED_MODULE_1__[\"DATE_INPUT_GAP_SEPARATOR\"]);\n var month = parseInt(split[0]);\n var day = parseInt(split[1]);\n var year = parseInt(split[2]);\n var current_year = new Date().getFullYear();\n var current_month = new Date().getMonth() + 1;\n var current_day = new Date().getDate();\n if (year > current_year) {\n return false;\n }\n if (year == current_year && month > current_month) {\n return false;\n }\n return !(year == current_year && month == current_month && day > current_day);\n}", "function isDate(str, separator) {\nvar strYear =\"\";\nvar strMonth=\"\";\nvar strDay =\"\";\nvar iSeparatorCount =0;\nfor(var i=0;i<str.length;i++){\nvar c =str.charAt(i);\nvar cd =str.charCodeAt(i);\nif(cd>=0x0030 && cd<=0x0039){\nswitch(iSeparatorCount){\ncase 0:\n strYear+=c;\n break;\ncase 1:\n strMonth+=c;\n break;\ncase 2:\n strDay+=c;\n break;\ndefault:\n return false;\n}\n}else if(c==separator){\niSeparatorCount++;\nif(iSeparatorCount>2) return false;\n}else\nreturn false;\n}\nif(strYear.length==0 || strMonth.length==0 || strDay.length==0)return false;\nvar iYear =parseInt(eval(strYear));\nvar iMonth =parseInt(eval(strMonth));\nvar iDay =parseInt(eval(strDay));\nif(iYear<1900 || iYear>2100) return false;\nif(iMonth<1 || iMonth>12) return false;\nif(iDay<1) return false;\nvar iFebDays =28;\nif((iYear%400==0) || ((iYear%4==0) && (iYear%100!=0))) iFebDays=29;\nswitch(iMonth){\ncase 2:\nreturn (iDay<=iFebDays);\ncase 4: case 6: case 9: case 11:\nreturn (iDay<=30);\ndefault:\nreturn (iDay<=31);\n}\n}", "function validateDate( strValue ) {\n var objRegExp = /^\\d{1,2}(\\-|\\/|\\.)\\d{1,2}\\1\\d{4}$/\n \n if(!objRegExp.test(strValue))\n return false; \n else{\n var strSeparator = strValue.substring(2,3) \n\n var arrayDate = strValue.split(strSeparator); \n var arrayLookup = { '01' : 31,'03' : 31, '04' : 30,'05' : 31,'06' : 30,'07' : 31,\n '08' : 31,'09' : 30,'10' : 31,'11' : 30,'12' : 31}\n var intDay = parseInt(arrayDate[0],10);\n \n\n if(arrayLookup[arrayDate[1]] != null) {\n if(intDay <= arrayLookup[arrayDate[1]] && intDay != 0)\n return true; \n }\n var intMonth = parseInt(arrayDate[1], 10);\n\n if (intMonth == 2) { \n var intYear = parseInt(arrayDate[2]);\n if( ((intYear % 4 == 0 && intDay <= 29) || (intYear % 4 != 0 && intDay <=28)) && intDay !=0)\n return true;\n }\n }\n return false; \n}", "function validDate(date) {\n\n // check if date is falsey\n if (!date)\n return false;\n\n // check format & return true if date string matches YYYY-MM-DD format\n const regex = /^[0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}$/g;\n const str = date.substring(0, 10);\n return regex.test(str);\n}", "function validateDate() {\n let date = new Date(document.forms[formName]['fechaContrato'].value);\n let today = new Date();\n return date <= today;\n}", "function validateDeliveryDate(){\n// var a = $(\"#date_of_odering\").innerText;\n// alert(a);\n// alert(Date.parse(a));\n var dateOfOrdering = Date.parse(formatDate(json.orders.order_date));\n var objDateOfOrdering = new Date(dateOfOrdering);\n var deliveryDate = Date.parse($(\"#datepicker\").val());\n var objDeliveryDate = new Date(deliveryDate);\n var re = /(0[1-9]|1[012])[\\/](0[1-9]|[12][0-9]|3[01])[\\/](20)\\d\\d/;\n if ($('#order_status').prop('checked')===true){\n if (re.exec($(\"#datepicker\").val()) && objDeliveryDate >= objDateOfOrdering) {\n return true\n }\n else {\n return false\n }\n }\n else {\n return true\n }\n }", "function testDateFormat(date) {\n if ( date === 'yyyy-mm-dd' || date === '' || /^[0-2][0-9]{3}\\-[0-1][0-9]\\-[0-3][0-9]$/.test(date)) {\n return (true)\n } else{\n return (false)\n }\n}", "function ossValidateDateField( id )\n{\n // get the appropriate regexp\n\n var re_day_strict = \"((0[1-9]{1})|([12][0-9]{1})|(3[01]{1}))\";\n var re_month_strict = \"((0[1-9]{1})|(1[012]{1}))\";\n\n var re_day = \"((0[1-9]{1})|([12][0-9]{1})|(3[01]{1})|[1-9]{1})\";\n var re_month = \"((0[1-9]{1})|(1[012]{1})|[1-9]{1})\";\n var re_year = \"(\\\\d{4})\";\n var re;\n var df;\n\n // case values correspond to OSS_Date DF_* constants\n switch( $( \"#\" + id ).attr( 'data-dateformat' ) )\n {\n case '2':\n re = re_month + '\\\\/' + re_day + '\\\\/' + re_year;\n df = 'MM/DD/YYYY';\n break;\n\n case '3':\n re = re_year + '-' + re_month + '-' + re_day;\n df = 'YYYY-MM-DD';\n break;\n\n case '4':\n re = re_year + '\\\\/' + re_month + '\\\\/' + re_day;\n df = 'YYYY/MM/DD';\n break;\n\n case '5':\n re = re_year + re_month_strict + re_day_strict;\n df = 'YYYYMMDD';\n break;\n\n case '1':\n default:\n re = re_day + '\\\\/' + re_month + '\\\\/' + re_year;\n df = 'DD/MM/YYYY';\n break;\n }\n\n re = '^' + re + '$';\n re = new RegExp( re );\n\n if( $( \"#\" + id ).val().match( re ) )\n {\n $( \"#div-form-\" + id ).removeClass( \"error\" );\n\n $( '#help-' + id ).html( \"\" );\n $( '#help-' + id ).hide( );\n return true;\n }\n else\n {\n $( \"#div-form-\" + id ).addClass( \"error\" );\n if( $( \"#help-\" + id ).length == 0 )\n $( \"#div-controls-\" + id ).append( '<p id=\"help-' + id + '\" class=\"help-block\"></p>' );\n $( '#help-' + id ).html( \"Bad date - use \" + df );\n $( '#help-' + id ).show( );\n return false;\n }\n}", "function compareDate(dos, rd) {\n\n }", "function isValidDate(input) {\n\treturn isDate(input) && isFinite(input);\n}", "function isValidDate(obj)\r\n{\r\n\tif (obj.value != \"\") {\r\n\t\tvar datePat = /^(\\d{1,2})[\\\\/|-](\\d{1,2})[\\\\/|-](\\d{2})?(\\d{2})$/;\r\n\t\tif (datePat.test(trim(obj.value))) {\r\n\t\t\tvar strDateParts = trim(obj.value).replace(datePat, \"$4-$1-$2\");\r\n\t\t\tvar arrDateParts = strDateParts.split(\"-\");\r\n\t\t\t// Check the year for validity\r\n\t\t\tif (arrDateParts[0] < 0 || arrDateParts[0] > 99) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Check the month for validity\r\n\t\t\tif (arrDateParts[1] < 1 || arrDateParts[1] > 12) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Check the month for validity\r\n\t\t\tif (arrDateParts[2] < 1 || arrDateParts[2] > 31) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tvar d = new Date(\"19\" + arrDateParts[0], arrDateParts[1] - 1, arrDateParts[2]);\r\n\t\t\tvar curDate = new Date();\r\n\t\t\tvar year = \"\";\r\n\t\t\tvar curYear = curDate.getYear() - 100;\r\n\t\t\tvar dyear = d.getYear();\r\n\t\t\tif (curYear >= 1900) { curYear = curYear - 1900; }\t\t// IE hack\r\n\t\t\tif (dyear > 100) { dyear = dyear - 100; } \t\t\t\t// Safari hack\r\n\r\n\t\t\t// Compare the 2-digit years to see what century it's in\r\n\t\t\tif (dyear >= curYear) {\r\n\t\t\t\tyear = 1900 + dyear;\r\n\t\t\t} else {\r\n\t\t\t\tyear = 2000 + dyear;\r\n\t\t\t}\r\n\t\t\tif (!isNaN(d.getMonth())) {\r\n\t\t\t\tobj.value = (d.getMonth() + 1) + \"/\" + d.getDate() + \"/\" + year;\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "function testForDate(value) {\n // console.log('testForDate', { value });\n if (type(value) === 'date' || type(value) === 'string') {\n const datetime = value.split('T');\n if (datetime.length === 2 && datetime[0].length === 10) {\n const d = datetime[0].split('-');\n if (d.length === 3) {\n return true;\n }\n }\n }\n return false;\n}", "validateStartDate(start_time){\n let start_time_date = new Date(start_time);\n let tempDate = new Date();\n tempDate.setDate(tempDate.getDate());\n let date_difference = tempDate.getTime() - start_time_date.getTime();\n let dayToMillis = 86400000;\n date_difference = date_difference / dayToMillis;\n if(date_difference >= 0 && date_difference < 7){\n return true;\n }\n return false;\n }", "function validDate (value) {\n\t return isDate(value) &&\n\t isNumber(Number(value))\n\t}", "function checkDate (dateString){\n var temp = dateString.replace('/', ',');\n var reservation_date = Date.parse(temp);\n var now = new Date();\n if(reservation_date>now){\n return true;\n }else{\n return false;\n }\n }", "function checkDate() {\r\n\tvar error = null;\r\n\tif (startDate.date != null) {\r\n\t\tif (endDate.date != null) {\r\n\t\t\tif (startDate.date >= endDate.date) {\r\n\t\t\t\terror = 'Der ' + $('#lb_in_start').text() + ' muss vor dem '\r\n\t\t\t\t\t\t+ $('#lb_in_end').text() + ' liegen.';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (deadDate.date != null) {\r\n\t\t\tif (startDate.date < deadDate.date) {\r\n\t\t\t\terror = 'Der ' + $('#lb_in_dead').text() + ' muss vor dem '\r\n\t\t\t\t\t\t+ $('#lb_in_end').text() + ' liegen.';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (startDate.date < now) {\r\n\t\t\terror = 'Der ' + $('#lb_in_start').text()\r\n\t\t\t\t\t+ ' muss in der Zukunft liegen.';\r\n\t\t}\r\n\t\tif (error == null) {\r\n\t\t\t$('#info-alert').hide();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t} else {\r\n\t\terror = 'Der ' + $('#lb_in_start').text() + ' muss angegeben werden.';\r\n\t}\r\n\r\n\t$('#info-alert').text(error);\r\n\t$('#info-alert').show();\r\n\treturn false;\r\n}", "isOnDate(date) {\n const selfDate = this.timeHuman.split(\" \")[0];\n const selfDay = Number(selfDate.split(\"-\")[2]);\n const day = Number(date.split(\"-\")[2]);\n return selfDay === day;\n }", "function isCheckValidDate(sysdate, frmdate, obj) // 2\n{ \n var objtxt = document.getElementById(obj);\n //form date\n var frmdatetxt = document.getElementById(frmdate).value;\n if (frmdatetxt == \"\") {\n return true;\n }\n var frmdatetxt = (frmdd + \"-\" + fmm + \"-\" + frmyr);\n //System Date\n var sysdatetxt;\n var sysdd = sysdate.toString().substr(0, 2);\n var sysmm = sysdate.toString().substr(3, 3);\n var sysyr = sysdate.toString().substr(7, 4);\n var smm;\n switch (sysmm.toLowerCase()) {\n case \"jan\": smm = \"01\";\n break;\n case \"feb\": smm = \"02\";\n break;\n case \"mar\": smm = \"03\";\n break;\n case \"apr\": smm = \"04\";\n break;\n case \"may\": smm = \"05\";\n break;\n case \"jun\": smm = \"06\";\n break;\n case \"jul\": smm = \"07\";\n break;\n case \"aug\": smm = \"08\";\n break;\n case \"sep\": smm = \"09\";\n break;\n case \"oct\": smm = \"10\";\n break;\n case \"nov\": smm = \"11\";\n break;\n case \"dec\": smm = \"12\";\n break;\n }\n var sysdatetxt = (sysyr + smm + sysdd);\n //frmdate\n var frmdatetxt = document.getElementById(frmdate).value;\n var frmdd = document.getElementById(frmdate).value.toString().substr(0, 2);\n var frmmm = document.getElementById(frmdate).value.toString().substr(3, 3);\n var frmyr = document.getElementById(frmdate).value.toString().substr(7, 4);\n var fmm;\n switch (frmmm.toLowerCase()) {\n case \"jan\": fmm = \"01\";\n break;\n case \"feb\": fmm = \"02\";\n break;\n case \"mar\": fmm = \"03\";\n break;\n case \"apr\": fmm = \"04\";\n break;\n case \"may\": fmm = \"05\";\n break;\n case \"jun\": fmm = \"06\";\n break;\n case \"jul\": fmm = \"07\";\n break;\n case \"aug\": fmm = \"08\";\n break;\n case \"sep\": fmm = \"09\";\n break;\n case \"oct\": fmm = \"10\";\n break;\n case \"nov\": fmm = \"11\";\n break;\n case \"dec\": fmm = \"12\";\n break;\n }\n\n var frmdatetxt = (frmyr + fmm + frmdd);\n\n if (frmdatetxt <= sysdatetxt) {\n return true;\n }\n else {\n //alert(\"Invalid date\\nCheck DateFormat or\\nCheck Future Date\");\n alert(\"Please enter a valid date. Date cannot be future date and format should be dd-MMM-yyyy.\");\n //NotifyMessage(\"Please enter a valid date. Date cannot be future date and format should be dd-MMM-yyyy.\");\n objtxt.value = \"\";\n objtxt.focus();\n objtxt.select();\n return false;\n }\n}", "function checkDate() {\r\n var date = document.getElementById(\"date\").value;\r\n newDate = new Date(date);\r\n var year = newDate.getFullYear();\r\n\r\n if(year == 2020)\r\n {\r\n return false;\r\n }else\r\n {\r\n return true;\r\n }\r\n}", "function dateCheck(date){\n let finalDate;\n if (date==null){\n finalDate='';\n }else{\n finalDate= date;\n }\n return finalDate;\n}", "function checkDate(form) {\r\n // Pattern ensures there is at least one character surrounding the '@' and '.'\r\n // e.g. '[email protected]' is acceptable\r\n var datePattern =/^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})$/;\r\n if(!datePattern.test(form.dateForm.value)) {\r\n document.getElementById(\"noDate\").style.display = 'inline-block';\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function js_checkResvDateTime(txtDate, txtTime)\n{\n //Create date from input value\n var dateParts = txtDate.split(\"/\");\n var timeParts = txtTime.split(\":\");\n\n //check exactly a number, use Number function, if it is not a number, it will return NaN \n var day = Number(dateParts[0]);\n var month = Number(dateParts[1]);\n var year = Number(dateParts[2]);\n\n if (isNaN(day) || isNaN(month) || isNaN(year))\n {\n return \"Date format is incorrect (It should be DD/MM/YYYY)<br/>\";\n }\n\n if (month < 1 || month > 12) { // check month range\n return \"Month must be between 1 and 12.<br/>\";\n }\n\n if (day < 1 || day > 31) {\n return \"Day must be between 1 and 31.<br/>\";\n }\n\n if ((month === 4 || month === 6 || month === 9 || month === 11) && day === 31) {\n return \"Month \" + month + \" doesn't have 31 days.<br/>\";\n }\n\n if (month === 2) { // check for february 29th\n var isleap = (year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0));\n if (day > 29 || (day === 29 && !isleap)) {\n return \"February \" + year + \" doesn't have \" + day + \" days.<br/>\";\n }\n }\n\n //Get today's date\n var today = new Date();\n\n var checkDate = new Date(dateParts[2], (dateParts[1] - 1), dateParts[0], timeParts[0], timeParts[1], 59);\n\n return (checkDate > today) ? (\"\") : (\"The selected date time should be later than now.<br/>\");\n}", "function validDate(dt) {\n\n if (dt.length !==3 || dt[1] > 12 || dt[0] > MONTH_DAYS[dt[1] - 1] && !(dt[1] == 2 && dt[0] == 29 && isLeapYear(dt[2])))\n return false;\n\n //dates must be between 01/01/1901 and 31/12/2999.\n return (dt[0] > 0 && dt[1] > 0 && dt[2] > 1901 && dt[2] < 3000);\n}", "function checkDate()\n\t\t\t{\n\t\t\t\tvar index=document.RecuringFeesReceipt.all.dropmop.selectedIndex;\n\t\t\t\tvar mmode=document.RecuringFeesReceipt.all.dropmop.options[index].value\n\t\t\t\tvar date=\"\";\n\t\t\t\t//alert(index)\n\t\t\t\t//alert(mmode)\n\t\t\t\t//if(index>0)\n\t\t\t\tif(index>=0)\n\t\t\t\t{\n\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\tdate=document.RecuringFeesReceipt.txtdraftDate.value;\n\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t\t\t\tdate=document.RecuringFeesReceipt.txtchDate.value;\n\t\t\t\t\talert(date.indexOf('/'))\n\t\t\t\t\talert(date.lastIndexOf('/'))\n\t\t\t\t\tif(date.indexOf('/')>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(date.lastIndexOf('/')<=date.indexOf('/'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talert(\"Date is invalid formate\");\n\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\talert(\"Date is invalid formate\");\n\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t\t \tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t}\n\t\t\t\t\tvar d=date.split('/');\n\t\t\t\t\tif((d[2]%4==0 && d[2]%100)||d[2]%400==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(d[1]>13)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talert(\"Invalid Month\");\n\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(d[1]==1||d[1]==3||d[1]==5||d[1]==7||d[1]==8||d[1]==10||d[1]==12)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(d[0]>31)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talert(\"Invalid date\");\n\t\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(d[1]==2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(d[0]>29)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talert(\"Invalid date\");\n\t\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(d[1]==4||d[1]==6||d[1]==9||d[1]==11)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(d[0]>30)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talert(\"Invalid date\");\n\t\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(d[1]>=13)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talert(\"Invalid Month\");\n\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t \t\treturn;\n\t\t\t\t\t\t}\n\t\t\t \t\t\tif(d[1]==1||d[1]==3||d[1]==5||d[1]==7||d[1]==8||d[1]==10||d[1]==12)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(d[0]>31)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talert(\"Invalid date\");\n\t\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(d[1]==2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(d[0]>28)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talert(\"Invalid date\");\n\t\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(d[1]==4||d[1]==6||d[1]==9||d[1]==11)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(d[0]>30)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\talert(\"Invalid date\");\n\t\t\t\t\t\t\t\tif(mmode==\"By Draft\")\n\t\t\t\t\t\t\t\t\tdocument.RecuringFeesReceipt.txtdraftDate.value=\"\";\n\t\t\t\t\t\t\t\telse if(mmode==\"By Cheque\")\n\t\t\t \t\t\t\tdocument.RecuringFeesReceipt.txtchDate.value=\"\";\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t \n\t\t\t\t}\n\t\t\t}", "function isValidDate(bd){\n\t/*checking if the format is corret*/\n\t/*format of YYYY-MM(M)-DD(M) is accepted*/\n\tif(!/^\\d{4}\\-\\d{1,2}\\-\\d{1,2}$/.test(bd)){\n return false;\n\t}\n\n // divide the input into year, month and date to validate\n var split_input = bd.split(\"-\");\n var year = parseInt(split_input[0], 10);\n var month = parseInt(split_input[1], 10);\n var day = parseInt(split_input[2], 10);\n \n \n\n // since it is birthdate, year range is set from 1918 to 2018\n if(year <= 1919 || year > 2019 || month == 0 || month > 12)\n return false;\n /*checks for if day provided is in range*/\n var daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];\n\n if(day<=0 || day>daysInMonth[month-1])\n \treturn false;\n\n if (!isExpired(year,month,day)){\n\t\treturn false;\n\t}\n\n return true;\n}", "function ALB_CalendarIsValidDate( sDate )\r\n {\r\n // Date must be 4 digits, / , 1 or 2 digits, / , 1 or 2 digits\r\n // but there's still the problem that the date could be 00-00-0000\r\n var regExp = /\\d{4}\\/\\d{1,2}\\/\\d{1,2}/;\r\n var bInvalid = false;\r\n\r\n if (!isDate(sDate))\r\n {\r\n bInvalid = true;\r\n }\r\n else if (!sDate.match(regExp))\r\n {\r\n bInvalid = true;\r\n }\r\n else\r\n {\r\n // date must not have all zeros in any of the 3 positions 0000-00-00,\r\n re4ZerosYear = /0{4}\\/\\d{1,2}\\/\\d{1,2}/;\r\n re2ZerosMonth = /d{4}\\/0{2}\\/\\d{1,2}/;\r\n re2ZerosDay = /d{4}\\/\\d{1,2}\\/0{2}/;\r\n\r\n //reYearStartsWithZero = /0\\d{3}\\/\\d{1,2}\\/\\d{1,2}/; // perhaps this is not needed?\r\n re1ZeroMonth = /d{4}\\/0\\/\\d{1,2}/;\r\n re1ZeroDay = /d{4}\\/\\d{1,2}\\/0/;\r\n\r\n if (sDate.match(re4ZerosYear) || sDate.match(re2ZerosMonth) || sDate.match(re2ZerosDay)\r\n || sDate.match(re1ZeroMonth) || sDate.match(re1ZeroDay))\r\n bInvalid = true;\r\n }\r\n\r\n if (bInvalid)\r\n {\r\n today = new Date();\r\n sDate = formatDateWithZeros(today.getFullYear(), (today.getMonth()+1), today.getDate(), '/');\r\n }\r\n\r\n return sDate;\r\n }", "function isDate(value) {\n return (/\\d{2,4}-\\d{2}-\\d{2}[T -_]\\d{2}:\\d{2}:\\d{2}/).test(value);\n }", "function ValidateDateObj(selectdate) {\n var bool = true;\n if (selectdate != null && selectdate != undefined && String(selectdate).trim() != '') {\n var dt = String(selectdate).split(',');\n if (!(parseInt(dt[1]) > 0 && parseInt(dt[1]) < 13)) {\n\n // alert(\"Invalid Date Format. Date Must be MM/DD/YYYY\");\n bool = false;\n return bool;\n }\n else if (!(parseInt(dt[2]) > 0 && parseInt(dt[2]) < 31)) {\n // alert(\"Invalid Date Format. Date Must be MM/DD/YYYY\");\n bool = false;\n return bool;\n }\n else if (!(dt[3].length == 4 && parseInt(dt[3]) > 0)) {\n if (parseInt(a[0]) > 12 || parseInt(a[1] > 31)) {\n // alert(\"Invalid Date Format. Date Must be MM/DD/YYYY\");\n bool = false;\n return bool;\n }\n }\n }\n return bool;\n}", "function isValidDate(dateStr) {\n\tvar datePat = /^(\\d{4})(\\.)(\\d{1,2})(\\.)(\\d{1,2})$/; // requires 4 digit year\n\tvar matchArray = dateStr.match(datePat); // is the format ok?\n\tif (matchArray == null) {\n\t\t//alert(dateStr + \" Date is not in a valid format.Please enter the date in YYYY.MM.DD format.\")\n\t\treturn false;\n\t}\n\tmonth = matchArray[3]; // parse date into variables\n\tday = matchArray[5];\n\tyear = matchArray[1];\n\tvar d = new Date();\n\tvar curr_date = d.getDate();\n\tvar curr_month = (d.getMonth()+1);\n\tvar curr_year = d.getFullYear();\n\tif (year >curr_year){\n\t\t//alert(\"Year should not be greater than the current Year.\");\n\t\treturn false;\n\t}\n\tif (year ==curr_year){\n\t\tif (month >curr_month){\n\t\t\t//alert(\"Date should not be greater than the current Date.\");\n\t\t\t//alert(\"Month should not be greater than the current Month.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (month ==curr_month){\n\t\t\tif (day >curr_date){\n\t\t\t\t//alert(\"Date should not be greater than the current Date.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\tif (month < 1 || month > 12) { // check month range\n//\t\talert(\"Month must be between 1 and 12.\");\n\t\treturn false;\n\t}\n\tif (day < 1 || day > 31) {\n//\t\talert(\"Day must be between 1 and 31.\");\n\t\treturn false;\n\t}\n\tif ((month==4 || month==6 || month==9 || month==11) && day==31) {\n//\t\talert(\"Month \"+month+\" doesn't have 31 days!\")\n\t\treturn false;\n\t}\n\tif (month == 2) { // check for february 29th\n\t\tvar isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));\n\t\tif (day>29 || (day==29 && !isleap)) {\n//\t\t\talert(\"February \" + year + \" doesn't have \" + day + \" days!\");\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "isDate(value) {\n return (\n value &&\n Object.prototype.toString.call(value) === \"[object Date]\" &&\n !isNaN(value)\n );\n }", "function validateDateIsCorrect(dateObject){\n let currentDate = new Date();\n if(dateObject<currentDate){\n return false;\n }else { return true; }\n}", "function isValidDate(dateStr) {\n var d = new Date(dateStr);\n return !isNaN(d.getDate());\n }", "function date_validation()\r\n{\t\r\n\tvar startdate=document.forms[0].StartDate.value;\t\r\n\tvar start_date1=startdate.split(\" \");\r\n\tvar sd=start_date1[0];\r\n\t\r\n\tvar enddate=document.forms[0].EndDate.value;\r\n\tvar enddate1=enddate.split(\" \");\r\n\tvar ed=enddate1[0];\r\n\r\n\tvar today_date1=document.forms[0].today_date.value;\r\n\tvar today_date2=today_date1.split(\" \");\r\n\tvar td=today_date2[0];\r\n\t\r\n\tif(td == sd && td == ed)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\talert(\"Please Enter Current Date\")\r\n\t\treturn false;\r\n\t}\r\n}", "function CheckDate(ddVal, mmVal, yyVal) {\n\t if(ddVal <= 0 || ddVal > 31 || mmVal <= 0 || mmVal > 12 || yyVal <= 0 || yyVal.length != 4) {\n\t\t alert(\"Please enter a valid date\");\n\t\t return false;\n\t }\n\t monthArray = new Array(\"January\", \"Febuary\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\");\n\t if(mmVal == 2) {\n\t\t if(yyVal % 4 == 0) {\n\t\t\t if(ddVal > 29) {\n\t\t\t\t\talert(\"February \" + yyVal + \" has only 29 days\");\n\t\t\t\t\treturn false;\n\t\t\t }\n\t\t }\n\t\t else {\n\t\t\t if(ddVal > 28) {\n\t\t\t\t\talert(\"February \" + yyVal + \" has only 28 days\");\n\t\t\t\t\treturn false;\n\t\t\t }\n\t\t }\n\t }\n\t else {\n\t\t if(mmVal == 4 || mmVal == 6 || mmVal == 9 || mmVal == 11) {\n\t\t\t if(ddVal > 30) {\n\t\t\t\t\talert(monthArray[mmVal-1] + \" has only 30 days\");\n\t\t\t\t\treturn false;\n\t\t\t }\n\t\t }\n\t }\n\t return true;\n}", "function isdate(dd, mm, yy) {\r\n var maxDayArray = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\n var Xday = dd\r\n var Xmonth = mm\r\n var Xyear = yy\r\n\r\n if ((Xyear < 1900) || (mm > 12)) { return false; }\r\n\r\n if (((Xmonth == 2) && (Xyear % 4 > 0)) || (Xmonth != 2)) {\r\n\r\n if (Xday > maxDayArray[Xmonth - 1])\r\n return false;\r\n }\r\n else {\r\n if (Xday > 29)\r\n return false;\r\n }\r\n\r\n\r\n return true;\r\n}", "function checkDates($from, $thru) {\n if ($from.val() && $thru.val() && anchor && nonAnchor) {\n if (anchor > nonAnchor) {\n $from.val(nonAnchor.toString('MM/dd/yyyy'));\n $thru.val(anchor.toString('MM/dd/yyyy'));\n } else {\n $from.val(anchor.toString('MM/dd/yyyy'));\n $thru.val(nonAnchor.toString('MM/dd/yyyy'));\n }\n }\n }", "function check_text_datenull(InpDateObj)\n{\n\tvar InpDate=InpDateObj.value;\n\tif(InpDate != \"\")\n\t{\n\t\treturn check_text_date(InpDateObj);\t \t\n\t}\n}", "function isDate(obj) {\n return Object.prototype.toString.call(obj) === '[object Date]';\n }", "function checkDate(int,tomorrow,array){\r\n\tvar dateInfo = getTime();\r\n\tif(tomorrow){ //adjust day if needed\r\n\t\tif(dateInfo[2] == 6) {\r\n\t\t\tdateInfo[2] = 0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdateInfo[2] = dateInfo[2]+1;\r\n\t\t}\r\n\t}\r\n\tvar hourFloat = concot(dateInfo);\r\n\tif(finder(\"openWhen\",queryResult) != undefined) {\r\n\t\thourFloat = parseFloat(finder(\"openWhen\",queryResult));\r\n\t}\r\n\r\n\tif(dateInfo[2] == 6){\r\n\t\tvar saturday = array[int][\"tid_lordag\"].split(\" - \");\r\n\t\tif(parseFloat(saturday[0])<hourFloat&&parseFloat(saturday[1])>hourFloat || array[int][\"tid_lordag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\telse if (dateInfo[2] == 0) {\r\n\t\tvar sunday = array[int][\"tid_sondag\"].split(\" - \");\r\n\t\tif(parseFloat(sunday[0])<hourFloat &&parseFloat(sunday[1])>hourFloat || array[int][\"tid_sondag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tvar weekday = array[int][\"tid_hverdag\"].split(\" - \");\r\n\t\tif(parseFloat(weekday[0])<hourFloat&&parseFloat(weekday[1])>hourFloat || array[int][\"tid_hverdag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "function checkinputdate(thisDateField) \n{\n // add by charlie, 21-09-2003. trim the value before validation\n thisDateField.value = trim(thisDateField.value);\n // end add by charlie\n\tvar day = thisDateField.value.charAt(0).concat(thisDateField.value.charAt(1));\n\tvar month = thisDateField.value.charAt(3).concat(thisDateField.value.charAt(4));\n\tvar year = thisDateField.value.charAt(6).concat(thisDateField.value.charAt(7));\n\n\t// check input date is null or not\n\t//if (thisDateField.value.length==0) {\n\t\t//alert(\"Please provide the date\");\n\t\t//return false;\n\t//}\n\n // skip validation if no value is input\n\tif (thisDateField.value.length!=0){\n // check input length \n if (trim(thisDateField.value).length != 8) {\n alert(\"Input Date Format should be dd-mm-yy, ex: 01-04-01 for 1 April 2001\");\n thisDateField.focus(); \n return false;\n } \n\n // validate year input\n if (isNaN(year) || year < 0 || thisDateField.value.charAt(6)==\"-\") {\n alert(\"Year should between 00 to 99\");\n thisDateField.focus();\n return false;\n }\n\t\n // validate month input\n if (isNaN(month) || month <=0 || month > 12) {\n alert(\"Month should between 01 to 12\");\n thisDateField.focus();\n return false;\n }\n\n // validate day input\n if (isNaN(day) || day <= 0 || day > 31) {\n alert(\"Day range should between 01 to 31\");\n thisDateField.focus();\n return false;\n }\n\n // validate max day input allow according to the input month for (April, June, September, November)\n if ((month==4 || month==6 || month==9 || month==11) && day > 30) {\n alert(\"Day range should between 01 to 30\");\n thisDateField.focus(); \n return false;\n }\n\t\n // validate max day input allow for February according to input year (leap year)\n if (month==2) {\n if ( (parseInt(year) % 4 == 0 && parseInt(year) % 100 != 0 ) \n || parseInt(year) % 400 == 0 ){\n if (day > 29) {\n alert(\"Day range should between 0 to 29\");\n thisDateField.focus(); \n return false;\n }\n } else {\n if (day > 28) {\n alert(\"Day range should between 0 to 28\");\n thisDateField.focus();\n return false;\n }\n }\n }\n\t\n // validate is it a proper seperator between day and month, also between month and year\n if (thisDateField.value.charAt(2)!=\"-\" || thisDateField.value.charAt(5)!=\"-\") {\n alert(\"Invalid input for date, use - as a seperator\");\n thisDateField.focus();\n return false;\n }\n\n\n\n }\n\t\n\t// if input date is ok return true\n\treturn true;\n}", "checkDateExpiresOn(date) {\n let currentDate = new Date(Date.now());\n let givenDate = new Date(this.stringFormatDate(date));\n if (givenDate < currentDate) {\n return true;\n }\n return false;\n }", "function isDate(value, sepVal, dayIdx, monthIdx, yearIdx) {\n try {\n value = value.replace(/-/g, \"/\").replace(/\\./g, \"/\");\n sepVal = (sepVal === undefined ? \"/\" : sepVal.replace(/-/g, \"/\").replace(/\\./g, \"/\"));\n\n var SplitValue = value.split(sepVal);\n if (SplitValue.length != 3) {\n return false;\n }\n\n /*//Auto detection of indexes*/\n if (dayIdx === undefined || monthIdx === undefined || yearIdx === undefined) {\n if (SplitValue[0] > 31) {\n yearIdx = 0;\n monthIdx = 1;\n dayIdx = 2;\n } else {\n yearIdx = 2;\n monthIdx = 1;\n dayIdx = 0;\n }\n }\n\n /*//Change the below values to determine which format of date you wish to check. It is set to dd/mm/yyyy by default.*/\n var DayIndex = dayIdx !== undefined ? dayIdx : 0;\n var MonthIndex = monthIdx !== undefined ? monthIdx : 1;\n var YearIndex = yearIdx !== undefined ? yearIdx : 2;\n\n var OK = true;\n if (!(SplitValue[DayIndex].length == 1 || SplitValue[DayIndex].length == 2)) {\n OK = false;\n }\n if (OK && !(SplitValue[MonthIndex].length == 1 || SplitValue[MonthIndex].length == 2)) {\n OK = false;\n }\n if (OK && SplitValue[YearIndex].length != 4) {\n OK = false;\n }\n if (OK) {\n var Day = parseInt(SplitValue[DayIndex], 10);\n var Month = parseInt(SplitValue[MonthIndex], 10);\n var Year = parseInt(SplitValue[YearIndex], 10);\n var MonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n if (OK = (Month <= 12 && Month > 0)) {\n\n var LeapYear = (Year & 3) == 0 && ((Year % 25) != 0 || (Year & 15) == 0);\n MonthDays[1] = (LeapYear ? 29 : 28);\n\n OK = Day > 0 && Day <= MonthDays[Month - 1];\n }\n }\n return OK;\n }\n catch (e) {\n return false;\n }\n}" ]
[ "0.76711684", "0.7645414", "0.76122695", "0.76077014", "0.75384104", "0.7458504", "0.7407468", "0.7403451", "0.7402913", "0.73803276", "0.7351411", "0.732255", "0.7315654", "0.731516", "0.7289354", "0.72882485", "0.72827524", "0.7246374", "0.72328573", "0.7217748", "0.7189891", "0.7189355", "0.7170969", "0.71686345", "0.71686345", "0.71614903", "0.71568507", "0.71458495", "0.7135223", "0.71335137", "0.7130499", "0.7121945", "0.7118394", "0.7112025", "0.710832", "0.70888686", "0.7086931", "0.70732015", "0.7061169", "0.7053557", "0.70459163", "0.70361865", "0.70268553", "0.70139205", "0.69997156", "0.69943815", "0.6980868", "0.6979276", "0.6977644", "0.6975446", "0.6974664", "0.69735205", "0.69674736", "0.6950177", "0.69433117", "0.6932776", "0.693088", "0.69226766", "0.6921716", "0.69142276", "0.69139457", "0.6909256", "0.69088995", "0.68919224", "0.68918276", "0.68898654", "0.68803275", "0.6879366", "0.6870492", "0.68667436", "0.685533", "0.68548644", "0.6854408", "0.6846687", "0.684643", "0.6831164", "0.6824522", "0.6824208", "0.6818521", "0.6816624", "0.6814177", "0.68107283", "0.6808023", "0.680582", "0.6792525", "0.67901796", "0.6779733", "0.6777395", "0.6775015", "0.6770735", "0.67586905", "0.6755351", "0.6753725", "0.6744844", "0.67440677", "0.6742612", "0.6735667", "0.67330015", "0.67328167", "0.67269206", "0.67241" ]
0.0
-1
New validations for resume name and attachment name validation in AddConsultent.jsp new functions for consultant resume attachment validations
function attachmentNameValidate(){ var attachmentName= document.addConsultantForm.attachmentName; if (attachmentName.value != null && (attachmentName.value != "")) { if(attachmentName.value.replace(/^\s+|\s+$/g,"").length>50){ str = new String(document.addConsultantForm.attachmentName.value); document.addConsultantForm.attachmentName.value=str.substring(0,50); alert("The AttachResumeName must be less than 50 characters"); } document.addConsultantForm.attachmentName.focus(); return (false); } return (true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkResume() {\n\tvar x = document.getElementById('resume').value;\n\tvar sub = x.substring(x.length-3);\n\tvar validate;\n\t\n\tif(sub == \"doc\" || sub == \"ocx\" || sub == \"pdf\"){\n\t\tvalidate = true\n\t}\n\tif(sub == 0 || sub == \"\") {\n\t\tdocument.getElementById('div_4').className='error'\n\t\tdocument.getElementById('errPosition3').innerHTML='Invalid file type. Must be .doc , .docx or .pdf ';\n\t\tvalidate = false;\n\t}\n\treturn validate;\n}", "function DocumentValidation() {\n var bool = true;\n var Lo_Obj = [\"ddldocTypes\", \"ddldocType\", \"ddlcompany\", \"ddlpromotors\", \"hdnfilepath\"];\n var Ls_Msg = [\"Document Type\", \"Document\",\"Company\",\"Promotor\",\"\"];\n\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function PromoterValidation() {\n\n \n\n var bool = true;\n var Lo_Obj = [\"ddlOwner\", \"ddlPromPrefer\", \"txtPromFName\", \"txtPromMName\", \"txtPromLName\", \"ddlPromNominee\", \"txtPromNomineeName\", \"txtPromDBO\", \"ddlGender\",\n \"txtPromCAddres\", \"ddlPromCState\", \"ddlPromCCity\", \"txtPromCPIN\", \"txtPromPAddress\", \"ddlPromPState\", \"ddlPromPCity\", \"txtPromPPIN\",\n \"txtPromPhone\", \"txtPromCell\", \"txtPromPan\", \"txtPromAdhar\", \"txtPromQualification\", \"txtPromEmail\"];\n var Ls_Msg = [\"Company Owner\", \"Preference\", \"First Name\", \"Middele Name\", \"Last Name\", \"Nominee Type\", \"Nominee Name\", \"Date of Birth\", \"Gender\",\n \"Current Address\", \"Current state\", \"Current city\", \"Current pin\", \"Permanent Address\", \"Permanent State\", \"Permanent City\", \"Permanent PIN\",\n \"Landline Number\", \"Mobile Number\", \"PAN Number\", \"Adhar Number\", \"Qualification\", \"Email\"];\n\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function validateAttachFile() {\n var tempName = \"\";\n var fileName = fileInput.files[0].name;\n var fileExtension = fileName.split('.').pop().toLowerCase();\n var fileSize = fileInput.files[0].size;\n \n if(jQuery.inArray(fileExtension, ['png', 'jpg', 'jpeg', 'PNG', 'JPG', 'JPEG']) == -1) {\n errorMsg = \"<i>\" + fileName + \"</i> has invalid file type<br>\";\n attachment = \"\"\n } else if(fileSize > 4000000) {\n errorMsg = \"The size of <i>\" + fileName + \"</i> is too big<br>\";\n fileInputText.value = \"\";\n attachment = \"\";\n } else {\n errorMsg = \"\";\n if (fileName.lastIndexOf('\\\\')) {\n tempName = fileName.lastIndexOf('\\\\') + 1;\n } else if (fileName.lastIndexOf('/')) {\n tempName = fileName.lastIndexOf('/') + 1;\n }\n fileInputText.value = fileName.slice(tempName, fileName.length);\n attachment = fileInput.files[0];\n }\n}", "function ValidateForm()\n{\n\n// Email\n\n\tif(document.getElementById(\"txtAdsName\").value=='')\n\t{\n\t\talert(\"Please enter Add name\");\n\t\tdocument.getElementById(\"txtAdsName\").focus();\n\t\treturn false;\n\t}\n/*\tif(document.getElementById(\"cmbYear\").value=='')\n\t{\n\t\talert(\"Please enter year\");\n\t\tdocument.getElementById(\"cmbYear\").focus();\n\t\treturn false;\n\t}*/\n\tif(document.getElementById(\"txtAdsDescription\").value=='')\n\t{\n\t\talert(\"Please enter Add description\");\n\t\tdocument.getElementById(\"txtAdsDescription\").focus();\n\t\treturn false;\n\t}\n\t\n/*\tif(document.getElementById(\"txtAdsImgage\").value!=\"\")\n\t{\n\t\n\t\tif(!chkExt(document.getElementById(\"txtAdsImgage\").value))\n\t\t{\n\n\t\t\tdocument.getElementById(\"txtAdsImgage\").focus();\n\t\t\tdocument.getElementById(\"txtAdsImgage\").select();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}\n\t\n\t\n\tif(document.getElementById(\"txtAdsImgage\").value=='')\n\t{\n\t\talert(\"Please select image\");\n\t\tdocument.getElementById(\"txtAdsImgage\").focus();\n\n\t\treturn false;\n\t}*/\n\t\n\tvar chkStatus=0;\n\tfor(var p=0;p<document.frmAddAds.chkPage.length;p++)\n\t{\n\t\t\n\t\tif(document.frmAddAds.chkPage[p].checked)\n\t\tchkStatus=1;\n\t}\n\t\n\tif(!chkStatus)\n\t{\n\t\talert(\"Please select file\");\n\t\tdocument.getElementById(\"chkPage\").focus();\n\t\treturn false;\n\t}\n\t\n\t// Year is Numeric\n\tif(!isValidNumeric(document.frmAddAds.cmbYear.value,\"Year\"))\n\t{\n\tdocument.frmAddAds.cmbYear.focus();\n\tdocument.frmAddAds.cmbYear.select();\t\t\n\treturn false;\n\t}\nreturn true;\n}", "function checkFileType(e)\n{\n\t\n\tuploadPdfFlag = 0;\n\tif ( $(\"input[name= printableCheckbox]\")\n\t\t\t.is(\":checked\") ) \n\t{\n\t\t\n\t\t var el = e.target ? e.target : e.srcElement ;\n\t\t \n\t\t var regex = /pdf|jpg|jpeg|JPG|JPEG/ ;\n\t\t\n\t\t if( regex.test(el.value) )\n\t\t {\n\t\t\t invalidForm[el.name] = false ;\n\t\t\t \t\t \n\t\t\t $(el).parent(\"div\").prev()\n\t\t\t .prev(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t\t .html(__(\"<span class='success help-inline'>Valid file</span>\"));\n\t\t\t \n\t\t } else {\n\t\t\t\n\t\t\t $(el).parents(\"div\").prev()\n\t\t\t .prev(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t\t .html(__(\"<span class='error help-inline'>Please upload only jpg or pdf file</span>\"));\n\t\t\t \n\t\t\t invalidForm[el.name] = true ;\n\t\t\t errorBy = el.name ;\n\t\t\t \n\t\t\t \n\t\t }\n\t \n\t \n\t} else {\n\t\tinvalidForm = {} ;\n\t}\n\n\t \n\t \n}", "function validate_createjob(){\n\t\n\tvar emailExp = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\t\n\tif(document.createJob.cmbService.value == ''){\n\t\tdocument.getElementById('lblcmbService').innerHTML = 'This field is required';\n\t\tdocument.createJob.cmbService.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblcmbService').innerHTML = '';\n\t}\n\t//customer validation\n if(document.createJob.CustomerName.value == ''){\n\t\tdocument.getElementById('lblCustomerName').innerHTML = 'This field is required';\n\t\tdocument.createJob.CustomerName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustomerName').innerHTML = '';\n\t}\n\tif(regex.test(document.createJob.CustomerName.value)){\n\t\tdocument.getElementById('lblCustomerName').innerHTML = 'This field contains special chars';\n\t\tdocument.createJob.CustomerName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustomerName').innerHTML = '';\n\t}\n\t/*if(document.createJob.CustomerEmailID.value == ''){\n\t\tdocument.getElementById('lblCustomerEmailID').innerHTML = 'This field is required';\n\t\tdocument.createJob.CustomerEmailID.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustomerEmailID').innerHTML = '';\n\t}*/\n\tif(document.createJob.CustomerEmailID.value != ''){\n\t\tif(!document.createJob.CustomerEmailID.value.match(emailExp)){\n\t\t\tdocument.getElementById('lblCustomerEmailID').innerHTML = \"Required Valid Email Address.\";\n\t\t\tdocument.createJob.CustomerEmailID.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblCustomerEmailID').innerHTML = '';\n\t\t}\n\t}else{\n\t\tdocument.getElementById('lblCustomerEmailID').innerHTML = '';\n\t}\n\t\n\tif(document.createJob.CustAddress.value == ''){\n\t\tdocument.getElementById('lblCustAddress').innerHTML = 'This field is required';\n\t\tdocument.createJob.CustAddress.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustAddress').innerHTML = '';\n\t}\n\tif(document.createJob.CustomercontactName.value == ''){\n\t\tdocument.getElementById('lblCustomercontactName').innerHTML = 'This field is required';\n\t\tdocument.createJob.CustomercontactName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustomercontactName').innerHTML = '';\n\t}\n\t\n\tif(regex.test(document.createJob.CustomercontactName.value)){\n\t\tdocument.getElementById('lblCustomercontactName').innerHTML = 'This field contains special chars';\n\t\tdocument.createJob.CustomercontactName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustomercontactName').innerHTML = '';\n\t}\n\t\n\tif(document.createJob.CustCity.value == ''){\n\t\tdocument.getElementById('lblCustCity').innerHTML = 'This field is required';\n\t\tdocument.createJob.CustCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustCity').innerHTML = '';\n\t}\n\tif(regex.test(document.createJob.CustCity.value)){\n\t\tdocument.getElementById('lblCustCity').innerHTML = 'This field contains special chars';\n\t\tdocument.createJob.CustCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustCity').innerHTML = '';\n\t}\n\tif(document.createJob.CustState.value == ''){\n\t\tdocument.getElementById('lblCustState').innerHTML = 'This field is required';\n\t\tdocument.createJob.CustState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustState').innerHTML = '';\n\t}\n\tif(regex.test(document.createJob.CustState.value)){\n\t\tdocument.getElementById('lblCustState').innerHTML = 'This field contains special chars';\n\t\tdocument.createJob.CustState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustState').innerHTML = '';\n\t}\n\tif(document.createJob.CustZip.value == ''){\n\t\tdocument.getElementById('lblCustZip').innerHTML = 'This field is required';\n\t\tdocument.createJob.CustZip.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustZip').innerHTML = '';\n\t}\n\tif(regex.test(document.createJob.CustZip.value)){\n\t\tdocument.getElementById('lblCustZip').innerHTML = 'This field contains special chars';\n\t\tdocument.createJob.CustZip.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustZip').innerHTML = '';\n\t}\n\tif(document.createJob.CustPhone.value == ''){\n\t\tdocument.getElementById('lblCustPhone').innerHTML = 'This field is required';\n\t\tdocument.createJob.CustPhone.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblCustPhone').innerHTML = '';\n\t}\n\tif(document.createJob.notes.value == ''){\n\t\tdocument.getElementById('lblnotes').innerHTML = 'This field is required';\n\t\tdocument.createJob.notes.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblnotes').innerHTML = '';\n\t}\n\tif(document.createJob.Worktype1.value == ''){\n\t\tdocument.getElementById('lblWorktype1').innerHTML = 'This field is required';\n\t\tdocument.createJob.Worktype1.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblWorktype1').innerHTML = '';\n\t}\n\tif(document.createJob.Equipment1.value == ''){\n\t\tdocument.getElementById('lblEquipment1').innerHTML = 'This field is required';\n\t\tdocument.createJob.Equipment1.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblEquipment1').innerHTML = '';\n\t}\n\tif(document.createJob.Model1.value == ''){\n\t\tdocument.getElementById('lblModel1').innerHTML = 'This field is required';\n\t\tdocument.createJob.Model1.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblModel1').innerHTML = '';\n\t}\n\tif(document.createJob.Quantity1.value == ''){\n\t\tdocument.getElementById('lblQuantity1').innerHTML = 'This field is required';\n\t\tdocument.createJob.Quantity1.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblQuantity1').innerHTML = '';\n\t}\n}", "function ProposedValidation() {\n var bool = true;\n var Lo_Obj = [\"ddlProType\", \"txtProLimit\", \"txtProOutstand\", \"txtProBanker\", \"txtProCollateral\", \"txtProROI\", \"txtProTenure\"];\n var Ls_Msg = [\"Facilites Type\", \"Limit\", \"Outstand\", \"Banker\", \"Collateral\", \"ROI\", \"Tenure\"];\n\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function validateRequireFields() {\n var page = 0;\n [\n 'proposal.attachments',\n 'proposal.gameDesignDocuments[EN]',\n 'proposal.gameDesignDocuments[JA]'\n ].forEach(angular.bind(this, function(key) {\n var found = pageFieldList[page].indexOf(key);\n if (found > -1) {\n pageFieldList[page].splice(found, 1);\n }\n\n if(conceptCommonServiceField.field(key).required()) {\n pageFieldList[page].push(key);\n }\n }));\n\n }", "function supplierFrmValidation()\n\t{\n\t\t\n\t\tif(document.getElementById(\"txtName\").value == \"\")\n\t\t{\n\t\t\t alert(\"Please enter supplier name\");\n\t\t\t document.getElementById(\"txtName\").focus();\n\t\t\t return false;\n\t\t}\n\t\tif(Validate(document.getElementById(\"txtName\").value,\"[^A-Za-z0-9\\\\ ]\") == true)\n\t\t{\n\t\t\t\talert(\"Please enter valid supplier name\");\n\t\t\t\tdocument.getElementById(\"txtName\").focus();\n\t\t\t\treturn false;\n\t\t}\n\t\tif(document.getElementById(\"txtAddress\").value == \"\")\n\t\t{\n\t\t\t alert(\"Please enter supplier address\");\n\t\t\t document.getElementById(\"txtAddress\").focus();\n\t\t\t return false;\n\t\t}\n\t\tif(document.getElementById(\"txtTelephone\").value == \"\")\n\t\t{\n\t\t\t alert(\"please enter telephone number\");\n\t\t\t document.getElementById(\"txtTelephone\").focus();\n\t\t\t return false;\n\t\t}\n\t\tif(checkInternationalPhone(document.getElementById(\"txtTelephone\").value) == false)\n\t\t{\n\t\t\talert(\"Please enter a valid phone number\");\n\t\t\t document.getElementById(\"txtTelephone\").focus();\n\t\t\t return false;\n\t\t}\n\t\tif(document.getElementById(\"txtEmail\").value == \"\")\n\t\t{\n\t\t\t alert(\"Please enter email address\");\n\t\t\t document.getElementById(\"txtEmail\").focus();\n\t\t\t return false;\n\t\t}\n\t\tif(Validate(document.getElementById(\"txtEmail\").value,\"^[A-Za-z][A-Za-z0-9_\\\\.]*@[A-Za-z]*\\\\.[A-Za-z0-9]\") == false)\n\t\t{\n\t\t\t\talert(\"Please enter valid email address\");\n\t\t\t\tdocument.getElementById(\"txtEmail\").focus();\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t\t\n\t\n\t}", "function validate()\n{\t\n//\talert(\"hiiiiii\");\n\tvar msg=\"You Have Selected \";\n\tfid=document.getElementById(\"formID\").value;\n\tfdos=document.getElementById(\"formSubmissionDate\").value;\n\tfdos=fdos.replace(/\\s{1,}/g,'');\n\tfsn1=document.getElementById(\"candidateFirstName\").value;\n\tfsn1=fsn1.replace(/\\s{1,}/g, '');\n\tfsn2=document.getElementById(\"candidateMiddleName\").value;\n\tfsn2=fsn2.replace(/\\s{1,}/g, '');\n\tfsn3=document.getElementById(\"candidateLastName\").value;\n\tfsn3=fsn3.replace(/\\s{1,}/g, '');\n\tfdob=document.getElementById(\"dateOfBirth\").value;\n\tfdob=fdob.replace(/\\s{1,}/g,'');\n\tfemail=document.getElementById(\"candidateEmail\").value;\n\tfcn=document.getElementById(\"candidateContactNo\").value;\n\tfcn=fcn.replace(/\\s{1,}/g, '');\n\tatt=document.getElementsByName(\"file\");\n\t//Regular Expression\n\tredt=/^(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})$/;\n\tran=/^[A-Za-z ]{3,20}$/;\n\tcr=/^[\\w\\s]/;\n\tem1=/^([a-z0-9_.-])+@([a-z0-9_.-])+\\.+([a-z0-9_-]{2,3})+\\.+([a-z0-9_-]{2,3})$/;\n\tem2=/^([a-z0-9_.-])+@([a-z0-9_.-])+\\.+([a-z0-9_-]{3})$/;\n\tvar regPositiveNum = '[-+]?([0-9]*\\.[0-9]+|[0-9]+)$';\n\n\t//Form ID validation\n\tif(fid==\"\" || fid==\"NULL\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please Select FORMID\";\n\t\talert(\"Please Select FORMID\");\n\t\treturn false;\n\t}\n\t//Date Validation\n\tif(fdos==\"\" || fid==\"NULL\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please Enter Date Of Submission\";\n\t\talert(\"Please Enter Date Of Submission\");\n\t\treturn false;\n\t}\n\n\t//Student Name Validation\n\tif(fsn1=='First Name' || fsn1==\"\")\n\t{\n\t//\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter First Name of Student\";\n\t\talert(\"Please Enter First Name of Student\");\n\t\treturn false;\n\t}\n\tif(fsn1!=''){\n\t\tif(!fsn1.match(ran)){\n\t\t//\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Invalid First Name of Student\";\n\t\t\talert(\"Invalid First Name of Student\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif(fsn2=='MiddleName' || fsn2==\"\"){\n\t\tdocument.getElementById(\"candidateMiddleName\").value=\"\";\n\t}\n\t\t\n\tif(fsn3=='Last Name' || fsn3==\"\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Last Name of Student\";\n\t\talert(\"Please Enter Last Name of Student\");\n\t\treturn false;\n\t}\n\tif(fsn3!=''){\n\t\tif(!fsn3.match(ran)){\n\t\t//\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Invalid Last Name of Student\";\n\t\t\talert(\"Invalid Last Name of Student\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//Validate Gender\n\tvar gndr = document.getElementsByName(\"gender\");\n\tif ( ( gndr[0].checked == false ) && ( gndr[1].checked == false ))\n\t{\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please select Gender: Male or Female\";\n\t\talert(\"Please select Gender: Male or Female\");\n\t\treturn false;\n\t}\n\t\n\t//Date of Birth Validation\n\tif( fdob==\"\" || fid==\"NULL\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please Enter Date Of Birth\";\n\t\talert(\"Please Enter Date Of Birth\");\n\t\treturn false;\n\t}\n\t\n\t//Validate category\n\tct = document.getElementById(\"category\").value;\n\tct = ct.replace(/\\s{1,}/g,'');\n\tif(ct == \"\")\n\t{\talert(\"Please Select Category\");\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Select Category\";\n\t\treturn false;\n\t}\n\t\n\t//Email Validation\n\tif(femail==\"\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\"; \n\t\t//document.getElementById(\"warningmsg\").innerHTML=\"Please Enter E-mail Id\";\n\t\talert(\"Please Enter E-mail Id\");\n\t\treturn false;\n }\t\n if(!(em1.test(femail) || em2.test(femail))){\n //\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Valid E-mail Id\";\n \talert(\"Please Enter Valid E-mail Id\");\n\t\treturn false;\n }\n \n\t//Contact Number Validation\n\tif(fcn==\"\"){\n\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Contact Number\";\n\t\talert(\"Please Enter Contact Number\");\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\tif(!fcn.match(regPositiveNum)){\n\t\t\t//document.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Numeric contact Number\";\n\t\t\talert(\"Please Enter Numeric contact Number\");\n\t\t\treturn false;\n\t\t}\n\t\tif (fcn<7000000000 || fcn>9999999999){\n\t\t//\tdocument.getElementById(\"warningbox\").style.visibility=\"visible\";\n\t\t//\tdocument.getElementById(\"warningmsg\").innerHTML=\"Please Enter Valid Phone Number\";\n\t\t\talert(\"Please Enter Valid Phone Number\");\n\t\t\treturn false;\n\t\t}\t\t\n\t\t/*else{\t\t\n\t\t\t//document.getElementById(\"warningbox\").style.visibility=\"collapse\";\n\t\t\tchk=document.getElementsByName(\"file\");\n\t\t\tfor(var i=0;i<chk.length-1;i++){\n\t\t\t\tvar value = document.getElementsByName('file')[i].value;\n\t\t\t\tmsg=msg+value+\" \";\t\t\t\n\t\t\t}\n\t\t\tif(msg==\"You Have Selected \"){\n\t\t\t\tif(!confirm(\"You Have Not Uploaded Any Attachment.\\n \\t Do You Want To Submit ???\"))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(!confirm(msg))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}*/\n\t\treturn true;\n\t}\n}", "function SPDocumentonUpload(e) {\n var invalidName = false;\n //for (var i = 0; i < e.files.length; i++) {\n // var name = e.files[i].name;\n // if (/^[a-zA-Z0-9-_. ]*$/.test(name) == false) {\n // Notify(\"File name:\" + name + \" contain special character(s) which are not allowed.\", 'error');\n // invalidName = true;\n // }\n //}\n if (!invalidName) {\n if ($('#WO').attr('checked') ? true : false) {\n\n var checkedValue = 'WorkOrder';\n e.data = {\n CallSlipId: $('#CallSlipId').val(),\n check: checkedValue\n };\n }\n else if ($('#Inv').attr('checked') ? true : false) {\n\n var checkedValue = 'Invoice';\n e.data = {\n CallSlipId: $('#CallSlipId').val(),\n check: checkedValue\n };\n }\n else if ($('#SO').attr('checked') ? true : false) {\n\n var checkedValue = 'SO';\n e.data = {\n CallSlipId: $('#CallSlipId').val(),\n check: checkedValue\n };\n }\n else if ($('#Pic').attr('checked') ? true : false) {\n\n var checkedValue = 'Picture';\n e.data = {\n CallSlipId: $('#CallSlipId').val(),\n check: checkedValue,\n relatedToIphone: $('#relatedToIphone').is(':checked')\n };\n }\n else if ($('#Other').attr('checked') ? true : false) {\n\n var checkedValue = 'Other';\n e.data = {\n CallSlipId: $('#CallSlipId').val(),\n check: checkedValue,\n otherval: $('#OtherText').val()\n };\n }\n else {\n e.preventDefault();\n Notify(\"Please select a Type\", \"error\");\n }\n }\n else\n e.preventDefault();\n}", "function CompanyValidation() { \n var Lo_Obj = [\"ddlCompPrefer\", \"txtCompName\", \"textCompRAddres\", \"txtCompCPIN\", \"txtCompDBE\", \"txtCompPan\", \"textCompPAddress\",\n \"txtCompPPIN\", \"textCompPermanentAddress\", \"txtCompPermanentPPIN\", \"txtCompEmail\", \"txtCompPhone\", \"txtCompCell\"];\n var Ls_Msg = [\"Constitution Type\", \"Name of Enterprice\", \"REGD Office Address\", \"Pin\", \"Date of Establishment\", \"PAN Number\",\n \"Address of Factory/Shop\", \"Pin\", \"Permanent Address\", \"Pin\", \"Email \", \"Landline\", \"Mobile\"];\n var bool = true;\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function validaCampoFileInsavePrev(Nombre, ActualLement, espacio) {\n var ID = document.getElementById(ActualLement + '_txt_' + Nombre);\n var file = ID.files[0];\n var errorIs2 = false;\n var tipoArch = $('#' + ActualLement + '_txt_' + Nombre).attr('accept');\n var MaxTam = $('#' + ActualLement + '_txt_' + Nombre).attr('maxtam');\n var espacio = espacio !== undefined ? espacio : '_S_solicitud_datos';\n if (!MaxTam) {\n MaxTam = 10;\n }\n if (!tipoArch) {\n tipoArch = '.pdf';\n }\n var FilesAdded = new Array();\n var _G_ID_ = '#' + ActualLement;\n if (tipoArch.toUpperCase().includes('PDF')) {\n var reader = new FileReader(file);\n reader.onload = function (event) {\n var text = reader.result;\n var firstLine = text.split('\\n').shift(); // first line\n if (!(firstLine.toString().toUpperCase().includes('PDF'))) {\n redLabel_Space(Nombre, 'El archivo es invalido o no es PDF', _G_ID_);\n errorIs2 = true;\n }\n }\n reader.readAsText(file, 'UTF-8');\n }\n if (file.size > (MaxTam * 1024 * 1024)) {\n redLabel_Space(Nombre, 'El archivo no debe superar los ' + MaxTam + ' MB', _G_ID_);\n errorIs2 = true;\n }\n if (!ValidateAlphanumeric((file.name).replace('.', ''))) {\n redLabel_Space(Nombre, 'El nombre del archivo no debe contener caracteres especiales', _G_ID_);\n errorIs2 = true;\n }\n $(_G_ID_ + espacio + ' input').each(function (i, item) {\n if (item.type === 'file' && item.value !== '') {\n if (FilesAdded.indexOf(item.value) !== -1) {\n redLabel_Space(item.name, 'El archivo ya se encuentra cargado en otro requisito', _G_ID_);\n errorIs2 = true;\n }\n FilesAdded.push(item.value);\n }\n });\n if (file.size <= (0)) {\n redLabel_Space(Nombre, 'El archivo no es valido', _G_ID_);\n errorIs2 = true;\n }\n\n\n var tipoAA = file.name;\n tipoAA = tipoAA.split('.');\n var tamtipoAA = tipoAA.length;\n tipoAA = tipoAA[tamtipoAA - 1];\n\n\n if (!(tipoAA).toUpperCase().replace('.', '').includes(tipoArch.replace('.', '').toUpperCase())) {\n redLabel_Space(Nombre, 'El archivo debe ser' + tipoArch.toUpperCase(), _G_ID_);\n errorIs2 = true;\n }\n setTimeout(function () {\n if (errorIs2) {\n ShowAlertMPrev(_G_ID_, null, null, true);\n }\n errorIs[Nombre] = errorIs2;\n return errorIs2;\n }, 1000);\n}", "function validateFormPropals() {\n\n //if ( formEditConception.propals !== undefined ) {\n\n var files = document.getElementById(\"propals\").files;\n var l = files.length ;\n if (l != 3) {\n alert(\"Vous devez soumettre 3 propositions ! \" );\n document.getElementById(\"propals\").value = '' ;\n return false;\n }\n else\n {\n var resultat = false ;\n Object.keys(files).forEach(function (key){\n var blob = files[key]; \n var ex = blob.type ;\n if (ex != \"image/png\" && ex != \"image/jpeg\" )\n {\n resultat = true ;\n }\n });\n if (resultat) {\n alert(\"Les propositions doivent être au format : JPG ou PNG ! \");\n document.getElementById(\"propals\").value = \"\"\n return false; \n } \n }\n }", "function validarExt(){\r\n var pdffFile = document.getElementById('pdffFile');\r\n var archivoRuta = pdffFile.value;\r\n var extPermitidas = /(.pdf)$/i;\r\n\r\nif(!extPermitidas.exec(archivoRuta)){\r\n alert('Asegurate de haber selecconado un PDF');\r\n pdffFile.value='';\r\n return false;\r\n}\r\n\r\nelse{\r\n if(pdffFile.files && pdffFile.files[0]){\r\n var visor = new FileReader();\r\n visor.onload=function(e){\r\n //document.getElementById('visorArchivo').innerHTML= \r\n //'<embed src=\"'+e.target.result+'\" >';\r\n }\r\n visor.readAsDataURL(pdffFile.files[0]);\r\n }\r\n}\r\n}", "function ValidateSubject()\n{\t\n\tvar errorstring = L_CannotBeAdded_Text + lineBreak;\n\tvar tempValue = document.theForm.itemSubjectLong.value;\n\tvar allSpaces = true;\n\tfor (var si=0; si<tempValue.length; si++)\n\t{\n\t\tif (tempValue.charAt(si) != ' ')\n\t\t\tallSpaces = false;\n\t}\n\tif (document.theForm.itemSubjectLong.value == \"\" || allSpaces)\n\t{\n\t\terrorstring = L_CannotBeAdded_Text + lineBreak + L_DescriptionMissing_Text + lineBreak;\n\t\tSetFocus();\n\t\tShowAlertMsg(errorstring);\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\t\t\t\t\t\n}", "function specialsValidate(specialsForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\n\nif (specialsForm.name.value==\"\")\n{\nerrorMessage+=\"name not filled!\\n\";\nvalidationVerified=false;\n}\nif (specialsForm.description.value==\"\")\n{\nerrorMessage+=\"description not filled!\\n\";\nvalidationVerified=false;\n}\nif (specialsForm.price.value==\"\")\n{\nerrorMessage+=\"price not filled!\\n\";\nvalidationVerified=false;\n}\nif(specialsForm.start_date.value==\"\")\n{\nerrorMessage+=\"start date not filled!\\n\";\nvalidationVerified=false;\n}\nif(specialsForm.end_date.value==\"\")\n{\nerrorMessage+=\"end date not filled!\\n\";\nvalidationVerified=false;\n}\nif (specialsForm.photo.value==\"\")\n{\nerrorMessage+=\"photo not selected!\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nreturn validationVerified;\n}", "function validateLabPerson(){\n\tvar boo = true;\n\n\t//validate name\n\tif(!validateLPname()){\n\t\tboo = false;\n\t}\n\t\n\t//validate mail\n\tvar mail=$('input[name=LP-mail]');\n\tif (!validateEmail(mail)){\n\t\tsetErrorOnBox(mail);\n\t\t//mail.focus();\n\t\tboo = false;\n\t} else{\n\t\tsetValidOnBox(mail);\n\t}\n\t\n\t//validate phone\n\tvar phone=$('input[name=LP-phone]');\n\tif (phone[0].value==null || phone[0].value==\"\"){\n\t\tsetErrorOnBox(phone);\n\t\t//phone.focus();\n\t\tboo = false;\n\t} else{\n\t\tif(!phone[0].value.match(/^[0-9+ ]+$/)){\n\t\t\tsetErrorOnBox(phone);\n\t\t\tboo = false;\n\t\t} else {\n\t\t\tsetValidOnBox(phone);\n\t\t}\n\t}\n\t\n\treturn boo;\n}", "function validateSuportFields()\n{\n var userFullName = document.getElementById(\"name\").value;\n if(userFullName.length == 0) { alert(\"Please fill your name\"); return false;}\n var userMail = document.getElementById(\"email\");\n if(!userMail.validity.valid) { alert(\"Invalid Email Address\"); return false;}\n var selectedSubject = document.getElementById(\"subject\").value;\n if(selectedSubject == \"Select Subject\") {alert(\"Please select subject\"); return false;}\n var userComment = document.getElementById(\"comment\").value;\n if(userComment.length == 0) { alert(\"Please fill your message\"); return false;}\n else { alert(userFullName + \"\\n\" + userMail.value + \"\\n\" + selectedSubject + \"\\n\" + userComment); return true; }\n}", "function sjb_is_attachment( event ) {\n var error_free = true;\n $(\".sjb-attachment\").each(function () {\n\n var element = $(\"#\" + $(this).attr(\"id\"));\n var valid = element.hasClass(\"valid\");\n var is_required_class = element.hasClass(\"sjb-not-required\"); \n\n // Set Error Indicator on Invalid Attachment\n if (!valid) {\n if (!(is_required_class && 0 === element.get(0).files.length)) {\n error_free = false;\n }\n }\n\n // Stop Form Submission\n if (!error_free) {\n event.preventDefault();\n }\n });\n\n return error_free;\n }", "function check1(file)\n\t{\n\tvar filename=file.value;\n\tvar ext=filename.substring(filename.lastIndexOf('.')+1);\n\t\tif(ext==\"pdf\")\n\t\t{\n\t\t\tdocument.getElementById(\"submit\").disabled=false;\n\t\t\tdocument.getElementById(\"msg1\").innerHTML=\"\";\n\t\t}\n\t\telse\n\t\t{\n\t\tdocument.getElementById(\"msg1\").innerHTML=\"! Please upload only Pdf File\";\n\t\tdocument.getElementById(\"submit\").disabled=true;\n\t\t}\n\t}", "function validaCampoFileInsave(Nombre, ActualLement, espacio) {\n\n var ID = document.getElementById(ActualLement + '_txt_' + Nombre);\n var file = ID.files[0];\n var errorIs2 = false;\n var tipoArch = $('#' + ActualLement + '_txt_' + Nombre).attr('accept');\n var MaxTam = $('#' + ActualLement + '_txt_' + Nombre).attr('maxtam');\n var espacio = espacio !== undefined ? espacio : '_S_solicitud_datos';\n if (!MaxTam) {\n MaxTam = 10;\n }\n if (!tipoArch) {\n tipoArch = '.pdf';\n }\n var FilesAdded = new Array();\n var _G_ID_ = '#' + ActualLement;\n if (tipoArch.toUpperCase().includes('PDF')) {\n var reader = new FileReader(file);\n reader.onload = function (event) {\n var text = reader.result;\n var firstLine = text.split('\\n').shift(); // first line\n if (!(firstLine.toString().toUpperCase().includes('PDF'))) {\n redLabel_Space(Nombre, 'El archivo es inválido o no es PDF', _G_ID_);\n errorIs2 = true;\n }\n }\n reader.readAsText(file, 'UTF-8');\n }\n if (file.size > (MaxTam * 1024 * 1024)) {\n redLabel_Space(Nombre, 'El archivo no debe superar los ' + MaxTam + ' MB', _G_ID_);\n errorIs2 = true;\n }\n if (!ValidateAlphanumeric((file.name).replace('.', ''))) {\n redLabel_Space(Nombre, 'El nombre del archivo no debe contener caracteres especiales', _G_ID_);\n errorIs2 = true;\n }\n $(_G_ID_ + espacio + ' input').each(function (i, item) {\n if (item.type === 'file' && item.value !== '') {\n if (FilesAdded.indexOf(item.value) !== -1) {\n redLabel_Space(item.name, 'El archivo ya se encuentra cargado en otro requisito', _G_ID_);\n errorIs2 = true;\n }\n FilesAdded.push(item.value);\n }\n });\n if (file.size <= (0)) {\n redLabel_Space(Nombre, 'El archivo no es valido', _G_ID_);\n errorIs2 = true;\n }\n\n\n var tipoAA = file.name;\n tipoAA = tipoAA.split('.');\n var tamtipoAA = tipoAA.length;\n tipoAA = tipoAA[tamtipoAA - 1];\n\n\n if (!(tipoAA).toUpperCase().replace('.', '').includes(tipoArch.replace('.', '').toUpperCase())) {\n redLabel_Space(Nombre, 'El archivo debe ser' + tipoArch.toUpperCase(), _G_ID_);\n errorIs2 = true;\n }\n setTimeout(function () {\n if (errorIs2) {\n ShowAlertM(_G_ID_, null, null, true);\n }\n errorIs[Nombre] = errorIs2;\n return errorIs2;\n }, 1000);\n}", "function AssociateValidation() {\n var bool = true;\n var Lo_Obj = [\"ddlAssociateType\", \"txtAssociateName\", \"txtAssociateLimit\", \"txtAssociateOutstand\", \"txtAssociateBanker\", \"txtAssociateCollateral\",\n \"txtAssociateROI\", \"txtAssociateTenure\"];\n var Ls_Msg = [\"Facilites Type\", \"Associate Name\", \"Limit\", \"Outstand\", \"Banker\", \"Collateral\", \"ROI\", \"Tenure\"];\n\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function validateForm() {\n // Retrieving the values of form elements \n var name = document.contactForm.name.value;\n var email = document.contactForm.email.value;\n var mobile = document.contactForm.mobile.value;\n var occupation = document.contactForm.occupation.value;\n var time = document.contactForm.time.value;\n var ammenities = [];\n var checkboxes = document.getElementsByName(\"ammenities[]\");\n for(var i=0; i < checkboxes.length; i++) {\n if(checkboxes[i].checked) {\n // Populate ammenities array with selected values\n ammenities.push(checkboxes[i].value);\n }\n }\n \n // Defining error variables with a default value\n var nameErr = emailErr = mobileErr = occupationErr = timeErr = true;\n document.getElementById(\"file\").required = true;\n \n // Validate name\n if(name == \"\") {\n printError(\"nameErr\", \"Please enter your name\");\n } else {\n var regex = /^[a-zA-Z\\s]+$/; \n if(regex.test(name) === false) {\n printError(\"nameErr\", \"Please enter a valid name\");\n } else {\n printError(\"nameErr\", \"\");\n nameErr = false;\n }\n }\n \n // Validate email address\n if(email == \"\") {\n printError(\"emailErr\", \"Please enter your email address\");\n } else {\n // Regular expression for basic email validation\n var regex = /^\\S+@\\S+\\.\\S+$/;\n if(regex.test(email) === false) {\n printError(\"emailErr\", \"Please enter a valid email address\");\n } else{\n printError(\"emailErr\", \"\");\n emailErr = false;\n }\n }\n \n // Validate mobile number\n if(mobile == \"\") {\n printError(\"mobileErr\", \"Please enter your mobile number\");\n } else {\n var regex = /^[1-9]\\d{9}$/;\n if(regex.test(mobile) === false) {\n printError(\"mobileErr\", \"Please enter a valid 10 digit mobile number\");\n } else{\n printError(\"mobileErr\", \"\");\n mobileErr = false;\n }\n }\n \n // Validate occupation\n if(occupation == \"Select\") {\n printError(\"occupationErr\", \"Please select your occupation\");\n } else {\n printError(\"occupationErr\", \"\");\n occupationErr = false;\n }\n \n // Validate time\n if(time == \"\") {\n printError(\"timeErr\", \"Please select your time\");\n } else {\n printError(\"timeErr\", \"\");\n timeErr = false;\n }\n \n // Prevent the form from being submitted if there are any errors\n if((nameErr || emailErr || mobileErr || occupationErr || timeErr) == true) {\n return false;\n } else {\n // Creating a string from input data for preview\n var dataPreview = \"You've entered the following details: \\n\" +\n \"Name: \" + name + \"\\n\" +\n \"Email Address: \" + email + \"\\n\" +\n \"Mobile Number: \" + mobile + \"\\n\" +\n \"occupation: \" + occupation + \"\\n\" +\n \"time: \" + time + \"\\n\";\n if(ammenities.length) {\n dataPreview += \"ammenities: \" + ammenities.join(\", \");\n }\n console.log(dataPreview)\n // Display input data in a dialog box before submitting the form\n //alert(dataPreview);\n if(confirm(dataPreview)){\n\n }\n else {\n return false\n }\n\n\n }\n}", "function validateFormModification(e) {\n\n // Contrôler les fichiers images\n var files = document.getElementById(\"doc\").files;\n var rslt = false ;\n Object.keys(files).forEach(function (key){\n var blob = files[key]; \n var ex = blob.type ;\n\n if (ex != 'image/png' && ex != 'application/pdf' && ex != 'image/jpeg'\n && ex != 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n && ex != 'application/msword'\n && ex != 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n && ex != 'application/vnd.ms-powerpoint'\n && ex != 'application/vnd.openxmlformats-officedocument.presentationml.presentation')\n {\n rslt = true ;\n }\n\n });\n\n if (rslt) {\n alert(\"Les documents doivent être au format : Word, PowerPoint, PDF, JPG, PNG ou Excel ! \");\n document.getElementById(\"labelDoc\").style.color = \"red\"\n document.getElementById(\"doc\").value = \"\"\n\n return false; \n }\n\nreturn ( true );\n\n\n }", "function validation() {\r\n\t\t\r\n\t}", "function validation()\r\n{\r\n\tvar reference = new String(document.getElementById(\"reference\").value);\r\n\tif (reference.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(referenceNonRenseignee);\r\n\t}\r\n\r\n\tif (!verifier(reference))\r\n\t{\r\n\t\treturn afficheErreur(referenceLettreRequise);\t\t\r\n\t}\r\n\t\r\n\tvar titre = new String(document.getElementById(\"titre\").value);\r\n\tif (titre.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(titreNonRenseigne);\r\n\t}\r\n\t\r\n\tvar auteurs = new String(document.getElementById(\"auteurs\").value);\r\n\tif (auteurs.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(auteursNonRenseignes);\r\n\t}\r\n\r\n\tvar editeur = new String(document.getElementById(\"editeur\").value);\r\n\tif (editeur.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(editeurNonRenseigne);\r\n\t}\r\n\t\r\n\tvar edition = new String(document.getElementById(\"edition\").value);\r\n\tif (edition.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(editionNonRenseignee);\r\n\t\t\r\n\t}\r\n\tif (isNaN(edition))\r\n\t{\r\n\t\treturn afficheErreur(editionDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar annee = new String(document.getElementById(\"annee\").value);\r\n\tif (annee.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(anneeNonRenseignee);\r\n\t\t\r\n\t}\r\n\tif (isNaN(annee) || annee.length != 4)\r\n\t{\r\n\t\treturn afficheErreur(anneeDoitEtreNombre4Chiffres);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar isbn = new String(document.getElementById(\"isbn\").value);\r\n\tif (isbn.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(isbnNonRenseigne);\r\n\t}\r\n\tif (isNaN(isbn))\r\n\t{\r\n\t\treturn afficheErreur(isbnDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\t\r\n\tvar nombreExemplaires = new String(document.getElementById(\"nombreExemplaires\").value);\r\n\tif (nombreExemplaires.length == 0)\r\n\t{\r\n\t\treturn afficheErreur(nombreExemplairesNonRenseigne);\r\n\t\t\r\n\t}\r\n\tif (isNaN(nombreExemplaires))\r\n\t{\r\n\t\t// Afficher Erreur Correspondante\r\n\t\treturn afficheErreur(isbnDoitEtreNombre);\r\n\t\t\r\n\t}\r\n\r\n\tvar disponibilite = document.getElementById(\"Disponibilite\").checked;\r\n\tvar excluPret = document.getElementById(\"excluPret\").checked;\r\n\tvar commentaires = new String(document.getElementById(\"Commentaires\").value);\r\n\t// crŽation d'un ouvrage \r\n\t\r\n\tvar ouvrage = new Array();\r\n\touvrage[indiceReference] = reference;\r\n\t// Completer l'ouvrage\r\n\touvrage[indiceTitre] = titre;\r\n\touvrage[indiceAuteurs] = auteurs;\r\n\touvrage[indiceEditeur] = editeur;\r\n\touvrage[indiceEdition] = edition;\r\n\touvrage[indiceAnnee] = annee;\r\n\touvrage[indiceIsbn] = isbn;\r\n\touvrage[indiceNombreExemplaires] = nombreExemplaires;\r\n\touvrage[indiceDisponibilite] = disponibilite;\r\n\touvrage[indiceExcluPret] = excluPret;\r\n\touvrage[indiceCommentaires] = commentaires;\r\n\touvrages[nombreOuvrages] = ouvrage;\r\n\tnombreOuvrages++;\r\n\t\r\n\tafficherResume(ouvrage);\r\n\treset_validation()\r\n\t\r\n}", "function validation() {\nvar firstname = document.getElementById(\"first-name\").value;\nvar lastname = document.getElementById(\"last-name\").value;\nvar email = document.getElementById(\"email\").value;\nvar phone = document.getElementById(\"phone\").value;\nvar title = document.getElementById(\"title\").value;\nvar Organization = document.getElementById(\"Organization\").value;\nvar emailReg = /^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\\]?)$/;\nif (firstname === '' || lastname === '' || email === '' || title === '' || Organization === '') {\nalert(\"Please fill all fields...!!!!!!\");\nreturn false;\n} else if (!(email).match(emailReg)) {\nalert(\"Invalid Email...!!!!!!\");\nreturn false;\n} else {\nreturn true;\n}\n}", "function specialsValidate(specialsForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\n\nif (specialsForm.name.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền tên!\\n\";\nvalidationVerified=false;\n}\nif (specialsForm.description.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền miêu tả!\\n\";\nvalidationVerified=false;\n}\nif (specialsForm.price.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền giá!\\n\";\nvalidationVerified=false;\n}\nif(specialsForm.start_date.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền ngày bắt đầu!\\n\";\nvalidationVerified=false;\n}\nif(specialsForm.end_date.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền ngày kết thúc!\\n\";\nvalidationVerified=false;\n}\nif (specialsForm.photo.value==\"\")\n{\nerrorMessage+=\"Bạn chưa chọn ảnh!\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nreturn validationVerified;\n}", "function validate_pdf_upload(file_type) {\n\n // var file_name = file_name.value;\n\n if (file_type == 'doc') {\n\n var input_files = document.getElementById('post_pdf_upload');\n\n var files = input_files.files;\n\n var file;\n\n // var feedback = document.getElementById('pdf_feedback');\n $('#pdf_feedback').html('');\n $('#submit_post').removeAttr('disabled');\n\n var extensions = new Array(\"pdf\", \"xls\", \"xlsx\");\n\n for (let i = 0; i < files.length; i++) {\n\n var file = files[i];\n\n var file_name = file.name;\n\n var file_extension = file_name.split('.').pop();\n\n var file_extension = file_extension.toLowerCase();\n\n if (extensions.includes(file_extension)) {\n $('#pdf_feedback').html($('#pdf_feedback').html() + file_name + '<br/>');\n } else {\n $('#pdf_feedback').html('*only pdf and xls spreadsheets allowed. Please select a different file<br/>');\n $('#submit_post').prop('disabled', true);\n return false;\n }\n\n }\n\n }\n\n if (file_type == 'img') {\n\n var input_files = document.getElementById('post_img_upload');\n\n var files = input_files.files;\n\n var file;\n\n // var feedback = document.getElementById('pdf_feedback');\n $('#img_feedback').html('');\n\n $('#submit_post').removeAttr('disabled');\n\n var extensions = new Array(\"jpeg\", \"jpg\", \"png\");\n\n for (let i = 0; i < files.length; i++) {\n\n var file = files[i];\n\n var file_name = file.name;\n\n var file_extension = file_name.split('.').pop();\n\n var file_extension = file_extension.toLowerCase();\n\n if (extensions.includes(file_extension)) {\n $('#img_feedback').html($('#img_feedback').html() + file_name + '<br/>');\n } else {\n $('#img_feedback').html('*only .jpeg, .jpg & .png extensions allowed . Please select a different image<br/>');\n $('#submit_post').prop('disabled', true);\n\n return false;\n }\n\n }\n }\n\n\n}", "function inputFileCheck()\n{\n\n var element = eval(this.element);\n if ( typeof element != 'undefined' )\n {\n\n this.custom_alert = (typeof this.custom_alert != 'undefined') ? this.custom_alert : '';\n\n this.ref_label = (typeof this.ref_label != 'undefined') ? this.ref_label\n : JS_RESOURCES.getFormattedString('field_name.substitute', [element.name]);\n var val = element.value;\n\n\n if ( this.invalid_chars )\n {\n var arr = val.invalidChars(this.invalid_chars);\n\n if ( arr && arr.length )\n {\n alert(JS_RESOURCES.getFormattedString('validation.invalid_chars',\n [this.ref_label, arr.join(', ')]));\n shiftFocus( element, false);\n return false;\n }\n }\n\n if ( val.length < this.minlength )\n {\n if ( this.minlength == 1 )\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.required', [this.ref_label]));\n }\n else\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.minimum_length',\n [this.minlength, this.ref_label]));\n }\n\n return false;\n }\n\n if ( this.img_check )\n {\n return image_check(element);\n }\n\n }\n return true;\n}", "function validateFields() {\n var result = checkTargetName();\n if ( !result ) {\n \talertUser();\n }\n return result;\n}", "function CheckAuditReviewLocalFields() { \n\tif ($(\"#reportDate\").val() == \"\") { \n\t\t\talert(\"Report Date is Require\");\n\t\t\t$('#reportDate').focus();\n\t\t\treturn false;\n\t} else { \n\t\tif ($(\"#rating\").val() == \"\") {\n\t\t\talert(\"Rating is Require\");\n\t\t\t$('#rating').focus();\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif(!$.isNumeric($(\"#numRecommendationsTotal\").val())) {\n\t\t\t\talert(\"Total Recomemendation must be numeric type.\");\n\t\t\t\t$('#numRecommendationsTotal').focus();\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tif(!$.isNumeric($(\"#numRecommendationsOpen\").val())) {\n\t\t\t\t\talert(\"Open Recomemendation must be numeric type.\");\n\t\t\t\t\t$('#numRecommendationsOpen').focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}\n\treturn true;\n}", "validatePDF() {\n if (this.hasExistingPDF()) {\n this.requiredPDF.check()\n return true\n } else if (this.primary_pdf_upload.hasFiles && this.onlyOnePdfAllowed() && this.isAPdf()) {\n this.requiredPDF.check()\n return true\n } else {\n this.requiredPDF.uncheck()\n return false\n }\n }", "function validateOnSave()\n{\n\tvar approver = nlapiGetFieldValue('custrecord_approver_coa');\n if (approver == null || approver == '') \n\t{\n alert('There is no Approver assigned for this Record.');\n return false;\n }\n\t//check for sub account type validation to its parent type\n var subAccount = nlapiGetFieldText('custrecord_subaccount_info');\n var currentAccountType = nlapiGetFieldText('custrecord_account_type');\n if (subAccount) \n\t{\n\t\t//if Sub account is of Update accounts\n\t\tvar filters = new Array();\n\t\tvar columns = new Array();\n\t\tfilters[0] = new nlobjSearchFilter('custrecord_accntname', null, 'is', subAccount);\n\t\tcolumns[0] = new nlobjSearchColumn('custrecord_account_type');\n\t\tcolumns[1] = new nlobjSearchColumn('custrecord_approval_status_coa');\n\t\tvar records = nlapiSearchRecord('customrecord_accounts', null, filters, columns);\n\t\tvar accountType = '';\n\t\tif (records) {\n\t\t\taccountType = records[0].getText('custrecord_account_type');\n\t\t\tvar status = records[0].getText('custrecord_approval_status_coa');\n\t\t\tif (status == 'Pending Approval') {\n\t\t\t\talert('The Subaccount chosen has not been approved. Please select any other account.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t\t//Validation for single subsidiary on Bank and credit card\n\t\tvar subs = nlapiGetFieldValues('custrecord_subs_coa');\n\t\tvar subLen = subs.length;\n\t\tvar child = nlapiGetFieldValue('custrecord_coa_include_children');\n\t\tif ((currentAccountType == 'Bank' || currentAccountType == 'Credit Card') && (subLen > 1 || child == 'T')) {\n\t\t\talert('Bank Accounts and Credit Card Accounts must be restricted to a single Subsidiary');\n\t\t\treturn false;\n\t\t}\n\t\t// If the Bank/Credit card account type is assigned to an elimination Subsidiary //\n\t\tvar subEliminationid = 6; //'Splunk Inc. : Splunk Consolidation Elimination'\n\t\tif (currentAccountType == 'Bank' || currentAccountType == 'Credit Card') \n\t\t{\n\t\t\tfor (var x = 0; x < subs.length; x++) \n\t\t\t{\n\t\t\t\tif (subs[x] == subEliminationid) \n\t\t\t\t{\n\t\t\t\t\talert('This record may not be assigned to an elimination Subsidiary.');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Check for Deferral Account\n\t\tvar deferralAccount = nlapiGetFieldValue('custrecord_def_account_ea');\n\t\tvar deferralAccountName = nlapiGetFieldText('custrecord_def_account_ea');\n\t\tif (deferralAccount) \n\t\t{\n\t\t\tvar customSub = nlapiGetFieldValues('custrecord_subs_coa');\n\t\t\tvar accountRec = nlapiLoadRecord('account', deferralAccount);\n\t\t\tvar stdSubsidiary = accountRec.getFieldValues('subsidiary');\n\t\t\tvar includchild = accountRec.getFieldValue('includechildren');\n\t\t\tvar stdSub = '';\n\t\t\tif (stdSubsidiary) \n\t\t\t{\n\t\t\t\tvar subs = stdSubsidiary.toString();\n\t\t\t\tstdSub = subs.split(',');\n\t\t\t}\n\t\t\tif (customSub.length > stdSub.length) \n\t\t\t{\n\t\t\t\talert('The subsidiary restrictions on this record are incompatible with those defined for account:' + deferralAccountName + '.' + 'Subsidiary access on this record must be a subset of those permitted by the account.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tif (includchild != 'T') {\n\t\t\t\t\tvar aresult = [];\n\t\t\t\t\tvar index = {};\n\t\t\t\t\tcustomSub = customSub.sort();\n\t\t\t\t\tfor (var c = 0; c < stdSub.length; c++) \n\t\t\t\t\t{\n\t\t\t\t\t\tindex[stdSub[c]] = stdSub[c];\n\t\t\t\t\t}\n\t\t\t\t\tfor (var d = 0; d < customSub.length; d++) \n\t\t\t\t\t{\n\t\t\t\t\t\tif (!(customSub[d] in index)) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taresult.push(customSub[d]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (aresult.length > 0) {\n\t\t\t\t\t\talert('The subsidiary restrictions on this record are incompatible with those defined for account:' + deferralAccountName + '.' + 'Subsidiary access on this record must be a subset of those permitted by the account.');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar accntName = nlapiGetFieldValue('custrecord_accntname');\n var accntNumber = nlapiGetFieldValue('custrecord_accntnumber');\n\t\tvar filter = new Array();\n filter[0] = new nlobjSearchFilter('custrecord_accntnumber', null, 'is', accntNumber);\n filter[1] = new nlobjSearchFilter('custrecord_accntnumber', null, 'isnotempty', null);\n\t\tfilter[2] = new nlobjSearchFilter('internalid',null,'noneof',nlapiGetRecordId());\n var result = nlapiSearchRecord('customrecord_accounts', null, filter);\n if (result != null) {\n alert('The account number you have chosen is already used.Go back, change the number and resubmit.');\n return false;\n }\n \n var newFilter = new Array();\n newFilter[0] = new nlobjSearchFilter('custrecord_accntname', null, 'is', accntName);\n\t\tnewFilter[1] = new nlobjSearchFilter('internalid',null,'noneof',nlapiGetRecordId());\n var records = nlapiSearchRecord('customrecord_accounts', null, newFilter);\n if (records != null) {\n alert('The account name you have chosen is already used.Go back, change the name and resubmit.');\n return false;\n }\n\t\treturn true;\n}", "function ShareValidation() {\n\t// wait for main validation object to initialize\n\tif (typeof(Validation) == \"undefined\") { setTimeout(ShareValidation, 500); return; }\n\t\t\n\t// ensure only one optional value was entered\n\tValidation.Functions.push( function() {\n\t\tvar hasValue = false;\n\t\tvar file = false;\n\t\t\n\t\tfor (var x = 0; x < Validation.Fields.length; x++) {\n\t\t\tif (Validation.Fields[x].HasValue()) {\n\t\t\t\tif (hasValue) {\n\t\t\t\t\t// too many values\n\t\t\t\t\treturn \"A file or the address of a web page, not both, must be entered to continue\";\n\t\t\t\t}\n\t\t\t\thasValue = true;\n\t\t\t\tif (Validation.Fields[x].Match(\"fldUpload\")) { file = true; }\n\t\t\t}\n\t\t}\n\t\tif (!hasValue) {\n\t\t\treturn \"A file or the address of a web page must be entered to continue\";\n\t\t} else {\n\t\t\tif (file) {\n\t\t\t\t// ensure that terms were accepted\n\t\t\t\tif (!DOM.GetNode(\"fldTerms\").checked) {\n\t\t\t\t\treturn \"The Terms & Conditions for uploaded files must be accepted to continue\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t} );\n}", "function validateForm(){\n//initalize the deferred object\n//will resolve if all inputs are valid, reject if any of the inputs are invalid\nvar validationDeferred = $.Deferred();\n//get the files to read\n//if the attachment input is empty set the attachmentFiles variable to undefined, otherwise set it to the attached files\nattachmentFiles = typeof $(\"#attachmentInput:visible\")[0] !== \"undefined\" ? $(\"#attachmentInput:visible\")[0].files : undefined;\n//an array from promises returned from the readFile function\n//once all fileRead promises have been resolved the validation process can continue\nvar promises = [];\n//loop through all attachments and add a promise to the promise array\n$.each(attachmentFiles,function(){\n promises.push(readFile(this,fileReadSucess,fileReadFail));\n});\n//validation process should only continue once all files have been read\n$.when.apply($, promises).then(function(e){\n //once all files have been processed sucessfully, mark the attachmentinput as valid and continue with the rest of the form validation\n $(\"#attachmentInput\").addClass(\"valid\");\n $(\"#attachmentInput\").removeClass(\"invalid\");\n\n //check all required inputs\n $(\"#intakeFormContainer .intakeFormSection:visible .requiredInput\").each(function(){\n //if the input is blank or null mark the input invalid and turn it red\n if(($(this).val() == \"\" || $(this).val() == null)){\n $(this).addClass(\"invalid\");\n $(this).addClass(\"incorrect_color\");\n $(this).removeClass(\"valid\");\n }\n //if the input is not blank but has already been determined incorrect set it as invalid\n //Note: at the moment the only inputs that are determined incorrect or correct is the owner and co-owner fields\n else if($(this).hasClass(\"incorrect_response\")){\n $(this).addClass(\"invalid\");\n $(this).removeClass(\"valid\");\n }\n //If none of the above conditions are true, the input is valid\n else{\n $(this).addClass(\"valid\");\n $(this).removeClass(\"incorrect_color\");\n $(this).removeClass(\"invalid\");\n }\n });\n //check all optionl inputs\n $(\"#intakeFormContainer .intakeFormSection:visible .optionalInput\").each(function(){\n //if the input is not blank and the value is not null and the value has not been marked as inccorect the input is valid\n // or if the value is blank the input is also considered valid\n if(($(this).val() !== \"\" && $(this).val() !== null && !$(this).hasClass(\"incorrect_response\")) || ($(this).val() == \"\")){\n $(this).addClass(\"valid\");\n $(this).removeClass(\"incorrect_color\");\n $(this).removeClass(\"invalid\");\n }\n //if the the above conditions failed, the input is invalid\n else{\n $(this).addClass(\"invalid\");\n $(this).addClass(\"incorrect_color\");\n $(this).removeClass(\"valid\");\n }\n });\n\n //check the validity of all visible inputs\n //if any input is marked as invalid or has not been made valid alert the user that provided information is incorrect and reject the promise\n if($(\"#intakeFormContainer .intakeFormSection:visible .formInput\").hasClass(\"invalid\") || !$(\"#intakeFormContainer .intakeFormSection:visible .formInput\").hasClass(\"valid\")){\n alert(\"Please fill in all fields with the correct information\");\n //reject the promise\n validationDeferred.reject(\"All fields were not filled in properly\");\n }\n //otherwise all information provided is valid and resolve the promise\n else{\n validationDeferred.resolve(\"All fields contain vailid data\");\n }\n},function(rejectMessage){\n //if any of the attached files are rejected mark the attachment input as invalid and tell the user why their attached file was rejected\n $(\"#attachmentInput\").addClass(\"invalid\");\n $(\"#attachmentInput\").removeClass(\"valid\");\n alert(rejectMessage);\n validationDeferred.reject(rejectMessage);\n});\n\nreturn validationDeferred.promise();\n\n}", "function validate_editclient(){\n\tvar emailExp = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\t\n\tif(document.frmProfile.ProfileUserName.value == ''){\n\t\tdocument.getElementById('lblProfileUserName').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileUserName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileUserName').innerHTML = '';\n\t}\t\n\tif(regex.test(document.frmProfile.ProfileUserName.value)){\n\t\tdocument.getElementById('lblProfileUserName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmProfile.ProfileUserName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileUserName').innerHTML = '';\n\t}\n\tif(document.frmProfile.ProfileContactName.value == ''){\n\t\tdocument.getElementById('lblProfileContactName').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileContactName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileContactName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmProfile.ProfileContactName.value)){\n\t\tdocument.getElementById('lblProfileContactName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmProfile.ProfileContactName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileContactName').innerHTML = '';\n\t}\n\tif(document.frmProfile.ProfileEmailID.value == ''){\n\t\tdocument.getElementById('lblProfileEmailID').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileEmailID.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileEmailID').innerHTML = '';\n\t}\n\tif(!document.frmProfile.ProfileEmailID.value.match(emailExp)){\n\t\tdocument.getElementById('lblProfileEmailID').innerHTML = \"Required Valid Email ID.\";\n\t\tdocument.frmProfile.ProfileEmailID.focus();\n\t\treturn false;\n\t}\n\telse{\n\t\tdocument.getElementById('lblProfileEmailID').innerHTML = '';\n\t}\n\t/*if(document.frmProfile.ProfilePassword.value == ''){\n\t\tdocument.getElementById('lblProfilePassword').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfilePassword.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfilePassword').innerHTML = '';\n\t}*/\n\tif(document.frmProfile.ProfileMobile.value == ''){\n\t\tdocument.getElementById('lblProfileMobile').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileMobile.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileMobile').innerHTML = '';\n\t}\n\tif(regex.test(document.frmProfile.ProfileMobile.value)){\n\t\tdocument.getElementById('lblProfileMobile').innerHTML = 'This field contains special chars';\n\t\tdocument.frmProfile.ProfileMobile.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileMobile').innerHTML = '';\n\t}\n\tif(document.frmProfile.ProfileFaxno.value == ''){\n\t\tdocument.getElementById('lblProfileFaxno').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileFaxno.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileFaxno').innerHTML = '';\n\t}\n\tif(regex.test(document.frmProfile.ProfileFaxno.value)){\n\t\tdocument.getElementById('lblProfileFaxno').innerHTML = 'This field contains special chars';\n\t\tdocument.frmProfile.ProfileFaxno.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileFaxno').innerHTML = '';\n\t}\n\tif(document.frmProfile.ProfileAddress.value == ''){\n\t\tdocument.getElementById('lblProfileAddress').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileAddress.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileAddress').innerHTML = '';\n\t}\n\tif(document.frmProfile.ProfileCity.value == ''){\n\t\tdocument.getElementById('lblProfileCity').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileCity').innerHTML = '';\n\t}\n\tif(regex.test(document.frmProfile.ProfileCity.value)){\n\t\tdocument.getElementById('lblProfileCity').innerHTML = 'This field contains special chars';\n\t\tdocument.frmProfile.ProfileCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileCity').innerHTML = '';\n\t}\n\tif(document.frmProfile.ProfileState.value == ''){\n\t\tdocument.getElementById('lblProfileState').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileState').innerHTML = '';\n\t}\n\tif(regex.test(document.frmProfile.ProfileState.value)){\n\t\tdocument.getElementById('lblProfileState').innerHTML = 'This field contains special chars';\n\t\tdocument.frmProfile.ProfileState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileState').innerHTML = '';\n\t}\n\tif(document.frmProfile.ProfileZipcode.value == ''){\n\t\tdocument.getElementById('lblProfileZipcode').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileZipcode.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileZipcode').innerHTML = '';\n\t}\n\tif(regex.test(document.frmProfile.ProfileZipcode.value)){\n\t\tdocument.getElementById('lblProfileZipcode').innerHTML = 'This field contains special chars';\n\t\tdocument.frmProfile.ProfileZipcode.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileZipcode').innerHTML = '';\n\t}\n\t/*if(document.frmProfile.ProfileLocation.value == ''){\n\t\tdocument.getElementById('lblProfileLocation').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfileLocation.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileLocation').innerHTML = '';\n\t}*/\n\t/*if(document.frmProfile.ProfilePhoto.value == ''){\n\t\tdocument.getElementById('lblProfilePhoto').innerHTML = 'This field is required';\n\t\tdocument.frmProfile.ProfilePhoto.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfilePhoto').innerHTML = '';\n\t}*/\n}", "function validate_techEdit(){\n\tvar emailExp = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\t\n\tif(document.frmTech.TechFirstName.value == ''){\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechFirstName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechFirstName.value)){\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechFirstName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = '';\n\t}\n\tif(document.frmTech.TechLastName.value == ''){\n\t\tdocument.getElementById('lblTechLastName').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechLastName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechLastName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechLastName.value)){\n\t\tdocument.getElementById('lblTechLastName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechLastName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechLastName').innerHTML = '';\n\t}\t\t\t\n\tif(document.frmTech.TechEmailID.value == ''){\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechEmailID.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = '';\n\t}\n\tif(!document.frmTech.TechEmailID.value.match(emailExp)){\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = \"Required Valid Email ID.\";\n\t\tdocument.frmTech.TechEmailID.focus();\n\t\treturn false;\n\t}\n\telse{\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = '';\n\t}\n\tif(document.frmTech.TechContactNo.value == ''){\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechContactNo.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechContactNo.value)){\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechContactNo.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = '';\n\t}\t\n\t\n\tif(document.frmTech.TechPicture.value != ''){\n\t\tvar str=document.getElementById('TechPicture').value;\n\t\tvar bigstr=str.lastIndexOf(\".\");\n\t\tvar ext=str.substring(bigstr+1);\n\t\tif(ext == 'jpg' || ext == 'JPG' || ext == 'jpeg' || ext == 'JPEG' || ext == 'png' || ext == 'PNG' || ext == 'gif' || ext == 'GIF' ){\n\t\t\tdocument.getElementById('lblTechPicture').innerHTML = '';\n\t\t}else{\n\t\t\tdocument.getElementById('lblTechPicture').innerHTML = 'Please enter a valid image';\n\t\t\treturn false;\n\t\t}\n\t}\n\tif(document.frmTech.TechAddress.value == ''){\n\t\tdocument.getElementById('lblTechAddress').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechAddress.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechAddress').innerHTML = '';\n\t}\n\tif(document.frmTech.TechCity.value == ''){\n\t\tdocument.getElementById('lblTechCity').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechCity').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechCity.value)){\n\t\tdocument.getElementById('lblTechCity').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechCity').innerHTML = '';\n\t}\t\n\tif(document.frmTech.TechState.value == ''){\n\t\tdocument.getElementById('lblTechState').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechState').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechState.value)){\n\t\tdocument.getElementById('lblTechState').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechState').innerHTML = '';\n\t}\t\n\tif(document.frmTech.TechZipcode.value == ''){\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechZipcode.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechZipcode.value)){\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechZipcode.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = '';\n\t}\n\tif(document.frmTech.TechPayGrade.value == ''){\n\t\tdocument.getElementById('lblTechPayGrade').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechPayGrade.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechPayGrade').innerHTML = '';\n\t}\n\tvar chk=$('input:checkbox[name=TechPayble[]]:checked').length;\n\tif(chk == 0){\n\t\tdocument.getElementById('lblTechPayble').innerHTML = 'This field is required';\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechPayble').innerHTML = '';\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n}", "function validateForm() {\n // Retrieving the values of form elements \n var fname = document.contactForm.fname.value;\n var email = document.contactForm.email.value;\n var mobile = document.contactForm.phone.value;\n var lname = document.contactForm.lName.value;\n var schoolName = document.contactForm.schoolName.value;\n var jobDes = document.contactForm.job.value;\n \n \n \n\t// Defining error variables with a default value\n var nameErr = emailErr = mobileErr = fnameErr = lnameErr =snameErr=jnameErr= true;\n \n // Validate name\n if(fname == \"\") {\n printError(\"fnameErr\", \"Please enter your name\");\n } else {\n var regex = /^[a-zA-Z\\s]+$/; \n if(fname.match(regex)) {\n clear();\n fnameErr = false;\n \n } else {\n printError(\"fnameErr\", \"Please enter a valid name\");\n \n }\n }\n \n // Validate email address\n if(email == \"\") {\n printError(\"emailErr\", \"Please enter your email address\");\n } else {\n // Regular expression for basic email validation\n var regex = /^\\S+@\\S+\\.\\S+$/;\n if(email.match(regex)) {\n printError(\"emailErr\", \"\");\n emailErr = false;\n } else{\n printError(\"emailErr\", \"Please enter a valid email address\");\n \n }\n }\n \n // Validate mobile number\n if(mobile == \"\") {\n printError(\"mobileErr\", \"Please enter your mobile number\");\n } else {\n var regex = /^\\d{11}$/;\n if(mobile.match(regex)) {\n printError(\"mobileErr\", \"\");\n mobileErr = false;\n \n } else{\n printError(\"mobileErr\", \"Please enter a valid 10 digit mobile number\");\n }\n }\n \n if(lname == \"\") {\n printError(\"lnameErr\", \"Please enter your last name\");\n } else {\n var regex = /^[a-zA-Z\\s]+$/; \n if(lname.match(regex)) {\n printError(\"lnameErr\", \"\");\n lnameErr = false;\n \n } else {\n printError(\"lnameErr\", \"Please enter a valid last name\"); \n }\n }\n if(schoolName == \"\") {\n printError(\"snameErr\", \"Please enter your schoolName\");\n } else {\n var regex = /^[a-zA-Z\\s]+$/; \n if(schoolName.match(regex)) {\n printError(\"snameErr\", \"\");\n snameErr = false;\n \n } else {\n printError(\"snameErr\", \"Please enter a valid schoolName\");\n }\n }\n if(jobDes == \"\") {\n printError(\"jnameErr\", \"Please enter your job description\");\n } else {\n var regex = /^[a-zA-Z\\s]+$/; \n if(jobDes.match(regex)) {\n printError(\"jnameErr\", \"\");\n jnameErr = false;\n \n } else {\n printError(\"nameErr\", \"Please enter a valid job description\");\n }\n }\n \n \n // Prevent the form from being submitted if there are any errors\n if((fnameErr || emailErr || mobileErr || fnameErr || lnameErr ||snameErr||jnameErr) == true) {\n return false;\n debugger;\n // console.log(error);\n } else {\n var dataPreview = \"You've entered the following details: \\n\" +\n \"Full Name: \" + fname + \"\\n\" +\n \"Email Address: \" + email + \"\\n\" +\n \"Mobile Number: \" + mobile + \"\\n\" +\n console.log(fname)\n console.log(email)\n console.log(mobile)\n document.getElementById(\"cnt-us\").innerHTML=\"thanks for contact us\";\n console.log(\"right\")\n alert(dataPreview);\n }\n}", "function inlineBasicsValidations() {\n var translation = $translate.instant(['campaign_basics_currency_prompt', 'campaign_basics_uploadimage_prompt', 'campaign_basics_selectcategory_prompt', 'campaign_basics_description_prompt', 'campaign_basics_selectstartdate_prompt', 'campaign_basics_select_end_date_prompt']);\n if (!$scope.campaign.currency_id) {\n $('.select-error').remove();\n $('#campaign-currency-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_currency_prompt + '</div>');\n $('#campaign-currency-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if (!$scope.currency_options) {;\n $('.select-error').remove();\n $('#campaign-currency-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n if (!$('#featured-img-field .ui.image').hasClass('image-uploaded') && (typeof $scope.hideCampaignImageField == 'undefined' || !$scope.hideCampaignImageField)) {\n $('#featured-img-field .select-error').remove();\n $('#featured-img-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_uploadimage_prompt + '</div>');\n $('#featured-img-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if (!$('#category-field .select2-choices li').hasClass('select2-search-choice') && (typeof $scope.hideCampaignCategoryField == 'undefined' || !$scope.hideCampaignCategoryField)) {\n $('#category-field .select-error').remove();\n $('#category-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_selectcategory_prompt + '</div>');\n $('#category-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if (!$('#start-date-field .quickdate').hasClass('startdate-selected')) {\n $('#start-date-field .select-error').remove();\n $('#start-date-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_selectstartdate_prompt + '</div>');\n $('#start-date-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if (!$('#end-date-field .quickdate').hasClass('enddate-selected') && $scope.run_mode) {\n $('#end-date-field .select-error').remove();\n $('#end-date-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_select_end_date_prompt + '</div>');\n $('#end-date-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if ($scope.invalidVideo) {\n $('#campaign-video .select-error').remove();\n $('#campaign-video').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if ($scope.invalidThumbnailVideo) {\n $('#campaign-thumbnail-video .select-error').remove();\n $('#campaign-thumbnail-video').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n }", "function upload_validation() {\n\t\n\t$('#mw-upload-form').on('submit', function(){\n\t\t\n\t\t//Add space preceding text in Desc and Source\n\t\t$('#mw-input-source, #wpUploadDescription').each(function() {\n\t\t\tvar valFirstChar = $(this).val().charAt(0);\n\t\t\tif (valFirstChar !== '' && valFirstChar !== ' ')\n\t\t\t\t$(this).val( ' ' + $(this).val() );\n\t\t});\n\t\t\n\t\t//Make file extension lowercase\n\t\tvar fileName = $('#wpDestFile').val()\n\t\t , ext = fileName.substring(fileName.lastIndexOf('.')+1).toLowerCase();\n\t\t$('#wpDestFile').val( fileName.slice(0, -1*ext.length) + ext );\n\t\t\n\t});\n\t\n\t//Add the html5 'required' property and 'pattern' attribute to the Source field on Special:Upload\n\t$('#mw-input-source').prop('required', true).attr('pattern', '.*\\\\S.*');\n\t//Add helpful links to Guidelines:Files\n\t$('label[for=mw-input-source]').html('Source (<a href=\"/Guidelines:Files#Sourcing\" target=\"_blank\" title=\"Guidelines:Files\">help</a>)');\n\t$('label[for=mw-input-subject]').html('Subject (<a href=\"/Guidelines:Files#Subject\" target=\"_blank\" title=\"Guidelines:Files\">help</a>)');\n\t\n}", "function advIssueEditCheck(){\n\tif(document.frmEditIssueMast.mediaNewid.selectedIndex == 0 ){\n alert ( \"Please select a Media Type.\" );\n\t\tdocument.frmEditIssueMast.mediaNewid.focus();\n return false;\n }\n\n\tif(document.frmEditIssueMast.txtIssueName.value==\"\"){\n\t\talert(\"Issue Name cannot be empty.\");\n\t\tdocument.frmEditIssueMast.txtIssueName.focus();\n\t\treturn false;\n\t}\n\n\tif(document.frmEditIssueMast.txtIssueName.value.length>80){\n\t\talert(\"Issue Name should not exceed 80 characters.\");\n\t\tdocument.frmEditIssueMast.txtIssueName.focus();\n\t\treturn false;\n\t}\n\n\tif(document.frmEditIssueMast.txtIssueName.value.indexOf(' ')==0){\n\t\talert(\"Enter Valid Issue Name.\");\n\t\tdocument.frmEditIssueMast.txtIssueName.focus();\n\t\treturn false;\n\t}\n\n\tif(document.frmEditIssueMast.txtIssueName.value.indexOf(' ')!==-1){\n\t\talert(\"Enter Valid Issue Name.\");\n\t\tdocument.frmEditIssueMast.txtIssueName.focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function validate(){\n\tvar firstName = wordCheck('#firstName','#error_firstname');\n\tvar lastName = wordCheck('#lastName','#error_lastname');\n\tvar email = emailCheck('#email','#error_email');\n\tvar phoneNumber = numberCheck('#contactNumber','#error_contactnumber');\n\tif ($('#subject').length != 0){\n\t\tvar sub = wordCheck('#subject','#error_subject');\n\t}\n\tif (firstName && lastName && email && phoneNumber){\n\t\tif ($('#subject').length != 0){\n\t\t\tif (sub)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}\n\telse\n\t\treturn false;\n}", "function validate(){\n if( ($('#pgm').val().trim().length < 1 || $('#subj').val().trim().length < 1 || $('#year').val().trim().length < 1 || $('#typ').val().trim().length < 1)) {\n alert('Please enter or select the required fields');\n return false;// || $('#subj').val() ||$('#year').val() || $('#type').val())\n }\n return true;\n }", "function checkFileType(e)\n{\n\t\n\tvar el = e.target ? e.target : e.srcElement ;\n\t var cls = '';\n\tif(parseInt($('input#editUserroleId').val()) > 0 )\n\t{\n\t\tcls = 'marginForError';\n \n\t}\n\t var regex = /png|jpg|jpeg|gif/ ;\n\t if( regex.test(el.value) )\n\t {\n\t\t\n\t\t invalidForm[el.name] = false ;\n\t\t \t\t \n\t\t $(el).parents(\"div.mainpage-content-right\").addClass('success')\n\t\t .children(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t .html(\"<span class='\" + cls +\" success help-inline'>Valid file</span>\");\n\t\t \n\t } else {\n\t\t\n\t\t $(el).parents(\"div.mainpage-content-right\").addClass('error').removeClass('success')\n\t\t .children(\"div.mainpage-content-right-inner-right-other\").removeClass(\"focus\")\n\t\t .html(\"<span class='\" + cls + \" error help-inline'>Please upload valid file</span>\");\n\t\t \n\t\t invalidForm[el.name] = true ;\n\t\t errorBy = el.name ;\n\t }\n}", "function validate_techAssign(){\n\tif(document.frmtechAssign.SrchTechnician.value == ''){\n\t\tdocument.getElementById('lblSrchTechnician').innerHTML = 'This field is required';\n\t\tdocument.frmtechAssign.SrchTechnician.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblSrchTechnician').innerHTML = '';\n\t}\n\t/*if(document.frmtechAssign.StartDate.value==''){\n\t\tdocument.getElementById('lblStartDate').innerHTML='This field is required';\n\t\t<!--document.frmtechAssign.StartDate.focus();-->\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblStartDate').innerHTML='';\n\t}\n\tif(document.frmtechAssign.StartTime.value==''){\n\t\tdocument.getElementById('lblStartTime').innerHTML='This field is required';\n\t\t<!--document.frmtechAssign.StartTime.focus();-->\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblStartTime').innerHTML='';\n\t}*/\n\tvar chktechs=$('input:checkbox[name=chkTech[]]:checked').length;\n\tif(chktechs==0){\n\t\tdocument.getElementById('lblAssign').innerHTML='Please select at least one checkbox';\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblAssign').innerHTML='';\n\t}\n}", "function validateSiteFields(passForm, allEntityTypesArr,handle) \n{\n var validationStatus = true;\n var form = null;\n var checkAudTypeFlag = false;\n var obj;\n \n for(var i = 0 ; i < allEntityTypesArr.length ; i++)\n {\n obj = document.getElementById(allEntityTypesArr[i]+'AudType');\n for (j=0; j<obj.options.length; j++) \n {\n if (obj.options[j].selected) \n {\n checkAudTypeFlag = true;\n break;\n }\n }\n }\n \n if (passForm == \"mySiteAddForm\")\n form = document.mySiteAddForm;\n else \n form = document.mySiteEditForm;\n \n var siteURI = trim(form.siteURI.value);\n var siteName = trim(form.siteName.value);\n if (siteName == null || siteName.length == 0) \n {\n alert(\"please enter a site name\");\n validationStatus = false;\n //return false;\n }\n else if (!checkAudTypeFlag) \n {\n alert(\"Please select atleast one Audience Type.\");\n validationStatus = false;\n //return false;\n }\n else if (siteURI == null || siteURI.length == 0) \n {\n alert(\"please enter a url\");\n validationStatus = false;\n //return false;\n }\n \n if(validationStatus == true){\n var siteNameOld = escape(form.siteNameOld.value);\n var siteName = escape(form.siteName.value);\n var userID = form.userID.value;\n var view = form.view.value;\n var siteURI = form.siteURI.value;\n var entityType = form.entityType.value;\n var entitySplit = entityType.split(\",\");\n var audType = \"\";\n for(t=0; t<entitySplit.length; t++){\n var entity = entitySplit[t];\n var entityID = entitySplit[t] + \"AudType\";\n var e = document.getElementById(entityID);\n if(e != null && e != \"undefined\"){\n var audTypeTemp = \"\";\n var tempSep = '';\n for (i = 0; i < e.options.length; i++) {\n if (e.options[i].selected){\n audTypeTemp += tempSep ;\n audTypeTemp += e.options[i].value;\n if(tempSep =='') tempSep =',';\n } \n } \n \n if(trim(audTypeTemp) != ''){\n var audSplit = audTypeTemp.split(\",\");\n var sep = \"\";\n for(a=0; a<audSplit.length; a++){\n if(sep=='') sep = \"&\"+entity+\"AudType=\";\n audType += sep;\n audType += audSplit[a];\n \n } \n } \n }\n }\n actionURL = handle + \"&siteNameOld=\"+siteNameOld+\"&siteName=\"+siteName +\"&userID=\"+userID+\"&view=\"+view+audType+\"&siteURI=\"+siteURI ;\n window.open(actionURL,\"_self\"); \n validationStatus = true;\n //return true;\n } \n}", "function AttachmentsCheque(input, Id) {\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n fileExtension = (input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)).replace(/^.*\\./, '');\n if (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"pdf\" || fileExtension == \"png\") {\n\n document.getElementById(Id + 'PhotoSource').value = e.target.result; //Generated DataURL\n document.getElementById(Id + 'FileName').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n else {\n $(\"#\" + Id).val(\"\");\n alert(\"Only Pdf/jpg/jpeg/png Format allowed\");\n }\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}", "function validateExcelMandatoryFields(iInv, iSecId, iForm, transLan, supplier_gstin) {\n var isPttnMthced = false;\n if (iForm == \"GSTR1\") {\n switch (iSecId) {\n case 'b2b':\n var isInvTypeValid = validateNoteSupplyType(iInv, transLan, iSecId);\n if (!iInv['Reverse Charge']) {\n iInv['Reverse Charge'] = 'N';\n }\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100;\n }\n if (iInv['Invoice Type'] != 'Regular' && (iInv['E-Commerce GSTIN'])) {\n isPttnMthced = false;\n } else {\n isPttnMthced = (validatePattern(iInv['Invoice date'], true, null) &&\n isValidDateFormat(iInv['Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Invoice Type'], true, null) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Reverse Charge'], true, /^(Y|N)$/) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validateGSTIN(iInv['GSTIN/UIN of Recipient'], iForm) &&\n validatePattern(iInv['GSTIN/UIN of Recipient'], true, null) &&\n validatePattern(iInv['Receiver Name'], false, /^[a-zA-Z0-9\\_&'\\-\\.\\/\\,()?@!#%$~*;+= ]{1,99}$/) &&\n validatePattern(iInv['Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n ((Number(iInv['Invoice Number']) != 0) ? true : false) &&\n (iInv['E-Commerce GSTIN'] == '' || iInv['E-Commerce GSTIN'] == null) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n isInvTypeValid\n // \n );\n }\n break;\n case 'b2ba':\n var isInvTypeValid = validateNoteSupplyType(iInv, transLan, iSecId);\n if (!iInv['Reverse Charge']) {\n iInv['Reverse Charge'] = 'N';\n }\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n isPttnMthced = (validateGSTIN(iInv['GSTIN/UIN of Recipient'], iForm) &&\n validatePattern(iInv['GSTIN/UIN of Recipient'], true, null) &&\n validatePattern(iInv['Receiver Name'], false, /^[a-zA-Z0-9\\_&'\\-\\.\\/\\,()?@!#%$~*;+= ]{1,99}$/) &&\n validatePattern(iInv['Original Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n ((Number(iInv['Original Invoice Number']) != 0) ? true : false) &&\n ((Number(iInv['Revised Invoice Number']) != 0) ? true : false) &&\n validatePattern(iInv['Revised Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n validatePattern(iInv['Revised Invoice date'], true, null) &&\n validatePattern(iInv['Original Invoice date'], true, null) &&\n isValidDateFormat(iInv['Revised Invoice date']) &&\n isValidDateFormat(iInv['Original Invoice date']) &&\n validatePattern(iInv['Reverse Charge'], true, /^(Y|N)$/) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Invoice Value'], true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Invoice Type'], true, null) &&\n validatePattern(iInv['Taxable Value'], true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n (iInv['E-Commerce GSTIN'] == '' || iInv['E-Commerce GSTIN'] == null) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n isInvTypeValid\n );\n break;\n case 'b2cl':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n isPttnMthced = (\n validatePattern(iInv['Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n ((Number(iInv['Invoice Number']) != 0) ? true : false) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Invoice date'], true, null) &&\n isValidDateFormat(iInv['Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n isValidTotalInvValue(iInv['Invoice Value']) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n (iInv['E-Commerce GSTIN'] == '' || iInv['E-Commerce GSTIN'] == null) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\d{0,11})(\\.\\d{0,2})?$/)\n );\n break;\n case 'b2cla':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n isPttnMthced = (\n validatePattern(iInv['Original Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n validatePattern(iInv['Revised Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n ((Number(iInv['Original Invoice Number']) != 0) ? true : false) &&\n ((Number(iInv['Revised Invoice Number']) != 0) ? true : false) &&\n validatePattern(iInv['Original Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Revised Invoice date'], true, null) &&\n validatePattern(iInv['Original Invoice date'], true, null) &&\n isValidDateFormat(iInv['Original Invoice date']) &&\n isValidDateFormat(iInv['Revised Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n isValidTotalInvValue(iInv['Invoice Value']) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n (iInv['E-Commerce GSTIN'] == '' || iInv['E-Commerce GSTIN'] == null) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\d{0,11})(\\.\\d{0,2})?$/)\n );\n break;\n case 'b2cs':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n var isRequired = (iInv['Type'] && iInv['Type'] == \"E\") ? true : false,\n isERecord = false;\n\n if (isRequired) {\n isERecord = validatePattern(iInv['E-Commerce GSTIN'], isRequired, /[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[C]{1}[0-9a-zA-Z]{1}/);\n\n }\n else {\n\n if (!(iInv['E-Commerce GSTIN'])) {\n isERecord = true;\n }\n }\n\n isPttnMthced = (\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(iInv['Type'], true, /^(OE)$/) && isERecord &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/)\n );\n\n break;\n case 'b2csa':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n var isRequired = (iInv['Type'] && iInv['Type'] == \"E\") ? true : false,\n isERecord = false;\n\n if (isRequired) {\n isERecord = validatePattern(iInv['E-Commerce GSTIN'], isRequired, /[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[C]{1}[0-9a-zA-Z]{1}/);\n\n }\n else {\n\n if (!(iInv['E-Commerce GSTIN'])) {\n isERecord = true;\n }\n }\n\n isPttnMthced = (\n validatePattern(iInv['Financial Year'], true, yearPattern) &&\n validatePattern(iInv['Original Month'], true, monthPattern) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Type'], true, /^(OE)$/) &&\n isERecord &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/)\n );\n break;\n case 'cdnr':\n var isNtsplyValid = validateNoteSupplyType(iInv, transLan, iSecId);\n if (!iInv[transLan.LBL_Diff_Percentage]) {\n iInv[transLan.LBL_Diff_Percentage] = 100.00;\n }\n isPttnMthced = (\n isValidDateFormat(iInv[transLan.LBL_DEBIT_CREDIT_NOTE_DATE]) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_Taxable_Value]), true, validations.taxableVal) &&\n validatePattern(iInv[transLan.LBL_NOTE_TYP], true, validations.noteType) &&\n validateGSTIN(iInv[transLan.LBL_GSTIN_UIN_RECIPIENT], iForm) &&\n validatePattern(iInv[transLan.LBL_GSTIN_UIN_RECIPIENT], true, null) &&\n validatePattern(iInv[transLan.LBL_RECEIVER_NAME], false, validations.tName) &&\n ((Number(iInv[transLan.LBL_DEBIT_CREDIT_NOTE_NO]) != 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_DEBIT_CREDIT_NOTE_NO], true, validations.InvNoteNumber) &&\n validatePattern(iInv[transLan.LBL_Diff_Percentage], true, validations.diffPercentage) &&\n validatePattern(iInv[transLan.LBL_DEBIT_CREDIT_NOTE_DATE], true, null) &&\n validatePattern(iInv[transLan.LBL_POS_Excel], true, null, true) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_NOTE_VAL_Excel]), true, validations.InvNoteValue) &&\n ((Number(iInv[transLan.LBL_NOTE_VAL_Excel]) >= 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_Cess_Amount]) >= 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_Taxable_Value]) > 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_Rate], true, validations.rates) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_Cess_Amount]), false, validations.cessAmount) &&\n validatePattern(iInv[transLan.LBL_RECHRG], true, validations.reverseChrge) &&\n validatePattern(iInv[transLan.LBL_NT_SPLY_TY], true, null) &&\n isNtsplyValid\n );\n break;\n case 'cdnur':\n if (!iInv[transLan.LBL_Diff_Percentage]) {\n iInv[transLan.LBL_Diff_Percentage] = 100.00;\n }\n var isRequired = false;\n var isValidPosStCd = validatePOSWithSupStCode(iInv, transLan, supplier_gstin);\n if ((iInv[transLan.LBL_UR_TYPE] == \"EXPWOP\") || (iInv[transLan.LBL_UR_TYPE] == \"EXPWP\")) {\n if (!iInv[transLan.LBL_POS_Excel] && iInv[transLan.LBL_Diff_Percentage] == 100.00)\n isRequired = true;\n } else {\n isRequired = validatePattern(iInv[transLan.LBL_POS_Excel], true, null, true)\n }\n // changes for delinking start\n isPttnMthced = (\n isValidDateFormat(iInv[transLan.LBL_DEBIT_CREDIT_NOTE_DATE]) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_Taxable_Value]), true, validations.taxableVal) &&\n validatePattern(iInv[transLan.LBL_NOTE_TYP], true, validations.noteType) &&\n validatePattern(iInv[transLan.LBL_DEBIT_CREDIT_NOTE_NO], true, validations.InvNoteNumber) &&\n ((Number(iInv[transLan.LBL_DEBIT_CREDIT_NOTE_NO]) != 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_Diff_Percentage], true, validations.diffPercentage) &&\n validatePattern(iInv[transLan.LBL_DEBIT_CREDIT_NOTE_DATE], true, null) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_NOTE_VAL_Excel]), true, validations.InvNoteValue) &&\n ((Number(iInv[transLan.LBL_NOTE_VAL_Excel]) >= 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_Cess_Amount]) >= 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_Taxable_Value]) > 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_UR_TYPE], true, validations.urType) &&\n isRequired &&\n validatePattern(iInv[transLan.LBL_Rate], true, validations.rates) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_Cess_Amount]), false, validations.cessAmount) &&\n isValidPosStCd\n );\n //changes for delinking end\n break;\n case 'cdnra':\n var isNtsplyValid = validateNoteSupplyType(iInv, transLan, iSecId);\n if (!iInv[transLan.LBL_Diff_Percentage]) {\n iInv[transLan.LBL_Diff_Percentage] = 100.00;\n }\n isPttnMthced =\n (isValidDateFormat(iInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_DATE]) &&\n isValidDateFormat(iInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_DATE]) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_Taxable_Value]), true, validations.taxableVal) &&\n validatePattern(iInv[transLan.LBL_NOTE_TYP], true, validations.noteType) &&\n validateGSTIN(iInv[transLan.LBL_GSTIN_UIN_RECIPIENT], iForm) &&\n validatePattern(iInv[transLan.LBL_Diff_Percentage], true, validations.diffPercentage) &&\n validatePattern(iInv[transLan.LBL_GSTIN_UIN_RECIPIENT], true, null) &&\n validatePattern(iInv[transLan.LBL_RECEIVER_NAME], false, validations.tName) &&\n ((Number(iInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_NO]) != 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_NO]) != 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_NO], true, validations.InvNoteNumber) &&\n validatePattern(iInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_DATE], true, null) &&\n validatePattern(iInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_NO], true, validations.InvNoteNumber) &&\n validatePattern(iInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_DATE], true, null) &&\n validatePattern(iInv[transLan.LBL_POS_Excel], true, null, true) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_NOTE_VAL_Excel]), true, validations.InvNoteValue) &&\n ((Number(iInv[transLan.LBL_NOTE_VAL_Excel]) >= 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_Cess_Amount]) >= 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_Taxable_Value]) > 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_Rate], true, validations.rates) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_Cess_Amount]), false, validations.cessAmount) &&\n validatePattern(iInv[transLan.LBL_RECHRG], true, validations.reverseChrge) &&\n validatePattern(iInv[transLan.LBL_NT_SPLY_TY], true, null) &&\n isNtsplyValid\n );\n break;\n case 'cdnura':\n if (!iInv[transLan.LBL_Diff_Percentage]) {\n iInv[transLan.LBL_Diff_Percentage] = 100.00;\n }\n var isRequired = false;\n var isValidPosStCd = validatePOSWithSupStCode(iInv, transLan, supplier_gstin);\n if ((iInv[transLan.LBL_UR_TYPE] == \"EXPWOP\") || (iInv[transLan.LBL_UR_TYPE] == \"EXPWP\")) {\n if (!iInv[transLan.LBL_POS_Excel] && iInv[transLan.LBL_Diff_Percentage] == 100.00)\n isRequired = true;\n } else {\n isRequired = validatePattern(iInv[transLan.LBL_POS_Excel], true, null, true)\n }\n isPttnMthced = (\n isValidDateFormat(iInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_DATE]) &&\n isValidDateFormat(iInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_DATE]) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_Taxable_Value]), true, validations.taxableVal) &&\n validatePattern(iInv[transLan.LBL_NOTE_TYP], true, validations.noteType) &&\n validatePattern(iInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_NO], true, validations.InvNoteNumber) &&\n ((Number(iInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_NO]) != 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_DATE], true, null) &&\n validatePattern(iInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_NO], true, validations.InvNoteNumber) &&\n ((Number(iInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_NO]) != 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_DATE], true, null) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_NOTE_VAL_Excel]), true, validations.InvNoteValue) &&\n ((Number(iInv[transLan.LBL_NOTE_VAL_Excel]) >= 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_Cess_Amount]) >= 0) ? true : false) &&\n ((Number(iInv[transLan.LBL_Taxable_Value]) > 0) ? true : false) &&\n validatePattern(iInv[transLan.LBL_Diff_Percentage], true, validations.diffPercentage) &&\n validatePattern(iInv[transLan.LBL_UR_TYPE], true, validations.urType) &&\n isRequired &&\n validatePattern(iInv[transLan.LBL_Rate], true, validations.rates) &&\n validatePattern(cnvt2Nm(iInv[transLan.LBL_Cess_Amount]), false, validations.cessAmount) &&\n isValidPosStCd\n );\n\n break;\n case 'exp':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n if (iInv['Shipping Bill Number'] || iInv['Shipping Bill Date']) {\n isPttnMthced = (validatePattern(iInv['Invoice date'], true, null) &&\n isValidDateFormat(iInv['Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Export Type'], true, /^(WPAY|WOPAY)$/) &&\n validatePattern(iInv['Shipping Bill Number'], true, /^[0-9]{3,7}$/) &&\n validatePattern(iInv['Shipping Bill Date'], true, null) &&\n isValidDateFormat(iInv['Shipping Bill Date']) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Port Code'], false, /^[a-zA-Z0-9]{1,6}$/) &&\n validatePattern(iInv['Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n ((Number(iInv['Invoice Number']) != 0) ? true : false) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/)\n );\n }\n else {\n isPttnMthced = (validatePattern(iInv['Invoice date'], true, null) &&\n isValidDateFormat(iInv['Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Export Type'], true, /^(WPAY|WOPAY)$/) &&\n validatePattern(iInv['Shipping Bill Number'], false, /^[0-9]{3,7}$/) &&\n validatePattern(iInv['Shipping Bill Date'], false, null) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Port Code'], false, /^[a-zA-Z0-9]{1,6}$/) &&\n validatePattern(iInv['Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n ((Number(iInv['Invoice Number']) != 0) ? true : false) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/)\n );\n }\n\n break;\n case 'expa':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n if (iInv['Shipping Bill Number'] || iInv['Shipping Bill Date']) {\n isPttnMthced = (validatePattern(iInv['Original Invoice date'], true, null) &&\n isValidDateFormat(iInv['Original Invoice date']) &&\n validatePattern(iInv['Revised Invoice date'], true, null) &&\n isValidDateFormat(iInv['Revised Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Export Type'], true, /^(WPAY|WOPAY)$/) &&\n validatePattern(iInv['Shipping Bill Number'], true, /^[0-9]{3,7}$/) &&\n validatePattern(iInv['Shipping Bill Date'], true, null) &&\n isValidDateFormat(iInv['Shipping Bill Date']) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Port Code'], false, /^[a-zA-Z0-9]{1,6}$/) &&\n validatePattern(iInv['Original Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n ((Number(iInv['Original Invoice Number']) != 0) ? true : false) &&\n ((Number(iInv['Revised Invoice Number']) != 0) ? true : false) &&\n validatePattern(iInv['Revised Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/)\n );\n }\n else {\n isPttnMthced = (validatePattern(iInv['Original Invoice date'], true, null) &&\n isValidDateFormat(iInv['Original Invoice date']) &&\n validatePattern(iInv['Revised Invoice date'], true, null) &&\n isValidDateFormat(iInv['Revised Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Export Type'], true, /^(WPAY|WOPAY)$/) &&\n validatePattern(iInv['Shipping Bill Number'], false, /^[0-9]{3,7}$/) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Shipping Bill Date'], false, null) &&\n validatePattern(iInv['Port Code'], false, /^[a-zA-Z0-9]{1,6}$/) &&\n validatePattern(iInv['Original Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n validatePattern(iInv['Revised Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n ((Number(iInv['Original Invoice Number']) != 0) ? true : false) &&\n ((Number(iInv['Revised Invoice Number']) != 0) ? true : false) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/)\n );\n }\n break;\n case 'at':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n if (!iInv['Cess Amount']) {\n iInv['Cess Amount'] = 0;\n }\n isPttnMthced = (\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(cnvt2Nm(iInv['Gross Advance Received']), true, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n ((Number(iInv['Gross Advance Received']) != 0) ? true : false) &&\n ((((Number(iInv['Gross Advance Received']) < 0) && ((Number(iInv['Cess Amount']) == 0) || (Number(iInv['Cess Amount']) < 0))) ? true : false) ||\n (((Number(iInv['Gross Advance Received']) > 0) && ((Number(iInv['Cess Amount']) == 0) || (Number(iInv['Cess Amount']) > 0))) ? true : false)) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/)\n );\n break;\n case 'ata':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n if (!iInv['Cess Amount']) {\n iInv['Cess Amount'] = 0;\n }\n isPttnMthced = (\n validatePattern(iInv['Financial Year'], true, yearPattern) &&\n validatePattern(iInv['Original Month'], true, monthPattern) &&\n validatePattern(iInv['Original Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Gross Advance Received'], true, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n ((Number(iInv['Gross Advance Received']) != 0) ? true : false) &&\n ((((Number(iInv['Gross Advance Received']) < 0) && ((Number(iInv['Cess Amount']) == 0) || (Number(iInv['Cess Amount']) < 0))) ? true : false) ||\n (((Number(iInv['Gross Advance Received']) > 0) && ((Number(iInv['Cess Amount']) == 0) || (Number(iInv['Cess Amount']) > 0))) ? true : false)) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/)\n );\n break;\n case 'atadj':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n isPttnMthced = (\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(cnvt2Nm(iInv['Gross Advance Adjusted']), true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\d{0,11})(\\.\\d{0,2})?$/)\n );\n break;\n case 'atadja':\n if (!iInv['Applicable % of Tax Rate']) {\n iInv['Applicable % of Tax Rate'] = 100.00;\n }\n isPttnMthced = (\n validatePattern(iInv['Financial Year'], true, yearPattern) &&\n validatePattern(iInv['Original Month'], true, monthPattern) &&\n validatePattern(iInv['Original Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Gross Advance Adjusted'], true, /^(\\d{0,11})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Applicable % of Tax Rate'], true, /^(100|65)$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Amount']), false, /^(\\d{0,11})(\\.\\d{0,2})?$/)\n );\n break;\n case 'hsn':\n var descRegexPattern = new RegExp(\"^[ A-Za-z0-9_@./&-]{0,30}$\", \"gi\");\n var hsnRegexPatter = new RegExp(\"^[0-9]{2,8}$\", \"gi\");\n var isHSNReq = true, isDescrReq = true;\n var isITAmt = true, isSTUTAmt = true, isCTAmt = true;\n var isRateReq = false, isTotalVal = true;\n\n if (iInv['Integrated Tax Amount']) {\n isSTUTAmt = false; isCTAmt = false;\n\n } else if (iInv['Central Tax Amount'] && iInv['State/UT Tax Amount']) {\n isITAmt = false;\n }\n\n if (iInv['HSN']) {\n isDescrReq = false;\n }\n else if (iInv['Description']) {\n isHSNReq = false;\n }\n\n if (iInv['UQC'] && iInv['UQC'] != \"NA\") {\n iInv['UQC'] = (iInv['UQC']).trim()\n }\n\n if (!R1Util.isCurrentPeriodBeforeAATOCheck(shareData.newHSNStartDateConstant, shareData.monthSelected.value)) {\n isHSNReq = true;\n isDescrReq = true;\n isRateReq = true;\n isTotalVal = false;\n\n descRegexPattern = new RegExp(\"^[^]{1,}$\", \"gi\");\n if (shareData.disableHSNRestrictions) {\n isDescrReq = false;\n }\n if (shareData.disableAATOLengthCheck) {\n hsnRegexPatter = new RegExp(\"^[0-9]{2,8}$\", \"gi\");\n }\n else {\n if (shareData.aatoGreaterThan5CR) {\n hsnRegexPatter = new RegExp(\"^[0-9]{6,8}$\", \"gi\");\n }\n\n else {\n hsnRegexPatter = new RegExp(\"^[0-9]{4,8}$\", \"gi\");\n }\n }\n\n isPttnMthced = (\n validatePattern(iInv['HSN'], isHSNReq, hsnRegexPatter) &&\n validatePattern(iInv['Description'], isDescrReq, descRegexPattern) &&\n validatePattern(iInv['UQC'], true, /^[a-zA-Z -]*$/) &&\n validatePattern(cnvt2Nm(iInv['Total Quantity']), true, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) && // &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Taxable Value'])), true, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(iInv['Rate'], isRateReq, /^(0|0.1|0.25|1|1.5|3|5|7.5|12|18|28)$/) && //RateValidationInReturn\n validatePattern(Math.abs(cnvt2Nm(iInv['Integrated Tax Amount'])), isITAmt, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Central Tax Amount'])), isCTAmt, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['State/UT Tax Amount'])), isSTUTAmt, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Cess Amount'])), false, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/)\n\n );\n }\n else {\n isPttnMthced = (\n validatePattern(iInv['HSN'], isHSNReq, hsnRegexPatter) &&\n validatePattern(iInv['Description'], isDescrReq, descRegexPattern) &&\n validatePattern(iInv['UQC'], true, /^[a-zA-Z -]*$/) &&\n validatePattern(cnvt2Nm(iInv['Total Quantity']), true, /^(\\-?(\\d{0,15})(\\.\\d{0,2})?)$/) && // &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Total Value'])), isTotalVal, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Taxable Value'])), true, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Integrated Tax Amount'])), isITAmt, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Central Tax Amount'])), isCTAmt, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['State/UT Tax Amount'])), isSTUTAmt, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Cess Amount'])), false, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/)\n );\n }\n break;\n case 'nil':\n isPttnMthced = (\n validatePattern(cnvt2Nm(iInv['Nil Rated Supplies']), false, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(cnvt2Nm(iInv['Exempted(other than nil rated/non GST supply)']), false, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n validatePattern(cnvt2Nm(iInv['Non-GST Supplies']), false, /^(\\-?(\\d{0,11})(\\.\\d{0,2})?)$/) &&\n (\n iInv['Description'] == 'Inter-State supplies to registered persons' ||\n iInv['Description'] == 'Intra-State supplies to registered persons' ||\n iInv['Description'] == 'Inter-State supplies to unregistered persons' ||\n iInv['Description'] == 'Intra-State supplies to unregistered persons'\n )\n );\n break;\n case 'doc_issue':\n isPttnMthced = (validatePattern(iInv['Sr. No. From'], true, /^[a-zA-Z0-9\\/\\-]{1,16}$/) &&\n validatePattern(iInv['Sr. No. To'], true, /^[a-zA-Z0-9\\/\\-]{1,16}$/) &&\n validatePattern(iInv['Total Number'], true, /^(\\d*)$/) &&\n validatePattern(iInv['Cancelled'], true, /^(\\d*)$/) &&\n (cnvt2Nm(iInv['Total Number']) >= cnvt2Nm(iInv['Cancelled'])) &&\n validatePattern(iInv['Nature of Document'], true, /^(Delivery Challan in case other than by way of supply \\(excluding at S no. 9 to 11\\)|Invoices for outward supply|Invoices for inward supply from unregistered person|Revised Invoice|Debit Note|Credit Note|Receipt Voucher|Payment Voucher|Refund Voucher|Delivery Challan for job work|Delivery Challan for supply on approval|Delivery Challan in case of liquid gas)$/));\n break;\n }\n } else if (iForm == \"GSTR2\") {\n switch (iSecId) {\n case 'b2b': // GSTR2\n if (!iInv['Reverse Charge']) {\n iInv['Reverse Charge'] = 'N';\n }\n if (!iInv['Integrated Tax Paid'])\n iInv['Integrated Tax Paid'] = 0;\n\n if (!iInv['Central Tax Paid'])\n iInv['Central Tax Paid'] = 0;\n\n if (!iInv['State/UT Tax Paid'])\n iInv['State/UT Tax Paid'] = 0;\n isPttnMthced = (validatePattern(iInv['Invoice date'], true, null) &&\n isValidDateFormat(iInv['Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n validatePattern(cnvt2Nm(iInv['Integrated Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Central Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['State/UT Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n validatePattern(cnvt2Nm(iInv['Availed ITC Integrated Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC Central Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC State/UT Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC Cess']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n (cnvt2Nm(iInv['Availed ITC Integrated Tax']) <= cnvt2Nm(iInv['Integrated Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC Central Tax']) <= cnvt2Nm(iInv['Central Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC State/UT Tax']) <= cnvt2Nm(iInv['State/UT Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC Cess']) <= cnvt2Nm(iInv['Cess Paid'])) &&\n\n\n\n\n validatePattern(iInv['Reverse Charge'], true, /^(Y|N)$/) &&\n validateGSTIN(iInv['GSTIN of Supplier'], iForm) &&\n validatePattern(iInv['GSTIN of Supplier'], true, null) &&\n validatePattern(iInv['Invoice Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['Eligibility For ITC'], true, /^(Inputs|Input services|Capital goods|Ineligible)$/) && isEligibleForITC(iInv['Place Of Supply'], iInv['Eligibility For ITC'])\n\n );\n break;\n case 'b2bur': // GSTR2\n\n\n\n isPttnMthced = (\n\n validatePattern(iInv['Invoice date'], true, null) &&\n isValidDateFormat(iInv['Invoice date']) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Supplier Name'], false, /^[a-zA-Z0-9\\_&'\\-\\.\\/\\,()?@!#%$~*;+= ]{1,99}$/) &&\n\n validatePattern(cnvt2Nm(iInv['Integrated Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Central Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['State/UT Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n validatePattern(cnvt2Nm(iInv['Availed ITC Integrated Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC Central Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC State/UT Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC Cess']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n (cnvt2Nm(iInv['Availed ITC Integrated Tax']) <= cnvt2Nm(iInv['Integrated Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC Central Tax']) <= cnvt2Nm(iInv['Central Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC State/UT Tax']) <= cnvt2Nm(iInv['State/UT Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC Cess']) <= cnvt2Nm(iInv['Cess Paid'])) &&\n\n validatePattern(iInv['Invoice Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['Eligibility For ITC'], true, /^(Inputs|Input services|Capital goods|Ineligible)$/) &&\n validatePattern(iInv['Supply Type'].trim(), true, /^(Inter State|Intra State)$/) && isEligibleForITC(iInv['Place Of Supply'], iInv['Eligibility For ITC'])\n );\n\n break;\n case 'b2ba': // GSTR2\n if (!iInv['Reverse Charge']) {\n iInv['Reverse Charge'] = 'N';\n }\n isPttnMthced = (validatePattern(iInv['Original Invoice date'], true, null) &&\n validatePattern(iInv['Revised Invoice date'], true, null) &&\n isValidDateFormat(iInv['Original Invoice date']) &&\n isValidDateFormat(iInv['Revised Invoice date']) &&\n validatePattern(iInv['Total Invoice Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Total Taxable Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Category'], true, /^(G|S)$/) &&\n validatePattern(iInv['Reverse Charge'], true, /^(Y|N)$/) &&\n validatePattern(iInv['Supplier GSTIN'], true, /[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[Z]{1}[0-9a-zA-Z]{1}/) &&\n validatePattern(iInv['Original Invoice Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['Revised Invoice Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['CGST Rate'], true, /^(0|2.5|6|9|14)$/) &&\n validatePattern(iInv['SGST Rate'], true, /^(0|2.5|6|9|14)$/) &&\n validatePattern(iInv['IGST Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['CESS Rate'], false, /^(0|15|135|290)$/) &&\n validateItcValues(iInv['IGST Amount'], iInv['Taxable IGST']) &&\n validateItcValues(iInv['CGST Amount'], iInv['Taxable CGST']) &&\n validateItcValues(iInv['SGST Amount'], iInv['Taxable SGST']) &&\n validateItcValues(iInv['Cess Amount'], iInv['Taxable CESS']) &&\n validateItcValues(iInv['Taxable IGST'], iInv['ITC IGST']) &&\n validateItcValues(iInv['Taxable SGST'], iInv['ITC SGST']) &&\n validateItcValues(iInv['Taxable CGST'], iInv['ITC CGST']) &&\n validateItcValues(iInv['Taxable CESS'], iInv['ITC CESS'])\n );\n break;\n case 'b2bura': // GSTR2\n if (!iInv['Reverse Charge']) {\n iInv['Reverse Charge'] = 'N';\n }\n isPttnMthced = (validatePattern(iInv['Original Invoice date'], true, null) &&\n validatePattern(iInv['Revised Invoice date'], true, null) &&\n isValidDateFormat(iInv['Original Invoice date']) &&\n isValidDateFormat(iInv['Revised Invoice date']) &&\n validatePattern(iInv['Total Invoice Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Total Taxable Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Category'], true, /^(G|S)$/) &&\n validatePattern(iInv['Reverse Charge'], true, /^(Y|N)$/) &&\n validatePattern(iInv['Supplier Name'], true, /[A-Za-z0-9_@\\s]{50}/) &&\n validatePattern(iInv['Original Invoice Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['Revised Invoice Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n // validatePattern(iInv['HSN/SAC of Supply'], false, /^[0-9]{2,8}$/) &&\n validatePattern(iInv['CGST Rate'], true, /^(0|2.5|6|9|14)$/) &&\n validatePattern(iInv['SGST Rate'], true, /^(0|2.5|6|9|14)$/) &&\n validatePattern(iInv['IGST Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['CESS Rate'], false, /^(0|15|135|290)$/) &&\n validateItcValues(iInv['IGST Amount'], iInv['Taxable IGST']) &&\n validateItcValues(iInv['CGST Amount'], iInv['Taxable CGST']) &&\n validateItcValues(iInv['SGST Amount'], iInv['Taxable SGST']) &&\n validateItcValues(iInv['Cess Amount'], iInv['Taxable CESS']) &&\n validateItcValues(iInv['Taxable IGST'], iInv['ITC IGST']) &&\n validateItcValues(iInv['Taxable SGST'], iInv['ITC SGST']) &&\n validateItcValues(iInv['Taxable CGST'], iInv['ITC CGST']) &&\n validateItcValues(iInv['Taxable CESS'], iInv['ITC CESS'])\n );\n break;\n case 'cdnr': // GSTR2\n if (!iInv['Pre GST']) {\n iInv['Pre GST'] = 'N';\n }\n\n\n\n isPttnMthced = (validatePattern(iInv['Invoice/Advance Payment Voucher date'], true, null) &&\n isValidDateFormat(iInv['Invoice/Advance Payment Voucher date']) &&\n validateGSTIN(iInv['GSTIN of Supplier'], iForm) &&\n validatePattern(iInv['GSTIN of Supplier'], true, null) &&\n isValidDateFormat(iInv['Note/Refund Voucher date']) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Note/Refund Voucher Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n validatePattern(cnvt2Nm(iInv['Integrated Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Central Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['State/UT Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n validatePattern(cnvt2Nm(iInv['Availed ITC Integrated Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC Central Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC State/UT Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC Cess']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n (cnvt2Nm(iInv['Availed ITC Integrated Tax']) <= cnvt2Nm(iInv['Integrated Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC Central Tax']) <= cnvt2Nm(iInv['Central Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC State/UT Tax']) <= cnvt2Nm(iInv['State/UT Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC Cess']) <= cnvt2Nm(iInv['Cess Paid'])) &&\n\n\n validatePattern(iInv['Reason For Issuing document'], true, /^(01-Sales Return|02-Post Sale Discount|03-Deficiency in services|04-Correction in Invoice|05-Change in POS|06-Finalization of Provisional assessment|07-Others)$/) &&\n validatePattern(iInv['Document Type'], true, /^(C|D)$/) &&\n validatePattern(iInv['Invoice/Advance Payment Voucher Number'], true, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Note/Refund Voucher Number'], true, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Note/Refund Voucher date'], true, null) &&\n validatePattern(iInv['Pre GST'], true, /^(Y|N)$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['Supply Type'], true, /^(Inter State|Intra State)$/)\n );\n break;\n case 'cdnur': // GSTR2\n\n if (!iInv['Pre GST']) {\n iInv['Pre GST'] = 'N';\n }\n\n\n isPttnMthced = (validatePattern(iInv['Invoice/Advance Payment Voucher date'], true, null) &&\n isValidDateFormat(iInv['Invoice/Advance Payment Voucher date']) &&\n isValidDateFormat(iInv['Note/Voucher date']) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Note/Voucher Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n validatePattern(cnvt2Nm(iInv['Integrated Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Central Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['State/UT Tax Paid']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n validatePattern(cnvt2Nm(iInv['Availed ITC Integrated Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC Central Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC State/UT Tax']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Availed ITC Cess']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n\n (cnvt2Nm(iInv['Availed ITC Integrated Tax']) <= cnvt2Nm(iInv['Integrated Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC Central Tax']) <= cnvt2Nm(iInv['Central Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC State/UT Tax']) <= cnvt2Nm(iInv['State/UT Tax Paid'])) &&\n (cnvt2Nm(iInv['Availed ITC Cess']) <= cnvt2Nm(iInv['Cess Paid'])) &&\n\n\n validatePattern(iInv['Reason For Issuing document'], true, /^(01-Sales Return|02-Post Sale Discount|03-Deficiency in services|04-Correction in Invoice|05-Change in POS|06-Finalization of Provisional assessment|07-Others)$/) &&\n validatePattern(iInv['Document Type'], true, /^(C|D)$/) &&\n validatePattern(iInv['Invoice/Advance Payment Voucher number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n validatePattern(iInv['Note/Voucher Number'], true, /^[a-zA-Z0-9-\\/]{1,16}$/) &&\n validatePattern(iInv['Note/Voucher date'], true, null) &&\n validatePattern(iInv['Pre GST'], true, /^(Y|N)$/) &&\n validatePattern(iInv['Invoice Type'], true, /^(IMPS|B2BUR)$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['Supply Type'].trim(), true, /^(Inter State|Intra State)$/) &&\n isValidSuplyType(iInv['Invoice Type'], iInv['Supply Type'].trim())\n );\n break;\n case 'cdnra': // GSTR2\n isPttnMthced = (validatePattern(iInv['Invoice date'], true, null) &&\n isValidDateFormat(iInv['Invoice date']) &&\n isValidDateFormat(iInv['Original Debit Note date']) &&\n isValidDateFormat(iInv['Revised Debit Note date']) &&\n validatePattern(iInv['Total Differential Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Reason For Issuing Note'], true, /^(Balance|Sales Return|Post Sale Discount|Deficiency in Service|Not mentioned|Others)$/) &&\n validatePattern(iInv['Note Type'], true, /^(C|D)$/) &&\n validatePattern(iInv['Supplier GSTIN'], true, /[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[Z]{1}[0-9a-zA-Z]{1}/) &&\n validatePattern(iInv['Invoice Number'], true, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Original Debit Note Number'], true, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Original Debit Note date'], true, null) &&\n validatePattern(iInv['Revised Debit Note Number'], true, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Revised Debit Note date'], true, null) &&\n validatePattern(iInv['E-Commerce GSTIN'], false, /^[a-zA-Z0-9]{15}$/) &&\n validatePattern(iInv['CGST Rate'], true, /^(0|2.5|6|9|14)$/) &&\n validatePattern(iInv['SGST Rate'], true, /^(0|2.5|6|9|14)$/) &&\n validatePattern(iInv['IGST Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['CESS Rate'], false, /^(0|15|135|290)$/) &&\n validateItcValues(iInv['IGST Amount'], iInv['Taxable IGST']) &&\n validateItcValues(iInv['CGST Amount'], iInv['Taxable CGST']) &&\n validateItcValues(iInv['SGST Amount'], iInv['Taxable SGST']) &&\n validateItcValues(iInv['Cess Amount'], iInv['Taxable CESS']) &&\n validateItcValues(iInv['Taxable IGST'], iInv['ITC IGST']) &&\n validateItcValues(iInv['Taxable SGST'], iInv['ITC SGST']) &&\n validateItcValues(iInv['Taxable CGST'], iInv['ITC CGST']) &&\n validateItcValues(iInv['Taxable CESS'], iInv['ITC CESS'])\n );\n break;\n case 'imp_g': // GSTR2\n if (!iInv['GSTIN Of SEZ Supplier']) {\n iInv['GSTIN Of SEZ Supplier'] = '';\n }\n var validGstn, isRequired;\n if (iInv['Document Type'] == 'Received from SEZ') {\n validGstn = validateGSTIN(iInv['GSTIN Of SEZ Supplier'], iForm),\n isRequired = true;\n }\n else {\n validGstn = true;\n isRequired = false;\n }\n\n isPttnMthced = (\n validGstn &&\n validatePattern(iInv['GSTIN Of SEZ Supplier'], isRequired, null) &&\n validatePattern(iInv['Bill Of Entry Date'], true, null) &&\n isValidDateFormat(iInv['Bill Of Entry Date']) &&\n validatePattern(cnvt2Nm(iInv['Bill Of Entry Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) && validatePattern(iInv['Document type'], true, /^(Imports|Received from SEZ)$/) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Port Code'], true, /^[a-zA-Z0-9-\\/]{6}$/) &&\n validatePattern(iInv['Bill Of Entry Number'], true, /^[0-9]{7}$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['Eligibility For ITC'], true, /^(Inputs|Input services|Capital goods|Ineligible)$/) &&\n (cnvt2Nm(iInv['Availed ITC Integrated Tax']) <= cnvt2Nm(iInv['Integrated Tax Paid'])) && isImportFromSez(iInv['GSTIN Of SEZ Supplier'], iInv['Document type'])\n );\n break;\n case 'imp_ga': // GSTR2\n\n\n isPttnMthced = (validatePattern(iInv['Original Bill Of Entry date'], true, null) &&\n isValidDateFormat(iInv['Original Bill Of Entry date']) &&\n validatePattern(iInv['Revised Bill Of Entry date'], true, null) &&\n isValidDateFormat(iInv['Revised Bill Of Entry date']) &&\n validatePattern(iInv['Total Invoice Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Total Taxable Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Category'], true, /^(G|S)$/) &&\n validatePattern(iInv['Port Code'], false, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Original Bill Of Entry Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['Revised Bill Of Entry Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['IGST Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['CESS Rate'], false, /^(0|15|135|290)$/) &&\n validateItcValues(iInv['IGST Amount'], iInv['Taxable IGST']) &&\n validateItcValues(iInv['Cess Amount'], iInv['Taxable CESS']) &&\n validateItcValues(iInv['Taxable IGST'], iInv['ITC IGST']) &&\n validateItcValues(iInv['Taxable CESS'], iInv['ITC CESS'])\n );\n break;\n case 'imp_s': // GSTR2\n isPttnMthced = ((validatePattern(iInv['Invoice date'], true, null) || validatePattern(iInv['Invoice Date'], true, null)) &&\n (isValidDateFormat(iInv['Invoice date']) || isValidDateFormat(iInv['Invoice Date'])) &&\n validatePattern(cnvt2Nm(iInv['Invoice Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['Taxable Value']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(iInv['Invoice Number of Reg Recipient'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) && isEligibleForITC(iInv['Place Of Supply'], iInv['Eligibility For ITC']) &&\n validatePattern(iInv['Eligibility For ITC'], true, /^(Inputs|Input services|Capital goods|Ineligible)$/) &&\n (cnvt2Nm(iInv['Availed ITC Integrated Tax']) <= cnvt2Nm(iInv['Integrated Tax Paid']))\n );\n break;\n case 'imp_sa': // GSTR2\n isPttnMthced = (validatePattern(iInv['Original Invoice date'], true, null) &&\n isValidDateFormat(iInv['Original Invoice date']) &&\n validatePattern(iInv['Revised Invoice date'], true, null) &&\n isValidDateFormat(iInv['Revised Invoice date']) &&\n validatePattern(iInv['Total Invoice Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Total Taxable Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Category'], true, /^(G|S)$/) &&\n validatePattern(iInv['Port Code'], false, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Original Invoice Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['Revised Invoice Number'], true, /^[a-zA-Z0-9-/]*$/) &&\n validatePattern(iInv['IGST Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['CESS Rate'], false, /^(0|15|135|290)$/) &&\n validateItcValues(iInv['IGST Amount'], iInv['Taxable IGST']) &&\n validateItcValues(iInv['Cess Amount'], iInv['Taxable CESS']) &&\n validateItcValues(iInv['Taxable IGST'], iInv['ITC IGST']) &&\n validateItcValues(iInv['Taxable CESS'], iInv['ITC CESS'])\n );\n break;\n case 'txi': // GSTR2\n isPttnMthced = (\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(cnvt2Nm(iInv['Gross Advance Paid']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Supply Type'], true, /^(Inter State|Intra State)$/)\n );\n break;\n case 'atxi': // GSTR2\n isPttnMthced = (\n validatePattern(iInv['Recipient State Code'], true, null, true) &&\n validatePattern(iInv['Total Taxable Value'], true, /^((\\d*)|(\\d*.\\d{0,2}))$/) &&\n validatePattern(iInv['Category'], true, /^(G|S)$/) &&\n validatePattern(iInv['Type'], true, /^(REGD|UNREGD)$/) &&\n validatePattern(iInv['Original Document Number'], true, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Original Document date'], true, null) &&\n validatePattern(iInv['Revised Document Number'], true, /^[a-zA-Z0-9]*$/) &&\n validatePattern(iInv['Revised Document date'], true, null) &&\n isValidDateFormat(iInv['Original Document date']) &&\n isValidDateFormat(iInv['Revised Document date']) &&\n validatePattern(iInv['Original Supplier GSTIN'], true, /[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[Z]{1}[0-9a-zA-Z]{1}/) &&\n validatePattern(iInv['Revised Supplier GSTIN'], true, /[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[Z]{1}[0-9a-zA-Z]{1}/) &&\n validatePattern(iInv['CGST Rate'], true, /^(0|2.5|6|9|14)$/) &&\n validatePattern(iInv['SGST Rate'], true, /^(0|2.5|6|9|14)$/) &&\n validatePattern(iInv['IGST Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(iInv['CESS Rate'], false, /^(0|15|135|290)$/) &&\n validateItcValues(iInv['IGST Amount'], iInv['Taxable IGST']) &&\n validateItcValues(iInv['CGST Amount'], iInv['Taxable CGST']) &&\n validateItcValues(iInv['SGST Amount'], iInv['Taxable SGST']) &&\n validateItcValues(iInv['Cess Amount'], iInv['Taxable CESS']) &&\n validateItcValues(iInv['Taxable IGST'], iInv['ITC IGST']) &&\n validateItcValues(iInv['Taxable SGST'], iInv['ITC SGST']) &&\n validateItcValues(iInv['Taxable CGST'], iInv['ITC CGST']) &&\n validateItcValues(iInv['Taxable CESS'], iInv['ITC CESS'])\n );\n break;\n case 'hsnsum': // GSTR2\n var isHSNReq = true, isDescrReq = true;\n var isITAmt = true, isSTUTAmt = true, isCTAmt = true;\n if (iInv['Integrated Tax Amount']) {\n isSTUTAmt = false; isCTAmt = false;\n\n } else if (iInv['Central Tax Amount'] && iInv['State/UT Tax Amount']) {\n isITAmt = false;\n }\n\n if (!iInv['Central Tax Amount']) {\n iInv['Central Tax Amount'] = '';\n }\n if (!iInv['State/UT Tax Amount']) {\n iInv['State/UT Tax Amount'] = '';\n }\n if (!iInv['Integrated Tax Amount']) {\n iInv['Integrated Tax Amount'] = '';\n\n }\n if (!iInv['Cess Amount']) {\n iInv['Cess Amount'] = '';\n }\n if (iInv['HSN']) {\n isDescrReq = false;\n }\n else if (iInv['Description']) {\n isHSNReq = false;\n }\n\n if (!iInv['Description'])\n iInv['Description'] = '';\n\n\n // as per system, either HSN or DESCRIPTION is required\n // changes undo done by vasu\n\n if (iInv['UQC'])\n iInv['UQC'] = (iInv['UQC']).trim()\n\n isPttnMthced = (\n\n\n validatePattern(iInv['HSN'], isHSNReq, /^[0-9]{2,8}$/) &&\n validatePattern(iInv['Description'], isDescrReq, /^[ A-Za-z0-9_@./&-]{0,30}$/) &&\n validatePattern(iInv['UQC'], true, /^[a-zA-Z0-9 -]*$/) &&\n validatePattern(iInv['Total Quantity'], true, /^([-]?[0-9]{0,15}|[-]?[0-9]{0,15}\\.{1}[0-9]{0,2})$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Total Value'])), true, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Taxable Value'])), true, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Integrated Tax Amount'])), isITAmt, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Central Tax Amount'])), isCTAmt, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['State/UT Tax Amount'])), isSTUTAmt, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(Math.abs(cnvt2Nm(iInv['Cess Amount'])), false, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/)\n\n );\n break;\n\n\n case 'itc_rvsl': // GSTR2\n isPttnMthced = (\n validatePattern(cnvt2Nm(iInv['ITC Integrated Tax Amount']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['ITC Central Tax Amount']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['ITC State/UT Tax Amount']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(cnvt2Nm(iInv['ITC Cess Amount']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/)\n\n );\n break;\n case 'atadj': // GSTR2\n isPttnMthced = (\n validatePattern(iInv['Place Of Supply'], true, null, true) &&\n validatePattern(cnvt2Nm(iInv['Gross Advance Paid to be Adjusted']), true, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Rate'], true, /^(0|0.25|0.1|0.10|1|1.5|1.50|3|5|7.5|7.50|12|18|28)$/) &&\n validatePattern(cnvt2Nm(iInv['Cess Adjusted']), false, /^(\\d{0,13})(\\.\\d{0,2})?$/) &&\n validatePattern(iInv['Supply Type'], true, /^(Inter State|Intra State)$/)\n );\n break;\n\n case 'nil': // GSTR2\n isPttnMthced = (\n validatePattern(cnvt2Nm(iInv['Nil Rated Supplies']), false, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(cnvt2Nm(iInv['Exempted (other than nil rated/non GST supply )']), false, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(cnvt2Nm(iInv['Non-GST supplies']), false, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n validatePattern(cnvt2Nm(iInv['Composition taxable person']), false, /^(\\-?(\\d{0,13})(\\.\\d{0,2})?)$/) &&\n (\n iInv['Description'] == 'Inter-State supplies' ||\n iInv['Description'] == 'Intra-State supplies'\n )\n )\n break;\n\n }\n }\n return isPttnMthced;\n }", "function validate_Jobtype(){\n\tif(document.frmJobtype.ProfileJobtypeName.value == ''){\n\t\tdocument.getElementById('lblProfileJobtypeName').innerHTML = 'This field is required';\n\t\tdocument.frmJobtype.ProfileJobtypeName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileJobtypeName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmJobtype.ProfileJobtypeName.value)){\n\t\tdocument.getElementById('lblProfileJobtypeName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmJobtype.ProfileJobtypeName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblProfileJobtypeName').innerHTML = '';\n\t}\n}", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function validation(realName, formEltName, eltType, upToSnuff, format) {\n this.realName = realName;\n this.formEltName = formEltName;\n this.eltType = eltType;\n this.upToSnuff = upToSnuff;\n this.format = format;\n}", "function validateUserFields(){\n\t\n\tvar result = true;\n\tvar infoEmployee = true;\n\tvar infoAddress = true;\n\tvar infoContact = true;\n\tvar infoPeople = true;\n\tvar errorText = \"\";\n\thideAlertUserFields();\n\t\n//\talert($(\"#checkPeopleEmployee\").is(':checked'))\n\t\n\tif($(\"#checkPeopleEmployee\").is(':checked')){\n\t\t\n\t\tif($('#textCodeCollaborator').val().trim().length == 0 ){\n\t\t\t$('#alertCodeCollaborator').addClass('error');\n\t\t\t$('#textCodeCollaborator').focus();\n\t\t\terrorText = \"Código del colaborador<br>\" + errorText;\n\t\t\tinfoEmployee = false;\n\t\t}\n\t\t\n\t\tif($('#textInitials').val().trim().length == 0 ){\n\t\t\t$('#alertInitials').addClass('error');\n\t\t\t$('#textInitials').focus();\n\t\t\terrorText = \"Iniciales<br>\" + errorText;\n\t\t\tinfoEmployee = false;\n\t\t}\n\t\t\n\t\tif($('#textCodeNumber').val().trim().length == 0 ){\n\t\t\t$('#alertCodeNumber').addClass('error');\n\t\t\t$('#textCodeNumber').focus();\n\t\t\terrorText = \"Código numérico<br>\" + errorText;\n\t\t\tinfoEmployee = false;\n\t\t}\n\t\t\n\t\tif($('#textTypeSeller').val() == null || $('#textTypeSeller').val() == 0){\n\t\t\t$('#alertTypeSeller').addClass('error');\n\t\t\t$('#textTypeSeller').focus();\n\t\t\terrorText = \"Tipo de vendedor<br>\" + errorText;\n\t\t\tinfoEmployee = false;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif(infoEmployee == false){\n\t\t\t$('#alertValPeopleEmployee .alert-box').html(\"<label>Please complete fields in red</label>\" );\n\t\t\t$('#alertValPeopleEmployee').show(100);\n\t\t\tresult = false;\n\t\t}\n\t}\n\t\n\tvar regex = /[\\w-\\.]{2,}@([\\w-]{2,}\\.)*([\\w-]{2,}\\.)[\\w-]{2,4}/;\n\t//email 2\n\tif($('#textEmail2').val().trim().length > 0){\n\t\tif(!regex.test($('#textEmail2').val().trim())){\n\t\t\t$('#alertEmail2').addClass('error');\n\t\t\t$('#textEmail2').focus();\n\t\t\terrorText = \"El correo 2 debe ser valido<br>\" + errorText;\n\t\t\tinfoContact = false;\n\t\t}\n\t}\n\t\n\t\n\tif($('#textEmail1').val().trim().length > 0){\n\t\tif(!regex.test($('#textEmail1').val().trim())){\n\t\t\t$('#alertEmail1').addClass('error');\n\t\t\t$('#textEmail1').focus();\n\t\t\terrorText = \"EL correo debe ser valido</br>\" + errorText;\n\t\t\tinfoContact = false;\n\t\t}\n\t}\n\t\n\t//Telefono 3\n\tif($('#textPhone3').val().trim().length > 0 && $('#textPhone3').val().trim().length > 14 ){\n\t\t$('#alertPhone3').addClass('error');\n\t\t$('#textPhone3').focus();\n\t\terrorText = \"El telefono 3 debe tener maximo 11 caracteres<br>\" + errorText;\n\t\tinfoContact = false;\n\t}\n\t\n\t//Telefono 2\n\tif($('#textPhone2').val().trim().length > 0 && $('#textPhone2').val().trim().length > 14 ){\n\t\t$('#alertPhone2').addClass('error');\n\t\t$('#textPhone2').focus();\n\t\terrorText = \"El telefono 2 debe tener maximo 11 caracteres<br>\" + errorText;\n\t\tinfoContact = false;\n\t}\n\t\n\t//Telefono 2\n\tif($('#textPhone1').val().trim().length > 0 && $('#textPhone1').val().trim().length > 14 ){\n\t\t$('#alertPhone1').addClass('error');\n\t\t$('#textPhone1').focus();\n\t\terrorText = \"El telefono 1 debe tener maximo 11 caracteres<br>\" + errorText;\n\t\tinfoContact = false;\n\t}\n\t\n\tif(infoContact == false){\n\t\tresult = false;\n\t\t$('#alertValPeopleContact .alert-box').html(\"<label>Please complete fields in red</label>\" + errorText );\n\t\t$('#alertValPeopleContact').show(100);\n\t\t$('#containerContact').show();\n\t}\n\t\n\terrorText = \"\";\n\t\n\terrorText = \"\";\n\t\n\t//validate fecha\n\t\n\t//aniversario\n\tif($('#textWeddingAnniversary').val().trim().length > 0){\n\t\t\tif(!isDate($('#textWeddingAnniversary').val())){\n\t\t\t$('#alertWeddingAnniversary').addClass('error');\n\t\t\t//$('#textWeddingAnniversary').focus();\n\t\t\terrorText = \"Selecione una fecha de aniversario correcta>\" + errorText;\n\t\t\tinfoPeople = false;\n\t\t}\n\t}\n\t//alert(regex2.test($('#textBirthdate').val())\n\t//fecha\n\tif($('#textBirthdate').val().trim().length > 0){\n\t\tif(!isDate($('#textBirthdate').val())){\n\t\t\t$('#alertBirthdate').addClass('error');\n\t\t\t//$('#textBirthdate').focus();\n\t\t\terrorText = \"Selecione una fecha correctabr>\" + errorText;\n\t\t\tinfoPeople = false;\n\t\t}\n\t}\n\t\n\t//genero\n\tvar gender = 0;\n\t$(\".RadioGender\").each(function (index){\n\t\tif(!$(this).is(':checked')) {\n\t\t\tgender = gender + 1;\n } \n\t});\n\t\n\tif(gender != 1){\n\t\t$('#alertGender').addClass('error');\n\t\terrorText = \"Genero<br>\" + errorText;\n\t\tinfoPeople = false;\n\t}\n\t\n\t//apellido paterno\n\tif($('#textLastName').val().trim().length == 0){\n\t\t$('#alertLastName').addClass('error');\n\t\t$('#textLastName').focus();\n\t\terrorText = \"Apellido paterno<br>\" + errorText;\n\t\tinfoPeople = false;\n\t}\n\t//nombre\n\tif($('#textName').val().trim().length == 0){\n\t\t$('#alertName').addClass('error');\n\t\t$('#textName').focus();\n\t\terrorText = \"Nombre<br>\" + errorText;\n\t\tinfoPeople = false;\n\t}\n\t\n\tif(infoPeople == false){\n\t\t$('#alertValPeopleGeneral .alert-box').html(\"<label>Please complete fields in red</label>\" + errorText );\n\t\t$('#alertValPeopleGeneral').show(100);\n\t\tresult = false;\n\t}\n\t\n\treturn result;\n}", "function ValidateAndSaveRetentionCode(params, result) {\n var $form = $('#frmRetentionCodeDetails');\n\n if ($form.valid() && IsSaveOkay()) {\n //if (result != \"undefined\" && typeof result != 'undefined' && typeof result != undefined && result != null) {\n if (result != undefined || result != null) {\n var IsFieldsChanged = false;\n var currLstEventTypeList = ($('#lstEventTypeList').val() == \"\" || $('#lstEventTypeList').val() == null) ? \"N/A\" : $('#lstEventTypeList').val();\n var currLstEventTypeListOfficialRcd = ($('#lstEventTypeListOfficialRcd').val() == \"\" || $('#lstEventTypeListOfficialRcd').val() == null) ? \"N/A\" : $('#lstEventTypeListOfficialRcd').val();\n var currTxtRetentionPeriodUser = $('#txtRetentionPeriodUser').val();\n var currTxtInactivityPeriod = $('#txtInactivityPeriod').val();\n var currTxtLegalPeriod = $('#txtLegalPeriod').val();\n var currChkForceToEndOfYear = $('#chkForceToEndOfYear').is(':checked') == true ? \"true\" : \"false\";\n var currChkForceToEndOfYearRetPeriodOffitial = $('#chkForceToEndOfYearRetPeriodOffitial').is(':checked') == true ? \"true\" : \"false\";\n\n var msg = \"<p>\" + vrRetentionRes['msgJsRetention1OfFollowFieldsChanged'] + \"</br><ul><li>\" + vrRetentionRes['msgJsRetentionInActivityEventType'] + \"</li><li>\" + vrRetentionRes['msgJsRetentionRetEventType'] + \"</li><li>\" + vrRetentionRes['msgJsRetentionRetUserPeriod'] + \"</li><li>\" + vrRetentionRes['msgJsRetentionInActivityPeriod'] + \"</li><li>\" + vrRetentionRes['msgJsRetentionRetLegalPeriod'] + \"</li><li>\" + vrRetentionRes['msgJsRetentionInActivityForce2EndOfYear'] + \"</li><li>\" + vrRetentionRes['msgJsRetentionRetForce2EndOfYear'] + \"</li></ul></br></br>\" + vrRetentionRes['msgJsRetentionInOrdr2EnsureDataIntigrity'] + \"</br></br>\" + vrRetentionRes['msgJsRetentionWouldULike2ContiSavingRetCode'] + \"</p>\";\n\n if (currLstEventTypeList != result.InactivityEventType\n || currLstEventTypeListOfficialRcd != result.RetentionEventType\n || parseFloat(currTxtRetentionPeriodUser) != result.RetentionPeriodUser\n || parseFloat(currTxtInactivityPeriod) != result.InactivityPeriod\n || parseFloat(currTxtLegalPeriod) != result.RetentionPeriodLegal\n || currChkForceToEndOfYear != result.InactivityForceToEndOfYear.toString()\n || currChkForceToEndOfYearRetPeriodOffitial != result.RetentionPeriodForceToEndOfYear.toString()) {\n\n $(this).confirmModal({\n confirmTitle: 'TAB FusionRMS',\n confirmMessage: msg,\n confirmOk: vrCommonRes['Yes'],\n confirmCancel: vrCommonRes['No'],\n confirmStyle: 'default',\n confirmCallback: function () {\n SaveRetentionCode(params);\n },\n confirmCallbackCancel: function () {\n setTimeout(function () {\n $('body').addClass('modal-open');\n }, 400);\n }\n });\n }\n else {\n SaveRetentionCode(params);\n }\n }\n else {\n SaveRetentionCode(params);\n }\n }\n }", "function validate_techAdd(){\n\tvar emailExp = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\t\n\tif(document.frmTech.TechFirstName.value == ''){\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechFirstName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechFirstName.value)){\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechFirstName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechFirstName').innerHTML = '';\n\t}\n\t\n\tif(document.frmTech.TechLastName.value == ''){\n\t\tdocument.getElementById('lblTechLastName').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechLastName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechLastName').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechLastName.value)){\n\t\tdocument.getElementById('lblTechLastName').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechLastName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechLastName').innerHTML = '';\n\t}\t\t\t\n\tif(document.frmTech.TechEmailID.value == ''){\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechEmailID.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = '';\n\t}\n\tif(!document.frmTech.TechEmailID.value.match(emailExp)){\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = \"Required Valid Email ID.\";\n\t\tdocument.frmTech.TechEmailID.focus();\n\t\treturn false;\n\t}\n\telse{\n\t\tdocument.getElementById('lblTechEmailID').innerHTML = '';\n\t}\n\tif(document.frmTech.TechContactNo.value == ''){\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechContactNo.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechContactNo.value)){\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechContactNo.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechContactNo').innerHTML = '';\n\t}\t\n\t\n\tif(document.frmTech.TechAddress.value == ''){\n\t\tdocument.getElementById('lblTechAddress').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechAddress.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechAddress').innerHTML = '';\n\t}\n\tif(document.frmTech.TechCity.value == ''){\n\t\tdocument.getElementById('lblTechCity').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechCity').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechCity.value)){\n\t\tdocument.getElementById('lblTechCity').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechCity.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechCity').innerHTML = '';\n\t}\t\n\tif(document.frmTech.TechState.value == ''){\n\t\tdocument.getElementById('lblTechState').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechState').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechState.value)){\n\t\tdocument.getElementById('lblTechState').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechState.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechState').innerHTML = '';\n\t}\t\n\tif(document.frmTech.TechZipcode.value == ''){\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechZipcode.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = '';\n\t}\n\tif(regex.test(document.frmTech.TechZipcode.value)){\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = 'This field contains special chars';\n\t\tdocument.frmTech.TechZipcode.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechZipcode').innerHTML = '';\n\t}\n\tif(document.frmTech.TechPicture.value != ''){\n\t\tvar str=document.getElementById('TechPicture').value;\n\t\tvar bigstr=str.lastIndexOf(\".\");\n\t\tvar ext=str.substring(bigstr+1);\n\t\tif(ext == 'jpg' || ext == 'JPG' || ext == 'jpeg' || ext == 'JPEG' || ext == 'png' || ext == 'PNG' || ext == 'gif' || ext == 'GIF' ){\n\t\t\tdocument.getElementById('lblTechPicture').innerHTML = '';\n\t\t}else{\n\t\t\tdocument.getElementById('lblTechPicture').innerHTML = 'Please enter a valid image';\n\t\t\treturn false;\n\t\t}\n\t}\n\tif(document.frmTech.TechPayGrade.value == ''){\n\t\tdocument.getElementById('lblTechPayGrade').innerHTML = 'This field is required';\n\t\tdocument.frmTech.TechPayGrade.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechPayGrade').innerHTML = '';\n\t}\n\tvar chk=$('input:checkbox[name=TechPayble[]]:checked').length;\n\tif(chk == 0){\n\t\tdocument.getElementById('lblTechPayble').innerHTML = 'This field is required';\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblTechPayble').innerHTML = '';\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n}", "function validateField(type, name, linenum)\r\n{\r\n\r\n\t/* On validate field:\r\n\r\n - EXPLAIN THE PURPOSE OF THIS FUNCTION\r\n\r\n\r\n FIELDS USED:\r\n\r\n --Field Name--\t\t\t\t--ID--\r\n\r\n\r\n */\r\n\r\n\r\n\t// LOCAL VARIABLES\r\n\r\n\r\n\r\n\t// VALIDATE FIELD CODE BODY\r\n\r\n\r\n\treturn true;\r\n\r\n}", "function validation() {\t\t\t\t\t\r\n\t\t\t\t\tvar frmvalidator = new Validator(\"app2Form\");\r\n\t\t\t\t\tfrmvalidator.EnableOnPageErrorDisplay();\r\n\t\t\t\t\tfrmvalidator.EnableMsgsTogether();\r\n\r\n\t\t\t\t\tif (document.getElementById('reasonForVisit').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitPatientReason\",\"req\",\"Please enter your reason For Visit\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitPatientReason_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (document.getElementById('visitYes').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitNewpatient\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\tif (document.getElementById('visitNo').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"visitNewpatient\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitNewpatient_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visitPrDocYes').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"hasPhysian\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\tif (document.getElementById('visitPrDocNo').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"hasPhysian\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_hasPhysian_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('emailAddress').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitEmail\",\"req\", \"Email is required\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitEmail\",\"email\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitEmail_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientFirstName').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientFirstName\",\"req\",\"Please enter your First Name\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientFirstName_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientLastName').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientLastName\",\"req\",\"Please enter your Last Name\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientLastName_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('pdob').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"pdob\",\"\",\"DOB is required\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_pdob_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('phoneNumber').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"req\",\"Phone Number is required\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"numeric\",\"numbers only\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"minlen=10\",\"not enough numbers\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientPhoneNumber_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visitGender').value==\"0\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitGender\",\"dontselect=0\",\"Please select an option 'Male or Female'\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitGender_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientZipCode').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"numeric\",\"numbers only\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"minlen=5\",\"not a valid zipcode\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"req\",\"zip code is required\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientZipCode_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visit_terms_911').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"agreeTerms\",\"selmin=2\",\"please check all boxes to continue\");\r\n\t\t\t\t\t\tif (document.getElementById('visit_custom_terms').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"agreeTerms\",\"selmin=2\",\"please check all boxes to continue\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_agreeTerms_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n \r\n}", "function validate_fileto()\n{\n\t$(\"#fileto_msg\").hide();\n\t$(\"#maxemails_msg\").hide();\n\t// remove white spaces \n\tvar email = $(\"#fileto\").val();\n\temail = email.split(\" \").join(\"\");\n\t$(\"#fileto\").val(email);\n\temail = email.split(/,|;/);\n\tif(email.length>maxEmailRecipients)\n\t{\n\t\t$(\"#maxemails_msg\").show();\n\t\treturn false;\n\t}\n\tfor (var i = 0; i < email.length; i++) {\n\t\tif (!echeck(email[i], 1, 0)) {\n\t\t$(\"#fileto_msg\").show();\n\t\treturn false;\n\t}\n\t}\n\treturn true;\t\t\n}", "static partIssueCreateUpdateValidation(pageClientAPI) {\n\n var dict = libCom.getControlDictionaryFromPage(pageClientAPI);\n dict.InlineErrorsExist = false;\n\n libCom.setInlineControlErrorVisibility(dict.StorageLocationLstPkr, false);\n dict.QuantitySim.clearValidation();\n\n //First process the inline errors\n return libThis.validateQuantityGreaterThanZero(pageClientAPI, dict)\n .then(libThis.validateQuantityIsNumeric.bind(null, pageClientAPI, dict), libThis.validateQuantityIsNumeric.bind(null, pageClientAPI, dict))\n .then(libThis.validateStorageLocationNotBlank.bind(null, pageClientAPI, dict), libThis.validateStorageLocationNotBlank.bind(null, pageClientAPI, dict))\n .then(libThis.processInlineErrors.bind(null, pageClientAPI, dict), libThis.processInlineErrors.bind(null, pageClientAPI, dict))\n //If there are dialog based validation rules or warnings, add them to the chain here\n .then(function() {\n return true; \n }, function() {\n return false; \n }); //Pass back true or false to calling action\n }", "function invalid()\n\t{\n \t if(document.getElementById(\"project_title\").value == \"\")\n \t\t{\n\t \t\t\talert(\"Please Enter Project Title! \");\n\t\t\t\tdocument.getElementById(\"project_title\").focus()\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\tif(document.getElementById(\"short_desc\").value == \"\")\n \t\t{\n\t \t\talert(\"Please Enter Short Description! \");\n\t\t\tdocument.getElementById(\"short_desc\").focus()\n\t\t\treturn false;\n\t\t} \n\tif(document.getElementById(\"file\").value == \"\")\n \t\t{\n\t \t\talert(\"Please Enter Upload Image! \");\n\t\t\tdocument.getElementById(\"file\").focus()\n\t\t\treturn false;\n\t\t} \n\tif(document.getElementById(\"description\").value == \"\")\n \t\t{\n\t \t\talert(\"Please Enter Description! \");\n\t\t\tdocument.getElementById(\"description\").focus()\n\t\t\treturn false;\n\t\t} \t\n \t}", "function validateFileUpload(el, useWhiteList) {\n\tvar val = el.value;\n\tvar cbox = document.getElementById(el.name + \"_pdf\");\n\tif (cbox) {\n\t\tcbox.disabled = true;\n\t\tcbox.checked = false;\n\t}\n\tif (val.length > 0) {\n\t\tif (!isAllowedFileExtension(val, useWhiteList)) {\n\t\t\talert(\"The file you are trying to upload is not an allowed file type.\");\n\t\t\tel.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif (cbox) {\n\t\t\tcbox.disabled = !isAllowedFileExtensionPDF(val);\n\t\t\tif (cbox.disabled) cbox.checked = false;\n\t\t}\n\t}\n\treturn true;\n}", "function validateFunction(userName,contentName,lendDate,lendDueDate,todayDate)\r\n{\r\n\tvar successMessage = null;\r\n\tvar errormessage1 = \"Please enter the Details!\";\r\n\tvar errormessage2 = \"Content name, Lend date, Lend due date cannot be null!\";\r\n\tvar errormessage3 = \"User name, Lend date & Lend due date cannot be null!\";\r\n\tvar errormessage4 = \"User name, Content name, Lend due date cannot be null!\";\r\n\tvar errormessage5 = \"User name, Content name, Lend date cannot be null!\";\r\n\tvar errormessage6 = \"Lend date & Lend due date cannot be null!\";\r\n\tvar errormessage7 = \"User name & Content name cannot be null!\";\r\n\tvar errormessage8 = \"Please enter the User name!\";\r\n\tvar errormessage9 = \"Please enter the Content name!\";\r\n\tvar errormessage10 = \"Please enter the Lend date!\";\r\n\tvar errormessage11 = \"Please enter the Lend due date!\";\r\n\tvar errormessage12 = \"Lend due date should be greater than lend date!\";\r\n\tvar errormessage13 = \"Lend due date should be greater than today date!\";\r\n\tvar errormessage14 = \"Content Name and Lend due date cannot be null!\";\r\n\tvar errormessage15 = \"Lend Date should be greater than today date!\";\r\n\r\n\tif((userName != '') && (contentName != '') && (lendDate != '') && (lendDueDate != ''))\r\n\t{\r\n\t\tif(lendDate > lendDueDate)\r\n\t\t{\r\n\t\t\tsuccessMessage = errormessage12;\t\r\n\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsuccessMessage = '1';\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif(userName == '' && contentName == '' && lendDate == '' && lendDueDate == '')\r\n\t\t{\r\n\t\t\tsuccessMessage = errormessage1;\r\n\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\t\tif((lendDueDate == '') && (contentName == '') && (lendDate == ''))\r\n\t\t\t\t{\r\n\t\t\t\t\tsuccessMessage = errormessage2;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif((userName == '') && (lendDueDate == '') && (lendDate == ''))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsuccessMessage = errormessage3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((userName == '') && (contentName == '') && (lendDueDate == ''))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsuccessMessage = errormessage4;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif((userName == '') && (contentName == '') && (lendDate == ''))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tsuccessMessage = errormessage5;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif((lendDueDate == '') && (lendDate == ''))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tsuccessMessage = errormessage6;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif((userName == '') && (contentName == ''))\r\n\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tsuccessMessage = errormessage7;\r\n\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif(userName == '')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tsuccessMessage = errormessage8;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif(contentName == '' && lendDueDate == '')\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tsuccessMessage = errormessage14;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif(contentName == '')\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsuccessMessage = errormessage9;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(lendDate == '')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsuccessMessage = errormessage10;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(lendDueDate == '')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsuccessMessage = errormessage11;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(lendDate > lendDueDate)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsuccessMessage = errormessage12;\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}\r\n\r\n\treturn (successMessage);\r\n}", "function dummy_fun() {\n // mi serve soltanto come documentazione e per evitare errori nel javascript validator \n\n var in_body_id;\n in_body_id = \"filedescr1\";\n in_body_id = \"filedescr2\";\n in_body_id = \"filedescr3\";\n in_body_id = \"filedescr4\";\n in_body_id = \"filename1\";\n in_body_id = \"filename2\";\n in_body_id = \"filename3\";\n in_body_id = \"filename4\";\n in_body_id = \"head_preview\";\n in_body_id = \"id_conferma1\";\n in_body_id = \"id_inp_prova\";\n in_body_id = \"id_istruzioni\";\n in_body_id = \"id_poesia_NO\";\n in_body_id = \"id_poesia_SI\";\n in_body_id = \"id_ricarica1\";\n in_body_id = \"id_titolo\";\n in_body_id = \"id_txt_pagOrigP\";\n in_body_id = \"id_txt_pagTradP\";\n in_body_id = \"id_urlpagina\";\n in_body_id = \"m002_h001\";\n in_body_id = \"m011_scrivi_titolo\";\n in_body_id = \"m012_scrivi_http\";\n in_body_id = \"m021_sez1or\";\n in_body_id = \"m021_sez1tr\";\n in_body_id = \"m050_testo1\";\n in_body_id = \"m051_provatxt1\";\n in_body_id = \"menu_preview\";\n in_body_id = \"my_preview\";\n in_body_id = \"sez1_titolo2\";\n\n\n onclick_1ottiene_righe_Orig_Trad('id_txt_pagOrigP', 'id_txt_pagTradP', 'id_poesia_NO');\n onclick_3ricarica_last_input('id_txt_pagOrigP', 'id_txt_pagTradP');\n onclickdown1(123, '1');\n onclickview1(123, '2');\n\n} // fine dummy_fun", "function MemberoneValidate(){\n//------------------------------------------------------------------------------------------\n//-----------------------------for Salutation for Family Member One-----------\n\t if(document.frmMembRegi.selectSalute1.selectedIndex==0)\n\t {alert(\"Select a salutation in Family Member one\");\n\t document.frmMembRegi.selectSalute1.focus();\n\t return false;}\n//------------------------------------------------------------------------------------------\n//--------------------------------for First Name in Family Member One--------\n\n\tif(document.frmMembRegi.firstname1.value==\"\")\n\t{alert(\"Enter First Name of Family Member One\");\n\tdocument.frmMembRegi.firstname1.focus();\n\treturn false;}\n\tif(document.frmMembRegi.firstname1.value.length>80)\n\t{alert(\"Enter valid First Name of Family Member One\");\n\tdocument.frmMembRegi.firstname1.focus();\n\treturn false;}\n\tif(isnotName(document.frmMembRegi.firstname1.value))\n\t{alert(\"Enter a valid First Name in Family Member One\");\n\tdocument.frmMembRegi.firstname1.focus();\n\treturn false;}\n\tif((document.frmMembRegi.firstname1.value.indexOf(' ')!=-1)||(document.frmMembRegi.firstname1.value.indexOf(' ')!=-1))\n\t{alert(\"Enter a valid First Name in Family Member One\");\n\tdocument.frmMembRegi.firstname1.focus();\n\treturn false;}\n//-----------------------------------------------------------------------------------------------\n//---------------------------------for Middle Name in Family Member One-------------------------------------\n\tif(document.frmMembRegi.middlename1.value.length>80)\n\t{alert(\"Enter Middle Name of Family Member One\");\n\tdocument.frmMembRegi.middlename1.focus();\n\treturn false;}\n\tif(isnotName(document.frmMembRegi.middlename1.value))\n\t{alert(\"Enter a valid Middle Name in Family Member One\");\n\tdocument.frmMembRegi.middlename1.focus();\n\treturn false;}\n\tif((document.frmMembRegi.middlename1.value.indexOf(' ')!=-1)||(document.frmMembRegi.middlename1.value.indexOf(' ')!=-1))\n\t{alert(\"Enter a valid Middle Name in Family Member One\");\n\tdocument.frmMembRegi.middlename1.focus();\n\treturn false;}\n//-----------------------------------------------------------------------------------------------\n//---------------------------------for Last Name in Family Member One------------------------\n\tif(document.frmMembRegi.lastname1.value==\"\")\n\t{alert(\"Enter Last Name of Family Member One\");\n\n\tdocument.frmMembRegi.lastname1.focus();\n\treturn false;}\n\tif(document.frmMembRegi.lastname1.value.length>80)\n\t{alert(\"Enter valid Last Name of Family Member One\");\n\tdocument.frmMembRegi.lastname1.focus();\n\treturn false;}\n\tif(isnotName(document.frmMembRegi.lastname1.value))\n\t{alert(\"Enter a valid Last Name in Family Member One\");\n\tdocument.frmMembRegi.lastname1.focus();\n\treturn false;}\n\tif((document.frmMembRegi.lastname1.value.indexOf(' ')!=-1)||(document.frmMembRegi.lastname1.value.indexOf(' ')!=-1))\n\t{alert(\"Enter a valid Last Name in Family Member One\");\n\tdocument.frmMembRegi.lastname1.focus();\n\treturn false;}\n//-----------------------------------------------------------------------------------------------\n//---------------------------------for Suffix in Family Member One-----------------------\n\t if(document.frmMembRegi.suffix1.value.length>80)\n\t{alert(\"Enter valid Suffix of Family Member One\");\n\tdocument.frmMembRegi.suffix1.focus();\n\treturn false;}\n//--------------------------------------------------------------------------------------------\n//---------------------------for Date Of Birth - Month field in Famliy Member One-----------\n\tif(document.frmMembRegi.selectMonth1.selectedIndex==0)\n\t {alert(\"Select a Month in Date Of Birth in Family Member One.\");\n\t document.frmMembRegi.selectMonth1.focus();\n\t return false;}\n//--------------------------------------------------------------------------------------------\n//---------------------------for Date Of Birth - Day field in Famliy Member One-----------\n\tif(document.frmMembRegi.selectDay1.selectedIndex==0)\n\t {alert(\"Select a Month in Date Of Birth in Family Member One.\");\n\n\t document.frmMembRegi.selectDay1.focus();\n\t return false;}\n//--------------------------------------------------------------------------------------------\n//---------------------------for Date Of Birth - Year field in Famliy Member One-----------\n\tif(document.frmMembRegi.selectYear1.selectedIndex==0)\n\t {alert(\"Select a Month in Date Of Birth in Family Member One.\");\n\t document.frmMembRegi.selectYear1.focus();\n\t return false;}\n//-----------------------------------------------------------------------------------------\n//------------------------for Gender in Family Member One--------------------------\n\tchosen1=\"\";\n\tlen1 = document.frmMembRegi.gender1.length ;\n\tfor(i1=0;i1<len1;i1++){\n\t\tif(document.frmMembRegi.gender1[i1].checked)\n\t\t{\tchosen1= document.frmMembRegi.gender1[i1].value;\t}\t}\n\n\tif(chosen1==\"\")\n\t{\talert(\"Check any of Gender Option in Family Member One.\");\n\t\treturn false; }\n//---------------------------------------------------------------------------------------\n//-------------------------------------------------------------------------------------------------------\n//----------------------IF ENTER EITHER PHONE \n\nif(document.frmMembRegi.phone1.value==\"\" && document.frmMembRegi.mobile1.value==\"\" )\n{ alert(\"Enter a Contact Number in Family Member One\");\n document.frmMembRegi.phone1.focus();\n return false;}\n//------------------------------------------------------------------------------------\n//--------------------------------PHONE NUMBER in Family Member One --------------\n\n\nif(document.frmMembRegi.phone2.value!=\"\")\n{\t\tvar s1=document.frmMembRegi.phone1.value.indexOf('(');\n\t\tvar s2=document.frmMembRegi.phone1.value.indexOf(')');\n\t\tvar s5=document.frmMembRegi.phone1.value.indexOf('+');\n\t\tvar s6=document.frmMembRegi.phone1.value.lastIndexOf('+');\n\t\tvar s7=document.frmMembRegi.phone1.value.indexOf('-');\n\t\tvar s8=document.frmMembRegi.phone1.value.lastIndexOf('-');\n\t\tvar s3=1+s2;\n\t\tvar s4=1+s1;\n\t\tif(s1==s3){\n\t\t\talert(\"Enter valid Phone Number in Family Member One\");\n\t\t\tdocument.frmMembRegi.phone1.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif(s2==s4){\n\t\t\talert(\"Enter valid Phone Number in Family Member One\");\n\t\t\tdocument.frmMembRegi.phone1.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif(s5!=s6){\n\t\t\talert(\"Enter valid Phone Number in Family Member One\");\n\t\t\tdocument.frmMembRegi.phone1.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif(s7!=s8){\n\t\t\talert(\"Enter valid Phone Number in Family Member One\");\n\t\t\tdocument.frmMembRegi.phone1.focus();\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n len7=document.frmMembRegi.phone1.value.length;\n strnum = document.frmMembRegi.phone1.value;\n var GoodChars = \"0123456789()-+ \";\n valid = 1;\n for(j=0;j<len7;j++)\n{ if(GoodChars.indexOf(strnum.charAt(j))==-1)\n { valid=0;} }\nif(valid!=1)\n{alert(\"Enter valid Phone Number in Family Member One\");\n document.frmMembRegi.phone1.focus();\n return false;}\n if(document.frmMembRegi.phone1.value.length>40)\n {alert(\"Enter valid Phone Number in Family Member One\");\n document.frmMembRegi.phone1.focus();\n return false;}\n \n}\n//------------------------------------------------------------------------------------\n//-----------------------------for Mobile in Family Member One----------------\nif(isnotInteger(document.frmMembRegi.mobile1.value))\n{alert(\"Enter a valid Mobile Number in Family Member One.\");\ndocument.frmMembRegi.mobile1.focus();\nreturn false;}\n\n//------------------------------------------------------------------------------------\n//-----------------------------------------FAX--------------------------------\n \n\t\t/*if(document.frmMembRegi.fax1.value==\"\")\n\t\t{\talert(\"Enter fax in Family Member One\");\n\t\t\tdocument.frmMembRegi.fax1.focus();\n\t\t\treturn false;\n\t\t}*/\n\n\tvar s1=document.frmMembRegi.fax1.value.indexOf('(');\n\t\tvar s2=document.frmMembRegi.fax1.value.indexOf(')');\n\t\tvar s5=document.frmMembRegi.fax1.value.indexOf('+');\n\t\tvar s6=document.frmMembRegi.fax1.value.lastIndexOf('+');\n\t\tvar s7=document.frmMembRegi.fax1.value.indexOf('-');\n\t\tvar s8=document.frmMembRegi.fax1.value.lastIndexOf('-');\n\n\t\tvar s3=1+s2;\n\t\tvar s4=1+s1;\n\t\tif(s1==s3){\n\t\t\talert(\"Enter valid fax in Family Member One\");\n\t\t\tdocument.frmMembRegi.fax1.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif(s2==s4){\n\t\t\talert(\"Enter valid fax in Family Member One\");\n\t\t\tdocument.frmMembRegi.fax1.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif(s5!==s6){\n\t\t\talert(\"Enter valid fax in Family Member One\");\n\t\t\tdocument.frmMembRegi.fax1.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif(s7!==s8){\n\t\t\talert(\"Enter valid fax in Family Member One\");\n\t\t\tdocument.frmMembRegi.fax1.focus();\n\t\t\treturn false;\n\t\t}\n\n len7=document.frmMembRegi.fax1.value.length;\n strnum = document.frmMembRegi.fax1.value;\n var GoodChars = \"0123456789()-+ \";\n valid = 1;\n for(j=0;j<len7;j++)\n{ if(GoodChars.indexOf(strnum.charAt(j))==-1)\n { valid=0;} }\nif(valid!=1)\n{alert(\"Enter valid fax in Family Member One\");\n document.frmMembRegi.fax1.focus();\n return false;}\n \n if(document.frmMembRegi.fax1.value.length>40)\n {alert(\"Enter valid Fax in Family Member One\");\n document.frmMembRegi.fax1.focus();\n return false;}\n//------------------------------------------------------------------------------------\n//-----------------------for Email in Family Member One-------------------------\n\tif(document.frmMembRegi.email1.value==\"\")\n\t{alert(\"Enter Email in Family Member One\");\n\t document.frmMembRegi.email1.focus();\n\t return false;}\n\tif(isnotVlaidEmail(document.frmMembRegi.email1.value))\n\t{alert(\"Enter a valid Email in Family Member One\");\n\t document.frmMembRegi.email1.focus();\n\t return false;}\n\t \nreturn true;\n}", "function validateFileExtention(){\n\tvar ext=\"\";\n\tvar kilobyte=1024;\n\tvar len=$('input[type=file]').val().length;\n\tvar count=0;\n\t $('input[type=file]').each(function () {\n\t var fileName = $(this).val().toLowerCase(),\n\t regex = new RegExp(\"(.*?)\\.(pdf|jpeg|png|jpg|gif)$\");\n\t\t\t if(fileName.length!=0){\n\t \tif((this.files[0].size/kilobyte)<=kilobyte){\n\t\t\t\t}else{\n\t\t\t\t\tif(fileName.lastIndexOf(\".\") != -1 && fileName.lastIndexOf(\".\") != 0)\n\t\t\t\t ext= fileName.substring(fileName.lastIndexOf(\".\")+1); \n\t\t\t\t\talert(\"Please Upload Below 1 MB \"+ext+\" File\");\n\t\t\t\t\tcount++;\n\t\t\t\t\t//alert('Maximum file size exceed, This file size is: ' + this.files[0].size + \"KB\");\n\t\t\t\t\t$(this).val('');\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t if (!(regex.test(fileName))) {\n\t\t $(this).val('');\n\t\t alert('Please select correct file format');\n\t\t count++;\n\t\t return false; \t\n\t\t }\n\t }\n\t });\n\t if(count!=0){\n\t\t return false; \n\t }else{\n\t\t return true;\n\t }\n}", "function validateProfessionalInfo() {\n if (!volunteerRegObject.companyName) {\n return false;\n }\n if (!volunteerRegObject.role) {\n return false;\n }\n return true;\n}", "function runValidation() {\n nameVal();\n phoneVal();\n mailVal();\n}", "function valSearchBannerGirviByAmountInputs(obj) {\r\n\r\n var gPrinAmtOrSerialNo = document.search_girvi_by_prinAmt.searchGirviPrinAmt.value;\r\n var checkSerialNo = gPrinAmtOrSerialNo.substr(0, 1);\r\n if (document.search_girvi_by_prinAmt.searchGirviPrinAmt.value == \"Principal Amount / Serial No. (s1234)\") {\r\n alert(\"Please Enter Girvi Principal Amount Or Girvi Serial Number!\");\r\n document.search_girvi_by_prinAmt.searchGirviPrinAmt.focus();\r\n return false;\r\n } else if (checkSerialNo == 's' || checkSerialNo == 'S') {\r\n var serialNo = gPrinAmtOrSerialNo.slice(1);\r\n if (validateEmptyField(serialNo, \"Please Enter Girvi Serial Number!\") == false ||\r\n validateAlphaNum(serialNo, \"Accept only Numbers without space character!\") == false) {\r\n document.search_girvi_by_prinAmt.searchGirviPrinAmt.focus();\r\n return false;\r\n }\r\n } else if (validateEmptyField(document.search_girvi_by_prinAmt.searchGirviPrinAmt.value, \"Please enter girvi principal amount!\") == false ||\r\n validateNum(document.search_girvi_by_prinAmt.searchGirviPrinAmt.value, \"Accept only Numbers without space character!\") == false) {\r\n document.search_girvi_by_prinAmt.searchGirviPrinAmt.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function validateExploria()\n{\n\t\tvar propertyName = 'Exploria'; \n\t\tvar streetName = 'Exploria Road'; \n\t\tproperty(propertyName, streetName); \n\t\tevent.preventDefault();\n\n}", "function main()\r{\r\tif(isNeedToValidateReqDocument(capIDModel,processCode, stepNum, processID, taskStatus))\r\t{\t\r\t\tisRequiredDocument();\r\t}\r}", "function validateInvoice(iForm, iSecID, iExInv, existingInv, iYearsList, transLan) {\n var isFieldsMatch = false;\n if (iExInv['Place Of Supply']) {\n iExInv['Place Of Supply'] = (iExInv['Place Of Supply']).substring(0, 2);\n }\n if (iExInv['Recipient State Code']) {\n iExInv['Recipient State Code'] = (iExInv['Recipient State Code'] < 10) ? \"0\" + iExInv['Recipient State Code'] : \"\" + iExInv['Recipient State Code'];\n }\n if (iExInv['Original State Code']) {\n iExInv['Original State Code'] = (iExInv['Original State Code'] < 10) ? \"0\" + iExInv['Original State Code'] : \"\" + iExInv['Original State Code'];\n }\n\n if (iForm === \"GSTR1\") {\n switch (iSecID) {\n case 'b2b':\n isFieldsMatch = (\n iExInv['GSTIN/UIN of Recipient'] == existingInv['ctin'] &&\n iExInv['Receiver Name'] == existingInv['cname'] &&\n (iExInv['Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Invoice date'] == existingInv['idt'] &&\n iExInv['Invoice Value'] == existingInv['val'] &&\n iExInv['Place Of Supply'] == existingInv['pos'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent'] &&\n iExInv['Reverse Charge'] == existingInv['rchrg'] &&\n iExInv['E-Commerce GSTIN'] == existingInv['etin']\n\n );\n break;\n case 'b2ba':\n isFieldsMatch = (\n iExInv['GSTIN/UIN of Recipient'] == existingInv['ctin'] &&\n iExInv['Receiver Name'] == existingInv['cname'] &&\n (iExInv['Original Invoice Number']).toLowerCase() == (existingInv['oinum']).toLowerCase() &&\n iExInv['Original Invoice date'] == existingInv['oidt'] &&\n (iExInv['Revised Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Revised Invoice date'] == existingInv['idt'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent'] &&\n iExInv['Invoice Value'] == existingInv['val'] &&\n iExInv['Place Of Supply'] == existingInv['pos'] &&\n iExInv['Reverse Charge'] == existingInv['rchrg']);\n\n break;\n case 'b2cl':\n isFieldsMatch = (\n (iExInv['Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Invoice date'] == existingInv['idt'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent'] &&\n iExInv['Invoice Value'] == existingInv['val'] &&\n iExInv['Place Of Supply'] == existingInv['pos']);\n break;\n case 'b2cla':\n isFieldsMatch = (\n (iExInv['Original Invoice Number']).toLowerCase() == (existingInv['oinum']).toLowerCase() &&\n iExInv['Original Invoice date'] == existingInv['oidt'] &&\n (iExInv['Revised Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Revised Invoice date'] == existingInv['idt'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent'] &&\n iExInv['Invoice Value'] == existingInv['val'] &&\n iExInv['Original Place Of Supply'].slice(0, 2) == existingInv['pos']\n );\n break;\n case 'at':\n isFieldsMatch = (\n iExInv['Place Of Supply'].slice(0, 2) == existingInv['pos'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent']);\n\n break;\n case 'ata':\n var year = iExInv['Financial Year'],\n month = iExInv['Original Month'],\n curntOMon = isValidRtnPeriod(iYearsList, year, month).monthValue;\n isFieldsMatch = (\n iExInv['Original Place Of Supply'].slice(0, 2) == existingInv['pos'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent'] &&\n curntOMon == existingInv['omon']);\n break;\n case 'exp':\n isFieldsMatch = (\n iExInv['Export Type'] == existingInv['exp_typ'] &&\n parseInt(iExInv['Shipping Bill Number']) == existingInv['sbnum'] &&\n iExInv['Port Code'] == existingInv['sbpcode'] &&\n iExInv['Shipping Bill Date'] == existingInv['sbdt'] &&\n (iExInv['Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Invoice date'] == existingInv['idt'] &&\n iExInv['Invoice Value'] == existingInv['val']);\n break;\n case 'expa':\n isFieldsMatch = (\n iExInv['Export Type'] == existingInv['exp_typ'] &&\n iExInv['Shipping Bill Number'] == existingInv['sbnum'] &&\n iExInv['Port Code'] == existingInv['sbpcode'] &&\n iExInv['Shipping Bill Date'] == existingInv['sbdt'] &&\n (iExInv['Original Invoice Number']).toLowerCase() == (existingInv['oinum']).toLowerCase() &&\n iExInv['Original Invoice date'] == existingInv['oidt'] &&\n (iExInv['Revised Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Revised Invoice date'] == existingInv['idt'] &&\n iExInv['Invoice Value'] == existingInv['val']);\n break;\n case 'cdnr':\n isFieldsMatch = (\n iExInv[transLan.LBL_GSTIN_UIN_RECIPIENT] == existingInv['ctin'] &&\n iExInv[transLan.LBL_RECEIVER_NAME] == existingInv['cname'] &&\n iExInv[transLan.LBL_DEBIT_CREDIT_NOTE_NO] == existingInv['nt_num'] &&\n iExInv[transLan.LBL_DEBIT_CREDIT_NOTE_DATE] == existingInv['nt_dt'] &&\n iExInv[transLan.LBL_NOTE_TYP] == existingInv['ntty'] &&\n iExInv[transLan.LBL_Diff_Percentage] / 100 == existingInv['diff_percent'] &&\n iExInv[transLan.LBL_POS_Excel] == existingInv['pos'] &&\n iExInv[transLan.LBL_RECHRG] == existingInv['rchrg'] &&\n iExInv[transLan.LBL_NOTE_VAL_Excel] == existingInv['val']);\n break;\n case 'cdnur':\n isFieldsMatch = (\n iExInv[transLan.LBL_DEBIT_CREDIT_NOTE_NO] == existingInv['nt_num'] &&\n iExInv[transLan.LBL_DEBIT_CREDIT_NOTE_DATE] == existingInv['nt_dt'] &&\n iExInv[transLan.LBL_NOTE_TYP] == existingInv['ntty'] &&\n iExInv[transLan.LBL_Diff_Percentage] / 100 == existingInv['diff_percent'] &&\n iExInv[transLan.LBL_POS_Excel] == existingInv['pos'] &&\n iExInv[transLan.LBL_UR_TYPE] == existingInv['typ'] &&\n iExInv[transLan.LBL_NOTE_VAL_Excel] == existingInv['val']);\n\n break;\n case 'cdnra':\n isFieldsMatch = (\n iExInv[transLan.LBL_GSTIN_UIN_RECIPIENT] == existingInv['ctin'] &&\n iExInv[transLan.LBL_RECEIVER_NAME] == existingInv['cname'] &&\n iExInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_NO] == existingInv['ont_num'] &&\n iExInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_DATE] == existingInv['ont_dt'] &&\n iExInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_NO] == existingInv['nt_num'] &&\n iExInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_DATE] == existingInv['nt_dt'] &&\n iExInv[transLan.LBL_NOTE_TYP] == existingInv['ntty'] &&\n iExInv[transLan.LBL_Diff_Percentage] / 100 == existingInv['diff_percent'] &&\n iExInv[transLan.LBL_POS_Excel] == existingInv['pos'] &&\n iExInv[transLan.LBL_RECHRG] == existingInv['rchrg'] &&\n iExInv[transLan.LBL_NOTE_VAL_Excel] == existingInv['val']);\n\n break;\n case 'cdnura':\n isFieldsMatch = (\n iExInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_NO] == existingInv['ont_num'] &&\n iExInv[transLan.LBL_ORIGINAL_DEBIT_CREDIT_NOTE_DATE] == existingInv['ont_dt'] &&\n iExInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_NO] == existingInv['nt_num'] &&\n iExInv[transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_DATE] == existingInv['nt_dt'] &&\n iExInv[transLan.LBL_NOTE_TYP] == existingInv['ntty'] &&\n iExInv[transLan.LBL_Diff_Percentage] / 100 == existingInv['diff_percent'] &&\n iExInv[transLan.LBL_POS_Excel] == existingInv['pos'] &&\n iExInv[transLan.LBL_UR_TYPE] == existingInv['typ'] &&\n iExInv[transLan.LBL_NOTE_VAL_Excel] == existingInv['val']);\n\n break;\n case 'b2cs':\n isFieldsMatch = (\n iExInv['Place Of Supply'] == existingInv['pos'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent'] &&\n iExInv['Type'] == existingInv['typ']);\n\n break;\n case 'b2csa':\n if (!iExInv['E-Commerce GSTIN'])\n iExInv['E-Commerce GSTIN'] = \"\";\n var year = iExInv['Financial Year'],\n month = iExInv['Original Month'],\n curntOMon = isValidRtnPeriod(iYearsList, year, month).monthValue;\n isFieldsMatch = (\n iExInv['Place Of Supply'].slice(0, 2) == existingInv['pos'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent'] &&\n iExInv['E-Commerce GSTIN'] == existingInv['etin'] &&\n curntOMon == existingInv['omon'] &&\n iExInv['Type'] == existingInv['typ']);\n break;\n case 'atadj':\n isFieldsMatch = (\n iExInv['Place Of Supply'].slice(0, 2) == existingInv['pos'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent']);\n break;\n case 'atadja':\n var year = iExInv['Financial Year'],\n month = iExInv['Original Month'],\n curntOMon = isValidRtnPeriod(iYearsList, year, month).monthValue;\n isFieldsMatch = (\n iExInv['Original Place Of Supply'].slice(0, 2) == existingInv['pos'] &&\n iExInv['Applicable % of Tax Rate'] / 100 == existingInv['diff_percent'] &&\n curntOMon == existingInv['omon']);\n break;\n case 'hsn':\n isFieldsMatch = (\n iExInv['HSN'] == existingInv['hsn_sc'] &&\n iExInv['Description'] == existingInv['desc']\n );\n break;\n case 'nil':\n isFieldsMatch = (\n iExInv['Description'] == existingInv['sply_ty'] &&\n iExInv['Nil Rated Supplies'] == existingInv['nil_amt'] &&\n iExInv['Exempted(other than Nil rated/non-GST supply)'] == existingInv['expt_amt'] &&\n iExInv['Non-GST Supplies'] == existingInv['ngsup_amt']\n );\n break;\n case 'doc_issue':\n isFieldsMatch = (\n iExInv['Nature of Document'] == existingInv['doc_typ']\n );\n break;\n }\n } else if (iForm === \"GSTR2\") {\n switch (iSecID) {\n case 'b2b': // GSTR2\n isFieldsMatch = (iExInv['GSTIN of Supplier'] == existingInv['ctin'] &&\n iExInv['Supplier Name'] == existingInv['cname'] &&\n (iExInv['Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Invoice date'] == existingInv['idt'] &&\n iExInv['Invoice Value'] == existingInv['val'] &&\n iExInv['Place Of Supply'] == existingInv['pos'] &&\n iExInv['Reverse Charge'] == existingInv['rchrg']);\n\n break;\n case 'b2bur': // GSTR2\n isFieldsMatch = (\n (iExInv['Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Invoice date'] == existingInv['idt'] &&\n iExInv['Invoice Value'] == existingInv['val'] &&\n iExInv['Place Of Supply'] == existingInv['pos']\n );\n\n break;\n case 'b2ba': // GSTR2\n isFieldsMatch = (iExInv['Supplier GSTIN'] == existingInv['ctin'] &&\n iExInv['Original Invoice Number'] == existingInv['oinum'] &&\n iExInv['Original Invoice date'] == existingInv['oidt'] &&\n (iExInv['Revised Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Revised Invoice date'] == existingInv['idt'] &&\n iExInv['Total Invoice Value'] == existingInv['val'] &&\n iExInv['Place Of Supply'] == existingInv['pos'] &&\n iExInv['Reverse Charge'] == existingInv['rchrg']);\n\n break;\n case 'b2bura': // GSTR2\n isFieldsMatch = (iExInv['Supplier Name'] == existingInv['cname'] &&\n iExInv['Original Invoice Number'] == existingInv['oinum'] &&\n iExInv['Original Invoice date'] == existingInv['oidt'] &&\n (iExInv['Revised Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Revised Invoice date'] == existingInv['idt'] &&\n iExInv['Total Invoice Value'] == existingInv['val'] &&\n iExInv['Place Of Supply'] == existingInv['pos'] &&\n iExInv['Reverse Charge'] == existingInv['rchrg']);\n break;\n case 'cdnr': // GSTR2\n isFieldsMatch = (iExInv['GSTIN of Supplier'] == existingInv['ctin'] &&\n iExInv['Note/Refund Voucher Number'] == existingInv['nt_num'] &&\n iExInv['Note/Refund Voucher date'] == existingInv['nt_dt'] &&\n iExInv['Document Type'] == existingInv['ntty'] &&\n iExInv['Reason For Issuing document'] == existingInv['rsn'] &&\n (iExInv['Invoice/Advance Payment Voucher Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Invoice/Advance Payment Voucher date'] == existingInv['idt'] &&\n iExInv['Pre GST'] == existingInv['p_gst'] &&\n iExInv['Supply Type'] == existingInv['sp_typ'] &&\n iExInv['Note/Refund Voucher Value'] == existingInv['val']\n );\n break;\n case 'cdnur': // GSTR2\n isFieldsMatch = (\n iExInv['Note/Voucher Number'] == existingInv['nt_num'] &&\n iExInv['Note/Voucher date'] == existingInv['nt_dt'] &&\n iExInv['Document Type'] == existingInv['ntty'] &&\n iExInv['Reason For Issuing document'] == existingInv['rsn'] &&\n (iExInv['Invoice/Advance Payment Voucher number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Invoice/Advance Payment Voucher date'] == existingInv['idt'] &&\n iExInv['Pre GST'] == existingInv['p_gst'] &&\n iExInv['Supply Type'] == existingInv['sp_typ'] &&\n iExInv['Invoice Type'] == existingInv['inv_typ'] &&\n iExInv['Note/Voucher Value'] == existingInv['val']);\n break;\n case 'cdnra': // GSTR2\n isFieldsMatch = (iExInv['Supplier GSTIN'] == existingInv['ctin'] &&\n iExInv['Original Debit Note Number'] == existingInv['ont_num'] &&\n iExInv['Original Debit Note date'] == existingInv['ont_dt'] &&\n iExInv['Revised Debit Note Number'] == existingInv['nt_num'] &&\n iExInv['Revised Debit Note date'] == existingInv['nt_dt'] &&\n iExInv['Note Type'] == existingInv['ntty'] &&\n iExInv['Reason For Issuing Note'] == existingInv['rsn'] &&\n (iExInv['Invoice Number']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n iExInv['Invoice date'] == existingInv['idt'] &&\n iExInv['Total Invoice Value'] == existingInv['val']);\n\n break;\n case 'imp_g': // GSTR2\n isFieldsMatch = (iExInv['Bill Of Entry Number'] == existingInv['boe_num'] &&\n iExInv['Bill Of Entry Date'] == existingInv['boe_dt'] &&\n iExInv['Port Code'] == existingInv['port_code'] &&\n iExInv['Bill Of Entry Value'] == existingInv['boe_val']);\n break;\n case 'imp_ga': // GSTR2\n isFieldsMatch = (iExInv['Original Bill Of Entry Number'] == existingInv['oboe_num'] &&\n iExInv['Original Bill Of Entry date'] == existingInv['oboe_dt'] &&\n iExInv['Revised Bill Of Entry Number'] == existingInv['boe_num'] &&\n iExInv['Revised Bill Of Entry date'] == existingInv['boe_dt'] &&\n iExInv['Port Code'] == existingInv['port_code'] &&\n iExInv['Total Invoice Value'] == existingInv['boe_val']);\n break;\n case 'imp_s': // GSTR2\n var dateStr = \"\";\n if (iExInv.hasOwnProperty('Invoice date'))\n dateStr = iExInv['Invoice date'];\n else\n dateStr = iExInv['Invoice Date'];\n isFieldsMatch = (\n (iExInv['Invoice Number of Reg Recipient']).toLowerCase() == (existingInv['inum']).toLowerCase() &&\n dateStr == existingInv['idt'] &&\n iExInv['Place Of Supply'] == existingInv['pos'] &&\n iExInv['Invoice Value'] == existingInv['ival']);\n break;\n case 'imp_sa': // GSTR2\n isFieldsMatch = (\n (iExInv['Original Invoice Number']).toLowerCase() == (existingInv['oi_num']).toLowerCase() &&\n iExInv['Original Invoice date'] == existingInv['oi_dt'] &&\n (iExInv['Revised Invoice Number']).toLowerCase() == (existingInv['i_num']).toLowerCase() &&\n iExInv['Revised Invoice date'] == existingInv['i_dt'] &&\n iExInv['Total Invoice Value'] == existingInv['i_val']);\n break;\n case 'txi': // GSTR2\n isFieldsMatch = (iExInv['Place Of Supply'].slice(0, 2) == existingInv['pos'] &&\n iExInv['Supply Type'] == existingInv['sply_ty']);\n\n break;\n case 'atxi': // GSTR2\n isFieldsMatch = (iExInv['Recipient State Code'] == existingInv['state_cd'] &&\n iExInv['Revised Supplier GSTIN'] == existingInv['cpty'] &&\n iExInv['Original Supplier GSTIN'] == existingInv['ocpty'] &&\n iExInv['Original Document Number'] == existingInv['odnum'] &&\n iExInv['Type'] == existingInv['reg_type'] &&\n iExInv['Original Document date'] == existingInv['otdt'] &&\n iExInv['Revised Document Number'] == existingInv['dnum'] &&\n iExInv['Revised Document date'] == existingInv['dt']);\n break;\n case 'hsn': // GSTR2\n isFieldsMatch = (\n iExInv['HSN'] == existingInv['hsn_sc'] &&\n iExInv['Description'] == existingInv['desc']\n );\n break;\n case 'itc_rvsl': // GSTR2\n isFieldsMatch = true;\n break;\n case 'atadj': // GSTR2\n isFieldsMatch = (iExInv['Place Of Supply'].slice(0, 2) == existingInv['pos'] &&\n iExInv['Supply Type'] == existingInv['sply_ty']);\n break;\n case 'nil': // GSTR2\n isFieldsMatch = (\n iExInv['Description'] == existingInv['sply_ty'] &&\n iExInv['Nil Rated Supplies'] == existingInv['nil_amt'] &&\n iExInv['Exempted (other than nil rated/non GST supply )'] == existingInv['expt_amt'] &&\n iExInv['Non-GST supplies'] == existingInv['ngsup_amt']\n );\n break;\n }\n }\n\n return (isFieldsMatch);\n }", "function reservationsAllocationValidate(allocationForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\n\nif (allocationForm.reservationid.selectedIndex==0)\n{\nerrorMessage+=\"Bạn chưa chọn mã đặt chỗ!\\n\";\nvalidationVerified=false;\n}\nif(allocationForm.staffid.selectedIndex==0)\n{\nerrorMessage+=\"Bạn chưa chọn mã nhân viên!\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nreturn validationVerified;\n}", "function validation(ev) {\n ev.preventDefault();\n\n if (\n inputName.value.length > 1 &&\n inputJob.value.length > 1 &&\n inputEmail.value.length > 1 &&\n inputPhone.value.length > 1 &&\n inputLinkedin.value.length > 1 &&\n inputGithub.value.length > 1\n ) {\n textShare.classList.remove('hidden');\n formButton.classList.add('disabled');\n formButton.classList.remove('share__content__button');\n // imgButton.classList.add('img-disabled');\n // imgButton.classList.remove('action__upload-btn');\n } else {\n alert('No has introducido ningún dato');\n }\n\n sendRequest(formData);\n}", "function formValidation() {\n\n \n // var email = document.forms[\"regform\"][\"email\"].value;\n\n if (!formFilled()){\n var formValid = false;\n return formValid;\n } else if (!provIsSelected()) {\n var formValid = false;\n return formValid;\n \n } else if (!validatePO()) {\n var formValid = false;\n return formValid;\n } else{\n var formValid = true;\n return formValid;\n }\n}", "function validateCaseSummary(){\r\n var valid = true;\r\n var roleDD = document.getElementById(\"0_role_dd\");\r\n var statusDD = document.getElementById(\"0_status_dd\");\r\n \r\n if (document.NewEntryServlet.text_casename.value == \"\"){\r\n alert( \"Please fill in the Case Name.\" );\r\n valid = false;\r\n } \r\n else if (roleDD.value == 0) { \r\n alert(\"Please select a role.\" );\r\n valid = false;\r\n }\r\n else if (statusDD.value == 0) {\r\n alert ( \"Please select a status.\" );\r\n valid = false;\r\n }\r\n \r\n return valid;\r\n}", "function employeeValidation(textFirstName, textLastName, textUserName, textEmail, textPassword, role_id) {\n\tlet messages = [];\n\tlet isValid = true;\n\tlet feedback = \"\";\n\t\n\t// validate the firstname\n\tfeedback = validateFirstName(textFirstName);\n\tif (feedback.trim().length > 0) {\n\t\tmessages.push(feedback);\n\t\tfeedback = \"\";\n\t}\n\n\t// validate the lastname\n\tfeedback = validateLastName(textLastName);\n\tif (feedback.trim().length > 0) {\n\t\tmessages.push(feedback);\n\t\tfeedback = \"\";\n\t}\n\n\t// validate the username\n\tfeedback = validateUserName(textUserName);\n\tif (feedback.trim().length > 0) {\n\t\tmessages.push(feedback);\n\t\tfeedback = \"\";\n\t}\n\t\n\t// validate the email\n\tfeedback = validateEmail(textEmail);\n\tif (feedback.trim().length > 0) {\n\t\tmessages.push(feedback);\n\t\tfeedback = \"\";\n\t}\n\n\t// validate the password\n\tfeedback = validatePassword(textPassword);\n\tif (feedback.trim().length > 0) {\n\t\tmessages.push(feedback);\n\t\tfeedback = \"\";\n\t}\n\n\t// validate the Role\n\tfeedback = validateRole(role_id);\n\tif (feedback.trim().length > 0) {\n\t\tmessages.push(feedback);\n\t\tfeedback = \"\";\n\t}\n\t\n\tif(messages.length > 0) {\n\t\tisValid = false;\n\t\traiseAlert(403,messages);\n\t}\n\n\treturn isValid;\n}", "function ValidateDependancyFields() {\n\n var retStr = true;\n\n $('#RegularDisplay').find('.edit-profile-select-dep-field').each(function () {\n\n var depVal = $(this).val();\n ShowCheckFlag($(this));\n\n if (depVal != '') {\n\n\n\n\n //verify that mf is not the same\n var mv = $(this).parents('.edit-profile-item-record').find('.edit-profile-select-milestone-field').val();\n var cv = $(this).parents('.edit-profile-item-record').find('.edit-profile-select-calc-field').val();\n var co = $(this).parents('.edit-profile-item-record').find('.edit-profile-fire-order').val();\n if (mv == depVal) {\n ShowErrorMessage(\"Milestone Fields And Dependant Fields Need To Be Different\");\n ShowErrorFlag($(this));\n retStr = false;\n\n }\n\n if (cv == '') {\n ShowErrorMessage(\"Calculation Field Required\");\n ShowErrorFlag($(this));\n retStr = false;\n\n }\n\n if (co == '' || isNaN(Number(co))) {\n ShowErrorMessage(\"Calc Order Field Required\");\n ShowErrorFlag($(this));\n retStr = false;\n\n }\n\n var hasFieldVal = false;\n //ensure there is a corresponding select milestone field .We can use this one if it is the same if would barf on previous check\n $('.edit-profile-select-milestone-field').each(function () {\n\n var fieldVal = $(this).val();\n if (fieldVal == depVal) {\n hasFieldVal = true;\n\n }\n });\n\n if (!hasFieldVal) {\n\n ShowErrorMessage(\"The Dependancy Does Not Have a Corresponding Milestone Entry\");\n ShowErrorFlag($(this));\n retStr = false;\n\n }\n\n\n }\n\n }\n\n\n );\n\n\n return retStr;\n\n }", "function checkFieldName(temp,submitForm) \r\n{\r\n\t// Set save button to show progress spinner\r\n\tif (submitForm) {\r\n\t\tvar saveBtn = $('#div_add_field').dialog(\"widget\").find(\".ui-dialog-buttonpane button\").eq(1);\r\n\t\tvar saveBtnHtml = saveBtn.html();\r\n\t\tvar cancelBtn = $('#div_add_field').dialog(\"widget\").find(\".ui-dialog-buttonpane button\").eq(0);\r\n\t\tsaveBtn.html('<img src=\"'+app_path_images+'progress_circle.gif\" class=\"imgfix\"> '+langOD8);\r\n\t\tcancelBtn.prop('disabled',true);\r\n\t\tsaveBtn.prop('disabled',true);\r\n\t}\r\n\t// If a section header, then ignore field name and just submit, if saving field\r\n\tif ($('#field_type').val() == 'section_header' && submitForm) {\r\n\t\tdocument.addFieldForm.submit();\r\n\t}\r\n\t// Initialize and get current field name before changed\r\n\told_field_name = $('#sq_id').val();\r\n\tdocument.getElementById('field_name').style.backgroundColor='#FFFFFF';\r\n\t//Make sure value is not empty\r\n\ttemp = trim(temp);\r\n\tif (temp.length == 0) return false;\t\t\r\n\t//Remove any illegal characters\r\n\tdocument.getElementById('field_name').value = temp = filterFieldName(temp);\r\n\t//Detect if an illegal field name ('redcap_event_name' et al)\r\n\tif (!(status > 0 && $('#field_name').attr('readonly'))) { // If already in production with a reserved name, do not give alert (it's too late).\r\n\t\tvar is_reserved = in_array(temp, reserved_field_names);\r\n\t\tif (is_reserved) {\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tsimpleDialog('\"'+temp+'\" '+langOD5,null,'illegalFieldErrorDialog',null,\"document.getElementById('field_name').focus();\");\r\n\t\t\t},50);\r\n\t\t\tdocument.getElementById('field_name').style.backgroundColor='#FFB7BE';\r\n\t\t\t// Set save button back to normal if clicked Save button\r\n\t\t\tif (submitForm) {\r\n\t\t\t\tsaveBtn.html(saveBtnHtml);\r\n\t\t\t\tcancelBtn.prop('disabled',false);\r\n\t\t\t\tcancelBtn.removeAttr('disabled');\r\n\t\t\t\tsaveBtn.prop('disabled',false);\t\r\n\t\t\t\tsaveBtn.removeAttr('disabled');\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t// Make sure this variable name doesn't already exist\r\n\tif (temp != old_field_name) {\r\n\t\t// Make ajax call\r\n\t\t$.get(app_path_webroot+'Design/check_field_name.php', { pid: pid, field_name: temp, old_field_name: old_field_name },\r\n\t\t\tfunction(data) {\r\n\t\t\t\tif (data != '0') {\r\n\t\t\t\t\t// Set save button back to normal if clicked Save button\r\n\t\t\t\t\tif (submitForm) {\r\n\t\t\t\t\t\tsaveBtn.html(saveBtnHtml);\r\n\t\t\t\t\t\tcancelBtn.prop('disabled',false);\r\n\t\t\t\t\t\tcancelBtn.removeAttr('disabled');\r\n\t\t\t\t\t\tsaveBtn.prop('disabled',false);\t\r\n\t\t\t\t\t\tsaveBtn.removeAttr('disabled');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsimpleDialog(langOD9+' \"'+temp+'\" '+langOD10+' \"'+data+'\"'+langPeriod+' '+langOD11,null,'fieldExistsErrorDialog',null,\"document.getElementById('field_name').focus();\");\r\n\t\t\t\t\tdocument.getElementById('field_name').style.backgroundColor='#FFB7BE';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//Detect if longer than 26 characters. If so, give warning but allow.\r\n\t\t\t\t\tif (temp.length > 26) {\r\n\t\t\t\t\t\tsimpleDialog(langOD7);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// No duplicates. Submit form if specified.\r\n\t\t\t\t\tif (submitForm) {\r\n\t\t\t\t\t\tdocument.addFieldForm.submit();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t );\r\n\t} else {\r\n\t\t//Detect if longer than 26 characters. If so, give warning but allow.\r\n\t\tif (temp.length > 26) {\r\n\t\t\tsimpleDialog(langOD7);\r\n\t\t}\r\n\t\t// No duplicates. Submit form if specified.\r\n\t\tif (submitForm) {\r\n\t\t\tdocument.addFieldForm.submit();\r\n\t\t}\r\n\t}\r\n}", "function validaCampoFilePrev(Nombre, ActualLement, espacio) {\n // errorIs = Array();\n\n $('#' + ActualLement + '_txt_' + Nombre).change(function () {\n\n resetCampo(Nombre, '#' + ActualLement);\n validaCampoFileInsavePrev(Nombre, ActualLement, espacio);\n var OBJ_Campo = document.getElementById(ActualLement + '_txt_' + Nombre);\n if (OBJ_Campo.type == 'file') {\n\n var reader = new FileReader();\n reader.readAsDataURL(OBJ_Campo.files[0]);\n reader.onloadend = function () {\n allCamposB64[OBJ_Campo.name] = reader.result;\n\n };\n }\n\n });\n}", "function validateStudentFields() {\n var bloggerName = $('#blogger_name').val();\n var bloggerUrl = $('#blogger_feed_url').val();\n var bloggerTwitterHandle = $('#blogger_twitter_handle').val();\n if(bloggerName == '' || bloggerName == null) {\n $('#blogger_name').addClass('form-error');\n $('#blogger_name').val('name can\\'t be blank');\n return true;\n };\n\n if(bloggerUrl.indexOf(\"http://\") != 0) {\n $('#blogger_feed_url').addClass('form-error');\n $('#blogger_feed_url').val('must start with http://');\n return true;\n }\n\n if(bloggerTwitterHandle != '' && bloggerTwitterHandle != null) {\n if(bloggerTwitterHandle.indexOf('@') == -1) {\n $('#blogger_twitter_handle').addClass('form-error');\n $('#blogger_twitter_handle').val('must start with @');\n return true;\n }\n }\n }", "function validateCompanyEditForm() {\n var companyId = $(\"#companyId\").val();\n var contactPersonName = $(\"#contactPersonName\").val();\n var contactNumber = $(\"#contactNumber\").val();\n var email = $(\"#email\").val();\n var numberOfAgents = $(\"#numberOfAgents\").val();\n var planId = $(\"#planId\").val();\n var authId = $(\"#authId\").val();\n\n if (vlaidateContactPerson(contactPersonName) == false) {\n return false;\n }\n\nif (validateContactNumber(contactNumber) == false) {\n return false;\n }\n \n var phoneExist = checkCompanyPhoneExist(\"edit\",companyId);\n if (phoneExist == \"yes\") {\n alert(\"Contact Number already exists!\");\n return false;\n }\n \n if (validateEmail(email) == false) {\n return false;\n }\n var y = checkCompanyEmailExist(\"edit\", companyId);\n if (y == \"yes\") {\n alert(\"Email already exists!\");\n return false;\n }\n\n if (validateNumberofAgents(numberOfAgents) == false) {\n return false;\n }\n \n if (planId == null || planId == \"\") {\n alert(\"Please select a charging plan.\");\n return false;\n }\n\n if (authId == null || authId == \"\") {\n alert(\"Please select an authentication model.\");\n return false;\n }\n}", "function validate_techStatus(){\n\t\tif(document.frmTechStatus.cmbStatus.value == ''){\n\t\t\tdocument.getElementById('lblcmbStatus').innerHTML = 'This field is required';\n\t\t\tdocument.frmTechStatus.cmbStatus.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblcmbStatus').innerHTML = '';\n\t\t}\n\t\tif(document.frmTechStatus.ArrivalDate.value == ''){\n\t\t\tdocument.getElementById('lblArrivalDate').innerHTML = 'This field is required';\n\t\t\t//document.frmTechStatus.ArrivalDate.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblArrivalDate').innerHTML = '';\n\t\t}\n\t\tif(document.frmTechStatus.ArrivalTime.value == ''){\n\t\t\tdocument.getElementById('lblArrivalTime').innerHTML = 'This field is required';\n\t\t\t//document.frmTechStatus.ArrivalTime.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblArrivalTime').innerHTML = '';\n\t\t}\n\t\tif(document.frmTechStatus.DepartTime.value == ''){\n\t\t\tdocument.getElementById('lblDepartTime').innerHTML = 'This field is required';\n\t\t\t//document.frmTechStatus.DepartTime.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblDepartTime').innerHTML = '';\n\t\t}\n\t\t\n\t\tif(document.frmTechStatus.SerialNumber.value == ''){\n\t\t\tdocument.getElementById('lblSerialNumber').innerHTML = 'This field is required';\n\t\t\t//document.frmTechStatus.ArrivalTime.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblSerialNumber').innerHTML = '';\n\t\t}\n\t\tif(document.frmTechStatus.ModelNumber.value == ''){\n\t\t\tdocument.getElementById('lblModelNumber').innerHTML = 'This field is required';\n\t\t\t//document.frmTechStatus.DepartTime.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblModelNumber').innerHTML = '';\n\t\t}\n\t\tif(document.frmTechStatus.partStatus.value == ''){\n\t\t\tdocument.getElementById('lblPartStatus').innerHTML = 'This field is required';\n\t\t\t//document.frmTechStatus.DepartTime.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lblPartStatus').innerHTML = '';\n\t\t}\n\t\tif(document.frmTechStatus.techNotes.value == ''){\n\t\t\tdocument.getElementById('lbltechNotes').innerHTML = 'This field is required';\n\t\t\tdocument.frmTechStatus.techNotes.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lbltechNotes').innerHTML = '';\n\t\t}\n\t\tif(regex.test(document.frmTechStatus.techNotes.value)){\n\t\t\tdocument.getElementById('lbltechNotes').innerHTML = 'This field contains special chars';\n\t\t\tdocument.frmTechStatus.techNotes.focus();\n\t\t\treturn false;\n\t\t}else{\n\t\t\tdocument.getElementById('lbltechNotes').innerHTML = '';\n\t\t}\n}", "function validate() {\n resetForm(); // reset any form errors\n\n // Check Account Value\n if($('#ucp-account').val().indexOf('.')== -1){\n $('#ucp-account').parents('.slds-form-element').addClass('slds-has-error');\n $('#ucp-account').parents('.slds-form-element').find('.slds-form-element__help').removeClass('slds-hide');\n }\n // Check Dataset Value\n if($('#ucp-dataset').val()==''){\n $('#ucp-dataset').parents('.slds-form-element').addClass('slds-has-error');\n $('#ucp-dataset').parents('.slds-form-element').find('.slds-form-element__help').removeClass('slds-hide');\n }\n\n if(!$('#catalog-1-checkbox').is(':checked') && !$('#catalog-2-checkbox').is(':checked') && !$('#catalog-3-checkbox').is(':checked')){\n $('#catalog-1-checkbox').parents('.slds-form-element').addClass('slds-has-error');\n $('#catalog-1-checkbox').parents('.slds-form-element').find('.slds-form-element__help').removeClass('slds-hide');\n }\n\n // Load Product Catalog\n if($('#catalog-1-checkbox').is(':checked')){\n loadCatalogObj('catalog-1');\n }\n // Load Article Catalog\n if($('#catalog-2-checkbox').is(':checked')){\n loadCatalogObj('catalog-2');\n }\n // Load Blog Catalog\n if($('#catalog-3-checkbox').is(':checked')){\n loadCatalogObj('catalog-3');\n }\n // Check that all components are there before continuing\n if($('.slds-has-error').length==0) {\n array.account = $.trim($('#ucp-account').val().toLowerCase());\n array.dataset = $.trim($('#ucp-dataset').val().toLowerCase());\n array.vertical = $.trim($('#ucp-vertical').val().toLowerCase());\n array.apiKey = $.trim($('#ucp-api-key').val());\n array.apiSecret = $.trim($('#ucp-api-secret').val());\n array.encodedData = window.btoa(array.apiKey + ':' + array.apiSecret);\n array.ids = [];\n localStorage.setItem('account', $.trim($('#ucp-account').val().toLowerCase()));\n localStorage.setItem('dataset', $.trim($('#ucp-dataset').val().toLowerCase()));\n localStorage.setItem('apiKey', $.trim($('#ucp-api-key').val()));\n localStorage.setItem('apiSecret', $.trim($('#ucp-api-secret').val()));\n var checkFiles = setInterval(function() {\n if($('input[aria-busy=\"1\"]').length==0) {\n gtag('set', 'user_properties', {\n vertical: 'Education'\n });\n validateCatalogs();\n wakeAPI();\n showHide('validation', 'upload');\n clearInterval(checkFiles);\n }\n }, 100); // check every 100ms\n }\n}", "function Form20_Validator(theForm)\n{\n// allow ONLY alphanumeric keys, no symbols or punctuation\n// this can be altered for any \"checkOK\" string you desire\n\n// check if first_name field is blank\nif ((theForm.name.value.replace(' ','') == \"\") || (theForm.name.value.replace(' ','') == \"Name\"))\n{\nalert(\"You must enter Your Name.\");\ntheForm.name.focus();\nreturn (false);\n}\n\n\n// check if email field is blank\nvar emailStructure = \"\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\";\n\nif ((theForm.emailfrom.value.replace(' ','') == \"\") || (theForm.emailfrom.value.replace(' ','') == \"Email\"))\n{\nalert(\"Please enter a value for the \\\"Email\\\" field.\");\ntheForm.emailfrom.focus();\nreturn (false);\n}\nelse\n {\n\t if (!emailStructure.test(theForm.emailfrom.value))\n\t {\n\t\talert(\"Email Id: Enter complete Email Id like [email protected]\");\n\t\ttheForm.emailfrom.focus();\n\t\treturn false;\n\t }\n }\n\n// test if valid email address, must have @ and .\n/*var checkEmail = \"@.\";\nvar checkStr = theForm.emailfrom.value;\nvar EmailValid = false;\nvar EmailAt = false;\nvar EmailPeriod = false;\nfor (i = 0; i < checkStr.length; i++)\n{\nch = checkStr.charAt(i);\nfor (j = 0; j < checkEmail.length; j++)\n{\nif (ch == checkEmail.charAt(j) && ch == \"@\")\nEmailAt = true;\nif (ch == checkEmail.charAt(j) && ch == \".\")\nEmailPeriod = true;\n\t if (EmailAt && EmailPeriod)\n\t\tbreak;\n\t if (j == checkEmail.length)\n\t\tbreak;\n\t}\n\t// if both the @ and . were in the string\nif (EmailAt && EmailPeriod)\n{\n\t\tEmailValid = true\n\t\tbreak;\n\t}\n}\nif (!EmailValid)\n{\nalert(\"The \\\"email\\\" field must contain an \\\"@\\\" and a \\\".\\\".\");\ntheForm.emailfrom.focus();\nreturn (false);\n}*/\n\n// check if company field is blank\n\nif ((theForm.company.value.replace(' ','') == \"\") || (theForm.company.value.replace(' ','') == \"Company\"))\n{\nalert(\"You must enter Company Name.\");\ntheForm.company.focus();\nreturn (false);\n}\n\n\n//check if Title is blank\n\nif ((theForm.title.value.replace(' ','') == \"\") || (theForm.title.value.trim() == \"report title\"))\n{\nalert(\"Please enter a value for the Report Title field.\");\ntheForm.title.focus();\nreturn (false);\n}\n\n\n\n\n// test if valid email address, must have @ and .\n/*var checkEmail = \"@.\";\nvar checkStr = theForm.emailfrom.value;\nvar EmailValid = false;\nvar EmailAt = false;\nvar EmailPeriod = false;\nfor (i = 0; i < checkStr.length; i++)\n{\nch = checkStr.charAt(i);\nfor (j = 0; j < checkEmail.length; j++)\n{\nif (ch == checkEmail.charAt(j) && ch == \"@\")\nEmailAt = true;\nif (ch == checkEmail.charAt(j) && ch == \".\")\nEmailPeriod = true;\n\t if (EmailAt && EmailPeriod)\n\t\tbreak;\n\t if (j == checkEmail.length)\n\t\tbreak;\n\t}\n\t// if both the @ and . were in the string\nif (EmailAt && EmailPeriod)\n{\n\t\tEmailValid = true\n\t\tbreak;\n\t}\n}\nif (!EmailValid)\n{\nalert(\"The \\\"email\\\" field must contain an \\\"@\\\" and a \\\".\\\".\");\ntheForm.emailfrom.focus();\nreturn (false);\n}*/\n\n}", "function Form60_Validator(theForm)\n{\n// allow ONLY alphanumeric keys, no symbols or punctuation\n// this can be altered for any \"checkOK\" string you desire\n\n// check if first_name field is blank\nif ((theForm.name.value.replace(' ','') == \"\") || (theForm.name.value.replace(' ','') == \"Name\"))\n{\nalert(\"You must enter Your Name.\");\ntheForm.name.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.name,\"Name\"))\nreturn false;\n}\n\n\n// check if email field is blank\n\nif ((theForm.emailfrom.value.replace(' ','') == \"\") || (theForm.emailfrom.value.replace(' ','') == \"Email\"))\n{\nalert(\"Please enter a value for the \\\"Email\\\" field.\");\ntheForm.emailfrom.focus();\nreturn (false);\n}\nelse\n {\n\t if (!theForm.emailfrom.value.test(\"\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\"))\n\t {\n\t\talert(\"Email Id: Enter complete Email Id like [email protected]\");\n\t\ttheForm.emailfrom.focus();\n\t\treturn false;\n\t }\n }\n\n// test if valid email address, must have @ and .\n/*var checkEmail = \"@.\";\nvar checkStr = theForm.emailfrom.value;\nvar EmailValid = false;\nvar EmailAt = false;\nvar EmailPeriod = false;\nfor (i = 0; i < checkStr.length; i++)\n{\nch = checkStr.charAt(i);\nfor (j = 0; j < checkEmail.length; j++)\n{\nif (ch == checkEmail.charAt(j) && ch == \"@\")\nEmailAt = true;\nif (ch == checkEmail.charAt(j) && ch == \".\")\nEmailPeriod = true;\n\t if (EmailAt && EmailPeriod)\n\t\tbreak;\n\t if (j == checkEmail.length)\n\t\tbreak;\n\t}\n\t// if both the @ and . were in the string\nif (EmailAt && EmailPeriod)\n{\n\t\tEmailValid = true\n\t\tbreak;\n\t}\n}\nif (!EmailValid)\n{\nalert(\"The \\\"email\\\" field must contain an \\\"@\\\" and a \\\".\\\".\");\ntheForm.emailfrom.focus();\nreturn (false);\n}*/\n\n// check if company field is blank\nif ((theForm.job_title.value.replace(' ','') == \"\") || (theForm.job_title.value.replace(' ','') == \"report title\"))\n{\nalert(\"Please enter your Designation.\");\ntheForm.job_title.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.job_title,\"Designation\"))\nreturn false;\n}\n\nif ((theForm.company.value.replace(' ','') == \"\") || (theForm.company.value.replace(' ','') == \"Company\"))\n{\nalert(\"You must enter Company Name.\");\ntheForm.company.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.company,\" Company Name\"))\nreturn false;\n}\n\n\n//check if Title is blank\n\nif ((theForm.phone_no.value.replace(' ','') == \"\") || (theForm.phone_no.value.replace(' ','') == \"report title\"))\n{\nalert(\"Please enter your Phone Number.\");\ntheForm.phone_no.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.phone_no,\"Phone Number\"))\nreturn false;\n}\n\n\n\n// test if valid email address, must have @ and .\nvar checkOK = \"0123456789\";\nvar checkStr = theForm.phone_no.value;\nvar allValid = true;\nvar allNum = \"\";\nfor (i = 0; i < checkStr.length; i++)\n{\nch = checkStr.charAt(i);\nfor (j = 0; j < checkOK.length; j++)\nif (ch == checkOK.charAt(j))\nbreak;\nif (j == checkOK.length)\n{\nallValid = false;\nbreak;\n}\nif (ch != \",\")\nallNum += ch;\n}\nif (!allValid)\n{\nalert(\"Please enter only digit characters in the \\\"Phone\\\" field.\");\ntheForm.phone_no.focus();\nreturn (false);\n}\n\nif ((theForm.country.value.replace(' ','') == \"\") || (theForm.country.value.replace(' ','') == \"company\"))\n{\nalert(\"Please enter your Country Name.\");\ntheForm.country.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.country,\"Country Name\"))\nreturn false;\n}\n\n\nif ((theForm.title.value.replace(' ','') == \"\") || (theForm.title.value.trim() == \"report title\"))\n{\nalert(\"Please enter the title of the report you are interested.\");\ntheForm.title.focus();\nreturn (false);\n}\nelse\n{\nif (!isProper(theForm.country,\"Report Interested in\"))\nreturn false;\n}\nif (!isProper(theForm.comments,\"comments\"))\nreturn false;\n\n}", "function validateForm() {\n // Retrieving the values of form elements \n var name = document.contactForm.name.value;\n var email = document.contactForm.email.value;\n var phone = document.contactForm.phone.value;\n var designation = document.contactForm.designation.value;\n var gender = document.contactForm.gender.value;\n var areaofinterest = document.contactForm.areaofinterest.value;\n var str =\"\";\n\n var skills = [];\n var checkboxes = document.getElementsByName(\"skills[]\");\n for(var i=0; i < checkboxes.length; i++) {\n if(checkboxes[i].checked) {\n // Populate Skills array with selected values\n skills.push(checkboxes[i].value);\n }\n }\n \n\t// Defining error variables with a default value\n var nameErr = emailErr = phoneErr = designationErr = genderErr = skillErr = areaofinterest = true;\n \n // Validate name\n if(name == \"\") {\n printError(\"nameErr\", \"Please enter your name\");\n } else {\n var regex = /^[a-zA-Z\\s]+$/; \n if(regex.test(name) === false) {\n printError(\"nameErr\", \"Please enter a valid name\");\n } else {\n printError(\"nameErr\", str);\n nameErr = false;\n }\n }\n \n // Validate email address\n if(email == \"\") {\n printError(\"emailErr\", \"Please enter your email address\");\n } else {\n // Regular expression for basic email validation\n var regex = /^\\S+@\\S+\\.\\S+$/;\n if(regex.test(email) === false) {\n printError(\"emailErr\", \"Please enter a valid email address\");\n } else{\n printError(\"emailErr\", \"\");\n emailErr = false;\n }\n }\n \n // Validate mobile number\n if(phone == \"\") {\n printError(\"phoneErr\", \"Please enter your mobile number\");\n } else {\n var regex = /^[1-9]\\d{9}$/;\n if(regex.test(phone) === false) {\n printError(\"phoneErr\", \"Please enter a valid 10 digit mobile number\");\n } else{\n printError(\"phoneErr\", \"\");\n phoneErr = false;\n }\n }\n \n // Validate Designation\n if(designation == \"Select\") {\n printError(\"designationErr\", \"Please select your Designation\");\n } else {\n printError(\"designationErr\", \"\");\n designationErr = false;\n }\n \n // Validate gender\n if(gender == \"\") {\n printError(\"genderErr\", \"Please select your gender\");\n } else {\n printError(\"genderErr\", \"\");\n genderErr = false;\n }\n\n if(skills.length == \"\") {\n printError(\"skillErr\", \"Please select atleast one skill\");\n } else{\n printError(\"skillErr\",\"\");\n skillErr = false;\n }\n\n \n // Prevent the form from being submitted if there are any errors\n if((nameErr || emailErr || phoneErr || designationErr || genderErr || skillErr || areaofinterestErr) == true) {\n return false;\n } else {\n // Creating a string from input data for preview\n var dataPreview = \"You've entered the following details: \\n\" +\n \"Full Name: \" + name + \"\\n\" +\n \"Gender: \" + gender + \"\\n\";+\n \"Email Address: \" + email + \"\\n\" +\n \"Mobile Number: \" + phone + \"\\n\" +\n \"Designation: \" + designation + \"\\n\" +\n \"Area Of Interest: \" + areaofinterest + \"\\n\";\n if(skills.length) {\n dataPreview += \"Skills: \" + skills.join(\", \");\n }\n // Display input data in a dialog box before submitting the form\n alert(dataPreview); \n } \n}", "function validateOnSubmit() {\n\n var elem;\n\n var errs=0;\n\n // execute all element validations in reverse order, so focus gets\n\n // set to the first one in error.\n\n if (!validateTelnr (document.forms.demo.telnr, 'inf_telnr', true)) errs += 1; \n\n if (!validateAge (document.forms.demo.age, 'inf_age', false)) errs += 1; \n\n if (!validateEmail (document.forms.demo.email, 'inf_email', true)) errs += 1; \n\n if (!validatePresent(document.forms.demo.from, 'inf_from')) errs += 1; \n\n\n\n if (errs>1) alert('There are fields which need correction before sending');\n\n if (errs==1) alert('There is a field which needs correction before sending');\n\n\n\n return (errs==0);\n\n }", "function validateForm() {\r\n // Retrieving the values of form elements \r\n var fname = document.searchForm.fname.value;\r\n var lname = document.searchForm.lname.value; \r\n var email = document.searchForm.email.value; \r\n \r\n\t// Defining error variables with a default value\r\n var fnameErr = emailErr = lnameErr = true;\r\n \r\n if(fname == \"\" && lname == \"\" && email == \"\") {\r\n printError(\"nameErr\", \"Please enter names or email\");\r\n } \r\n if(fname != \"\" && lname == \"\") {\r\n printError(\"nameErr\", \"Please enter both names\");\r\n } \r\n if(fname == \"\" && lname != \"\") {\r\n printError(\"nameErr\", \"Please enter both names\");\r\n } \r\n\r\n if(fname != \"\" && lname != \"\") {\r\n fnameErr = false;\r\n lnameErr = false;\r\n if(email == \"\")\r\n emailErr = false;\r\n } \r\n \r\n // Validate email address\r\n if (email != \"\") {\r\n // Regular expression for basic email validation\r\n var regex = /^\\S+@\\S+\\.\\S+$/;\r\n if (regex.test(email) === false) {\r\n printError(\"emailErr\", \"Please enter a valid email address\");\r\n } else {\r\n printError(\"emailErr\", \"\");\r\n emailErr = false;\r\n }\r\n\r\n if(fname == \"\" && lname == \"\") {\r\n fnameErr = false;\r\n lnameErr = false;\r\n } else if(fname != \"\" && lname == \"\"){\r\n fnameErr = true;\r\n lnameErr = true;\r\n printError(\"nameErr\", \"Please enter both names\");\r\n } else if(fname == \"\" && lname != \"\"){\r\n fnameErr = true;\r\n lnameErr = true;\r\n printError(\"nameErr\", \"Please enter both names\");\r\n } \r\n }\r\n \r\n // Prevent the form from being submitted if there are any errors\r\n if((fnameErr || emailErr || lnameErr) == true) {\r\n return false;\r\n } else {\r\n // Creating a string from input data for preview\r\n var dataPreview = \"You've entered the following details: \\n\" +\r\n \"first Name: \" + fname + \"\\n\" +\r\n \"last name: \" + lname + \"\\n\" +\r\n \"Email: \" + email + \"\\n\";\r\n \r\n // Display input data in a dialog box before submitting the form\r\n alert(dataPreview);\r\n }\r\n}", "function validForAddPage()\r\n\t{\r\n\t //alert(\"validForAddPage\");\r\n\t if(document.getElementById('clientName').value.length == 0)\r\n\t {\r\n\t jQuery.facebox(\"Enter the Client Name\");\r\n\t\t return false;\r\n\t }\r\n\t else if(document.getElementById('vendor').value.length == 0)\r\n\t {\r\n\t jQuery.facebox(\"Enter the Franchise Name\");\r\n\t\t return false;\r\n\t }\r\n\t else\r\n\t {\r\n\t document.getElementById('mv').value=ss11;\r\n\r\n\t\tinsertUnSavedItems();\r\n\r\n\t\t//imageWindow.document.uploadForm.mv.value='clear';\r\n\r\n\t\t//imageWindow.document.uploadForm.Object1.src='';\r\n\r\n\t\tif(imageWindow.document.uploadForm.Object1.src!=null){\r\n\t\t\t/*** Checking previouse Image and submitting **/\r\n\t\t\t//alert('inside save and return 5')\r\n\t\t\t//pausecomp(300);\r\n\t\t\t\r\n\t\t\t\t\t\timageWindow.document.uploadForm.submitButton.click();\r\n\t\t\t//pausecomp(300);\r\n\t\t\t\r\n\t\t\t//imageSubmitCaller(document.getElementById('inim').value);\r\n\t\t//alert('inside save and return 6')\r\n\t\t}else{\r\n\r\n\t\t\t//\t\talert('there is no image')\r\n\t\t}\r\n\r\n\t//\timageWindow.document.uploadForm.reset();\r\n\t//\timageWindow.document.uploadForm.Object1.src=\"\";\r\n\t\t//alert('Image window '+imageWindow.document.uploadForm.vo.value);\r\n\r\n\r\n\t\tvar invoiceId = document.getElementById('invoiceId').value;\r\n\t\t//alert('invoiceId.val'+invoiceId);\r\n \teditValue(document.getElementById('status').value,'<%=invoiceStatus_ColID%>','<%=invoiceTableId%>',invoiceId);\r\n \tdocument.voucherInvoiceAllocation.submit();\r\n\t//pausecomp(300);\r\n\t//agentWindow.close();\r\n\t//alert('3');\r\n\timageWindow.close();\r\n\t//alert('4');\r\n\t//return false;\r\n\t }\r\n\t \r\n\t}", "function checkPdfJpegfiles(id)\n{\n\t//|| ext[1]==\"JPEG\" || ext[1]==\"jpeg\" || ext[1]==\"PNG\" || ext[1]==\"png\" ||\n\tvar flag=0;\n\t var myfile=$('#corresuploaddoc'+id).val();\t\t\t\n var ext = myfile.split('.');\n \n if(ext[1]==\"pdf\" || ext[1]==\"jpg\" || ext[1]==\"JPG\"){\n \tflag=1;\n }\n else{\n \t flag=0;\n \tbootbox.alert(\"Please select pdf or image(jpg) file only\");\n \tdocument.getElementById(\"corresuploaddoc\"+id).value = \"\";\n }\n \n if(flag==1)\n \t {\n \t checkFileSize(id);\n \t } \n \n}", "static partCreateUpdateValidation(pageClientAPI) {\n\n var dict = libCom.getControlDictionaryFromPage(pageClientAPI);\n\n libCom.setInlineControlErrorVisibility(dict.QuantitySim, false);\n libCom.setInlineControlErrorVisibility(dict.PlantLstPkr, false);\n libCom.setInlineControlErrorVisibility(dict.OperationLstPkr, false);\n libCom.setInlineControlErrorVisibility(dict.UOMSim, false);\n //Clear validation will refresh all fields on screen\n dict.MaterialLstPkr.clearValidation();\n\n return libThis.validateQuantityGreaterThanZero(pageClientAPI, dict)\n .then(libThis.validatePlantNotBlank.bind(null, pageClientAPI, dict), libThis.validatePlantNotBlank.bind(null, pageClientAPI, dict))\n .then(libThis.validateUOMExceedsLength.bind(null, pageClientAPI, dict), libThis.validateUOMExceedsLength.bind(null, pageClientAPI, dict))\n .then(libThis.validateOperationNotBlank.bind(null, pageClientAPI, dict), libThis.validateOperationNotBlank.bind(null, pageClientAPI, dict))\n .then(libThis.validateQuantityIsNumeric.bind(null, pageClientAPI, dict), libThis.validateQuantityIsNumeric.bind(null, pageClientAPI, dict))\n .then(libThis.validateMaterialNotBlank.bind(null, pageClientAPI, dict), libThis.validateMaterialNotBlank.bind(null, pageClientAPI, dict))\n .then(libThis.processInlineErrors.bind(null, pageClientAPI, dict), libThis.processInlineErrors.bind(null, pageClientAPI, dict))\n .then(function() {\n return true; \n }, function() {\n return false; \n }); //Pass back true or false to calling action\n }", "function validateAutomaticEmailReportForm(){\n\tvar sucessCount = 0;\n\t\n\tvar isValidReportName = validateNotNullFieldWithInputVal($(\"#automaticEmailReportForm input[name=reportName]\").val(),\"automaticEmailReportNameError\",\"Report Name\");\n\t\n\tsucessCount = sucessCount + checkEmailIDFieldsWithInputValue($(\"#automaticEmailReportForm input[name=email1]\").val(),\"automaticEmailReportEmail1Error\",\"Email 1\") ;\n\tvar email2 = $(\"#automaticEmailReportForm input[name=email2]\").val();\n\tif(email2!=\"\"){\n\t\tsucessCount = sucessCount + checkEmailIDFieldsWithInputValue(email2,\"automaticEmailReportEmail2Error\",\"Email 2\") ;\n\t}else{\n\t\tsucessCount = sucessCount + 1;\n\t}\n\tvar email3 = $(\"#automaticEmailReportForm input[name=email3]\").val();\n\tif(email3!=\"\"){\n\t\tsucessCount = sucessCount + checkEmailIDFieldsWithInputValue(email3,\"automaticEmailReportEmail3Error\",\"Email 3\") ;\n\t}else{\n\t\tsucessCount = sucessCount + 1;\n\t}\n\tsucessCount = sucessCount + validDropDownValue(\"automaticEmailReportForm select[name=locationIds]\",\"automaticEmailReportLocationError\",($(\"#locationLabel\").val()));\n\tsucessCount = sucessCount + validDropDownValue(\"automaticEmailReportForm select[name=resourceIds]\",\"automaticEmailReportResourceError\",($(\"#resourceLabel\").val()));\n\tsucessCount = sucessCount + validDropDownValue(\"automaticEmailReportForm select[name=serviceIds]\",\"automaticEmailReportServiceError\",($(\"#serviceLabel\").val()));\n\t\n\tvar reportApptStatus = $('input[name=\"automaticEmailReportApptStatus\"]:checked').map(function () { \n return this.value;\n }).get().join(\",\");\n\t\n\tvar reportOtherApptStatus = $(\"#automaticEmailReportOtherApptStatus\").val();\n\t\n\tif((reportApptStatus!=null && reportApptStatus!=\"\") || (reportOtherApptStatus!=null && reportOtherApptStatus!=\"\")){\n\t\tsucessCount = sucessCount + 1;\n\t\t$('#automaticEmailReportApptStatusError').html(\"\");\t\n\t\tvar apptStatus = \"\";\n\t\tif(reportApptStatus!=null && reportApptStatus!=\"\"){\n\t\t\tapptStatus = reportApptStatus;\n\t\t}\n\t\tif(reportOtherApptStatus!=null && reportOtherApptStatus!=\"\"){\n\t\t\tif(apptStatus!=null && apptStatus!=\"\"){\n\t\t\t\tapptStatus = apptStatus + \",\";\n\t\t\t}\n\t\t\tapptStatus = apptStatus + reportOtherApptStatus;\n\t\t}\n\t\t$(\"#apptStatusFetch\").val(apptStatus);\t\t\n\t}else{\n\t\t$('#automaticEmailReportApptStatusError').html(\"Please select at least one Appointment Status\");\n\t}\n\t\n\tif(sucessCount==7 && isValidReportName){\t\t\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function validateTrainerperCourseForm() {\n const start = trainerCoursestartDate.value;\n const end = trainerCourseendDate.value;\n const partsStart = start.split(\"-\");\n const partsEnd = end.split(\"-\");\n const dayStart = parseInt(partsStart[2], 10);\n const monthStart = parseInt(partsStart[1], 10);\n const yearStart = parseInt(partsStart[0], 10);\n const dayEnd = parseInt(partsEnd[2], 10);\n const monthEnd = parseInt(partsEnd[1], 10);\n const yearEnd = parseInt(partsEnd[0], 10);\n const regex = /^[a-zA-Z ]{2,15}$/;\n if (trainerCourseFirstName.value === null || trainerCourseFirstName.value === '' || regex.test(trainerCourseFirstName.value) === false) {\n errTrainerCourse.innerText = 'First Name up to 15 letters / no numbers';\n trainerCourseFirstName.classList.add('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseendDate.classList.remove('invalid');\n return false;\n }\n else if (trainerCourseLastName.value === null || trainerCourseLastName.value === '' || regex.test(trainerCourseLastName.value) === false) {\n errTrainerCourse.innerText = 'Last Name up to 15 letters / no numbers';\n trainerCourseLastName.classList.add('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseendDate.classList.remove('invalid');\n return false;\n }\n else if (trainerCourseSubject.value === null || trainerCourseSubject.value === '#') {\n trainerCourseSubject.classList.add('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseendDate.classList.remove('invalid');\n errTrainerCourse.innerText = 'Choose a subject';\n return false;\n }\n else if (trainerCoursestartDate.value === '' || yearStart < 2020 || monthEnd == 0 || monthStart < 12 || dayStart < 0 || dayStart > 31) {\n trainerCoursestartDate.classList.add('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n trainerCourseendDate.classList.remove('invalid');\n errTrainerCourse.innerText = 'Start Date has to be set and cant be before next month';\n\n return false;\n }\n else if (trainerCourseendDate.value === '' || yearEnd < 2021 || monthEnd == 0 || monthEnd < 3 || dayEnd < 0 || dayEnd > 31) {\n trainerCourseendDate.classList.add('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n errTrainerCourse.innerText = 'End Date has to be at least three months after the start';\n return false;\n }\n else if (!trainerCoursePartType.checked && !trainerCourseFullType.checked) {\n trainerCourseendDate.classList.remove('invalid');\n trainerCoursestartDate.classList.remove('invalid');\n trainerCourseSubject.classList.remove('invalid');\n trainerCourseLastName.classList.remove('invalid');\n trainerCourseFirstName.classList.remove('invalid');\n errTrainerCourse.innerText = 'Choose Course Type';\n return false;\n }\n else {\n errTrainerCourse.innerText = '';\n return true;\n }\n}", "function validateSubnames(){\r\n var subnameExpression =/^([A-ZÁÉÍÓÚ]{1}[a-zñáéíóú]+[\\s]*)+$/;\r\n if(form.clientSubname.value == \"\" && document.getElementById(\"clientSubnameSpanWhiteSpace\") == null){\r\n var span = document.createElement(\"span\");\r\n span.setAttribute(\"id\",\"clientSubnameSpanWhiteSpace\");\r\n span.setAttribute(\"class\",\"spanErrors\");\r\n span.innerHTML = \"Apellidos incompletos\";\r\n $(\"#clientSubnameLabel\").appendChild(span);\r\n validated = false;\r\n }else if(!subnameExpression.test(form.clientSubname.value)){\r\n form.clientSubname.classList.add(\"error\");\r\n form.clientSubname.focus();\r\n validated = false;\r\n if(document.getElementById(\"clientSubnameSpan\") == null && document.getElementById(\"clientSubnameSpanWhiteSpace\") == null){\r\n var span = document.createElement(\"span\");\r\n span.setAttribute(\"id\",\"clientSubnameSpan\");\r\n span.setAttribute(\"class\",\"spanErrors\");\r\n span.innerHTML = \"Apellidos incorrectos\";\r\n $(\"#clientSubnameLabel\").appendChild(span);\r\n }\r\n }else{\r\n validated = true;\r\n } \r\n return validated; \r\n}", "function foodsValidate(foodsForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\n\nif(foodsForm.name.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền tên thức ăn!\\n\";\nvalidationVerified=false;\n}\nif(foodsForm.price.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền giá thức ăn!\\n\";\nvalidationVerified=false;\n}\nif(foodsForm.category.selectedIndex==0)\n{\nerrorMessage+=\"Hãy lựa chọn thể loại thức ăn!\\n\";\nvalidationVerified=false;\n}\nif(foodsForm.photo.value==\"\")\n{\nerrorMessage+=\"Bạn chưa chọn hình ảnh!\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nreturn validationVerified;\n}", "function CfnDocument_AttachmentsSourcePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key));\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('values', cdk.listValidator(cdk.validateString))(properties.values));\n return errors.wrap('supplied properties not correct for \"AttachmentsSourceProperty\"');\n}", "function partyhallsValidate(partyhallsForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\n\nif (partyhallsForm.name.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền tên hội trường!\\n\";\nvalidationVerified=false;\n}\nif (partyhallsForm.partyhall.selectedIndex==0)\n{\nerrorMessage+=\"Bạn chưa chọn hội trường!\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nreturn validationVerified;\n}", "function Attachments(input, count) {\n if (input.files && input.files[0]) {\n\n var filerdr = new FileReader();\n filerdr.onload = function (e) {\n fileExtension = (input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)).replace(/^.*\\./, '');\n if (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"pdf\" || fileExtension == \"png\") {\n\n document.getElementById('PhotoSource' + count + '').value = e.target.result; //Generated DataURL\n document.getElementById('PhotoFileName' + count + '').value = input.value.substring((input.value.lastIndexOf(\"\\\\\")) + 1)\n }\n else {\n $(\"#\"+count).val(\"\");\n alert(\"Only Pdf/jpg/jpeg/png Format allowed\");\n }\n }\n filerdr.readAsDataURL(input.files[0]);\n }\n\n}" ]
[ "0.7143847", "0.6299985", "0.591096", "0.5736371", "0.5716605", "0.5593715", "0.55903906", "0.5575404", "0.5569979", "0.554915", "0.55022824", "0.54944205", "0.54754704", "0.5461847", "0.5443368", "0.54389447", "0.5421969", "0.5412685", "0.541155", "0.5378472", "0.53620934", "0.53609025", "0.5346196", "0.534553", "0.53438157", "0.5342528", "0.53340715", "0.532589", "0.53210396", "0.5320445", "0.531501", "0.5312106", "0.53093576", "0.5304484", "0.5282749", "0.5278471", "0.5278078", "0.5274779", "0.5251811", "0.52476853", "0.5234499", "0.5230769", "0.523047", "0.5229116", "0.52287143", "0.5225842", "0.5224895", "0.5222184", "0.5210366", "0.51933527", "0.51909196", "0.51818204", "0.5178533", "0.5175272", "0.5174361", "0.5172739", "0.51680034", "0.5162532", "0.5135533", "0.5132852", "0.51284343", "0.5127725", "0.5124563", "0.51225984", "0.51192147", "0.5113569", "0.5108249", "0.51055217", "0.5103034", "0.51009333", "0.5097445", "0.50926787", "0.5092509", "0.5089596", "0.5080295", "0.5076975", "0.50727487", "0.50690144", "0.5066997", "0.5064077", "0.5064015", "0.50616676", "0.50567067", "0.5054201", "0.50423265", "0.5041544", "0.50412303", "0.50405824", "0.5038343", "0.5036307", "0.50290096", "0.50276715", "0.5025494", "0.5015576", "0.50152504", "0.5014328", "0.5012023", "0.5008248", "0.50075364", "0.49991977" ]
0.67289054
1
user click on start to startGame
function startGame(){ countStartGame = 30; correctAnswers = 0; wrongAnswers = 0; unanswered = 0; if (!timerRunning){ intervalId = setInterval(timer, 1000); timerRunning = true; } timer(); console.log("game startiiing"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame() { }", "onStartGame(event) {\n\n if(this.checkStartButton()){\n console.log('On click btn start'); \n this.app.goToGame();\n\n if(this.start){\n this.app.start(); \n }\n }\n }", "pressedStart()\n\t\t\t{\n\t\t\tif(this.gamestate === 'starting')\n\t\t\t\t{\n\t\t\t\tthis.gamestate = 'choose';\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'choose')\n\t\t\t\t{\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'stats')\n\t\t\t\t{\n\t\t\t\tthis.gamestate = 'bedroom';\n\t\t\t\t}\n\t\t\telse if(this.gamestate === 'bedroom')\n\t\t\t\t{\n\t\t\t\tthis.menu.RunFunction(this);\n\t\t\t\t}\n\t\t\t}", "function displayStart(){\n\t// Display game start button again\n\t$('#game').append(\"<div id='start'></div>\");\n\t$(\"#start\").unbind();\n\t$(\"#start\").click(startGame);\n\t// Play main theme song again\n\tmarioGame.audMainTheme.play();\n}", "function startGame() {\n\t\t\tvm.gameStarted = true;\n\t\t\tMastermind.startGame();\n\t\t\tcurrentAttempt = 1;\n\t\t\tactivateAttemptRow();\n\t\t}", "function startGame() {\n\t$(\"#start-button\", \"#menu\").click(function(){\n\t\tif (sess_token == null) {\n\t\t\treturn;\n\t\t}\n\t\tbutton_lock = true;\n\t\tdocument.getElementById(\"question-answer-container\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"stats\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"menu\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"reset-button\").style.visibility = \"visible\";\n\t\tgetQuestion(\"easy\");\n\t}); \n}", "function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }", "function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}", "function startClicked(){\n //console.log('start clicked');\n gameStart.hidden = true;\n bord.hidden = false;\n start = true;\n if (start == true){\n start=false;\n gameLoop();\n }\n}", "async startClick() {\n this.game = await this.getGame();\n // STORE GAME STATE TO localStorage to persist after refresh\n localStorage.setItem(\"game\", JSON.stringify(this.game));\n await this.startGame();\n }", "start() {\n\t\tthis.emit(\"game_start\");\n\t}", "function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }", "function gameStart(){\n\t\tplayGame = true;\n\t\tmainContentRow.style.visibility = \"visible\";\n\t\tscoreRow.style.visibility = \"visible\";\n\t\tplayQuitButton.style.visibility = \"hidden\";\n\t\tquestionPool = getQuestionPool(answerPool,hintPool);\n\t\tcurrentQuestion = nextQuestion();\n}", "startGame() {\n //@todo: have this number set to the difficulty, easy = 3, normal = 6, hard = 9\n StateActions.onStart(5, 5, this.state.difficulty);\n StateStore.setGameState(1);\n this.gameState();\n }", "function startGame() {\n console.log('start button clicked')\n $('.instructions').hide();\n $('.title').show();\n $('.grid_container').show();\n $('.score_container').show();\n $('#timer').show();\n // soundIntro('sound/Loading_Loop.wav');\n }", "function gamestart() {\n\t\tshowquestions();\n\t}", "function gameStart() {\n\trenderQuestion(State.Questions[State.onQuestion]);\n\t$(\"#question-box\").removeClass('hidden');\n\t$(\"#start\").addClass('hidden');\n}", "function startGame() {\n\n game.updateDisplay();\n game.randomizeShips();\n $(\"#resetButton\").toggleClass(\"hidden\");\n $(\"#startButton\").toggleClass(\"hidden\");\n game.startGame();\n game.updateDisplay();\n saveGame();\n}", "function startGame(){\n\t$( \"#button_game0\" ).click(function() {selectGame(0)});\n\t$( \"#button_game1\" ).click(function() {selectGame(1)});\n\t$( \"#button_game2\" ).click(function() {selectGame(2)});\n\tloadRound();\n}", "go() {\n\t\tthis.context.analytics.record(\"Game Loaded\");\n\t\tthis._$template.css({ \"visibility\": \"visible\"}).hide().fadeIn();\n\t\tthis._$start = $(\".start\", this._$template);\n\n\t\tthis._$start.on('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\tthis._$template.fadeOut(() => {\n\t\t\t\tthis.nextState(\"playing\");\n\t\t\t});\n\t\t});\n\t}", "StartButPress(){\n this.refHolder.getComponent('AudioController').PlayTap();\n this.refHolder.getComponent('UIAnimManager').MainMenuOut();\n this.refHolder.getComponent(\"GamePlay\").CreatePuzzle();\n\n this.refHolder.getComponent('UIAnimManager').GameMenuIn();\n }", "function startGame(){\n hideContent();\n unhideContent();\n assignButtonColours();\n generateDiffuseOrder();\n clearInterval(interval);\n setlevel();\n countdown(localStorage.getItem(\"theTime\"));\n listeningForClick();\n}", "function handleStartClick() {\n toggleButtons(true); // disable buttons\n resetPanelFooter(); // reset panel/footer\n\n for (let id of ['player-panel', 'ai-panel', 'enemyboard', 'ai-footer', 'player-footer']) {\n document.getElementById(id).classList.remove(\"hidden\");\n }\n\n game = new Game(settings.difficulty, settings.playerBoard);\n game.start();\n}", "function handleStartGame() {\n console.log(\"Start Game clicked...!\");\n\n //------- Timer ------- //\n\n // Start Timer\n startTimer(0);\n}", "function startGame() {\n incrementGameStep({ gameId, gameData });\n }", "startBtnClickHandler() {\n this.changeGamePhase(\"creatureSelect\");\n }", "start() {\n this.gameStart = true;\n }", "StartGame(player, start){\n this.scene.start('level1');\n }", "startGame () {\n game.state.start('ticTac')\n }", "function startGame () {\n\tplay = true;\n\n}", "function startGame() {\n\t\tstatus.show();\n\t\tinsertStatusLife();\n\t\tsetLife(100);\n\t\tsetDayPast(1);\n\t}", "handleStartGame() {\n this.gameState = 1; //A value of > 0 indicates that the game has started. First part of the round is 1.\n super.sendGameData({ event: \"start-game\", state: this.gameState });\n }", "function userTouchedContinue() {\n TileSum.game.state.start('Play');\n }", "function startGame() {\n setMessage(player1 + ' gets to start.');\n}", "function startGameButtonHandler() {\n socket.emit('startGame', gameInfo);\n startGame(gameInfo);\n}", "function gameStart() {\n gameStarted = true;\n let pSelected = userChoice;\n let hSelected = houseSelection();\n gameRule(pSelected, hSelected);\n}", "function start(){\n //hide game and error message\n document.getElementById(\"error-message\").classList.add(\"hidden\");\n document.getElementById(\"game\").classList.add(\"hidden\");\n\n //add event listener to start button to trigger game\n\tvar start = document.getElementById(\"intro\").firstChild.nextSibling;\n start.addEventListener('click', game);\n}", "function handleStartGame() {\n $('main').on('click','.start-button', function (event){\n event.preventDefault();\n STORE.quizStarted = true;\n render();\n });\n}", "startGame() {\n document.getElementById('homemenu-interface').style.display = 'none';\n document.getElementById('character-selection-interface').style.display = 'block';\n this.interface.displayCharacterChoice();\n this.characterChoice();\n }", "function clickStart() {\n $('main').on('click', '#start', function (event) {\n STORE.quizStarted = true;\n render();\n });\n }", "function startGame(event) {\n event.stopPropagation();\n gameTimer();\n cQuestion = -1;\n startBtn.style.display = \"none\";\n questionEl.textContent = \"\";\n choiceEl.textContent = \"\";\n nextQuestion();\n}", "function startGame()\n{\n\tconsole.log(\"startGame()\");\n\n\taddEvent(window, \"keypress\", keyPressed);\n\n\tfor(var i = 0; i < app.coverImgArr.length; i++)\n\t\tapp.coverImgArr[i].style.visibility = 'visible';\n\n\tinitBgImg();\n\tinitTileImg();\n\tinitCoverImg();\n\n\tapp.startBtn.disabled = true;\n\tapp.endBtn.disabled = false;\n\n\tfor(var i = 0; i < app.coverImgArr.length; i++){\n\t\taddEvent(app.coverImgArr[i], \"click\", tileClick);\n\t}\n}", "startGamePressed(self, event) {\n console.log(\"App.startGamePressed\");\n self.state = AppState.PLAYING;\n self.gameManager = new GameManager(self.sheet.currentBoard(), self);\n document.getElementById(\"board\").classList.remove(\"unplayable\"); // kell?\n document.getElementById(\"readyToPlay\").style.display = \"none\";\n document.getElementById(\"menu\").style.display = \"none\";\n document.getElementById(\"results\").style.display = \"none\";\n document.getElementById(\"game\").style.display = \"block\";\n document.getElementById(\"standing\").style.display = \"block\";\n document.getElementById(\"timeLeftPar\").style.display = \"block\";\n document.getElementById(\"timeIsUp\").style.display = \"none\";\n document.getElementById(\"stopButton\").style.display = \"block\";\n }", "function startGame(){\n\tgamePrompt(\"S.R.S.V: Press Enter to Start and to Continue\",intro);\n}", "function startGame() {\n hideStart();\n hideSaveScoreForm();\n resetFinalScore();\n clearCurrentQuestion();\n resetUserScore();\n displayCurrentQuestion();\n startTimer();\n}", "function startTheGame() {\n event.preventDefault();\n screenStart.style.display = 'none';\n board.style.display = 'block';\n player1.classList.add('active');\n}", "function startGame() {\n\tupdateGameState()\n\tmoveTetroDown()\n}", "function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}", "function startGame() {\n init();\n}", "function start()\r\n{\r\ninit();\r\ngame.start();\r\n}", "function startGame() {\n\t\ttheBoxes.innerText = turn;\n\t\twinner = null;\n\t}", "function handleButtonStartEvent(){\n\tif(SOUNDS_MODE){\n\t\taudioClick.play();\t\n\t}\n\t\n\t//buttonStart.image = IMAGE_PATH+'login/play_pressed.png';\n\t\n\tsigninTextField.value = signinTextField.value.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\tif(signinTextField.value != ''){\n\t\t\n\t\tsigninTextField.blur();\n\t\tsavePlayer(signinTextField.value, null,null);\n\t\tTi.API.info('signin.js: Player '+signinTextField.value+' enters game');\n\t\t\n\t\t//Build and show the Categories view\n\t\tmtbImport(\"categories.js\");\n\t\tbuildCategoriesView();\n\t\tviewCategories.animate({opacity:1, duration:400}, function(){\n\t\t\tdestroyPlayerLoginView();\n\t\t});\n\t\t\n\t} else {\n\t\talert('Πρέπει να επιλέξεις το όνομα σου.');\n\t}\n}", "function startGame() {\n\t\tvar game = document.getElementById(\"game-area\");\n\t\ttimeStart();\t\t\t\t\n\t}", "function startGame() {\n if(gameState.gameDifficulty === 'easy')\n {\n easyMode();\n } \n if(gameState.gameDifficulty ==='normal'){\n normalMode();\n }\n\n if(gameState.gameDifficulty ==='hard'){\n hardMode();\n }\n\n}", "function startGame() {\n myGameArea.start();\n}", "function startGame(playerCount) {\r\n\t\r\n\tGC.initalizeGame(playerCount);\r\n\t\r\n\tUI.setConsoleHTML(\"The game is ready to begin! There will be a total of \" + GC.playerCount + \" players.<br />Click to begin!\");\r\n\tUI.clearControls();\r\n\tUI.addControl(\"begin\",\"button\",\"Begin\",\"takeTurn()\");\r\n\t\r\n\tGC.drawPlayersOnBoard();\r\n}", "function startGame() {\n //hide the deal button\n hideDealButton();\n //show the player and dealer's card interface\n showCards();\n //deal the player's cards\n getPlayerCards();\n //after brief pause, show hit and stay buttons\n setTimeout(displayHitAndStayButtons, 2000);\n }", "function startGameButton() {\r\n\tif(table != undefined) {\r\n\t\ttable.startGame();\r\n\t}\r\n}", "function onStartGame(e) {\n\t\t// Reset Points and guesses and other variables\n\t\tcorrectMatches = 0;\n\t\ttotalPoints = 0;\n\t\tfirstGuess = true;\n\t\tconsecutiveGuesses = 0;\n\t\tuserInterface.score = totalPoints;\n\t\tfirstCard = null;\n\t\tsecondCard = null;\n\n\t\t// Play New Game Sound\n\t\tcreatejs.Sound.play('gameStartSound');\n\n\t\t// If the game isn't resetting\n\t\tif (currentState != gameState.resetting) {\n\t\t\t// If the game state is ready then add the cards to the stage\n\t\t\tif (currentState == gameState.ready) {\n\t\t\t\t//Show cards\n\t\t\t\tcards.forEach(card => {\n\t\t\t\t\tcard.addMe();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Remove the New game button\n\t\t\tuserInterface.hideNewGameBtn();\n\n\t\t\t//Add Restart Button\n\t\t\tuserInterface.showRestartBtn();\n\n\t\t\t// Remove click event on New Game Button\n\t\t\te.remove();\n\t\t}\n\n\t\t// Enable all the cards\n\t\tonEnableCards();\n\n\t\t// Add the event listener to restart button\n\t\tuserInterface._btnRestart.on('restartClicked', onResetGame);\n\n\t\t// Change current game state\n\t\tcurrentState = gameState.running;\n\t}", "function startGame() {\n $controls.addClass(\"hide\");\n $questionWrapper.removeClass(\"hide\");\n showQuestion(0, \"n\");\n points();\n}", "function startGame() {\n if(!presence.ballIsSpawned) {\n fill(start.color.c, start.color.saturation, start.color.brightness);\n stroke(start.color.c, start.color.saturation, start.color.brightness)\n if((windowWidth < 600) && (windowHeight < 600)) {\n textSize(20);\n text(\"PRESS ENTER TO START GAME\", windowWidth/4.2, windowHeight/2.5);\n textSize(15);\n text(\"(First to 7 Wins)\", windowWidth * 0.41, windowHeight * 0.47);\n }\n if((windowWidth > 601) && (windowHeight > 601)) {\n textSize(30)\n text(\"PRESS ENTER TO START GAME\", windowWidth * 0.35, windowHeight/2.5);\n textSize(20);\n text(\"(First to 7 Wins)\", start.textX + start.textX * 0.265, windowHeight * 0.44);\n }\n if(mode == 'single'){\n if((windowWidth > 601) && (windowHeight > 601)){\n text(\"Mode: \" + mode, windowWidth * 0.9, windowHeight * 0.08);\n textSize(18);\n text(\"USE ARROWS TO MOVE\", start.textX + start.textX * 0.2, windowHeight * 0.48);\n textSize(14);\n text(\"PRESS SHIFT FOR TWO PLAYER\", start.textX + start.textX * 0.2, windowHeight * 0.52);\n }\n if((windowWidth < 600) && (windowHeight < 600)){\n text(\"Mode: \" + mode, windowWidth * 0.8, windowHeight * 0.08);\n textSize(14);\n text(\"USE ARROWS TO MOVE\", start.textX + start.textX * 0.01, start.textY + start.textY * 0.04);\n textSize(12);\n text(\"PRESS SHIFT FOR TWO PLAYER\", windowWidth * 0.35, start.textY + start.textY * 0.16);\n defaultBallSpeed = 4;\n }\n }\n if(mode == 'two'){\n if((windowWidth > 601) && (windowHeight > 601)) {\n textSize(20);\n text(\"Mode: \" + mode, windowWidth * 0.9, windowHeight * 0.08)\n textSize(18);\n text(\"USE Q, A, P, L TO MOVE\", windowWidth * 0.43, windowHeight * 0.48);\n textSize(14);\n text(\"PRESS SHIFT FOR ONE PLAYER\", start.textX + start.textX * 0.2, windowHeight * 0.52);\n }\n }\n \n start.color.c += 1;\n if(start.color.c > 359) {\n start.color.c = 0;\n }\n }\n }", "function startGame() {\n gameScreen=1;\n}", "function startgame() {\t\r\n\tloadImages();\r\nsetupKeyboardListeners();\r\nmain();\r\n}", "function start() {\n\t\t\t$('.start').prop('disabled', true);\n\t\t\t$('.start').val('3');\n\n\t\t\tsetTimeout(function() {\n\t\t\t\t$('.start').val('2');\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$('.start').val('1');\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t$scope.$apply(function() {\n\t\t\t\t\t\t\tvm.gameStart = true;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinitialiseGame();\n\t\t\t\t\t}, 1000);\n\t\t\t\t}, 1000);\n\t\t\t}, 1000);\n\t\t}", "function gameStart() {\n\t//maybe add gameOverStatus\n\t//initial gameStatus\n\tmessageBoard.innerText = \"Game Start!\\n\" + \"Current Score: \" + counter + \" points\";\n\tcreateBoard();\n\tshuffleCards();\n}", "function startGame(index){\n\tgamePaused = false;\n\tmapStarted = true;\n}", "function startGame() {\n setTimeRemaining(starting_time)\n setShouldStart(true)\n setText(\"\")\n textboxRef.current.disabled = false\n textboxRef.current.focus()\n }", "function startGame(){\n \t\tGameJam.sound.play('start');\n \t\tGameJam.sound.play('run');\n\t\t\n\t\t// Put items in the map\n\t\titemsToObstacles(true);\n\n\t\t// Create the prisoner path\n\t\tGameJam.movePrisoner();\n\n\t\t// Reset items, we dont want the user to be able to drag and drop them\n \t\tGameJam.items = [];\n \t\t\n \t\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\n \t\t\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\n \t\t}\n\n\t\t// Reset prisoner speed\n\t\tGameJam.prisoner[0].sprite.speed = 5;\n\n\t\t// Reset game time\n\t\tGameJam.tileCounter = 0;\n\t\tGameJam.timer.className = 'show';\n\t\tdocument.getElementById('obstacles').className = 'hide';\n\t\tdocument.getElementById('slider').className = 'hide';\n\t\tdocument.getElementById('start-button-wrapper').className = 'hide';\n\n\t\t// Game has started\n\t\tGameJam.gameStarted = true;\n\n\t\tGameJam.gameEnded = false;\n\n\t\tdocument.getElementById('static-canvas').className = 'started';\n\n\t\tconsole.log('-- Game started');\n\t}", "function handleStart() {\n // create new game instance\n const game = new Game();\n\n // hide the form\n document.querySelector(\".form-container\").style.display = \"none\";\n\n // start the game\n game.start();\n\n // show the board\n document.querySelector(\".board-container\").style.display = \"flex\";\n}", "function startGame(){\n countdown();\n question();\n solution();\n }", "startGame() {\n this.setState({isStartGameclicked: true});\n }", "function start() {\n return {\n type: GameActionTypes.START,\n args: null\n }\n}", "function start() {\n\tclear();\n\tc = new GameManager();\n\tc.startGame();\t\n}", "function initiateGame(){\n\n\t$( document ).ready( function() {\n\t\t\n\t\t$( '#display' ).html('<button>' + 'start' + '</button>');\n\t\t$( '#display' ).attr('start', 'start');\n\t\t$( '#display' ).on( 'click', function() {\n\t\t\trenderGame();\n\t\t})\n\t\t\n\t});\n}", "start() {\n if (this.state == STATES.WAITING || this.state == STATES.GAMEOVER) {\n var d = new Date();\n var t = d.getTime();\n this.gameStart = t;\n this.gameStart2 = t;\n this.gameMode = this.scene.gameMode;\n this.gameLevel = this.scene.gameLevel;\n this.makeRequest(\"initialBoard\", this.verifyTabReply);\n this.timeleft = TIME_LEFT;\n this.SaveForMovie();\n // if (this.state == STATES.DISPLAYED) {\n this.state = STATES.READY_TO_PICK_PIECE;\n //}\n }\n }", "function gameStart(){\n if(start == \"true\"){\n textFont()\n fill(250, 250, 60);\n rect(225, 300, 350, 200);\n fill(200, 100, 50);\n rect(240, 315, 320, 170)\n fill(150, 200, 70);\n textAlign(CENTER);\n textSize(100);\n text(\"Snake\", 400, 425)\n }\n}", "function playButtonListener(){\r\n\t\t\tconsole.log(\"play button hit\");\r\n\t\t\tgame.state.start(\"Game\");\r\n\t\t}", "function start() {\n room.sendToPeers(GAME_START);\n onStart();\n}", "function startGame() {\n// Hide start\n start.style.display = \"none\";\n\n// On start, display first question\n displayQuestion();\n}", "function startGame() {\n //init the game\n gWorld = new gameWorld(6);\n gWorld.w = cvs.width;\n gWorld.h = cvs.height;\n \n gWorld.state = 'RUNNING';\n gWorld.addObject(makeGround(gWorld.w, gWorld.h));\n gWorld.addObject(makeCanopy(gWorld.w));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h,true));\n gWorld.addObject(makePlayer());\n \n startBox.active = false;\n pauseBtn.active = true;\n soundBtn.active = true;\n touchRightBtn.active = true;\n touchLeftBtn.active = true;\n replayBtn.active = false;\n \n gameLoop();\n }", "function startButton() {\r\n\tif (letters.length == 0){\r\n\t\trunGame();\r\n\t\t\r\n\t}\r\n\telse{\r\n\t\tstopGame();\r\n\t}\r\n}", "function startGame() {\n logger.log('Staring a new game');\n // Hide any dialog that might have started this game\n $('.modal').modal('hide');\n\n // Reset the board\n board.init();\n\n // Init the scores\n level = 1;\n score = 0;\n totalShapesDropped = 1;\n delay = 500; // 1/2 sec\n updateUserProgress();\n\n // Init the shapes\n FallingShape = previewShape;\n previewShape = dropNewShape();\n\n // Reset game state\n drawPreview();\n pauseDetected = false;\n isPaused = false;\n isGameStarted = true;\n isStopped = false;\n\n // Update the button if this is the first game\n $('#newGameButton').text(\"New Game\");\n\n // Start dropping blocks\n advance();\n }", "startGame() {\r\n // Hide start screen overlay\r\n document.getElementById('overlay').style.display = 'none';\r\n\r\n // get a random phrase and set activePhrase property\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhrasetoDisplay();\r\n }", "function gameStart() {\r\n newgame.disabled = true;\r\n holdHand.disabled = false;\r\n hit.disabled = false;\r\n }", "function startGame() {\n gameState.active = true;\n resetBoard();\n gameState.resetBoard();\n\n var activePlayer = rollForTurn();\n \n // Game has started: enable/disable control buttons accordingly.\n btnDisable(document.getElementById('btnStart'));\n btnEnable(document.getElementById('btnStop'));\n\n var showPlayer = document.getElementById('showPlayer');\n showPlayer.innerHTML = activePlayer;\n showPlayer.style.color = (activePlayer === \"Player 1\") ? \"blue\" : \"red\";\n // The above line, doing anything more would require a pretty sizeable refactor.\n // I guess I could name \"Player 1\" with a constant.\n}", "start(){\n if(gameState===0){\n player = new Player();\n player.getCount();\n\n form = new Form()\n form.display();\n }\n }", "function startGame() {\n \n $(\"#start-button\").html(\"<button id='btn-style'>Start Game</button>\");\n $(\"#start-button\").on('click', function () {\n $(\"#start-button\").remove();\n startTimer();\n getQuestion();\n });\n }", "function startGame() {\n startButton.classList.add(\"hide-content\");\n resetButton.classList.remove(\"hide-content\");\n $(\"#turnsTaken\").text(\"0\");\n originalColor();\n beginGame();\n}", "function start () {\n room.sendToPeers(GAME_START)\n onStart()\n}", "function mouseClicked() {\n if (start.buttonEnabled) {\n if (start.clicked()) {\n console.log(\"Start Clicked\");\n turbo.shouldMove = true;\n start.visible = false;\n start.buttonEnabled = false;\n gameState = \"Running\";\n }\n }\n\n if (reset.buttonEnabled) {\n if (reset.clicked()) {\n console.log(\"Reset Clicked\");\n gameState = \"Ready\";\n reset.visible = false;\n reset.buttonEnabled = false;\n }\n }\n}", "function startGame() {\r\n\r\n\tBrowser.loadUrl(CLICKERHEROES_URL);\r\n\tBrowser.finishLoading();\r\n\r\n\tHelper.sleep(5);\r\n\r\n\tfindAndClick(PLAY_PNG);\r\n\r\n\tHelper.log(\"Search Close Button...\");\r\n\tHelper.sleep(5);\r\n\r\n\t//Try to match close button\r\n\tfindAndClick(CLOSE_PNG);\r\n}", "function continueGame(event)\n {\n toGame();\n }", "function gameNotStarted(){\n\talert(\"Press 'Start Game' to play!\");\n}", "function startGame(){\n initialiseGame();\n}", "function startGame(mapName = 'galaxy'){\n toggleMenu(currentMenu);\n if (showStats)\n $('#statsOutput').show();\n $('#ammoBarsContainer').show();\n scene.stopTheme();\n scene.createBackground(mapName);\n if (firstTime) {\n firstTime = false;\n createGUI(true);\n render();\n } else {\n requestAnimationFrame(render);\n }\n}", "start()\r\n {\r\n if(gameState===0)\r\n {\r\n player= new Player();\r\n player.getCount();\r\n\r\n form= new Form();\r\n form.display();\r\n }\r\n }", "function startGame(){\n\t\tfor (var i=1; i<=9; i=i+1){\n\t\t\tclearBox(i);\n\t\t}\n\t\tdocument.turn = \"X\";\n\t\tif (Math.random()<0.5) {\n\t\t\tdocument.turn = \"O\";\n\t\t}\n\t\tdocument.winner = null;\n\t// This uses the \"setMessage\" function below in order to update the message with the contents from this function\n\t\tsetMessage(document.turn + \" gets to start.\");\n\t}", "function gameStart() {\n $(\"button\").on(\"click\", function () {\n gameOn = false;\n if (!gameOn) {\n $(\"#title\").remove()\n $(\"button\").remove()\n startQuestion()\n }\n })\n }", "start() { this.gameState = 'started'; }", "function start(){\n initializeBoard();\n playerTurn();\n }", "function actionOnClick () {\r\n game.state.start(\"nameSelectionMenu\");\r\n}" ]
[ "0.7925207", "0.7908294", "0.78537375", "0.762998", "0.76202166", "0.76115394", "0.75777036", "0.756493", "0.7529975", "0.7495164", "0.74581033", "0.7443494", "0.7438885", "0.74356896", "0.7435168", "0.7434496", "0.7433483", "0.7399481", "0.7386848", "0.7381565", "0.73702115", "0.7352789", "0.7346486", "0.73387724", "0.7313207", "0.7296341", "0.72933745", "0.72932404", "0.7286282", "0.72826856", "0.7272711", "0.7271916", "0.7269702", "0.72691894", "0.72688866", "0.72646785", "0.72393113", "0.7235612", "0.72294974", "0.72052693", "0.7199979", "0.71973574", "0.71789974", "0.717494", "0.7161559", "0.715767", "0.7157315", "0.7156809", "0.7142191", "0.71402174", "0.7126616", "0.71194917", "0.71031755", "0.7102145", "0.7099508", "0.7091779", "0.7091613", "0.7090015", "0.70853335", "0.7083228", "0.70781106", "0.7077494", "0.70753807", "0.7069985", "0.7069276", "0.70628417", "0.70608366", "0.7053285", "0.7042657", "0.70371217", "0.70349777", "0.7029427", "0.70152634", "0.70143723", "0.70081455", "0.7006958", "0.69938225", "0.69931877", "0.6986989", "0.69857115", "0.69761276", "0.69745815", "0.6972916", "0.69693244", "0.69686687", "0.69626033", "0.6961723", "0.6960428", "0.6959093", "0.69559246", "0.6948391", "0.69432425", "0.69338894", "0.69336945", "0.6931371", "0.69278675", "0.69187903", "0.69186765", "0.6913864", "0.69032806", "0.69025326" ]
0.0
-1
timer beggins 30 seconds countdown will it be a function?
function timer(){ countStartGame -= 1; console.log(countStartGame); if (countStartGame === 0){ console.log ("time's up"); //need to clear interval - add stop } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTime() {\n timer = timer + 30;\n}", "function start30SecTimer(){\r\n\t\tconsole.log( new Date());\r\n\t\t//setTimeout(function(){ console.log( new Date()) }, 30000);\r\n\t\tconsole.log(\"START TIMER!!!!!!\");\r\n\t\tfor(var x = 6; x>1; x--){\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\t//sendOutCount(x);\r\n\t\t\t\tDom.emit('count',data={count:count});\r\n\t\t\t\tcount++;\r\n\t\t\t\t}, 2000);\r\n\t\t\t\r\n\t\t}\r\n\t\t//it just does console log and then comes back and do what it has left to do\r\n\t\t//console.log( new Date());\r\n\t}", "function timerFunc() {\n seconds--;\n $(\"#timer\").text(\"Time left: \" + seconds);\n if (seconds === 0) {\n wrong++;\n clearTimer();\n shortTimer(false);\n };\n }", "function timerWrapper () {}", "function zähler (){\r\n\tnew countdown(1200, 'counter'); //alle Zeiten werden in Sekunden angegeben, rechnet selbst auf Minuten und Stunden um\r\n}", "function startTimer(){\n \n \n setTimeout(\"countdown()\",1000);\n \n }", "function conteo1(tiempo){setTimeout(function(){\r\n tiempo-=1;\r\n segundos=tiempo%60;\r\n minutos=(tiempo-(tiempo%60))/60;\r\n if (segundos<10) {\r\n $(\"#timer\").html(\"0\"+minutos+\":0\"+segundos);\r\n }else {\r\n $(\"#timer\").html(\"0\"+minutos+\":\"+segundos);\r\n }\r\n if ($(\"#timer\").html()==\"00:00\") {\r\n fin_del_juego()\r\n return\r\n }\r\n conteo2(tiempo)\r\n },1000);\r\n }", "function mytimerFn(){\n if(startStopCounter>0){\n second--; \n if(second<10){\n // show two digit for seconds\n elecountDownTimer.innerHTML=\"<p> Time Remaining 0\"+minute+\":0 \"+second+\" </p>\";\n }else{\n elecountDownTimer.innerHTML=\"<p> Time Remaining 0\"+minute+\":\"+second+\" </p>\";\n }\n // when second reaches 59 countdown minute by 1, recount seconds from 60;\n if(second===0&&minute!=0){\n second=60;\n minute--;\n } \n \n if(second===0){\n // clearInterval(setIntervalVar);\n startStopCounter=0;\n testCompletedFn();\n\n }\n }\n }", "function countdown() {\r\n setTimeout('Decrement()', 60);\r\n }", "function countdown() { \n setTimeout('Decrement()', 60); \n }", "ontimeout() {}", "function timer(){\n let minutes = 1;\n let seconds = 30;\n setInterval(function(){\n seconds--;\n if(seconds < 0 && minutes == 1){\n seconds = 59;\n minutes = 0;\n }\n if(seconds < 10){\n seconds = \"0\"+ seconds;\n }\n $('#timerDisplay').text(minutes + \":\" + seconds);\n\n if(minutes == 0 && seconds == 00){\n looseWindow()\n }\n },1000)\n }", "function removeTime() {\n timer = timer > 30 ? timer - 30 : 0;\n}", "function cleartimeout_example() {\r\n var start_time = new Date();\r\n sys.puts(\"\\nStarting 30 second timer and stopping it immediately without triggering callback\");\r\n var timeout = setTimeout(function() {\r\n var end_time = new Date();\r\n var difference = end_time.getTime() - start_time.getTime();\r\n sys.puts(\"Stopped timer after \" + Math.round(difference/1000) + \" seconds\");\r\n }, 30000);\r\n clearTimeout(timeout);\r\n interval_example();\r\n}", "function timerCountDownTrigger() {\n\n timerMinutes = parseInt($clockTimer.text());\n\n return window.setInterval(function() {\n displayTimeOnClock(timerMinutes, timerSeconds);\n timerSeconds -= 1;\n \n // subtrack minute when seconds hit 0\n if (timerSeconds < 00) { \n // timerSeconds = 59;\n timerMinutes -= 1;\n timerSeconds = 3;\n }\n switchBetweenSessionAndBreak();\n }, 1000);\n } // end timerCountDownTrigger", "function countdownTimer() {\n // reduce countdown timer by 1 second\n timer--;\n if (timer === 0) {\n // timer expired\n endTest();\n } else if (timer < 10) {\n // prefix times less than ten seconds with 0\n // update timer on web page\n $('#timer').text('0' + timer);\n } else {\n // update timer on web page\n $('#timer').text(timer);\n }\n }", "function timer() {\n timeRemaining--;\n if(timeRemaining <= 0) {\n me.callback();\n }\n me.setState({timeRemaining: timeRemaining});\n }", "function countdown() {\t\t\t\n\t\t\tsec--;\n\t\t\t\t\t\t\n\t\t\tif(min===0 && sec===0) { // use 'min < 0' for 0:00, 'min===0 && sec===0' for 0:01\t\t\t\t\n\t\t\t\tself.noCrew();\n\t\t\t\t$(timerID).addClass(\"fade-grey\");\n\t\t\t\tself.stopCountdown();\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tself.done = true;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tself.resetTime();\n\t\t\t\ttimerDone();\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\telse if(sec === 0) {\n\t\t\t\t$(timerID).html(min+\":0\"+sec)\t\t\t\t\t\t\t\n\t\t\t\tmin--;\n\t\t\t\tsec = 60;\t\t\t\n\t\t\t}\n\t\t\telse if(sec > 9) {\n\t\t\t\t$(timerID).html(min+\":\"+sec);\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(timerID).html(min+\":0\"+sec);\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\tif(timerID != \"#deck-timer\") {\n\t\t\t\t//Make timer red when timer is 1 min or less\n\t\t\t\tif(min === 0) {\n\t\t\t\t\t$(timerID).addClass(\"red-timer\");\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\t$(timerID).removeClass(\"red-timer\");\n\t\t\t\t}\n\t\t\t\t//Flash red at halfway point\t\t\t\t\n\t\t\t\tif(minute > 2) {\n\t\t\t\t\tif(minute%2 != 0 && sec === 30 && min === Math.floor(minute/2) || minute%2 === 0 && sec === 60 && min === minute/2-1) {\n\t\t\t\t\t\t$(timerID).addClass(\"fade-red\");\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}//countdown() end", "function runTimer() {\n clearInterval(intervalId);\n intervalId = setInterval(decrement, 1000);\n//prevent negative counter\n//enter time again \n timerNumber = 30;\n }", "function Timer() {}", "function timer(ctr) {\n ctr = typeof ctr !== 'undefined';\n statusGood();\n worldSaved();\n setInterval(function() {\n lightSequence(3);\n if (ctr > 0) {\n timer(ctr - 1);\n }\n }, 13000);\n}", "function countdownTimer() {\n console.log(\"Here is a countdown timer\")\n}", "function onTimer(){\r\n\tif (turn == OPPONENT) return;\r\n\tupdate_handler({time:timer});\r\n\ttimer--;\r\n\tif (timer < 0){\r\n\t\tmissStep();\r\n }\r\n}", "function startTimer(_timer){\n _timer.start({\n countdown: true,\n startValues: {\n seconds: 30\n }\n });\n }", "function logic(){\n //adds one second to clock\n\n\n\n if(add !== 0 && add >= 10 && add < 60 && timer25 !== 0){\n $('#timer').html(timer25 + ':' +add);\n add = add - 1;\n } else if(add == 00 && timer25 !== 0){\n add = 59;\n timer25 = timer25 -1;\n $('#timer').html(timer25 + ':' +add);\n } else if(add !== 0 && add > 0 && add < 10 && timer25 !== 0){\n $('#timer').html(timer25 + ':0' +add);\n add = add - 1;\n }\n // everytime logic is called, set timeout delay's console - log by one second.\n t = setTimeout(logic, 1000);\n console.log(timer25);\n\n }", "function testTimer() {\n toast({text: \"Testing Timer\", duration: 3, type: \"success\"});\n\n var time = 46;\n setInterval(() => {\n\n time -= 1;\n NetworkTables.putValue(\"/robot/time\", time);\n\n if (time < -5) time = 126;\n\n }, 1000);\n}", "function cleartimeout_example() {\n\tvar start_time = new Date();\n\tsys.puts('\\nStart 30s timeout and stop it instandly whitout call');\n\tvar timeout = setTimeout(function() {\n\t\tvar end_time = new Date();\n\t\tvar difference = end_time.getTime() - start_time.getTime();\n\t\tsys.puts('Stop the timer after' + Math.round(difference / 1000) + ' seconds.');\n\t}, 30000);\n\tclearTimeout(timeout);\n\tinterval_example();\n}", "function startTimer() {\n timer = setInterval(decrementTimer, 1000);\n remainingTime = 61;\n }", "function timer() {\n\t\tclock = setInterval(countDown, 1000);\n\t\tfunction countDown() {\n\t\t\tif (time < 1) {\n\t\t\t\tclearInterval(clock);\n\t\t\t\tuserTimeout();\n\t\t\t}\n\t\t\tif (time > 0) {\n\t\t\t\ttime--;\n\t\t\t}\n\t\t\t$(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n\t\t}\n\t}", "function timer() {\n\t\tclock = setInterval(countDown, 1000);\n\t\tfunction countDown() {\n\t\t\tif (time < 1) {\n\t\t\t\tclearInterval(clock);\n\t\t\t\tuserTimeout();\n\t\t\t}\n\t\t\tif (time > 0) {\n\t\t\t\ttime--;\n\t\t\t}\n\t\t\t$(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n\t\t}\n\t}", "function timer() {\n\t\tclock = setInterval(countDown, 1000);\n\t\tfunction countDown() {\n\t\t\tif (time < 1) {\n\t\t\t\tclearInterval(clock);\n\t\t\t\tuserTimeout();\n\t\t\t}\n\t\t\tif (time > 0) {\n\t\t\t\ttime--;\n\t\t\t}\n\t\t\t$(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n\t\t}\n\t}", "function countdown(){\n \n \n $(\"#timer\").html(timer);\n //Sets a delay of one second before the timer starts\n // time = setInterval(showCountdown, 1000);\n // Shows the countdown function. IT WORKS.\n showCountdown();\n \n }", "function startIdleTimer() { \n \n /* Increment the \n timer seconds */ \n valido = document.getElementById(\"secs\");\n\n if(currSeconds < 30 && currSeconds > 9){\n valido.innerText = \"00:\"+(currSeconds); \n }else{\n if(currSeconds <= 0){\n valido.innerText =\"00:00\"; \n \n }else{\n if(currSeconds == 30){\n valido.innerText =\"00:30\"; \n \n }else{\n valido.innerText =\"00:0\"+(currSeconds); \n }\n \n }\n\n } \n currSeconds--; \n \n \n /* Display the timer text */ \n\n }", "function resetTimer() {\n countdownTimer = 30;\n $(\"#countdownTimer\").text(\"Time Left: 00:30\");\n }", "function counterFunc() {\n //check if seconds has reached zero to enable alarm sound\n if (timer < 0) {\n clearInterval(countDown); //stop the setInterval method\n playAlarm();\n } else {\n //convert the seconds to time and extract the relevant portion\n const timerVal = new Date(timer * 1000).toISOString().substr(14, 5); //.substr(11,8) to include hr\n counter.innerText = `Time Remaining: ${timerVal}`;\n timer -= 1; //decrement the seconds counter by one\n }\n }", "startTimer() {\n if (this.onStartCallback) {\n this.onStartCallback(this.timeRemaining);\n }\n\n this.tickWaktu();\n this.intervalId = setInterval(() => {\n this.tickWaktu();\n }, 20);\n }", "function timer() {\n clock = setInterval(countDown, 1000);\n function countDown() {\n if (time < 1) {\n clearInterval(clock);\n userTimeout();\n }\n if (time > 0) {\n time--;\n }\n $(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n }\n }", "function timer(){\n clock = setInterval(countDown,1000);\n function countDown() {\n if( time < 1) {\n clearInterval(clock);\n userTimeout();\n \n }\n if (time > 0) {\n time --;\n }\n \n\n $(\"#timer\").html(\"<stong>\" + time + \"</stong>\");\n }\n\t\t\t\n\t}", "function Timer(){\n}", "function timer(arg){\n var nIntervId;\n var count = arg;\n\n function changeText() {\n nIntervId = setInterval(updateText, 1000);\n }\n\n function updateText() {\n if (count > -1) {\n $('#time').html(count);\n count--;\n } else {\n stopTimer();\n outOfTime();\n }\n }\n\n function stopTimer() {\n clearInterval(nIntervId);\n }\n // changeText();\n\n return {\n startTimer:changeText,\n stopTimer:stopTimer\n };\n }", "function timer() {\n$(\"timeLeft\").text(\"Time Remaning\" + counter)\ncounter = counter -1\n$(\"#timeLeft\").text(\"Time Remaning:\" + counter)\nif (counter === 0) {\n outOfTime()\n\n\n}\n}", "function startTimer() {\n timerInterval = setInterval(function() {\n timeRemaining--\n $timer.text(timeRemaining)\n if (timeRemaining === 0) {\n endQuiz()\n }\n }, 1000)\n }", "function timer() {\n\t count = count - 1;\n\t if (count == -1) {\n\t clearInterval(counter);\n\t return;\n\t }\n\t var seconds = count % 60;\n\t var minutes = Math.floor(count / 60);\n\t var hours = Math.floor(minutes / 60);\n\t minutes %= 60;\n\t hours %= 60;\n\t document.getElementById(\"timer\").innerHTML = hours + \":\" + minutes + \":\" + seconds + \" seconds left!\"; // watch for spelling\n\t}", "function timerStart(){\n\t\n\t\t\n\t}", "function timer(seconds) {\n // clear any exixsting timer before starting \n\n clearInterval(countdown)\n\n // find out when timer started\n\n const now = Date.now(); // This is a method to get current time stamp\n\n // time when clock stops;\n\n const then = now + seconds * 1000; \n\n//......................setInterval.........................//\n\ncountdown = setInterval(() => {\n\n \n\n // code out how much time left on timer to end and divide by thousand to convert it in miliseconds\n\n const secondsLeft = Math.round((then - Date.now()) / 1000);\n\n // Put a conditional to stop the timer when we ran out of time by using clearInterval\n \n if (secondsLeft < 0) {\n clearInterval(countdown);\n return;\n } \n displayTimeLeft(secondsLeft);\n\n},1000);\n\n}", "startCountdown() {\n return setInterval(() => {\n this.timeRemaining--;\n this.timer.innerText = this.timeRemaining;\n if(this.timeRemaining === 0)\n this.gameOver();\n }, 1000);\n }", "function GameTimer(game) {\n\tthis.seconds = game.timelimit;\n\n\tthis.secondPassed = function() {\n\t\tif (this.seconds === 0 && !game.gameOver) {\n\t\t\tgame.endGame();\n\t\t} else if (!game.gameOver) {\n\t\t\tthis.seconds--;\n\t\t\t$(\"#timer_num\").html(this.seconds);\n\t\t\t}\n\t} \n \n\tvar countdownTimer = setInterval('t.secondPassed()', 1000);\n}", "function countDown() {\n seconds -= 1;\n\n if (seconds < 0 && minutes > 0) {\n seconds += 60;\n minutes -= 1;\n }\n else if (seconds === -1 && minutes === 0) {\n // Timer is done. Call relevant functions\n stopTimer();\n PEvents.timerDone(currentTimerType);\n loadTimer();\n }\n \n render();\n }", "function countdown() {\n runtime();\n}", "function timer() {\r\n minuteCount = Math.floor(totalTime/60);\r\n secondCount = totalTime % 60;\r\n totalTime --;\r\n timerDisplay.innerHTML = \"Time left: \" + minuteCount + \" minutes \" + secondCount + \" seconds...\";\r\n if (totalTime === -1){\r\n \tclearInterval(timerIntv);\r\n\t}\r\n}", "function startTimer() {\n counter = 15;\n intervalId = setInterval(decrement, 1000);\n }", "function timer() {\n time = 10;\n broadcastChannel.publish('timeUpdate', {\n 'time': time,\n 'timeout': 0\n });\n clock = setInterval(countdown, 1000);\n function countdown() {\n if (time > 1) {\n broadcastChannel.publish('timeUpdate', {\n 'time': time,\n 'timeout': 0\n });\n time--;\n } else {\n clearInterval(clock);\n broadcastChannel.publish('timeUpdate', {\n 'time': time,\n 'timeout': 1\n });\n publishCorrectAnswer(index)\n };\n };\n}", "function timer(reset){\n\tif(intervalID){clearInterval(intervalID);}\n\tsecondsPass=0;\n\tdistance=0;\n\tintervalID = setInterval(function(){\n\t\tif(reset===0){\n\t\t\tsecondsPass++;\n\t\t\tdistance = timeLimit - secondsPass;\n\t\t\tmins = Math.floor(distance/60);\n\t\t\tseconds=distance-(mins*60);\n\t\t\t$('.clock').text(mins+\":\"+seconds);\n\t\t\tif(distance===0 && solved === false){\n\t\t\t\treset=-1;\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}\n\t},1000);\n}", "function clear_timeout(){\n\tvar start_time=new Date();\n\tsys.puts('se inicializa timer de 30s y lo detine de inmediato sin disparar una llamada');\n\tvar timeout= setTimeout(function(){\n\t\tvar end_time = new Date();\n\t\tvar diff= end_time.getTime() - start_time.getTime();\n\t\tsys.puts('tiempo detenido despues de' + Math.round(diff/1000)+' segundos');\n\n\n\t},30000);\n\t \n\tclearTimeout(timeout);\n\t \n\tinterval_ejemplo();\n}", "function timeoutTimer() {\n\tTIMEOUT_COUNTER--;\n\tif(TIMEOUT_COUNTER < 0) {\n\t\tclearInterval(TIMEOUT_TIMER);\n\t\tdisableButtons(false);\n\t\tshowFouls(true);\n\n\t\treturn;\n\t}\n\n\tsetTimeoutTimer(TIMEOUT_COUNTER);\n}", "function countdown(callback) {\n window.setTimeout(callback)\n}", "function startTimer() {\n // set timeout to 31 seconds so display begins with 30 seconds\n // because first display comes after initial interval of 1 sec\n var timeout = 31;\n function run() {\n counter = setInterval(decrement, 1000);\n }\n function decrement() {\n timeout--;\n // $(\"#timer\").show();\n $(\"#timerDiv\").html(\"<h2>Time Remaining: \" + timeout + \"</h2>\");\n \n if (timeout == 0) {\n // if time runs out, stop the timer, display time's up and ...\n $(\"#timerDiv\").html(\"&nbsp;\");\n clearInterval(counter);\n // ... and also run the timesUp function\n timesUp();\n }\n }\n run();\n }", "function answerTimer(number1) {\n intervalId = setInterval(function countDown() {\n $('#time-left').text(number1);\n number1 --;\n if (number1 === 0) {\n stopTimer();\n }; \n }, 1000);\n }", "function timer() {\r\n time += 1;\r\n timeoutID = setTimeout(timer, 1000);\r\n if (!(time % 10)) wait -= 10;\r\n}", "function countdownTimer() {\r\n\r\n\t\ttimerBar = timerBar-1;\r\n\r\n\t}", "function startTime(){\ndocument.getElementById('compteur').innerHTML =i+\" s\";\n \ni--;\ntemps=setTimeout(startTime, 1000);\t\nif (i<0) {\nclearTimeout(temps);\t\n}\nelse if (i<=30) {\n\tvar cp=document.getElementById('compteur');\ncp.style.color=\"red\";\n}\n\n\n}", "function inc_timer(){\n timer++;\n}", "function countdown() {\n\tcount = 20;\n\tcounter = setInterval(timer, 1000);\n\tfunction timer() {\n\t\tcount--;\n\t\tif (count === 0) {\n\t\t\t// Counter ended, stop timer and move on to the next question\n\t\t\tclearInterval(counter);\n\t\t\tgetNewQuestion();\n\t\t\treturn;\n\t\t}\n\t\t// Dispay the number of seconds\t\n\t\t$(\"#timer\").text(count);\n\t}\n}", "startCountdown() {\n return setInterval(() => {\n this.timeRemaining--;\n this.timer.innerText = this.timeRemaining;\n if(this.timeRemaining === 0)\n this.gameOver();\n }, 1000);\n }", "function countdown() {\n \n \n if (timeLeft == -1) {\n clearTimeout(timerId);\n \n } else {\n $(\"#timer\").text(timeLeft + ' seconds remaining');\n timeLeft--;\n }\n }", "function timer (seconds){ //counts time, takes seconds\n let remainTime = Date.now() + (seconds * 1000);\n displayTimeLeft(seconds);\n\n intervalTimer = setInterval(function(){\n timeLeft = Math.round((remainTime - Date.now()) / 1000);\n if(timeLeft < 0){\n clearInterval(intervalTimer);\n stopTimer();\n return ;\n }\n displayTimeLeft(timeLeft);\n }, 1000);\n}", "function timer() {\n var seconds = 30;\n var timer = document.getElementById(\"timer\");\n timer.innerHTML = \"<i class='fas fa-hourglass-start ml-2'></i> Temps restant : \" + seconds + \" s\";\n setInterval(function(){\n if(seconds >= 1) {\n seconds --;\n timer.innerHTML = \"<i class='fas fa-hourglass-start ml-2'></i> Temps restant : \" + seconds + \" s\";\n }\n else {\n restartGame(false);\n }\n }, 1000);\n}", "function howManySecs(){\n seconds--;\n $('#timer').html('<h3>You have ' + seconds + ' seconds left </h3>');\n if (seconds < 1){\n clearInterval(clock);\n isAnswered = false;\n whatIsTheAns();\n }\n}", "function onTimer(e) \n{\n\tif (e == \"clock\") \n\t{\n\t\tif (timerRunning) \n\t\t{\n\t\t\tdecreaseSecond();\n\t\t\tscene.setTimer(e, 1);\n\t\t}\n\t}\n}", "function countdown(){\n seconds = 20;\n $(\"#timeLeft\").html(\"00:\" + seconds);\n answered = true;\n //Sets a delay of one second before the timer starts\n time = setInterval(showCountdown, 1000);\n }", "function timer()\r\n {\r\n console.log(\"running...\");\r\n }", "function countDown() {\n setTimeout('Decrement()', 60);\n }", "function timer() {\n \n displaySec = seconds;\n displayMin = minutes;\n \n displayTimer();\n\n // When seconds reach zero, but there are minutes left\n if (seconds === 0 && minutes > 0) {\n decMinute();\n }\n // When minutes and seconds reach zero\n if (seconds === 0 && minutes === 0) {\n addLap();\n }\n \n // Decrease 1 second\n seconds--; \n}", "timer() {\n\t\tlet minutes = 20;\n\t\tlet minInMs = minutes * 60 * 1000;\n\n\t\tlet chrono = setInterval(() => {\n\n\t\t\tlet time = Date.now() - Number(sessionStorage.getItem(\"count\"));\n\n\t\t\tlet timeRemain = minInMs - time;\n\n\t\t\tlet minuteRemain = Math.floor(timeRemain / 1000 / 60)\n\t\t\tlet secondsRemain = Math.floor(timeRemain / 1000 % 60);\n\n\t\t\tif (String(secondsRemain).length === 1) {\n\t\t\t\tsecondsRemain = \"0\" + secondsRemain;\n\t\t\t}\n\t\t\tif (time < minInMs) {\n\t\t\t\t$(\"#time\").text(minuteRemain + \"min \" + secondsRemain + \"s\");\n\t\t\t} else {\n\t\t\t\tclearInterval(chrono);\n\t\t\t\tsessionStorage.clear();\n\t\t\t\t$(\"#booking-details\").hide();\n\t\t\t}\n\t\t}, 1000);\n\t}", "function timer() {\n if (timerState.style.zIndex == \"1\") {\n count -= 1;\n if (count === 0) {\n alertSound.play();\n clearInterval(counter);\n var breakCounter = setInterval(breakTimer);\n }\n timerState.innerHTML = count;\n if (Math.floor(count / 60) > 10) {\n if (count % 60 >= 10) {\n timerState.innerHTML = Math.floor(count / 60) + \":\" + count % 60;\n } else {\n timerState.innerHTML =\n Math.floor(count / 60) + \":\" + \"0\" + count % 60;\n }\n } else {\n if (count % 60 >= 10) {\n timerState.innerHTML =\n \"0\" + Math.floor(count / 60) + \":\" + count % 60;\n } else {\n timerState.innerHTML =\n \"0\" + Math.floor(count / 60) + \":\" + \"0\" + count % 60;\n }\n }\n\n // Format break timer to minutes and seconds\n function breakTimer() {}\n } else {\n clearInterval(counter);\n }\n }", "function countdownTimer() {\n return setInterval(() => {\n timeLeft--;\n timer.innerText = timeLeft;\n if (timeLeft == 0)\n tryAgain();\n },1000);\n}", "function timecounting() {\r\n myTime = setInterval(() => {\r\n time += 1\r\n document.getElementById('timecount').innerHTML = \"Time's remaining: \" + time\r\n if (time == 30){\r\n alert(\"Times up! Loser\");\r\n reset();\r\n }\r\n }, 1000)// every 1 second, it will add 1 into time variable (computer use millisecond so 1000 is 1 second)\r\n}", "function timerClick() {\n\n \n\n if (timer === null) {\n timer = setInterval(countdown, 1000);\n } else {\n clearInterval(timer);\n timer = null;\n }\n}", "function timerFunction() {\n\t$(\"#timer\").text(timeRemaining);\n\tif(timeRemaining > 0) {\n\ttimeRemaining-=1;\n\t} else {\n\t\tclearInterval(timer)\n\t\tindex = index + 1;\n\t\tsetQuestion()\n\t};\n}", "function timer() {\n \n var timeLeft = 75;\n var timeInterval = setInterval(function () {\n countdown.text(\"Time: \" + timeLeft );\n\n if (timeLeft > 0) {\n timeLeft--;\n }\n\n }, 1000);\n}", "function timerCountdown() {\n setInterval(function () {\n if (timerValue > 0) {\n timerValue--;\n }\n }, 1000);\n}", "function timer(){\n\tif(!start){\n\t\ttime+=1\n\t\tminutes = (Math.floor(time/60) < 10) ? '0' + Math.floor(time/60).toString() : Math.floor(time/60).toString()\n \tseconds = (time % 60 < 10) ? '0' + (time % 60).toString() : (time % 60).toString();\n\t}\n\t\n\t}", "function countdown() {\n // timeRemaining is incremented down\n timeRemaining --;\n\n // If time runs out, runs gameOver()\n if (timeRemaining <= 0) {\n gameOver();\n }\n\n // Updates the timer element\n timer.text(timeRemaining);\n }", "function troll(elapsed){\n\n}", "function timer() {\n footballCrowd();\n timerId = setInterval(() => {\n time--;\n $timer.html(time);\n\n if(time === 0) {\n restart();\n lastPage();\n }\n }, 1000);\n highlightTiles();\n }", "function timerDeduct(){\n (secondsLeft-=10);\n}", "function min_timer_callback(){\n if(second===59){\n second = 0;\n if(minute===59){\n minute = 0;\n hour++;\n } else{\n minute++;\n }\n } else {\n second++;\n }\n \n \n print('Time since started: ', hour,':', minute, ':', second);\n}", "eventTimer() {throw new Error('Must declare the function')}", "function startClock(){\n seconds++;\n}", "function count() {\n timer --;\n var theTime = timer;\n var t = timeConvert(theTime);\n \n $(\".theTimer\").html(t);\n \n if (timer <= 0) {\n timeOut();\n }\n}", "function gameTime() {\n\tvar ct = 30;\n\tvar igt = setInterval(function() {\n\t\tif(ct == 0) {\n\t\t\t// EndGame\n\t\t\ttime.innerHTML = ct;\n\t\t\tclearInterval(igt);\n\t\t\tendGame();\n\t\t} else {\n\t\t\ttime.innerHTML = ct;\n\t\t}\n\t\tct--;\n\t},1000);\n}", "function timerWrapper() {\n\tClock = setInterval( thirtySeconds, 1000 );\n\n\t//If the user doesn't answer when the timer runs out, run the timeOutLoss function & mark in unansweredTally.\n\tfunction thirtySeconds() {\n\t\tif ( counter === 0 ) {\n\t\t\tclearInterval( Clock );\n\t\t\ttimeOutLoss();\n\t\t}\n\t\t//If the number is greater than zero, keep counting down.\n\t\tif ( counter > 0 ) {\n\t\t\tcounter--;\n\t\t}\n\t\t$( \".timer\" )\n\t\t\t.html( counter );\n\t}\n}", "function startGameTimer(){\n var timer = setInterval(() => {\n console.log(GMvariables.timerSecs);\n $(\"#timer\").text(GMvariables.timerSecs);\n if(GMvariables.timerSecs == 0){\n $(\"#timer\").text(\"Go\");\n clearInterval(timer);\n setTimeout(() => {\n $(\"#timer\").css(\"display\", \"none\");\n reset();\n changePositionOfElement();\n headerUpdater();\n }, 1000);\n }\n GMvariables.timerSecs -= 1;\n }, 1000);\n \n}", "function timer() {\n let count = 30;\n\n let sec = setInterval(function () {\n // If no selection made, then clear timer\n if (selectionMade) {\n clearTimeout(sec);\n selectionMade = false;\n } else if (count === 0) {\n clearTimeout(sec);\n timeUp();\n } else {\n if (count >= 30) {\n secondsLeft(count);\n } else {\n count = count;\n secondsLeft(count);\n }\n }\n count--;\n }, 1000);\n}", "function countDownTimer(dt, id) {\n\t// Define the goal date\n\tvar end = new Date(dt);\n\n\t// Define each in milliseconds\n\tvar _second = 1000;\n\tvar _minute = _second * 60;\n\tvar _hour = _minute * 60;\n\tvar _day = _hour * 24;\n\tvar _week = _day * 7\n\t// Interval variable\n\tvar timer;\n\n\t// Create another function to show the time remaining\n\tfunction showRemaining() {\n\t\t// Get the current date\n\t\tvar now = new Date();\n\t\t// Get the difference\n\t\tvar distance = end - now;\n\t\t// If the date has passed\n\t\tif(distance <= 0) {\n\t\t\t// Clear the timer \n\t\t\tclearInterval(timer);\n\t\t\t// Print some text\n\t\t\tif(id == 'seniors') {\n\t\t\t\tdocument.getElementById(id).innerHTML = 'GRADUATION!!!';\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(id).innerHTML = 'SUMMER!!!';\n\t\t\t}\n\t\t\t// Don't continue with the rest of the function\n\t\t\treturn;\n\t\t}\n\n\t\t// Obtain the number for each of the following\n\t\tvar weeks = Math.floor(distance / _week);\n\t\tvar days = Math.floor((distance % _week) / _day);\n\t\tvar hours = Math.floor((distance % _day) / _hour);\n\t\tvar minutes = Math.floor((distance % _hour) / _minute);\n\t\tvar seconds = Math.floor((distance % _minute) / _second);\n\n\t\tvar timer = \"\";\n\n\t\t// Print the information on the page\n\t\tif(weeks != 0) timer += weeks + ' weeks, ';\n\t\tif(weeks != 0 || days != 0) timer += days + ' days, ';\n\t\tif(weeks != 0 || days != 0 || hours != 0) timer += hours + ' hrs, ';\n\t\tif(weeks != 0 || days != 0 || hours != 0 || minutes != 0) timer += minutes + ' min, ';\n\t\tif(weeks != 0 || days != 0 || hours != 0 || minutes != 0 || seconds != 0) timer += seconds + ' sec';\n\n\t\tdocument.getElementById(id).innerHTML = timer;\n\t};\n\t// Refresh every second\n\ttimer = setInterval(showRemaining, 1000);\n}", "function timer() {\n setInterval(function() {\n time--;\n if (time > 0) {\n displayRemainingTime();\n } else {\n endQuiz();\n }\n }, 1000);\n}", "function countdown() {\n var timeInterval= setInterval(function(){\n timer.innerText = timeLeft\n timeLeft--;\n },1000);\n}", "function countdown(){\n const countdown = setInterval(function() {\n timeRemaining--;\n $timer.text(timeRemaining);\n if(timeRemaining === 0){\n clearInterval(countdown);\n gameStarted = false;\n }\n }, 1000);\n }", "function timer() {\n count = count - 1;\n if (count <= 0) {\n clearInterval(counter);\n //counter ended, do something here\n\n $('#runadvert').prop('disabled', false);\n $('#runadvert').text('Run Advert');\n return;\n }\n\n //Do code for showing the number of seconds here\n $('#runadvert').text(count);\n }", "function timerWrapper() {\n theClock = setInterval(twentySeconds, 1000);\n function twentySeconds() {\n if (counter === 0) {\n clearInterval(theClock);\n userLossTimeOut();\n }\n if (counter > 0) {\n counter--;\n }\n $(\".timer\").html(counter);\n }\n}", "function clock() {\n // If time reaches 0\n if (triviagame.time === 0) {\n // Clear the interval of that time\n clearInterval(timer);\n // Run the function notime\n triviagame.notime();\n }\n // If there's time left\n if (triviagame.time > 0) {\n // Decrement time\n triviagame.time--;\n }\n // HTML\n $(\"#time-slot\").text(\"Time remaining: \" + triviagame.time);\n }" ]
[ "0.7035286", "0.69687426", "0.69199884", "0.6894611", "0.68926716", "0.6849651", "0.6823727", "0.68000007", "0.679997", "0.676423", "0.6763475", "0.67266095", "0.6720447", "0.67178816", "0.6706305", "0.6689997", "0.6684375", "0.6673262", "0.66707855", "0.6656377", "0.66549444", "0.66537756", "0.66521037", "0.6642665", "0.663352", "0.66180724", "0.661534", "0.6610656", "0.6585041", "0.6585041", "0.6585041", "0.65822977", "0.65763247", "0.6560317", "0.65560776", "0.6550679", "0.6534077", "0.6517769", "0.6516793", "0.6515398", "0.65149045", "0.6510417", "0.6500729", "0.64893335", "0.6477006", "0.6472146", "0.6465007", "0.6456599", "0.6451684", "0.64473355", "0.643014", "0.6426521", "0.64241", "0.6422878", "0.64208406", "0.6419013", "0.6410465", "0.640896", "0.6399954", "0.6397791", "0.63884485", "0.6383033", "0.638282", "0.63749903", "0.63625205", "0.6362221", "0.63591486", "0.63501686", "0.6341096", "0.63410485", "0.63362646", "0.6335112", "0.6333434", "0.63164485", "0.6310638", "0.63104045", "0.630901", "0.6300442", "0.6298675", "0.62964356", "0.6294186", "0.6293958", "0.6293524", "0.62851363", "0.62825316", "0.628115", "0.62770677", "0.6276632", "0.62761205", "0.62742233", "0.62737423", "0.62715214", "0.62580365", "0.6255588", "0.62531763", "0.6252697", "0.6251602", "0.6247742", "0.6246035", "0.6243966", "0.623773" ]
0.0
-1
Destroys the instance of the player and it's plugins.
destroy() { // Remove the player from the page. this.wrapper.innerHTML = ''; this.trigger('requestDestroy'); // HACK: fix this hack! Because requestDestroy refers to this.playerPlugin (via get playing) it throws an error when playerPlugin is nulled.. By using setTimeout 0 we effectively added nullifying on the eventstack setTimeout(() => { this.pluginLoader = null; this.playerPlugin = null; this.playlist = null; this.mediaController = null; this.fullscreenController = null; instances = instances.filter(instance => instance.id === this.id); }, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n // Try to delete as much about anything that could lead to memory leaks.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management\n this.ytPlayer.destroy();\n this.ytPlayer = undefined;\n this.rootElement.parentNode\n .removeChild(this.rootElement);\n this.rootElement = undefined;\n this.ytPlayerOptions = undefined;\n this.options = undefined;\n }", "destroy() {\n if (this._isRunning) this.pause(false); // Going to destroy -> no idle timeout.\n this.removeAllPlayers();\n this._playerManager.destroy();\n delete this._hub;\n delete this._timeIdleId;\n delete this._gameId;\n delete this._jobId;\n delete this._connection;\n delete this._kind;\n delete this._refreshRate;\n delete this._isRunning;\n }", "function destroyPlayer(){\n player.mesh.dispose();\n // then what?\n }", "Destroy() {\n for (const key in this.plugins) {\n if (this.plugins.hasOwnProperty(key)) {\n const plugin = this.plugins[key];\n if(plugin.destroy){\n plugin.destroy();\n }\n }\n }\n }", "destroy() {\n\t\tif (!this.options) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove click event\n\t\tthis.$el.off('click.' + this.options.eventNamespace);\n\n\t\t// Remove Vimeo API Event listeners\n\t\tif (this._player) {\n\t\t\tthis._player.off('play');\n\t\t\tthis._player.off('pause');\n\t\t\tthis._player.off('ended');\n\t\t\tthis._player.off('loaded');\n\t\t\tthis._player.off('error');\n\t\t\tthis._player = undefined;\n\t\t\tdelete(this._player);\n\t\t}\n\n\t\t// Reset interval\n\t\tthis._resetInterval();\n\n\t\tsuper.destroy();\n\t}", "remove() {\n player.dispose();\n }", "function destroy() {\n document.body.removeChild(_this.background);\n document.body.removeChild(_this.player);\n document.body.classList.remove('modal-open');\n\n delete _this.background;\n delete _this.player;\n delete _this.iframe;\n delete _this.close;\n }", "destroy() {\n removeAddedEvents();\n if (mc) {\n mc.destroy();\n }\n mc = null;\n instance = null;\n settings = null;\n }", "destroy() {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.plugins = [];\n this.inputState.destroy();\n this.dom.remove();\n this.observer.destroy();\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n this.destroyed = true;\n }", "destroy() {\n this.logger.warning('Destroying plugin');\n this.disconnect();\n this.view.removeElement();\n }", "async destroy() {\n if (this.hasInitialized()) {\n this.game.instance.destroy(true);\n this.game.instance = null;\n }\n }", "disposePlayer() {\n\n // Nothing to dispose.\n if (!this.player) {\n return;\n }\n\n // Dispose an in-page player.\n if (this.player.dispose) {\n this.player.dispose();\n\n // Dispose an iframe player.\n } else if (this.player.parentNode) {\n this.player.parentNode.removeChild(this.player);\n }\n\n // Null out the player reference.\n this.player = null;\n }", "destroy() {\n // destroy everything related to WebGL and the slider\n this.destroyWebGL();\n this.destroySlider();\n }", "destroy()\n {\n this.#gameObject = null;\n }", "function destroy() {\n // remove and unlink the HTML5 player\n $('#' + domId).html();\n }", "destroy() {\n this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveMenu');\n Foundation.unregisterPlugin(this);\n }", "destroy() {\n this.handles.off('.zf.slider');\n this.inputs.off('.zf.slider');\n this.$element.off('.zf.slider');\n\n clearTimeout(this.timeout);\n\n Foundation.unregisterPlugin(this);\n }", "destroy() {\n // Remove event listeners connected to this instance\n this.eventDelegate.off();\n\n // Delete references to instance\n delete this.ui.element.dataset[`${this.name}Instance`];\n\n delete window[namespace].modules[this.name].instances[this.uuid];\n }", "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n \n // Add code to restore the element to its original state...\n \n hook('onDestroy');\n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n });\n }", "destroy() {\n if (this.currentPlugin) this.currentPlugin.destroy();\n $(window).off('.zf.ResponsiveAccordionTabs');\n Foundation.unregisterPlugin(this);\n }", "destroy() {\n window.removeEventListener('gamepadconnected', this._ongamepadconnectedHandler, false);\n window.removeEventListener('gamepaddisconnected', this._ongamepaddisconnectedHandler, false);\n }", "destroy() {\n\t\tfor ( const socket of this._socketServer.getSocketsInRoom( this.id ) ) {\n\t\t\tsocket.disconnect();\n\t\t}\n\n\t\tif ( this.player ) {\n\t\t\tthis.player.destroy();\n\t\t}\n\n\t\tif ( this.opponent ) {\n\t\t\tthis.opponent.destroy();\n\t\t}\n\n\t\tthis.stopListening();\n\t}", "function destroy(){\n\t\t// TODO\n\t}", "destroyForPlayer(player) {\n if (!this.#players_.has(player))\n return;\n \n this.#element_.hideForPlayer(player);\n this.#players_.delete(player);\n }", "function destroy() {\n dispatchSliderEvent('before', 'destroy');\n\n // remove event listeners\n frame.removeEventListener(prefixes.transitionEnd, onTransitionEnd);\n frame.removeEventListener('touchstart', onTouchstart, touchEventParams);\n frame.removeEventListener('touchmove', onTouchmove, touchEventParams);\n frame.removeEventListener('touchend', onTouchend);\n frame.removeEventListener('mousemove', onTouchmove);\n frame.removeEventListener('mousedown', onTouchstart);\n frame.removeEventListener('mouseup', onTouchend);\n frame.removeEventListener('mouseleave', onTouchend);\n frame.removeEventListener('click', onClick);\n\n options.window.removeEventListener('resize', onResize);\n\n if (prevCtrl) {\n prevCtrl.removeEventListener('click', prev);\n }\n\n if (nextCtrl) {\n nextCtrl.removeEventListener('click', next);\n }\n\n // remove cloned slides if infinite is set\n if (options.infinite) {\n Array.apply(null, Array(options.infinite)).forEach(function () {\n slideContainer.removeChild(slideContainer.firstChild);\n slideContainer.removeChild(slideContainer.lastChild);\n });\n }\n\n dispatchSliderEvent('after', 'destroy');\n }", "stop () {\n if (this.player) {\n this.player.stop().off().unload()\n this.player = null\n this.currentSong = null\n\n }\n }", "function destroy () {\n\t\t// TODO\n\t}", "destroy() {\n if (this.engineWorker != null) {\n engineLoader.returnEngineWorker(this.engineWorker);\n }\n this.eventEmitter.removeAllListeners();\n }", "dispose() {\n console.log(\"disposedisposedisposedispose\");\n this.videoElement.removeEventListener('play', this.handlers.play);\n this.videoElement.removeEventListener('playing', this.handlers.playing);\n this.player.textTracks().removeEventListener('change', this.handlers.textTracksChange);\n this.uiTextTrackHandled = false;\n this.hls.destroy();\n }", "componentWillUnmount() {\n this.player.destroy();\n }", "componentWillUnmount() {\n this.player.destroy();\n }", "componentWillUnmount() {\n this.player.destroy();\n }", "function destroy() {\n $(document).off('keyup', this.videoFullScreen.exitHandler);\n this.videoFullScreen.fullScreenEl.remove();\n this.el.off({\n destroy: this.videoFullScreen.destroy\n });\n document.removeEventListener(\n getVendorPrefixed('fullscreenchange'),\n this.videoFullScreen.handleFullscreenChange\n );\n if (this.isFullScreen) {\n this.videoFullScreen.exit();\n }\n delete this.videoFullScreen;\n }", "destroy() {\n this.stop();\n\n // Remove listeners\n this.off('controlsMoveEnd', this._onControlsMoveEnd);\n\n var i;\n\n // Remove all controls\n var controls;\n for (i = this._controls.length - 1; i >= 0; i--) {\n controls = this._controls[0];\n this.removeControls(controls);\n controls.destroy();\n };\n\n // Remove all layers\n var layer;\n for (i = this._layers.length - 1; i >= 0; i--) {\n layer = this._layers[0];\n this.removeLayer(layer);\n layer.destroy();\n };\n\n // Environment layer is removed with the other layers\n this._environment = null;\n\n this._engine.destroy();\n this._engine = null;\n\n // Clean the container / remove the canvas\n while (this._container.firstChild) {\n this._container.removeChild(this._container.firstChild);\n }\n\n this._container = null;\n }", "destroy() {\n this._destroyed = true;\n\n if (typeof this.freeFromPool === 'function') {\n this.freeFromPool();\n }\n\n if (this.currentMap) {\n this.currentMap.removeObject(this);\n } else if (this.currentScene) {\n this.currentScene.removeObject(this);\n }\n\n this.children.forEach((child) => {\n child.destroy();\n });\n\n // triggers the wave end\n if (this.wave) {\n this.wave.remove(this);\n }\n }", "_disconnect() {\n this.player.destroy();\n this.cleanup();\n this.status = Constants.VoiceStatus.DISCONNECTED;\n /**\n * Emitted when the voice connection disconnects.\n * @event VoiceConnection#disconnect\n */\n this.emit('disconnect');\n }", "destroy() {\n // destroy everything related to the slider\n this.destroySlider();\n }", "destroy() {\n this.instance.disconnect();\n return;\n }", "function destroy() {\n\t\t\t// Iterate over each matching element.\n\t\t\t$el.each(function() {\n\t\t\t\tvar el = this;\n\t\t\t\tvar $el = $(this);\n\n\t\t\t\t// Destroy completely the element and remove event listeners\n\t\t\t\t$(window).off('resize.timeliny');\n\t\t\t\t$el.find('.' + options.className + '-timeblock:not(.inactive) .' + options.className + '-dot').off('click');\n\t\t\t\t$(document).off('mousemove.timeliny');\n\t\t\t\t$(document).off('mouseup.timeliny');\n\t\t\t\t$el.first().off('mousedown');\n\t\t\t\t$el.remove();\n\t\t\t\thook('onDestroy');\n\n\t\t\t\t// Remove Plugin instance from the element.\n\t\t\t\t$el.removeData('plugin_timeliny');\n\t\t\t});\n\t\t}", "destroy() {\n super.destroy();\n\n this.destroyWebAudio();\n }", "function Start () \n{\n\tDestroy(gameObject, time);\n}", "destroy() {\n this.container.removeChild(this.inspiredSprite);\n this.container.removeChild(this.sprite);\n this.container.removeChild(this.halo);\n this.container.removeChild(this.highlight);\n delete this.container;\n }", "function destroy(){}", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }", "function removePlayer(playerId) {\n players[playerId].destroy();\n delete players[playerId];\n delete cursors[playerId];\n delete positions[playerId];\n}", "destroy() {\n this._pluginsManager.beforeAppDestroy(this);\n for (let module of this._modulesOrder) {\n module.destroy();\n }\n }", "destroy() {\n if (this.$toDestroy) {\n this.$toDestroy.forEach(function(el) {\n el.destroy();\n });\n this.$toDestroy = null;\n }\n if (this.$mouseHandler)\n this.$mouseHandler.destroy();\n this.renderer.destroy();\n this._signal(\"destroy\", this);\n if (this.session)\n this.session.destroy();\n if (this._$emitInputEvent)\n this._$emitInputEvent.cancel();\n this.removeAllListeners();\n }", "function destroy() {\n\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "close() {\n this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`);\n this.reset();\n\n _classPrivateFieldLooseBase(this, _storeUnsubscribe)[_storeUnsubscribe]();\n\n this.iteratePlugins(plugin => {\n this.removePlugin(plugin);\n });\n\n if (typeof window !== 'undefined' && window.removeEventListener) {\n window.removeEventListener('online', _classPrivateFieldLooseBase(this, _updateOnlineStatus)[_updateOnlineStatus]);\n window.removeEventListener('offline', _classPrivateFieldLooseBase(this, _updateOnlineStatus)[_updateOnlineStatus]);\n }\n }", "destroy() {\r\n this.off();\r\n }", "destroy() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.scene = undefined;\n this.bullets.destroy(true);\n }", "function destroy() {\n // remove protected internal listeners\n removeEvent(INTERNAL_EVENT_NS.aria);\n removeEvent(INTERNAL_EVENT_NS.tooltips);\n Object.keys(options.cssClasses).forEach(function (key) {\n removeClass(scope_Target, options.cssClasses[key]);\n });\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n delete scope_Target.noUiSlider;\n }", "destroyAssets() {\n this.sprite.destroy();\n }", "function cleanup() {\n sendCommand(\"cleanup\");\n window.removeEventListener(\"message\", onMessage);\n $(\"#primeplayerinjected\").remove();\n $(\"#main\").off(\"DOMSubtreeModified mouseup\");\n ratingContainer.off(\"click\");\n $(window).off(\"hashchange\");\n for (var i = 0; i < observers.length; i++) {\n observers[i].disconnect();\n }\n hideConnectedIndicator();\n disableLyrics();\n port = null;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "destroy() {\r\n this.native.destroy();\r\n }", "function Start () {\nDestroy(this.gameObject,2);\n}", "function destroy(){\r\n }", "function destroy(){\r\n }", "destroy() {\n this.meshes.forEach(mesh => {\n mesh.destroy();\n });\n this.meshes.clear();\n this.lights.clear();\n this.__deleted = true;\n }", "destroy() {\n //--calls super function cleaning up this scene--//\n super.destroy();\n //--if you generate any textures call destroy(true) on them to destroy the base texture--//\n //texture.destroy(true);\n }", "destroy() {\n this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();\n Foundation.unregisterPlugin(this);\n }", "destroy() {\n this.modalPanel.destroy();\n this.fields = null;\n this.classes = null;\n }", "destroy() {\n var { component, instance } = this;\n\n if (component.destroyMethod) {\n CommonUtils.callback(component.destroyMethod, instance);\n }\n\n this.component = this.instance = null;\n }", "destroy()\n {\n this.removeListeners();\n\n if(typeof this.args.callbacks.close !== 'undefined') {\n this.args.callbacks.close();\n }\n\n this.element.parentElement.removeChild(this.element);\n }", "componentWillUnmount() {\n this.props.removeVideoJsInstance();\n if (this.player) {\n this.player.dispose()\n }\n }", "willDestroyElement() {\n\n\t\t// clear the timer\n\t\tthis.stopTimer();\n\n\t\t// destroy video player\n\t\tvar player = this.get('player');\n\t\tif (player) {\n\t\t\tplayer.destroy();\n\t\t\tthis.set('player', null);\n\t\t}\n\t}", "dispose(){\n if (InputManager.haveGamepadEvents) {\n window.removeEventListener(\"gamepadconnected\", this.gamepadConnectedHandler, false);\n window.removeEventListener(\"gamepaddisconnected\", this.gamepadDisconnectedHandler, false);\n } else if (InputManager.haveWebkitGamepadEvents) {\n window.removeEventListener(\"webkitgamepadconnected\", this.gamepadConnectedHandler, false);\n window.removeEventListener(\"webkitgamepaddisconnected\", this.gamepadDisconnectedHandler, false);\n } else {\n removeInterval(this.checkGamepads);\n }\n \n window.removeEventListener(\"keypress\", this.keyPressHandler, false);\n window.removeEventListener(\"click\", this.mouseClickHandler, false);\n\n this.cameraControl.dispose();\n }", "function unload() {\n for(let i = 0; i<localTracks.length; i++) {\n localTracks[i].dispose();\n }\n room.leave();\n connection.disconnect();\n}", "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n \n // Add code to restore the element to its original state...\n $el\n .css({\n 'height': '',\n 'width': '',\n })\n .removeClass('button-spinner')\n .html($content.html());\n \n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n $el.removeData(pluginName);\n });\n }", "componentWillMount() {\n this.player.destroy();\n }", "function destroy(clean) {\n if (!instance) {\n console.warn(\"not initialised\");\n return;\n }\n\n instance.destroy(clean);\n\n instance = null;\n}", "destroy() {\n this.close();\n this.$element.off('.zf.trigger .zf.offcanvas');\n this.$overlay.off('.zf.offcanvas');\n\n Foundation.unregisterPlugin(this);\n }", "onPlayerRemoved(playerName, instanceName) {\n if (this.instances[instanceName] === undefined) {\n return;\n }\n this.instances[instanceName].currentlyPlaying -= 1;\n }", "deletePlugin() {}", "destroy() {\n this.element.remove();\n //kill the server too!\n this.stopServer()\n }", "clearVideoPlayer(handler){\n let players = r360.compositor._videoPlayers._players;\n for(player in players){\n if(player !== 'default'){\n // console.log(player, \" destroyed!\")\n r360.compositor._videoPlayers.destroyPlayer(player)\n }\n }\n }", "delete() {\n delete Plugin._plugins[this.id];\n\n Promise.all([\n db.delete(\"Plugins\", {\n id: this.id\n })\n ]).then(() => {\n global.discotron.triggerEvent(\"plugin-deleted\", this.id);\n });\n }", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "destroy() {\n this.element.remove();\n this.subscriptions.dispose();\n this.editorSubs.dispose();\n }", "function destroy() {\n cssClasses.forEach(function(cls) {\n if (!cls) {\n return;\n } // Ignore empty classes\n removeClass(scope_Target, cls);\n });\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n delete scope_Target.noUiSlider;\n }", "destroy() {\n this.$element\n .find(`.${this.options.linkClass}`)\n .off('.zf.tabs').hide().end()\n .find(`.${this.options.panelClass}`)\n .hide();\n\n if (this.options.matchHeight) {\n if (this._setHeightMqHandler != null) {\n $(window).off('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n }\n\n if (this.options.deepLink) {\n $(window).off('popstate', this._checkDeepLink);\n }\n\n Foundation.unregisterPlugin(this);\n }" ]
[ "0.7446531", "0.7442718", "0.74154264", "0.728973", "0.7181743", "0.7156699", "0.7105579", "0.7088779", "0.70685625", "0.70408124", "0.7035602", "0.68820703", "0.6867774", "0.6848587", "0.6830043", "0.6731127", "0.6703837", "0.6663888", "0.6658892", "0.6658104", "0.66374576", "0.6625097", "0.6551486", "0.65248615", "0.64532757", "0.6452008", "0.6446854", "0.64290273", "0.6414835", "0.6393574", "0.63776296", "0.63776296", "0.6365173", "0.6358359", "0.6345123", "0.6340537", "0.6315983", "0.6314539", "0.63145304", "0.6308972", "0.63073117", "0.6304651", "0.6296656", "0.62932503", "0.62932503", "0.62932503", "0.62932503", "0.62932503", "0.6290808", "0.6279417", "0.62674916", "0.6266458", "0.62630844", "0.6250544", "0.62483853", "0.62465686", "0.624508", "0.62330234", "0.62200075", "0.62200075", "0.62200075", "0.62200075", "0.62151057", "0.62041724", "0.61927944", "0.61927944", "0.6190464", "0.61860627", "0.6184894", "0.61803067", "0.6170385", "0.6160279", "0.6151706", "0.6147864", "0.6132506", "0.61293787", "0.61132586", "0.61101544", "0.610516", "0.609846", "0.6097115", "0.60913754", "0.60843885", "0.6077299", "0.6077116", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.6075971", "0.60711265", "0.60593015", "0.6058235" ]
0.8091967
0
Don't rerender `` on page navigation (on `route` change). TrackedThreads = React.memo(TrackedThreads)
function TrackedThread({ edit, selected, locale, thread }) { const addedAt = useMemo(() => thread.addedAt, [thread]) const untrackButton = useRef() const undoUntrackButton = useRef() const dispatch = useDispatch() const [untracked, setUntracked] = useState() const onUntrackThread = useCallback(() => { dispatch(untrackThread(thread)) setUntracked(true) }, [thread]) const onTrackThread = useCallback(() => { dispatch(trackThread(thread, { addedAt })) setUntracked(false) }, [thread, addedAt]) useEffect(() => { if (untracked) { // Expired threads don't get an "Undo" button. if (undoUntrackButton.current) { undoUntrackButton.current.focus() } } else if (untracked === false) { untrackButton.current.focus() } }, [untracked]) const isDisabled = thread.expired || untracked const isLink = !isDisabled const Component = isLink ? Link : 'div' return ( <div title={thread.title} className={classNames('tracked-threads__thread', { 'tracked-threads__thread--edit': edit, 'tracked-threads__thread--expired': thread.expired, 'tracked-threads__thread--untracked': untracked, 'tracked-threads__thread--selected': selected && !isDisabled })}> <Component to={isLink ? getUrl(thread.board, thread) : undefined} className={classNames('tracked-threads__thread-inner', { 'tracked-threads__thread__link': isLink })}> {thread.thumbnail && <Picture border picture={thread.thumbnail} width={24} height={24} fit="cover" blur={thread.thumbnail.spoiler ? 0.1 : undefined} className="tracked-threads__thread__thumbnail"/> } <BoardUrl boardId={thread.board.id} className="tracked-threads__thread__board"/> <div className="tracked-threads__thread__title"> {thread.title} </div> {!thread.expired && thread.newRepliesCount && <div className="tracked-threads__thread__new-replies"> <span className="tracked-threads__thread__new-replies-count"> {thread.newRepliesCount} </span> </div> } {!thread.expired && thread.newCommentsCount && <div className="tracked-threads__thread__new-comments"> {thread.newCommentsCount} </div> } </Component> {(edit || thread.expired) && !untracked && <ListButton ref={untrackButton} muted icon="remove" onClick={onUntrackThread} title={getMessages(locale).trackedThreads.untrackThread}/> } {edit && untracked && !thread.expired && <Button ref={undoUntrackButton} title={getMessages(locale).trackedThreads.trackThread} onClick={onTrackThread} className="tracked-threads__undo-untrack rrui__button--text"> {getMessages(locale).actions.undo} </Button> } </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TrackedThread({\n\tselected,\n\tlocale,\n\tthread,\n\tdispatch\n}) {\n\tconst onUntrackThread = useCallback(() => dispatch(untrackThread(thread)), [thread])\n\tconst isLink = !thread.expired\n\tconst Component = isLink ? Link : 'div'\n\treturn (\n\t\t<div\n\t\t\ttitle={thread.title}\n\t\t\tclassName={classNames('tracked-threads__thread', {\n\t\t\t\t'tracked-threads__thread--expired': thread.expired,\n\t\t\t\t'tracked-threads__thread--selected': selected\n\t\t\t})}>\n\t\t\t<Component\n\t\t\t\tto={isLink ? getUrl(thread.board, thread) : undefined}\n\t\t\t\tclassName={classNames('tracked-threads__thread-inner', {\n\t\t\t\t\t'tracked-threads__thread__link': isLink\n\t\t\t\t})}>\n\t\t\t\t{thread.thumbnail &&\n\t\t\t\t\t<Picture\n\t\t\t\t\t\tborder\n\t\t\t\t\t\tpicture={thread.thumbnail}\n\t\t\t\t\t\twidth={24}\n\t\t\t\t\t\theight={24}\n\t\t\t\t\t\tfit=\"cover\"\n\t\t\t\t\t\tblur={thread.thumbnail.spoiler ? 0.1 : undefined}\n\t\t\t\t\t\tclassName=\"tracked-threads__thread__thumbnail\"/>\n\t\t\t\t}\n\t\t\t\t<BoardUrl\n\t\t\t\t\tboardId={thread.board.id}\n\t\t\t\t\tclassName=\"tracked-threads__thread__board\"/>\n\t\t\t\t<div className=\"tracked-threads__thread__title\">\n\t\t\t\t\t{thread.title}\n\t\t\t\t</div>\n\t\t\t\t{thread.newRepliesCount &&\n\t\t\t\t\t<div className=\"tracked-threads__thread__new-replies\">\n\t\t\t\t\t\t{thread.newRepliesCount}\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t{thread.newCommentsCount &&\n\t\t\t\t\t<div className=\"tracked-threads__thread__new-comments\">\n\t\t\t\t\t\t{thread.newCommentsCount}\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</Component>\n\t\t\t<ListButton\n\t\t\t\tmuted\n\t\t\t\ticon=\"remove\"\n\t\t\t\tonClick={onUntrackThread}\n\t\t\t\ttitle={getMessages(locale).trackedThreads.untrackThread}/>\n\t\t</div>\n\t)\n}", "componentWillReceiveProps(nextProps) {\n if (nextProps.tabs || nextProps.route.index !== this.props.route.index && nextProps.route.index) {\n clearTimeout(this.timer);\n } else if (!nextProps.tabs || nextProps.route.index !== this.props.route.index && !nextProps.route.index) {\n this.setupTimer();\n }\n }", "function Thread(props) {\n /*TO DO:\n -create a 'posted by: user_name' message for threads\n -make subcomments dynamic\n -make it so user can only like or unlike, not keep adding likes\n -make tick function server dependent. Currently clocks tick out of sync b/c they are a porperty of the thread itself\n */\n\n const [likes, setLikes] = useState(props.likes);\n const [time, setTime] = useState('Loading...');\n const [comments, setComments] = useState([]);\n const [showAddCommentField, setVisibility] = useState(false);\n\n useEffect(() => {\n fetch(`${BACKEND_PORT}/forum_comments/`)\n .then((response) => {\n response.json().then((data) => {\n let old_comments = [];\n for (let i = 0; i < data.length; i++) {\n //make sure comment belongs in this thread\n if (data[i].post_id === props.id) {\n // Retrieve data from backend\n let id = data[i].id;\n let name = data[i].name;\n let message = data[i].message;\n let likes = data[i].likes;\n let date = data[i].date;\n date = new Date(date);\n let post_id = data[i].post_id;\n let key = name + '' + date.getTime();\n //create comment\n let comment = <SubCommentA key={key} id={id} name={name} message={message} createdOn={date} likes={likes} post_id={post_id}/>;\n old_comments.push(comment);\n }\n }\n setComments(old_comments);\n });\n });\n }, []);\n\n const createdOn = props.createdOn;\n setTimeout(tick, 1000);\n //let clock = setInterval(tick, 1000);\n function tick() {\n setTime(howOld(createdOn));\n }\n\n function addLike() {\n fetch(`${BACKEND_PORT}/post/${props.id}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ likes : likes + 1 })\n });\n setLikes(likes + 1);\n };\n\n function addComment(name, message) {\n //make sure comment is not empty...\n if (name === '' || message === '') {\n alert('Must name comment and fill out description!');\n return;\n } else {\n console.log(\"User has added a comment...\");\n }\n const date = new Date();\n const key = name + ' ' + date.getTime();\n let newComment = <SubCommentA key={key} name={name} message={message} createdOn={date} likes={0} post_id={props.id}/>;\n setComments(comments.concat([newComment]));\n }\n\n // note: div instead of a react.fragment so that wrapper for the thread can be stylized\n return (\n <div className=\"thread\" id={props.id}>\n <div className=\"thread-name\">{props.name}</div>\n <button className=\"reply-button\" onClick={()=> setVisibility(true)}>Reply</button>\n <button className=\"like-button\" onClick={addLike}>Like</button>\n <div className=\"likes\">{likes}</div>\n <p>{props.message}</p>\n {comments}\n {showAddCommentField ? <CreateSubCommentForm createComment={addComment} post_id={props.id} hide={() => setVisibility(false)}/> : null}\n <p>{time}</p>\n </div>\n );\n }", "shouldComponentUpdate(nextProps,nextState){const routeDidChange=nextProps.location!==this.props.location;const{routes,delay=1000}=this.props;// If `routeDidChange` is true, means the router is trying to navigate to a new\n// route. We will preload the new route.\nif(routeDidChange){this.startProgressBar(delay);// Save the location first.\nthis.previousLocation=this.props.location;this.setState({nextRouteHasLoaded:false});// Load data while the old screen remains.\npreload(routes,nextProps.location.pathname).then(()=>{client_lifecycles_dispatcher.onRouteUpdate({previousLocation:this.previousLocation,location:nextProps.location});// Route has loaded, we can reset previousLocation.\nthis.previousLocation=null;this.setState({nextRouteHasLoaded:true},this.stopProgressBar);const{hash}=nextProps.location;if(!hash){window.scrollTo(0,0);}else{const id=hash.substring(1);const element=document.getElementById(id);if(element){element.scrollIntoView();}}}).catch(e=>console.warn(e));return false;}// There's a pending route transition. Don't update until it's done.\nif(!nextState.nextRouteHasLoaded){return false;}// Route has loaded, we can update now.\nreturn true;}", "componentDidUpdate() {\n const { routes } = this.props\n const { initialRender } = this.state\n\n // Wait until more than the one route is present.\n // This ensures that there is something to scroll past!\n if (initialRender && routes.length > 1) {\n // Using requestAnimationFrame() ensures that the scroll only happens once\n // paint is complete\n window.requestAnimationFrame(() => {\n // Setting initialRender to false ensures that routeRow will not initiate\n // any more scrolling\n this.setState({ initialRender: false })\n })\n }\n }", "componentDidUpdate() {\n if(!this.props.route) return;\n\n this.renderRoute();\n\n // Scroll down to visualization (shouldn't really be handled here)\n window.location.hash = 'route-map';\n }", "function ForumView({\n allThreads\n}) {\n _s();\n\n const {\n threadId\n } = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_3__[\"useParams\"])();\n const [currentForum, setCurrentForum] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useState\"])(null);\n Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(() => {\n setCurrentForum(allThreads.find(thread => thread.doc_id === threadId));\n }, []);\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__[\"jsxDEV\"])(\"div\", {\n className: \"forum-view\",\n children: currentForum && /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__[\"jsxDEV\"])(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__[\"Fragment\"], {\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__[\"jsxDEV\"])(\"h3\", {\n children: currentForum.title\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 21\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__[\"jsxDEV\"])(\"h4\", {\n children: [\"Posted by \", currentForum.user, \" on \", currentForum.date]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 21\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__[\"jsxDEV\"])(_material_ui_core__WEBPACK_IMPORTED_MODULE_2__[\"Divider\"], {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 21\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__[\"jsxDEV\"])(_CommentList__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 21\n }, this)]\n }, void 0, true)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 9\n }, this);\n}", "componentDidMount() {\n this.fetchRecentThreads();\n }", "componentWillMount () {\n if (localStorage.getItem(\"tempTodoListID\") !== null) {\n this.props.history.push(\"todolist/\" + localStorage.getItem(\"tempTodoListID\"));\n localStorage.removeItem(\"tempTodoListID\");\n }\n if (cookie.parse(document.cookie).hasOwnProperty(\"trelloAuth\")) {\n this.setState({ loadingFromTrello: true });\n this.props.getTrelloListsAction(cookie.parse(document.cookie).trelloAuth);\n }\n }", "componentWillMount() {\n if (!process.env.IS_BROWSER) return;\n state.appState.on('change', () => {\n measureRender(done => this.setState(this.getState(), done));\n });\n setInterval(this.pollStateToPersistance.bind(this), 10000);\n }", "function Chat ({ navigation, route }) {\r\n\r\n const { user } = route.params;\r\n const { matched } = route.params;\r\n const { chat } = route.params;\r\n\r\n const api = 'http://127.0.1.1:3080'\r\n\r\n const [currentChat, setCurrentChat] = useState(null)\r\n\r\n const [currentMessage, setCurrentMessage] = useState('');\r\n\r\n const handleChange = (value) => {\r\n setCurrentMessage(value);\r\n };\r\n\r\n const handleChat = () => {\r\n setCurrentChat(chat);\r\n }\r\n\r\n useEffect(()=> {\r\n handleChat();\r\n chatRefresh();\r\n }, [])\r\n\r\n const handleSubmit = async (sentMessage) => {\r\n\r\n if (sentMessage === '') return\r\n fetch(`${api}/postmessage`, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify({\r\n id : currentChat._id,\r\n content: sentMessage,\r\n timestamp: Date.now().toString(),\r\n sender: user._id\r\n })\r\n })\r\n .then((response) => {\r\n return response.json()\r\n })\r\n .then((response) => {\r\n console.log(response)\r\n setCurrentChat(response)\r\n })\r\n }\r\n\r\n const chatRefresh = async (stop) => {\r\n if (stop) {\r\n return;\r\n }\r\n setTimeout(() => {\r\n fetch(`${api}/getmatchchat`, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify({\r\n id : chat._id\r\n })\r\n })\r\n .then((response) => {\r\n return response.json()\r\n })\r\n .then((response) => {\r\n // console.log(response)\r\n setCurrentChat(response)\r\n })\r\n chatRefresh();\r\n }, 5000);\r\n }\r\n\r\n\r\n return (\r\n <View\r\n style={styles.chatContainer}\r\n >\r\n <View>\r\n {currentChat && currentChat.chat.map((el) => {\r\n if (el.sender === user._id) {\r\n return (\r\n <View\r\n key={el._id}\r\n style={styles.sent}\r\n ><Text>{el.content}</Text></View>\r\n )\r\n } else {\r\n return (\r\n <View key={el._id}\r\n style={styles.received}\r\n ><Text>{el.content}</Text></View>\r\n )\r\n }\r\n })}\r\n </View>\r\n <View\r\n style={styles.messageInputContainer}\r\n >\r\n <TextInput\r\n style={styles.messageInput}\r\n name=\"message\"\r\n value={currentMessage}\r\n onChangeText={(text) => handleChange(text)}\r\n ></TextInput>\r\n <Pressable\r\n style={styles.sendBtn}\r\n onPress={() => {\r\n handleSubmit(currentMessage)\r\n handleChange('');\r\n }}\r\n >\r\n <Text style={styles.sendText}>Send</Text></Pressable>\r\n </View>\r\n </View>\r\n )\r\n}", "componentWillReceiveProps (nextProps) {\n if (nextProps.activeWorkout !== this.props.activeWorkout) {\n if (nextProps.activeWorkout.path !== nextProps.route.path) throw new Error('Changed activeWorkout but not activeRoute')\n this.state.navigator.resetTo(nextProps.activeWorkout)\n console.log(`New activeWorkout set to ${nextProps.activeWorkout.key}. Resetting routes`)\n } else if (nextProps.route.path !== this.props.route.path) {\n let currentRoutes = this.state.navigator.getCurrentRoutes()\n let nextRouteIndex = currentRoutes.findIndex(x => x.path === nextProps.route.path)\n console.log(`found ${nextProps.route.path} at ${nextRouteIndex}`, currentRoutes)\n // did we go 'back', i.e., up some level?\n if (nextRouteIndex >= 0) {\n this.state.navigator.popN(currentRoutes.length - 1 - nextRouteIndex)\n } else {\n this.state.navigator.push(nextProps.route) // replace provides no transition\n }\n }\n }", "componentDidMount() {\n Router.onRouteChangeComplete = url => this.trackPageview();\n }", "function Interview(props) {\n\n //Creating object of pages\n const navigation = {\n pages: [\n { path: '/', label: 'Welcome', },\n { path: '/about-me', label: 'About Me' },\n { path: '/about-website', label: 'Why this website?' }\n ],\n }\n\n //Handler for Navigation tab changed\n const selectionHandler = (event, value) => {\n props.history.push(value);\n }\n\n return (\n //Website Navigation Tabs \n <Grid className='Interview' style={{height: '100%'}}>\n <CustomTabs\n value={props.history.location.pathname || '/'}\n onChange={selectionHandler}\n centered\n >\n {navigation.pages.map((page) => {\n return (\n <CustomTab value={page.path} label={page.label} key={page.path} />\n )\n })}\n </CustomTabs>\n {/*Configuring Switch to rerender exact page requested*/}\n <Switch>\n <Route path='/about-website'>\n <AboutWebsite />\n </Route>\n <Route path='/about-me'>\n <AboutMe />\n </Route>\n <Route path='/'>\n <Welcome />\n </Route>\n </Switch>\n <Footer />\n </Grid>\n );\n}", "function clientReducer(state, action) {\n switch(action.type){\n case ACTION_NAVIGATE:\n {\n const { url , navigateType , cache , mutable , forceOptimisticNavigation } = action;\n const { pathname , search } = url;\n const href = createHrefFromUrl(url);\n const pendingPush = navigateType === 'push';\n const isForCurrentTree = JSON.stringify(mutable.previousTree) === JSON.stringify(state.tree);\n if (mutable.mpaNavigation && isForCurrentTree) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : href,\n pushRef: {\n pendingPush,\n mpaNavigation: mutable.mpaNavigation\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: false\n },\n // Apply cache.\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: state.tree\n };\n }\n // Handle concurrent rendering / strict mode case where the cache and tree were already populated.\n if (mutable.patchedTree && isForCurrentTree) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : href,\n pushRef: {\n pendingPush,\n mpaNavigation: false\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: true\n },\n // Apply cache.\n cache: mutable.useExistingCache ? state.cache : cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: mutable.patchedTree\n };\n }\n const prefetchValues = state.prefetchCache.get(href);\n if (prefetchValues) {\n // The one before last item is the router state tree patch\n const { flightData , tree: newTree , canonicalUrlOverride , } = prefetchValues;\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return {\n canonicalUrl: flightData,\n // Enable mpaNavigation\n pushRef: {\n pendingPush: true,\n mpaNavigation: true\n },\n // Don't apply scroll and focus management.\n focusAndScrollRef: {\n apply: false\n },\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n tree: state.tree\n };\n }\n if (newTree !== null) {\n mutable.previousTree = state.tree;\n mutable.patchedTree = newTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n if (newTree === null) {\n throw new Error('SEGMENT MISMATCH');\n }\n const canonicalUrlOverrideHrefVal = canonicalUrlOverride ? createHrefFromUrl(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverrideHrefVal) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHrefVal;\n }\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n const flightSegmentPath = flightDataPath.slice(0, -3);\n // The one before last item is the router state tree patch\n const [treePatch, subTreeData, head] = flightDataPath.slice(-3);\n // Handles case where prefetch only returns the router tree patch without rendered components.\n if (subTreeData !== null) {\n if (flightDataPath.length === 3) {\n cache.status = CacheStates.READY;\n cache.subTreeData = subTreeData;\n cache.parallelRoutes = new Map();\n fillLazyItemsTillLeafWithHead(cache, state.cache, treePatch, head);\n } else {\n cache.status = CacheStates.READY;\n // Copy subTreeData for the root node of the cache.\n cache.subTreeData = state.cache.subTreeData;\n // Create a copy of the existing cache with the subTreeData applied.\n fillCacheWithNewSubTreeData(cache, state.cache, flightDataPath);\n }\n }\n const hardNavigate = // TODO-APP: Revisit if this is correct.\n search !== location.search || shouldHardNavigate(// TODO-APP: remove ''\n [\n '',\n ...flightSegmentPath\n ], state.tree, newTree);\n if (hardNavigate) {\n cache.status = CacheStates.READY;\n // Copy subTreeData for the root node of the cache.\n cache.subTreeData = state.cache.subTreeData;\n invalidateCacheBelowFlightSegmentPath(cache, state.cache, flightSegmentPath);\n // Ensure the existing cache value is used when the cache was not invalidated.\n } else if (subTreeData === null) {\n mutable.useExistingCache = true;\n }\n const canonicalUrlOverrideHref = canonicalUrlOverride ? createHrefFromUrl(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHref;\n }\n return {\n // Set href.\n canonicalUrl: canonicalUrlOverrideHref ? canonicalUrlOverrideHref : href,\n // Set pendingPush.\n pushRef: {\n pendingPush,\n mpaNavigation: false\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: true\n },\n // Apply patched cache.\n cache: mutable.useExistingCache ? state.cache : cache,\n prefetchCache: state.prefetchCache,\n // Apply patched tree.\n tree: newTree\n };\n }\n }\n // When doing a hard push there can be two cases: with optimistic tree and without\n // The with optimistic tree case only happens when the layouts have a loading state (loading.js)\n // The without optimistic tree case happens when there is no loading state, in that case we suspend in this reducer\n // forceOptimisticNavigation is used for links that have `prefetch={false}`.\n if (forceOptimisticNavigation) {\n const segments = pathname.split('/');\n // TODO-APP: figure out something better for index pages\n segments.push('');\n // Optimistic tree case.\n // If the optimistic tree is deeper than the current state leave that deeper part out of the fetch\n const optimisticTree = createOptimisticTree(segments, state.tree, true, false, href);\n // Copy subTreeData for the root node of the cache.\n cache.status = CacheStates.READY;\n cache.subTreeData = state.cache.subTreeData;\n // Copy existing cache nodes as far as possible and fill in `data` property with the started data fetch.\n // The `data` property is used to suspend in layout-router during render if it hasn't resolved yet by the time it renders.\n const res = fillCacheWithDataProperty(cache, state.cache, // TODO-APP: segments.slice(1) strips '', we can get rid of '' altogether.\n segments.slice(1), ()=>fetchServerResponse(url, optimisticTree));\n // If optimistic fetch couldn't happen it falls back to the non-optimistic case.\n if (!(res == null ? void 0 : res.bailOptimistic)) {\n mutable.previousTree = state.tree;\n mutable.patchedTree = optimisticTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, optimisticTree);\n return {\n // Set href.\n canonicalUrl: href,\n // Set pendingPush.\n pushRef: {\n pendingPush,\n mpaNavigation: false\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: true\n },\n // Apply patched cache.\n cache: cache,\n prefetchCache: state.prefetchCache,\n // Apply optimistic tree.\n tree: optimisticTree\n };\n }\n }\n // Below is the not-optimistic case. Data is fetched at the root and suspended there without a suspense boundary.\n // If no in-flight fetch at the top, start it.\n if (!cache.data) {\n cache.data = createRecordFromThenable(fetchServerResponse(url, state.tree));\n }\n // Unwrap cache data with `use` to suspend here (in the reducer) until the fetch resolves.\n const [flightData, canonicalUrlOverride] = readRecordValue(cache.data);\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return {\n canonicalUrl: flightData,\n // Enable mpaNavigation\n pushRef: {\n pendingPush: true,\n mpaNavigation: true\n },\n // Don't apply scroll and focus management.\n focusAndScrollRef: {\n apply: false\n },\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n tree: state.tree\n };\n }\n // Remove cache.data as it has been resolved at this point.\n cache.data = null;\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n // The one before last item is the router state tree patch\n const [treePatch, subTreeData, head] = flightDataPath.slice(-3);\n // Path without the last segment, router state, and the subTreeData\n const flightSegmentPath = flightDataPath.slice(0, -4);\n // Create new tree based on the flightSegmentPath and router state patch\n const newTree = applyRouterStatePatchToTree(// TODO-APP: remove ''\n [\n '',\n ...flightSegmentPath\n ], state.tree, treePatch);\n if (newTree === null) {\n throw new Error('SEGMENT MISMATCH');\n }\n const canonicalUrlOverrideHref = canonicalUrlOverride ? createHrefFromUrl(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHref;\n }\n mutable.previousTree = state.tree;\n mutable.patchedTree = newTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n if (flightDataPath.length === 3) {\n cache.status = CacheStates.READY;\n cache.subTreeData = subTreeData;\n fillLazyItemsTillLeafWithHead(cache, state.cache, treePatch, head);\n } else {\n // Copy subTreeData for the root node of the cache.\n cache.status = CacheStates.READY;\n cache.subTreeData = state.cache.subTreeData;\n // Create a copy of the existing cache with the subTreeData applied.\n fillCacheWithNewSubTreeData(cache, state.cache, flightDataPath);\n }\n return {\n // Set href.\n canonicalUrl: canonicalUrlOverrideHref ? canonicalUrlOverrideHref : href,\n // Set pendingPush.\n pushRef: {\n pendingPush,\n mpaNavigation: false\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: true\n },\n // Apply patched cache.\n cache: cache,\n prefetchCache: state.prefetchCache,\n // Apply patched tree.\n tree: newTree\n };\n }\n case ACTION_SERVER_PATCH:\n {\n const { flightData , previousTree , overrideCanonicalUrl , cache , mutable } = action;\n // When a fetch is slow to resolve it could be that you navigated away while the request was happening or before the reducer runs.\n // In that case opt-out of applying the patch given that the data could be stale.\n if (JSON.stringify(previousTree) !== JSON.stringify(state.tree)) {\n // TODO-APP: Handle tree mismatch\n console.log('TREE MISMATCH');\n // Keep everything as-is.\n return state;\n }\n if (mutable.mpaNavigation) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : state.canonicalUrl,\n // TODO-APP: verify mpaNavigation not being set is correct here.\n pushRef: {\n pendingPush: true,\n mpaNavigation: mutable.mpaNavigation\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: false\n },\n // Apply cache.\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: state.tree\n };\n }\n // Handle concurrent rendering / strict mode case where the cache and tree were already populated.\n if (mutable.patchedTree) {\n return {\n // Keep href as it was set during navigate / restore\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : state.canonicalUrl,\n // Keep pushRef as server-patch only causes cache/tree update.\n pushRef: state.pushRef,\n // Keep focusAndScrollRef as server-patch only causes cache/tree update.\n focusAndScrollRef: state.focusAndScrollRef,\n // Apply patched router state\n tree: mutable.patchedTree,\n prefetchCache: state.prefetchCache,\n // Apply patched cache\n cache: cache\n };\n }\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return {\n // Set href.\n canonicalUrl: flightData,\n // Enable mpaNavigation as this is a navigation that the app-router shouldn't handle.\n pushRef: {\n pendingPush: true,\n mpaNavigation: true\n },\n // Don't apply scroll and focus management.\n focusAndScrollRef: {\n apply: false\n },\n // Other state is kept as-is.\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n tree: state.tree\n };\n }\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n // Slices off the last segment (which is at -4) as it doesn't exist in the tree yet\n const flightSegmentPath = flightDataPath.slice(0, -4);\n const [treePatch, subTreeData, head] = flightDataPath.slice(-3);\n const newTree = applyRouterStatePatchToTree(// TODO-APP: remove ''\n [\n '',\n ...flightSegmentPath\n ], state.tree, treePatch);\n if (newTree === null) {\n throw new Error('SEGMENT MISMATCH');\n }\n const canonicalUrlOverrideHref = overrideCanonicalUrl ? createHrefFromUrl(overrideCanonicalUrl) : undefined;\n if (canonicalUrlOverrideHref) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHref;\n }\n mutable.patchedTree = newTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n // Root refresh\n if (flightDataPath.length === 3) {\n cache.status = CacheStates.READY;\n cache.subTreeData = subTreeData;\n fillLazyItemsTillLeafWithHead(cache, state.cache, treePatch, head);\n } else {\n // Copy subTreeData for the root node of the cache.\n cache.status = CacheStates.READY;\n cache.subTreeData = state.cache.subTreeData;\n fillCacheWithNewSubTreeData(cache, state.cache, flightDataPath);\n }\n return {\n // Keep href as it was set during navigate / restore\n canonicalUrl: canonicalUrlOverrideHref ? canonicalUrlOverrideHref : state.canonicalUrl,\n // Keep pushRef as server-patch only causes cache/tree update.\n pushRef: state.pushRef,\n // Keep focusAndScrollRef as server-patch only causes cache/tree update.\n focusAndScrollRef: state.focusAndScrollRef,\n // Apply patched router state\n tree: newTree,\n prefetchCache: state.prefetchCache,\n // Apply patched cache\n cache: cache\n };\n }\n case ACTION_RESTORE:\n {\n const { url , tree } = action;\n const href = createHrefFromUrl(url);\n return {\n // Set canonical url\n canonicalUrl: href,\n pushRef: state.pushRef,\n focusAndScrollRef: state.focusAndScrollRef,\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n // Restore provided tree\n tree: tree\n };\n }\n // TODO-APP: Add test for not scrolling to nearest layout when calling refresh.\n // TODO-APP: Add test for startTransition(() => {router.push('/'); router.refresh();}), that case should scroll.\n case ACTION_REFRESH:\n {\n const { cache , mutable } = action;\n const href = state.canonicalUrl;\n const isForCurrentTree = JSON.stringify(mutable.previousTree) === JSON.stringify(state.tree);\n if (mutable.mpaNavigation && isForCurrentTree) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : state.canonicalUrl,\n // TODO-APP: verify mpaNavigation not being set is correct here.\n pushRef: {\n pendingPush: true,\n mpaNavigation: mutable.mpaNavigation\n },\n // All navigation requires scroll and focus management to trigger.\n focusAndScrollRef: {\n apply: false\n },\n // Apply cache.\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: state.tree\n };\n }\n // Handle concurrent rendering / strict mode case where the cache and tree were already populated.\n if (mutable.patchedTree && isForCurrentTree) {\n return {\n // Set href.\n canonicalUrl: mutable.canonicalUrlOverride ? mutable.canonicalUrlOverride : href,\n // set pendingPush (always false in this case).\n pushRef: state.pushRef,\n // Apply focus and scroll.\n // TODO-APP: might need to disable this for Fast Refresh.\n focusAndScrollRef: {\n apply: false\n },\n cache: cache,\n prefetchCache: state.prefetchCache,\n tree: mutable.patchedTree\n };\n }\n if (!cache.data) {\n // Fetch data from the root of the tree.\n cache.data = createRecordFromThenable(fetchServerResponse(new URL(href, location.origin), [\n state.tree[0],\n state.tree[1],\n state.tree[2],\n 'refetch', \n ]));\n }\n const [flightData, canonicalUrlOverride] = readRecordValue(cache.data);\n // Handle case when navigating to page in `pages` from `app`\n if (typeof flightData === 'string') {\n return {\n canonicalUrl: flightData,\n pushRef: {\n pendingPush: true,\n mpaNavigation: true\n },\n focusAndScrollRef: {\n apply: false\n },\n cache: state.cache,\n prefetchCache: state.prefetchCache,\n tree: state.tree\n };\n }\n // Remove cache.data as it has been resolved at this point.\n cache.data = null;\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n // FlightDataPath with more than two items means unexpected Flight data was returned\n if (flightDataPath.length !== 3) {\n // TODO-APP: handle this case better\n console.log('REFRESH FAILED');\n return state;\n }\n // Given the path can only have two items the items are only the router state and subTreeData for the root.\n const [treePatch, subTreeData, head] = flightDataPath;\n const newTree = applyRouterStatePatchToTree(// TODO-APP: remove ''\n [\n ''\n ], state.tree, treePatch);\n if (newTree === null) {\n throw new Error('SEGMENT MISMATCH');\n }\n const canonicalUrlOverrideHref = canonicalUrlOverride ? createHrefFromUrl(canonicalUrlOverride) : undefined;\n if (canonicalUrlOverride) {\n mutable.canonicalUrlOverride = canonicalUrlOverrideHref;\n }\n mutable.previousTree = state.tree;\n mutable.patchedTree = newTree;\n mutable.mpaNavigation = isNavigatingToNewRootLayout(state.tree, newTree);\n // Set subTreeData for the root node of the cache.\n cache.status = CacheStates.READY;\n cache.subTreeData = subTreeData;\n fillLazyItemsTillLeafWithHead(cache, state.cache, treePatch, head);\n return {\n // Set href, this doesn't reuse the state.canonicalUrl as because of concurrent rendering the href might change between dispatching and applying.\n canonicalUrl: canonicalUrlOverrideHref ? canonicalUrlOverrideHref : href,\n // set pendingPush (always false in this case).\n pushRef: state.pushRef,\n // TODO-APP: might need to disable this for Fast Refresh.\n focusAndScrollRef: {\n apply: false\n },\n // Apply patched cache.\n cache: cache,\n prefetchCache: state.prefetchCache,\n // Apply patched router state.\n tree: newTree\n };\n }\n case ACTION_PREFETCH:\n {\n const { url , serverResponse } = action;\n const [flightData, canonicalUrlOverride] = serverResponse;\n if (typeof flightData === 'string') {\n return state;\n }\n const href = createHrefFromUrl(url);\n // TODO-APP: Currently the Flight data can only have one item but in the future it can have multiple paths.\n const flightDataPath = flightData[0];\n // The one before last item is the router state tree patch\n const [treePatch] = flightDataPath.slice(-3);\n const flightSegmentPath = flightDataPath.slice(0, -3);\n const newTree = applyRouterStatePatchToTree(// TODO-APP: remove ''\n [\n '',\n ...flightSegmentPath\n ], state.tree, treePatch);\n // Patch did not apply correctly\n if (newTree === null) {\n return state;\n }\n // Create new tree based on the flightSegmentPath and router state patch\n state.prefetchCache.set(href, {\n flightData,\n // Create new tree based on the flightSegmentPath and router state patch\n tree: newTree,\n canonicalUrlOverride\n });\n return state;\n }\n // This case should never be hit as dispatch is strongly typed.\n default:\n throw new Error('Unknown action');\n }\n}", "function MainPage(){\n const history = useHistory()\n //gets data and functions from context\n const {user, logout} = useContext(UserContext)\n const {idea, ideas, getAllIdeas, getAnIdea, addNewIdea, deleteAnIdea} = useContext(IdeaContext)\n //allows us to travel to the next page\n const [travel, setTravel]= useState(false)\n //gets users previous ideas to display\n useEffect(()=>{\n getAllIdeas()\n // eslint-disable-next-line\n },[])\n //pushes the user to a new/existing idea page everytime they click a different idea\n useEffect(()=>{\n if(idea._id && travel){\n history.push(`/ideaPage/${idea._id}`)\n setTravel(false)\n }\n// eslint-disable-next-line\n }, [idea])\n// uses function from context and 'story model' to creat a new story and push the user to that new story page\n function addNewStory(){\n addNewIdea(story)\n setTravel(true)\n }\n// uses function from context and ideaId from clickEvent to push the user to that existing story page\n function getStory(passedIdea){\n getAnIdea(passedIdea._id)\n setTravel(true)\n }\n//maps over the iea list and displays a link to get a new story and a button to delete delete a story\n const ideaList = ideas.map(idea=>{\n return (\n <div key = {idea._id}>\n <h3 onClick= {()=>getStory(idea)}>{idea.title}</h3>\n <p className = 'delete' onClick = {()=>deleteAnIdea(idea._id)}>X</p>\n </div>\n ) \n })\n return(\n <div className = 'notebook xcontainer'>\n <div>\n <h1>Written By: {user.username}</h1>\n <button className = 'logout' onClick = {logout}>logout</button>\n <p className = 'new' onClick = {addNewStory}> + Add a new Story Idea </p>\n <p>Or View a Work In Progress</p>\n <ul className ='wips'>\n {ideaList}\n </ul>\n </div>\n \n </div>\n\n )\n}", "function App() {\n function reload() {\n window.location.reload()\n }\n\n setInterval(reload, 300000); //reload app in 5 mins\n\n const time = new Date().toLocaleTimeString([], {hour12: false});\n\n const [currentTime, setCurrentTime] = useState(time);\n const [count, setCount] = useState(0);\n const [log, setLog] = useState([]);\n\n function updateTime() {\n let newTime = new Date().toLocaleTimeString([], {hour12: false});\n setCurrentTime(newTime);\n }\n\n function handleClick() {\n updateCount();\n logTime();\n }\n\n function updateCount() {\n setCount(count + 1);\n }\n\n function logTime() {\n let newLog = \"You clicked at: \" + currentTime;\n setLog((preValue) => {\n return [\n ...preValue,\n newLog\n ]\n })\n }\n\n return (<div className=\"app\"><SideBar handleClick={handleClick}/><MainContent updateTime={updateTime} time={time} count={count} log={log}/></div>);\n}", "componentWillReceiveProps(nextProps) {\n //if (nextProps.windowPath !== this.props.windowPath || nextProps.routeParams.area != this.props.routeParams.area) {\n // this.fetchData(nextProps);\n //}\n }", "function AnalyticsPage() {\n\n const dispatch = useDispatch();\n\n const auth = useSelector(state => state.user.authToken);\n\n useEffect(() => {\n dispatch(appActions.switchPage(2))\n dispatch(surveyActions.clearSurvey())\n const url = (window.location.pathname);\n let id = \"\";\n //this means that there is an id that is loaded.\n if (url.split('/').length === 3) {\n id = url.split('/')[2];\n //dispatch to get all survey ids\n dispatch(analyticsActions.loadResponses(id, auth));\n dispatch(analyticsActions.setCurrentSurvey(id)); \n dispatch(surveyActions.loadSurvey(id,auth));\n dispatch(analyticsActions.getWordCloud(\"test\"));\n }\n }, [])\n\n return (\n <div>\n <NavBar />\n <AnalyticsHeader />\n <AnalyticsResponse/>\n </div>\n );\n}", "componentWillMount() {\n if (localStorage.getItem(\"autotrackToken\") === null) {\n browserHistory.push(\"/\");\n }\n }", "async componentWillUnmount() {\n clearTimeout(this.timeStatus);\n // this.props.history.push('/'); // Keeping the home page link (so it goes to App.js)\n }", "async componentDidUpdate() {\n if(!this.state.pathSynchronized) {\n if(Fabric.isFrameClient) {\n if(this.props.frameRouting.path === undefined) { return; }\n\n await Fabric.Initialize();\n\n if(this.props.frameRouting.path !== this.props.router.location.pathname) {\n this.setState({redirectPath: this.props.frameRouting.path});\n } else {\n this.setState({\n contentSpaceLibraryId: Fabric.contentSpaceLibraryId,\n redirectPath: \"\",\n pathSynchronized: true\n });\n\n this.props.StartRouteSynchronization();\n }\n } else {\n await Fabric.Initialize();\n this.setState({\n contentSpaceLibraryId: Fabric.contentSpaceLibraryId,\n pathSynchronized: true\n });\n }\n }\n }", "_onTrackingUpdated(state, reason) {\n var trackingNormal = false;\n if (state == ViroConstants.TRACKING_NORMAL) {\n trackingNormal = true;\n } \n // this.props.dispatchARTrackingInitialized(trackingNormal);\n }", "function App() {\n\t\n\tconst [dataBefore, setDataBefore] = React.useState(false);\n\n\tconst onLoad = async () => {\n\t\tlet _resAll = await LoadDataBeforeTemp.init();\n\t\tif(_resAll){\n\t\t\tsetDataBefore(_resAll);\n\t\t}\n\t};\n\n\tReact.useEffect(() => {\n\t\tonLoad();\n\t}, []);\n\n\treturn (\n\t\t<Provider store={stores}>\n\t\t\t<Router history={history} config={config} basename={'/cms'}>\n\t\t\t\t<React.Suspense fallback={<Loader/>}>\n\t\t\t\t{!dataBefore && <Loader/>}\n\t\t\t\t{dataBefore && (\n\t\t\t\t\t<div id=\"wrapper\">\n\t\t\t\t\t\t<Header \n\t\t\t\t\t\t\thistory={history}\n\t\t\t\t\t\t\tconfig={config} />\n\t\t\t\t\t\t<div className=\"dashboard-container\">\n\t\t\t\t\t\t\t<LeftSideBar \n\t\t\t\t\t\t\t\thistory={history}\n\t\t\t\t\t\t\t\tconfig={config} />\n\t\t\t\t\t\t\t<div className=\"dashboard-content-container\">\n\t\t\t\t\t\t\t\t<Switch>\n\t\t\t\t\t\t\t\t\t{routes.map((route) => (\n\t\t\t\t\t\t\t\t\t\t<AppRoutes\n\t\t\t\t\t\t\t\t\t\t\tkey={route.path}\n\t\t\t\t\t\t\t\t\t\t\tpath={route.path}\n\t\t\t\t\t\t\t\t\t\t\texact={route.exact}\n\t\t\t\t\t\t\t\t\t\t\tcomponent={route.component}\n\t\t\t\t\t\t\t\t\t\t\tisPrivate={route.isPrivate}\n\t\t\t\t\t\t\t\t\t\t\tsitedata={dataBefore}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</Switch>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Footer \n\t\t\t\t\t\t\thistory={history}\n\t\t\t\t\t\t\tconfig={config}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t</React.Suspense>\n\t\t\t</Router>\n\t\t</Provider>\n\t);\n}", "function onMostVisitedChange() {\n reloadTiles();\n}", "componentWillUnmount() {\n\t\tthis.linksTracker.stop(); // stops the auto tracker from running after the component is closed\n\t}", "componentWillMount() {\n firebase.analytics().setCurrentScreen('Recent');\n }", "componentWillReceiveProps(nextProps) {\n // Check for new load\n if (nextProps.currentPage === \"Home\" || nextProps.currentPage === \"\") {\n if (nextProps.currentPage !== this.props.currentPage) {\n setTimeout(\n function() {\n this.splat();\n }.bind(this),\n 100\n );\n }\n\n // Check for leaving\n } else {\n }\n }", "componentWillUpdate(nextProps, nextState)\n {\n if(typeof chrome.storage != \"undefined\")\n {\n chrome.storage.sync.set({\n autoRedirectionWebsites: nextState.autoRedirectionWebsites,\n autoRedirection: nextState.active\n });\n }\n }", "function App() {\n const [tileArr, setTileArr] = useState([]);\n\n useEffect(() => {\n const storageArr = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY));\n if (storageArr) {\n setTileArr(storageArr);\n }\n }, []);\n\n useEffect(() => {\n localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(tileArr));\n }, [tileArr]);\n\n // SETTING ARRAY OF TILES\n function getID(date, realDate) {\n if (tileArr.includes(date)) return;\n setTileArr([date, ...tileArr]);\n }\n\n function removeTile(id) {\n setTileArr(tileArr.filter((tile) => tile !== id));\n }\n\n return (\n <div className=\"mainpage bg-gray-800\">\n <Header getID={getID} />\n <TileGrid tiles={tileArr} removeTile={removeTile} />\n <motion.div layout>\n <Stats tileID={tileArr} />\n </motion.div>\n <Footer />\n </div>\n );\n}", "componentWillReceiveProps(nextProps) {\r\n //fast comparison if unread threads have changed at all. \r\n if (JSON.stringify(this.props.unreadThreads) !== JSON.stringify(nextProps.unreadThreads)) {\r\n nextProps.appTitleManager.updateAppTitleRotation(nextProps.unreadThreads);\r\n }\r\n }", "componentDidUpdate(prevProps) {\n if (prevProps.thread._id !== this.props.thread._id) {\n this.getUser();\n this.refreshComments();\n }\n }", "componentWillReceiveProps(nextProps) {\n if (nextProps.routeParams.area != this.props.routeParams.area) {\n this._fetchData(nextProps)\n }\n }", "function reactNavigationHook({ history }) {\n let lastPathName = history.location.pathname;\n cleanupHistoryListener = history.listen(function(location) {\n if (location.pathname !== lastPathName) {\n lastPathName = location.pathname;\n cleanup();\n start();\n }\n });\n }", "function App() {\n const dispatch = useDispatch()\n\n\n\n useEffect(()=>{\n console.log('andandos')\n dispatch(actions.getAllChamp())\n\n\n },[])\n\n return (\n <div className=\"App\">\n\n <Route path=\"/\" component={NavBar} />\n <Route exact path=\"/\" component={Container} />\n <Route exact path=\"/battleground\" component={BattleGround} />\n\n\n {/* <Route exact path=\"/\" component={} />\n <Route path=\"/\" component={} /> */}\n </div>\n );\n}", "render() {\n return(\n <div>\n {/* {this is the router for changing pages on the site} */}\n <BrowserRouter history={history}>\n {/* The Main Context Providers */}\n <UserProvider>\n <OrganizationProvider>\n <VerifyStatusProvider>\n <PrimaryNavSelectedProvider>\n <OpenTicketContextProvider>\n <StatusListProvider>\n <PriorityListProvider>\n <TicketColumnsContextProvider>\n <TicketProvider>\n {/* {Navbar component to navigate} */}\n {/* <Navbar/> */}\n \n \n {/* TicketTabContext to hold the ticket tabs*/}\n <TicketTabContextProvider>\n <SelectedOrgProvider>\n \n\n \n {/* {creating a switch to swap out the component to show when on different pages} */}\n \n {/* {pages and the component assgined to them} */}\n \n <Route component={AllRoutes}/>\n\n </SelectedOrgProvider>\n \n </TicketTabContextProvider>\n \n </TicketProvider>\n </TicketColumnsContextProvider>\n </PriorityListProvider>\n </StatusListProvider>\n </OpenTicketContextProvider>\n </PrimaryNavSelectedProvider>\n </VerifyStatusProvider>\n </OrganizationProvider>\n </UserProvider>\n </BrowserRouter>\n </div>\n );\n }", "componentDidUpdate(prevProps) {\n if (\n routeHasChanged({\n prevWindowPath: prevProps.windowPath,\n curWindowPath: this.props.windowPath,\n prevRouteParams: prevProps.routeParams,\n curRouteParams: this.props.routeParams,\n })\n ) {\n this.fetchData(this.props)\n }\n }", "componentWillUpdate(nextProps) {\n if (nextProps.count >= nextProps.total) {\n let self = this;\n // redirect to next page\n setTimeout(function () {\n if (SessionService.needDirectSession()) {\n self.props.history.replace('/session');\n } else {\n self.props.history.replace(MenuConfig.defaultItem().path);\n }\n self.props.actions.resetState();\n setTimeout(() => self.props.actions.syncData(), 4000);\n }, 1000);\n }\n }", "routerHooks() {\n const router = this.router;\n router.afterEach((to, from) => {\n this.historyShouldChange = true;\n // get the vm instance after render\n this.Vue.nextTick(() => {\n const current = this.currentVm;\n const pendingToPushVm = resolvePushedVm(current);\n if (this.pre === null) {\n this.onInitial(pendingToPushVm);\n } else if (this.isReplace) {\n this.onReplace(pendingToPushVm);\n } else if (this.isPush) {\n this.onPush(pendingToPushVm);\n } else {\n this.onBack(pendingToPushVm);\n }\n this.pre = current;\n this.preStateId = this.stackPointer;\n if (!isPlaceHolderVm(pendingToPushVm)) {\n setCurrentVnodeKey(router, genKey(this.stackPointer, router));\n if (!this.hacked && current) {\n this.hackKeepAliveRender(current.$vnode.parent.componentInstance);\n }\n this.historyShouldChange = false;\n }\n });\n });\n }", "function App() {\n const classes = styles();\n\n React.useEffect(() => {\n logPageView();\n }, []);\n\n return (\n <body style={{ height: '100%' }}>\n <Grid container className={classes.AppHeader}>\n <Grid item xs={12} md={7}>\n <div className=\"intro-text\">\n <div>Hello</div>\n <div>\n <span className=\"weight-extraBold\" style={{ color: COLOR.primary }}>I'm Fahsai</span>, Front-End\n </div>\n <div>Developer</div>\n </div>\n <Link activeClass=\"active\" to=\"ProjectsSection\" spy={true} smooth={true} offset={0} duration={500}>\n <button className={classes.Button}>\n Get Started\n </button>\n </Link>\n </Grid>\n <Grid item xs={12} md={5}>\n <img style={{ width: '100%', maxHeight: 300, objectFit: 'contain' }} alt=\"cover\" src={IMAGES.cover} />\n </Grid>\n </Grid>\n\n <Element name=\"ProjectsSection\" className=\"element\">\n <ProjectsSection />\n </Element>\n\n <ContactSection />\n\n <FooterSection />\n </body>\n );\n}", "componentWillMount(){\n this.props.clearErrorMessage(this.state.randomFloat);\n this.props.startTaskProjectsLoading();\n this.props.startStatusesLoading();\n this.props.startCompaniesLoading();\n this.props.startTaskAttributesLoading();\n this.props.startTagsLoading();\n this.props.startUnitsLoading();\n this.props.startUsersLoading();\n this.props.deleteTaskSolvers();\n this.props.getTaskStatuses(this.props.statusesUpdateDate,this.props.token);\n this.props.getTaskProjects(this.props.token);\n this.props.getTaskCompanies(this.props.companiesUpdateDate,this.props.token);\n this.props.getTaskAttributes(this.props.token);\n this.props.getTags(this.props.token);\n this.props.getUnits(this.props.token);\n this.props.getUsers(\"\",this.props.token);\n\n this.props.setFilterPage(this.props.match.params?this.props.match.params.page:1);\n }", "function Logged({ user, setUser }) {\n let [tweets, setTweets] = useState([]);\n useEffect(() => {\n fetch(\"/tweet\")\n .then((res) => res.json())\n .then((twets) => setTweets(twets));\n }, []);\n return (\n <Router>\n <Nav />\n <Switch>\n <Route\n path=\"/\"\n exact\n render={() => (\n <Home\n user={user}\n setUser={setUser}\n tweets={tweets}\n setTweets={setTweets}\n />\n )}\n />\n <Route\n path=\"/Home\"\n render={() => (\n <Home\n user={user}\n setUser={setUser}\n tweets={tweets}\n setTweets={setTweets}\n />\n )}\n />\n <Route\n path=\"/Explore\"\n render={() => (\n <Explore user={user} setUser={setUser} tweets={tweets} />\n )}\n />\n <Route\n path=\"/Bookmarks\"\n render={() => <Bookmarks user={user} setUser={setUser} />}\n />\n <Route\n path=\"/Profile\"\n render={() => <Profile user1={user} setUser1={setUser} />}\n />\n <Route path=\"/Comments\" strict component={Comments} />\n <Route path=\"/DisplayUsers\" strict component={DisplayUsers} />\n {/* <Route path=\"/Signup\" component={Signup} />\n <Route path=\"/Signin\" component={Signin} /> */}\n </Switch>\n </Router>\n );\n}", "componentWillReceiveProps(nextProps, nextContext) {\n // Update the state.\n this.setState({});\n // Update the session store for this page.\n this.context.storeSession(this.props.location.pathname, {\n relay: {}\n });\n }", "function dispatch() {\n\n var hash = current();\n\n // Only when hash actually changed from\n // last activation and router is currently\n // enabled.\n\n if (last === hash) {\n\n return;\n }\n\n dispatchHash(hash);\n}", "componentWillUnmount(){\n this.linksTracker.stop();\n //saves resources.\n }", "componentDidMount() {\n if (!this.props.route.index) {\n this.setupTimer();\n }\n }", "componentDidMount() {\n initializeHistory();\n this.listenStaticRouterUpdates();\n }", "function Home() {\n //Redux state vars\n // const dispatch = useDispatch();\n // const { reloadFetch } = useSelector((state) => state.trackReducer);\n // const { reloadPlaylistFetch } = useSelector((state) => state.playlistReducer);\n\n //State vars for Tracks\n // const [lastUploadedTracks, setlastUploadedTracks] = useState([]);\n // const [mostPlayedTracks, setMostPlayedTracks] = useState([]);\n // const [mostLikedTracks, setMostLikedTracks] = useState([]);\n\n //State vars for Playlists\n // const [mostLikedPlaylists, setMostLikedPlaylists] = useState([]);\n // const [lastUploadedPlaylists, setlastUploadedPlaylists] = useState([]);\n\n // const [tracksLoaded, setTracksLoaded] = useState(false);\n\n // useEffect(() => {\n // if (reloadFetch) {\n // // Load last uploaded tracks\n // getAllTracks().then((response) => {\n // setlastUploadedTracks([]);\n // setlastUploadedTracks(response.data.tracks.slice(0, 6));\n // });\n\n // // Load most played tracks\n // getMostPlayedTracks().then((response) => {\n // setMostPlayedTracks([]);\n // setMostPlayedTracks(response.data.tracks.slice(0, 5));\n // });\n\n // // Load most liked tracks\n // getMostLikedTracks().then((response) => {\n // setMostLikedTracks([]);\n // setMostLikedTracks(response.data.tracks);\n // });\n // dispatch(reloadFetchAction(false));\n // }\n // // eslint-disable-next-line\n // }, [reloadFetch]);\n\n // useEffect(() => {\n // if (reloadPlaylistFetch) {\n //Load most liked playlists\n // getMostLikedPlaylists().then((response) => {\n // setMostLikedPlaylists([]);\n // setMostLikedPlaylists(response.data.playlists);\n // });\n\n //Load last uploaded playlists\n // getLastUploadedPlaylists().then((response) => {\n // setlastUploadedPlaylists([]);\n // setlastUploadedPlaylists(response.data.playlists);\n // });\n // dispatch(reloadPlaylistFetchAction(false));\n // }\n // eslint-disable-next-line\n // }, [reloadPlaylistFetch]);\n\n useEffect(() => {\n // return () => {\n // dispatch(reloadFetchAction(true));\n // dispatch(reloadPlaylistFetchAction(true));\n // };\n // eslint-disable-next-line\n }, []);\n\n return (\n <>\n <main>\n <Container>\n <Row>\n <Col sm xs={12} md={12} lg={6}>\n <h1>Trending:</h1>\n <div className=\"home-top-col\">\n {/* {mostPlayedTracks.map((track, index) => {\n return (\n <Track dataTrack={track} key={track ? track._id : index} />\n );\n })} */}\n </div>\n </Col>\n <Col sm xs={12} md={12} lg={6}>\n <h1>Trending:</h1>\n <div className=\"home-top-col\">\n {/* {mostPlayedTracks.map((track, index) => {\n return (\n <Track dataTrack={track} key={track ? track._id : index} />\n );\n })} */}\n </div>\n </Col>\n </Row>\n </Container>\n\n <div className=\"xl-separator\" />\n\n <Container>\n <h1>Recommended Tracks:</h1>\n {/* <ScrollContainer className=\"scroll-container\"> */}\n <Row className=\"scroll-wrapper-tracks\">\n {/* {mostLikedTracks.map((track, index) => {\n return (\n <Col key={track ? track._id : index}>\n <BlockTrack dataTrack={track} size=\"small\" />\n </Col>\n );\n })} */}\n </Row>\n {/* </ScrollContainer> */}\n </Container>\n\n <div className=\"xl-separator\" />\n\n <Container>\n <h1>Last Uploaded Tracks:</h1>\n <Row sm xs={4} md={4} lg={2}>\n {/* {lastUploadedTracks.map((track, index) => {\n return (\n <Col sm xs={2} md={4} lg={2} key={track ? track._id : index}>\n <BlockTrack dataTrack={track} size=\"big\" />\n </Col>\n );\n })} */}\n </Row>\n </Container>\n\n <div className=\"xl-separator\" />\n\n <Container>\n <h1>Popular playlists:</h1>\n <Row sm xs={4} md={4} lg={2}>\n {/* {mostLikedPlaylists.map((playlist, index) => {\n return (\n <Col\n sm\n xs={2}\n md={4}\n lg={2}\n key={playlist ? playlist._id : index}\n >\n <BlockPlaylist playlistData={playlist} size=\"big\" />\n </Col>\n );\n })} */}\n </Row>\n </Container>\n\n <div className=\"xl-separator\" />\n\n <Container>\n <h1>Last Uploaded Playlists:</h1>\n {/* <ScrollContainer className=\"scroll-container\">\n <Row className=\"scroll-wrapper-tracks\">\n {lastUploadedPlaylists.map((playlist, index) => {\n return (\n <Col key={playlist ? playlist._id : index}>\n <BlockPlaylist playlistData={playlist} size=\"small\" />\n </Col>\n );\n })}\n </Row>\n </ScrollContainer> */}\n </Container>\n </main>\n </>\n );\n}", "componentWillReceiveProps(nextProps) {\n //remove everything inside <> brackets (the HTML)\n const rmHTML = (t) => {\n return t.replace(/<(?:.|\\n)*?>/gm, ' ');\n }\n\n\n\n const addDirs = (a) => {\n let ans = [];\n for(let i = 0; i < a.length; i++) {\n ans.push(rmHTML(a[i].instructions));\n }\n return ans;\n }\n\n if( (nextProps.dst.status === 'done' && \n nextProps.org.status === 'done') && \n (\n nextProps.dst.lat !== this.props.dst.lat || \n nextProps.dst.lng != this.props.dst.lng ||\n nextProps.org.lng != this.props.org.lng ||\n nextProps.org.lat != this.props.org.lat \n )\n ) {\n let addTime = this.props.addTime;\n let addDirections = this.props.addDirections;\n this.directionsDisplay.setMap(this.map)\n\n //remove existing direction markers from previous render\n this.directionsDisplay.setDirections({routes: []});\n\n let dd = this.directionsDisplay; \n this.directionsService.route({\n origin: new google.maps.LatLng(nextProps.org.lat, nextProps.org.lng),\n destination: new google.maps.LatLng(nextProps.dst.lat, nextProps.dst.lng),\n travelMode: 'BICYCLING'\n }, function(res, status) {\n if(status === 'OK') {\n addDirections(addDirs(res.routes[0].legs[0].steps));\n dd.setDirections(res);\n //directionsDisplay.setDirections(res);\n addTime(res.routes[0].legs[0].duration.value, res.routes[0].legs[0].duration.text);\n } else {\n console.error('directions failed: ' + status)\n }\n });\n }\n }", "connectedCallback () {\n window.addEventListener('online', goOnline);\n window.addEventListener('offline', goOffline);\n\n getGeoPermission();\n\n // The next line/check is added for when the state is hydrated.\n const {selectedStop} = Store.getState().tripSelector;\n const {favoriteStops} = Store.getState().tripSelector;\n if (!selectedStop) loadGeolocationStopsAndTrips(favoriteStops);\n\n this.draw();\n this.watch([\n 'loadingScreen.isLoading',\n 'menu.expanded'\n ], () => this.draw());\n }", "async componentDidMount() {\n\n const { claims, uid } = this.props.logStatus\n\n if (claims !== 'guest') {\n\n let siteFavorites = this.props.siteFavorites\n let trailFavorites = this.props.trailFavorites\n\n if (siteFavorites.length === 0) {\n siteFavorites = await getFavoritesIDs(uid)\n this.props.setSiteFavorites(siteFavorites)\n } \n\n if (trailFavorites.length === 0) {\n trailFavorites = await getTrailFavoritesIDs(uid)\n this.props.setTrailFavorites(trailFavorites)\n }\n }\n }", "function App() {\n const dispatch = useDispatch();\n return (\n <div className=\"App\">\n <h2>Workshop MERN</h2>\n <Button inverted color='blue' onClick={() => dispatch(toggleFalse())} >\n <Link to = \"/add\">Add contact</Link>\n </Button>\n <Button inverted color='blue' onClick={() => dispatch(toggleFalse())}>\n <Link to = \"/\"> contact List</Link>\n </Button>\n <Switch>\n {/* kif na3mal / thezni ll contactList */}\n <Route exact path = \"/\" component={ContactList}/>\n{/* na3mal objet fast tableau kif yabda 3endna plusieurs route f same component in react router */}\n <Route path = {[\"/add\", \"/edit/:id\"]} component={Add}/>\n\n </Switch>\n </div>\n );\n}", "componentDidMount() {\n //quand tout est charger cette fonction ce lance\n Geolocation.getCurrentPosition(\n position => {\n // pour avoir la pos au lancement de l'app\n this.setState({\n latitude: position.coords.latitude,\n longitude: position.coords.longitude,\n altitude: position.coords.altitude,\n error: null,\n });\n },\n error => console.log('ALEDDD'),\n {\n enableHighAccuracy: true,\n timeout: 200000,\n distanceFilter: 1,\n },\n );\n Geolocation.watchPosition(\n // ce lance a chaque changement (+/- le timeout) de position\n position => {\n this.setState({\n latitude: position.coords.latitude,\n longitude: position.coords.longitude,\n altitude: position.coords.altitude,\n error: null,\n liste_des_positions: this.state.liste_des_positions.concat({\n latitude: this.state.latitude,\n longitude: this.state.longitude,\n }),\n });\n let newPos = {\n latitude: this.state.latitude,\n longitude: this.state.longitude,\n };\n this.setState({count: this.state.count});\n const tripp = this.props.state.newTrip.trip;\n //Accualise la valeur pour savoir si on crée un trajet ou non\n this.setState({creactionTrajetenCours: this.props.state.creactionTrajet.creactionDeTrajetEnCours});\n //console.log('Creation de trajet ' + this.state.creactionTrajetenCours)\n if (this.state.creactionTrajetenCours === true){\n //Envoie les donnes des pos a l'api\n console.log(tripp.url)\n this.postDataApiLocalisations(tripp.url);\n }\n this.setState({courseEnCours: this.props.state.creactionCourse.courseEnCours});\n console.log('route')\n console.log(this.props.route)\n if(this.state.courseEnCours === true ){\n this.setState({count: this.state.count + 1});\n this.props.changementCourseRunIncre();\n console.log('count = ' + this.props.state.countRun.conteurRun + 'taille liste = ' + this.props.route.params.liste_des_details_pour_course.length);\n if(this.props.state.countRun.conteurRun < this.props.route.params.liste_des_details_pour_course.length - 1) {\n console.log('count = ' +this.props.state.countRun.conteurRun + 'taille liste = ' +this.props.route.params.liste_des_details_pour_course.length);\n //Actualisation de la position de ghost\n this.setState({latitude_course: this.props.route.params.liste_des_details_pour_course[this.props.state.countRun.conteurRun].latitude});\n this.setState({longitude_course: this.props.route.params.liste_des_details_pour_course[this.props.state.countRun.conteurRun].longitude});\n this.setState({altitude_course: this.props.route.params.liste_des_details_pour_course[this.props.state.countRun.conteurRun].altitude});\n }\n else{\n //code pour arriver du ghost+\n if(this.props.state.countCourse.conteurCourse === 0){\n alert('Le ghost est arrivé avant vous !')\n console.log('ghost arrivé');\n this.props.changementCourseoupas();\n }\n this.props.changementCourseCount(1);\n }\n }\n\n },\n error => console.log('ALED'),\n {\n enableHighAccuracy: true,\n timeout: 1000,\n distanceFilter: 1,\n },\n );\n\n\n }", "function onMostVisitedChange() {\n var pages = apiHandle.mostVisited;\n\n if (isBlacklisting) {\n // If this was called as a result of a blacklist, add a new replacement\n // (possibly filler) tile at the end and trigger the blacklist animation.\n var replacementTile = createTile(pages[MAX_NUM_TILES_TO_SHOW - 1]);\n\n tiles.push(replacementTile);\n tilesContainer.appendChild(replacementTile.elem);\n\n var lastBlacklistedTileElement = lastBlacklistedTile.elem;\n lastBlacklistedTileElement.addEventListener(\n 'webkitTransitionEnd', blacklistAnimationDone);\n lastBlacklistedTileElement.classList.add(CLASSES.BLACKLIST);\n // In order to animate the replacement tile sliding into place, it must\n // be made visible.\n updateTileVisibility(numTilesShown + 1);\n\n } else if (isUndoing) {\n // If this was called as a result of an undo, re-insert the last blacklisted\n // tile in its old location and trigger the undo animation.\n tiles.splice(\n lastBlacklistedIndex, 0, lastBlacklistedTile);\n var lastBlacklistedTileElement = lastBlacklistedTile.elem;\n tilesContainer.insertBefore(\n lastBlacklistedTileElement,\n tilesContainer.childNodes[lastBlacklistedIndex]);\n lastBlacklistedTileElement.addEventListener(\n 'webkitTransitionEnd', undoAnimationDone);\n // Force the removal to happen synchronously.\n lastBlacklistedTileElement.scrollTop;\n lastBlacklistedTileElement.classList.remove(CLASSES.BLACKLIST);\n } else {\n // Otherwise render the tiles using the new data without animation.\n tiles = [];\n for (var i = 0; i < MAX_NUM_TILES_TO_SHOW; ++i) {\n tiles.push(createTile(pages[i]));\n }\n renderTiles();\n }\n}", "componentWillReceiveProps(nextProps) {\n this.updateDisplayedMessages(nextProps.activeRoom);\n }", "componentWillReceiveProps(nextProps) {\n this.updateDisplayedMessages(nextProps.activeRoom);\n }", "componentDidMount() { \n this._isMounted = true;\n document.body.style.background= '#fff'; \n window.history.pushState(window.state, null, window.location.href);\n window.addEventListener('popstate', e => this._handleGoBack(e));\n window.onbeforeunload = this._handleRefresh\n }", "componentDidUpdate(prevProps) {\n // for on page navigation\n if (this.props.photos !== prevProps.photos){\n this.createPhotoObjects(this.props.photos);\n // for browser navigation\n } else if (this.props.history.action === 'POP')\n { this.props.history.replace();\n this.props.startSearch(this.props.history.location.pathname.slice(8))}\n }", "componentWillMount() {\n this.props.fetchStopsIfNeeded();\n }", "function queueViewHooks(def,tView,i){if(def.afterViewInit){(tView.viewHooks||(tView.viewHooks=[])).push(i,def.afterViewInit);}if(def.afterViewChecked){(tView.viewHooks||(tView.viewHooks=[])).push(i,def.afterViewChecked);(tView.viewCheckHooks||(tView.viewCheckHooks=[])).push(i,def.afterViewChecked);}}", "function onUpdate() {\n if (window.__INITIAL_STATE__ !== null) {\n window.__INITIAL_STATE__ = null;\n return;\n }\n const { state: { components, params } } = this;\n preRenderMiddleware(store.dispatch, components, params);\n}", "componentDidMount() {\n this.handleCurrentPageCheck();\n }", "function App() {\n const initialAppState = {\n isAuthenticated: false\n }\n const [store, dispatch] = useReducer(reducer, initialAppState);\n\n // useEffect(function () {\n\n // function loadTasks() {\n // const res = {\n // data,\n // }\n\n // dispatch({\n // type: 'init',\n // payload: {\n // cards: res.data,\n // }\n // });\n \n // localStorage.removeItem(\"contactManagerApp_cards\");\n // // console.log(\"qwer\");\n // var cards = [];\n // for (let i = 0; i <= 30; i++) {\n // cards[i] = { like: false, dislike: false }\n // }\n // const str = JSON.stringify(cards);\n // localStorage.setItem(\"contactManagerApp_cards\", str);\n\n // // const LOCAL_STORAGE_KEY = \"12345\";\n // // localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(abcde));\n // // localStorage.getItem()\n // }\n\n // loadTasks();\n\n // }, []);\n \n \n \n \n \n\n return (\n <AppContext.Provider value={{ store, dispatch }}>\n <Router>\n <Header></Header>\n <Switch>\n {/* <Route exact path=\"/\">\n <Home number={1}></Home>\n </Route>\n <Route exact path=\"/page/1\">\n <Redirect to={{ pathname: '/' }} />\n </Route>\n <Route exact path=\"/page/:number\" render={(props) =>\n <Home number={props.match.params.number} />\n } />\n <Route exact path=\"/add\" component={AddContact} />\n <Route exact path=\"/info/:id\" component={Info} />\n <Route path=\"*\" component={NotFound} /> */}\n\n\n {/* Tham khảo theo :\n https://www.youtube.com/watch?v=VzWBLj_CfpE */}\n <Route exact path='/login'><Login/></Route>\n <Route exact path='/' component={true?HomeEng:Login} />\n <Route exact path='/thu' component={true?Thu:Login} />\n <Route exact path='/home-vi' component={true?HomeViet:Login} />\n {/* <PrivateRoute path='/'>\n <Home />\n </PrivateRoute> */}\n </Switch>\n <Footer></Footer>\n {/* <ScrollButton></ScrollButton> */}\n </Router>\n </AppContext.Provider>\n //</>\n );\n}", "componentWillMount() {\n console.log('time to fetch posts');\n// obtained access by mapDispatchToprops\n this.props.fetchPosts();\n }", "function HomeNavbar() {\n _s();\n\n const {\n currentUser,\n logout\n } = Object(_authentication_context_AuthContext__WEBPACK_IMPORTED_MODULE_7__[\"useAuth\"])();\n const history = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_4__[\"useHistory\"])();\n const {\n fetchAllThreads\n } = Object(_context_ForumContext__WEBPACK_IMPORTED_MODULE_6__[\"useForum\"])();\n const [navSelector, setNavSelector] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useState\"])({\n home: true,\n blog: false,\n forum: false,\n shop: false,\n login: false\n });\n\n const handleClick = e => {\n const selectorName = e.currentTarget.name;\n const navSelectorNone = {\n home: false,\n blog: false,\n forum: false,\n shop: false,\n login: false\n };\n setNavSelector({ ...navSelectorNone,\n [selectorName]: true\n });\n\n switch (selectorName) {\n case \"home\":\n history.push(_routerPaths__WEBPACK_IMPORTED_MODULE_5__[\"home\"]);\n break;\n\n case \"blog\":\n history.push(_routerPaths__WEBPACK_IMPORTED_MODULE_5__[\"blog\"]);\n break;\n\n case \"forum\":\n history.push(_routerPaths__WEBPACK_IMPORTED_MODULE_5__[\"forum\"]);\n handleForumRefresh();\n break;\n\n case \"shop\":\n history.push(_routerPaths__WEBPACK_IMPORTED_MODULE_5__[\"shop\"]);\n break;\n\n case \"login\":\n history.push(_routerPaths__WEBPACK_IMPORTED_MODULE_5__[\"login\"]);\n break;\n\n default:\n return;\n }\n };\n\n const loginOrlogout = () => {\n if (currentUser) {\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(_material_ui_core__WEBPACK_IMPORTED_MODULE_2__[\"Button\"], {\n name: \"logout\",\n onClick: logout,\n classes: {\n label: \"navbutton-label\"\n },\n children: \"Logout\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 9\n }, this);\n } else {\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(_material_ui_core__WEBPACK_IMPORTED_MODULE_2__[\"Button\"], {\n name: \"login\",\n onClick: handleClick,\n classes: {\n label: \"navbutton-label\"\n },\n children: \"Login\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 9\n }, this);\n }\n };\n\n const handleForumRefresh = () => {\n fetchAllThreads();\n };\n\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(\"div\", {\n className: \"navbar\",\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(\"div\", {\n className: \"navbutton-group\",\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(\"div\", {\n className: navSelector.home ? \"navbutton--border\" : \"navbutton\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(_material_ui_core__WEBPACK_IMPORTED_MODULE_2__[\"Button\"], {\n name: \"home\",\n onClick: handleClick,\n classes: {\n label: \"navbutton-label\"\n },\n children: \"Home\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 9\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(\"div\", {\n className: navSelector.blog ? \"navbutton--border\" : \"navbutton\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(_material_ui_core__WEBPACK_IMPORTED_MODULE_2__[\"Button\"], {\n name: \"blog\",\n onClick: handleClick,\n classes: {\n label: \"navbutton-label\"\n },\n children: \"Blog\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 9\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(\"div\", {\n className: navSelector.forum ? \"navbutton--border\" : \"navbutton\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(_material_ui_core__WEBPACK_IMPORTED_MODULE_2__[\"Button\"], {\n name: \"forum\",\n onClick: handleClick,\n classes: {\n label: \"navbutton-label\"\n },\n children: \"Forum\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 107,\n columnNumber: 9\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(\"div\", {\n className: navSelector.shop ? \"navbutton--border\" : \"navbutton\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(_material_ui_core__WEBPACK_IMPORTED_MODULE_2__[\"Button\"], {\n name: \"shop\",\n onClick: handleClick,\n classes: {\n label: \"navbutton-label\"\n },\n children: \"Shop\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 7\n }, this), currentUser && /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(\"div\", {\n style: {\n fontSize: \"80%\",\n display: \"flex\",\n alignContent: \"baseline\"\n },\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(_material_ui_icons_Person__WEBPACK_IMPORTED_MODULE_8___default.a, {\n style: {\n fontSize: \"18px\"\n }\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 136,\n columnNumber: 11\n }, this), currentUser.displayName]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 133,\n columnNumber: 9\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__[\"jsxDEV\"])(\"div\", {\n className: navSelector.login ? \"navbutton--border\" : \"navbutton\",\n children: loginOrlogout()\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 140,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 5\n }, this);\n}", "componentWillMount() {\n const {cookies, history} = this.props;\n if(!cookies.get('token')) {\n history.push('/');\n }\n this.fetchFlows();\n }", "function Forum(port_to_backend) {\n // Port to backend server\n const BACKEND_PORT = port_to_backend;\n // Creates a state that holds an array of all threads\n const [threads, setThreads] = useState([]);\n // Retrieves data from backend\n useEffect(() => {\n fetch(`${BACKEND_PORT}/forum_posts`)\n .then((response) => {\n response.json().then((data) => {\n let old_posts = [];\n for (let i = 0; i < data.length; i++) {\n let id = data[i].id;\n let post_name = data[i].name;\n let post_message = data[i].message;\n let likes = data[i].likes;\n let date = data[i].date;\n date = new Date(date);\n let key = id + '' + date;\n \n let newThread = <Thread key={key} id={id} name={post_name} message={post_message} likes={likes} createdOn={date}/>;\n old_posts.push(newThread);\n }\n setThreads(old_posts);\n });\n });\n }, []);\n\n //UI to get user input for creating new threads, calls Forum.addThread() w/ given information\n function ForumManager(props) {\n const [name, setName] = useState(''); //state to store name of thread\n const [message, setMessage] = useState(''); //state to store message of thread\n\n // Post Request To Backend\n function handleSubmit(e, thread_name, thread_message) {\n e.preventDefault();\n props.createThread(name, message);\n if (thread_name === '' || thread_message === '') {\n console.log(\"User attempted to post an empty thread...\");\n return false;\n } else {\n console.log(\"User posted a thread...\");\n }\n let data = { \n \"thread_name\": thread_name,\n \"thread_message\" : thread_message \n };\n fetch(`${BACKEND_PORT}/forum_posts/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n });\n setName('');\n setMessage('');\n }\n\n /* Returns 2 input fields where user can input information about thread\n and a button that calls method to create a thread */\n return (\n <div className=\"forum-manager\">\n <textarea \n value={name}\n onChange={e => setName(e.target.value)}\n placeholder=\"Thread Name\"\n className=\"create-thread-name-input\"\n name=\"thread_name\"\n />\n <textarea\n value={message}\n onChange={e => setMessage(e.target.value)}\n placeholder=\"Thread Message\"\n className=\"create-thread-message-input\"\n name=\"thread_message\"\n />\n <button\n type=\"button\"\n className=\"create-thread-btn\"\n onClick={(e) => handleSubmit(e, name, message)}\n >\n Create Post\n </button>\n <button\n type=\"button\"\n className=\"sort-by-likes-btn\"\n onClick={(e) => sortByLikes(e)}\n >\n Sort by Likes\n </button>\n <button\n type=\"button\"\n className=\"sort-by-new-btn\"\n onClick={(e) => sortByNew(e)}\n >\n Sort by New\n </button>\n <button\n type=\"button\"\n className=\"dev-button\"\n onClick={(e) => runDevelopment(e)}\n >\n Dev Button\n </button>\n </div>\n );\n }\n\n // Loads comments from backend according to highest number of likes\n function sortByLikes(e) {\n e.preventDefault();\n console.log(\"User is sorting posts by likes...\");\n fetch(`${BACKEND_PORT}/forum_posts_by_likes/`)\n .then((response) => {\n response.json().then((data) => {\n let old_posts = [];\n for (let i = 0; i < data.length; i++) {\n let id = data[i].id;\n let post_name = data[i].name;\n let post_message = data[i].message;\n let likes = data[i].likes;\n let date = data[i].date;\n date = new Date(date);\n \n let newThread = <Thread id={id} name={post_name} message={post_message} likes={likes} createdOn={date}/>;\n old_posts.push(newThread);\n }\n setThreads(old_posts);\n });\n })\n };\n\n // Loads comments from backend according to reverse chronological order\n function sortByNew(e) {\n e.preventDefault();\n console.log(\"User is sorting posts by new...\")\n fetch(`${BACKEND_PORT}/forum_posts_by_new/`)\n .then((response) => {\n response.json().then((data) => {\n let old_posts = [];\n for (let i = 0; i < data.length; i++) {\n let id = data[i].id;\n let post_name = data[i].name;\n let post_message = data[i].message;\n let likes = data[i].likes;\n let date = data[i].date;\n date = new Date(date);\n \n let newThread = <Thread id={id} name={post_name} message={post_message} likes={likes} createdOn={date}/>;\n old_posts.push(newThread);\n }\n setThreads(old_posts);\n });\n })\n };\n\n // React Component for threads\n function Thread(props) {\n /*TO DO:\n -create a 'posted by: user_name' message for threads\n -make subcomments dynamic\n -make it so user can only like or unlike, not keep adding likes\n -make tick function server dependent. Currently clocks tick out of sync b/c they are a porperty of the thread itself\n */\n\n const [likes, setLikes] = useState(props.likes);\n const [time, setTime] = useState('Loading...');\n const [comments, setComments] = useState([]);\n const [showAddCommentField, setVisibility] = useState(false);\n\n useEffect(() => {\n fetch(`${BACKEND_PORT}/forum_comments/`)\n .then((response) => {\n response.json().then((data) => {\n let old_comments = [];\n for (let i = 0; i < data.length; i++) {\n //make sure comment belongs in this thread\n if (data[i].post_id === props.id) {\n // Retrieve data from backend\n let id = data[i].id;\n let name = data[i].name;\n let message = data[i].message;\n let likes = data[i].likes;\n let date = data[i].date;\n date = new Date(date);\n let post_id = data[i].post_id;\n let key = name + '' + date.getTime();\n //create comment\n let comment = <SubCommentA key={key} id={id} name={name} message={message} createdOn={date} likes={likes} post_id={post_id}/>;\n old_comments.push(comment);\n }\n }\n setComments(old_comments);\n });\n });\n }, []);\n\n const createdOn = props.createdOn;\n setTimeout(tick, 1000);\n //let clock = setInterval(tick, 1000);\n function tick() {\n setTime(howOld(createdOn));\n }\n\n function addLike() {\n fetch(`${BACKEND_PORT}/post/${props.id}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ likes : likes + 1 })\n });\n setLikes(likes + 1);\n };\n\n function addComment(name, message) {\n //make sure comment is not empty...\n if (name === '' || message === '') {\n alert('Must name comment and fill out description!');\n return;\n } else {\n console.log(\"User has added a comment...\");\n }\n const date = new Date();\n const key = name + ' ' + date.getTime();\n let newComment = <SubCommentA key={key} name={name} message={message} createdOn={date} likes={0} post_id={props.id}/>;\n setComments(comments.concat([newComment]));\n }\n\n // note: div instead of a react.fragment so that wrapper for the thread can be stylized\n return (\n <div className=\"thread\" id={props.id}>\n <div className=\"thread-name\">{props.name}</div>\n <button className=\"reply-button\" onClick={()=> setVisibility(true)}>Reply</button>\n <button className=\"like-button\" onClick={addLike}>Like</button>\n <div className=\"likes\">{likes}</div>\n <p>{props.message}</p>\n {comments}\n {showAddCommentField ? <CreateSubCommentForm createComment={addComment} post_id={props.id} hide={() => setVisibility(false)}/> : null}\n <p>{time}</p>\n </div>\n );\n }\n\n // Function to add a thread to threads array\n function addThread(name, message) {\n //make sure thread is not empty...\n if (name === '' || message === '') {\n alert(\"Name and message cannot be empty!\");\n return;\n } else {\n console.log(\"User has added a thread...\");\n };\n\n const date = new Date();\n let newThread = <Thread id={threads.length + 1} name={name} message={message} likes={0} createdOn={date}/>;\n setThreads(threads.concat([newThread]));\n }\n\n // React Component for a subcomment\n function SubCommentA(props) {\n const [likes, setLikes] = useState(props.likes);\n const [time, setTime] = useState('Loading...');\n const createdOn = props.createdOn;\n function tick() {\n setTime(howOld(createdOn));\n }\n setTimeout(tick, 1000);\n function addLike() {\n fetch(`${BACKEND_PORT}/comment/${props.id}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ likes : likes + 1 })\n });\n setLikes(likes + 1);\n };\n return (\n <div className=\"comment\" post_id={props.post_id}>\n <div className=\"comment-name\">{props.name}</div>\n <button className=\"like-button\" onClick={addLike}>Like</button>\n <div className=\"likes\">{likes}</div>\n <div className=\"comment-message\">{props.message}</div>\n <p>{time}</p>\n </div>\n );\n };\n\n // UI for creating-sub-comment form\n function CreateSubCommentForm(props) {\n //state to store message of the comment\n const [message, setMessage] = useState('');\n const [name, setName] = useState('');\n\n function handleSubmit(e, comment_message, comment_name) {\n e.preventDefault();\n // start\n if (comment_name === '' || comment_message === '') {\n console.log(\"User attempted to comment an empty comment...\");\n return false;\n } else {\n console.log(\"Comment is valid...\");\n }\n props.createComment(comment_name, comment_message);\n let data = {\n comment_name: comment_name,\n comment_message : comment_message,\n post_id : props.post_id\n };\n console.log(data);\n fetch(`${BACKEND_PORT}/forum_comments/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n });\n // end\n props.hide();\n setMessage('');\n }\n\n return (\n <form>\n <input\n value={name}\n onChange={e => setName(e.target.value)}\n placeholder=\"Commenter Name\"\n name=\"thread_name\"\n />\n <input\n value={message}\n onChange={e => setMessage(e.target.value)}\n placeholder=\"Comment Message\"\n name=\"thread_message\"\n />\n <button\n type=\"submit\"\n //className=\"*need comment-button class*\"\n onClick={(e) => handleSubmit(e, message, name)}\n >\n Comment\n </button>\n <button\n type=\"submit\"\n onClick={() => props.hide()}\n >\n Cancel\n </button>\n </form>\n );\n }\n\n //returns message displaying how old a date is\n function howOld(createdOn) {\n // Time constants\n const created = createdOn;\n const min = 60 * 1000;\n const hour = min * 60;\n const day = hour * 24;\n const week = day * 7;\n const week2 = week * 2;\n const week3 = week * 3;\n const week4 = week * 4;\n const max = week * 5;\n\n // Handles created '[some time] ago' message\n const now = new Date();\n const diff = now - created;\n let message = '';\n switch (true) {\n case diff < min:\n message = Math.floor(diff/1000) + ' seconds ago';\n break;\n case diff < hour:\n message = Math.floor(diff/min) + ' minutes ago';\n break;\n case diff < day:\n message = Math.floor(diff/hour) + ' hours ago';\n break;\n case diff < week:\n message = Math.floor(diff/day) + ' days ago';\n break;\n case diff < week2:\n message = '1 week ago';\n case diff < week3:\n message = '2 weeks ago';\n case diff < week4:\n message = '3 weeks ago';\n case diff < max:\n message = '4 weeks ago';\n break;\n default:\n let month;\n switch (created.getMonth()) {\n case 0:\n month = 'January';\n break;\n case 1:\n month = 'February';\n break;\n case 2:\n month = 'March';\n break;\n case 3:\n month = 'April'\n break;\n case 4:\n month = 'May'\n break;\n case 5:\n month = 'June'\n break;\n case 6:\n month = 'July'\n break;\n case 7:\n month = 'August'\n break;\n case 8:\n month = 'September'\n break;\n case 9:\n month = 'October'\n break;\n case 10:\n month = 'November'\n break;\n case 11:\n month = 'December'\n break;\n }\n message = month + ' ' + created.getDate() + ' ' + created.getFullYear();\n break;\n }\n return(message);\n }\n\n // Use to test builds in development\n function runDevelopment() {\n alert(\"Running Development...\");\n }\n\n // Returns Forum\n return (\n <React.Fragment>\n <div className=\"forum-page\">\n {/* <br/> */}\n <ForumManager createThread={addThread}/>\n <br/>\n <br/>\n <br/>\n <br/>\n <br/>\n {/* <br/> */}\n {threads}\n <br/>\n </div>\n </React.Fragment>\n );\n}", "onNavigationStateChange(prevState, currentState) {\n const currentScreen = this.getCurrentRouteName(currentState);\n const prevScreen = this.getCurrentRouteName(prevState);\n ////console.log(\"onNavigationStateChange\", currentScreen, prevScreen)\n if (prevScreen !== currentScreen) {\n if (currentScreen == 'Login' && !auth.hasRole('authed')) {\n // We landed on the login page but we are already authed - go home\n navigation.navigate('Home');\n }\n // the line below uses the Google Analytics tracker\n // change the tracker here to use other Mobile analytics SDK.\n // //console.log('navigateTo: ' + currentScreen);\n }\n }", "onNavigate({ linked: RouteCtr, params, query, uriFragment }) {\n // Create a new route each time we navigate\n const newRoute = new RouteCtr({ router: this });\n\n // Remove unnecessary pieces from the routeData\n const routeData = { params, query, uriFragment };\n\n // Store the route we're trying to transition to. This lets us know if\n // the user transitions away at a later time.\n this._transitioningTo = newRoute;\n\n // Give the route a way to bail out of transitioning even if it isn't\n // navigating to a new route (which the above would catch)\n newRoute._bail = false;\n newRoute.bail = () => { newRoute._bail = true; };\n\n // Convenience method for pulling relevant filters\n function getFilters(obj, type) {\n return _.result(obj, 'filters').reduce((arr, filter) => {\n const fn = filter[type];\n return fn ? [...arr, fn.bind(obj)] : arr;\n }, []);\n }\n\n // Gather filter chains\n const promiseChain = [\n // Router \"before\" filters\n ...getFilters(this, 'before'),\n\n // Route \"before\" filters\n ...getFilters(newRoute, 'before'),\n\n // Route fetch method\n newRoute.fetch.bind(newRoute),\n\n // Exit previous route\n () => (this.currentRoute ? this.currentRoute.exit() : undefined),\n\n // Store reference to this new route\n () => { this.currentRoute = newRoute; },\n\n // Route show method\n newRoute.show.bind(newRoute),\n\n // Route \"after\" filters\n ...getFilters(newRoute, 'after'),\n\n // Router \"after\" filters\n ...getFilters(this, 'after'),\n\n // Finally trigger a navigate event on the router & remove reference\n // to the route-in-progress\n () => {\n this.trigger('navigate', routeData);\n delete this._transitioningTo;\n return this;\n },\n ];\n\n // Start the crazy promise chain\n return promiseChain.reduce((p, fn) => p.then(() => {\n // Anytime the developer has an opportunity to navigate again,\n // we need to check if they have. If they have, then we stop.\n // We need to do this check after every step.\n if (this._transitioningTo !== newRoute || newRoute._bail) {\n return this;\n }\n return fn(routeData); // eslint-disable-line consistent-return\n }), Promise.resolve())\n\n // If there are errors at any time, then we look for an `error`\n // method of the Route. If it exists, we execute it; otherwise, we\n // use the Router's `error` callback.\n .catch((e) => {\n const handler = newRoute.error || this.error;\n return handler(e, routeData);\n });\n }", "function followingScreen({navigation}) {\r\n const [followingList, setFollowingList] = useState([]);\r\n const [err, setError] = useState(false);\r\n const [loading, setLoading] = useState(true);\r\n\r\n useEffect(()=> {\r\n let following = new Following(global.login);\r\n following.query().then((user_data) => {\r\n setFollowingList(user_data.following.nodes);\r\n setLoading(false)\r\n }).catch((error) => {\r\n throw error;\r\n setError(true)\r\n setLoading(false)\r\n });\r\n }, [])\r\n const pressHandler = (login) => {\r\n global.login = login\r\n navigation.dispatch(\r\n CommonActions.reset({\r\n index: 1,\r\n routes: [\r\n { name: 'User'}\r\n ]\r\n })\r\n );\r\n }\r\n\r\n if(loading){\r\n return (\r\n <SafeAreaView style={styles.container}>\r\n <Title>\r\n Loading!\r\n </Title>\r\n </SafeAreaView>\r\n )\r\n } else if(err){\r\n return (\r\n <SafeAreaView style={styles.container}>\r\n <Title>\r\n Error Fetching Data!\r\n </Title>\r\n </SafeAreaView>\r\n )\r\n } else {\r\n return (\r\n <SafeAreaView style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>\r\n <SafeAreaView>\r\n <Title style={{marginBottom: 10, marginTop: 10}}>\r\n Following\r\n </Title>\r\n </SafeAreaView>\r\n <ScrollView>\r\n { followingList.map((item) =>{\r\n return (\r\n <SafeAreaView key={item.id}>\r\n <View\r\n style={{\r\n borderBottomColor: 'darkgrey',\r\n borderBottomWidth: 1,\r\n marginBottom: 10,\r\n marginTop: 25\r\n }}\r\n />\r\n <TouchableOpacity onPress={() => pressHandler(item.login)}>\r\n <View style={{flexDirection: 'row', marginTop: 15}}>\r\n <Avatar.Image \r\n source={{\r\n uri: item.avatarUrl\r\n }}\r\n size={80}\r\n />\r\n <View style={{marginLeft: 20}}>\r\n <Title style={[styles.title, {\r\n marginTop:15,\r\n marginBottom: 5,\r\n }]}>{item.name}</Title>\r\n <Caption style={styles.caption}>{item.login}</Caption>\r\n </View>\r\n </View>\r\n </TouchableOpacity>\r\n </SafeAreaView>\r\n )\r\n })}\r\n </ScrollView>\r\n </SafeAreaView>\r\n );\r\n }\r\n}", "function NavBar(props) {\n const [user2, setUser2] = useState(\"\");\n const [user3, setUser3] = useState(\"Login\");\n const [email2, setEmail2] = useState(\"Login\");\n const [userid, setUserid] = useState(\"eww\");\n const [isadmin, setIsadmin] = useState(\"false\");\n const [favs, setFavs] = useState([]);\n const [following, setFollowing] = useState([]);\n const [islogged, setIslogged] = useState(\"false\");\n let history = useHistory();\n const [redirectToReferrer, setRedirectToReferrer] = useState(\"false\")\n const [test, setTest]= useState(null)\n const [updatejobs, setUpdatejobs]= useState(0)\n const updatefavs=(upfavs)=>{\n console.log(\"Updating favs: \",upfavs)\n setFavs(upfavs)\n }\n const updatefollowing=(following)=>{\n console.log(\"Updating following: \",following)\n setFollowing(following)\n }\n const value12 = {\n user2: user2,\n email2: email2,\n islogged: islogged,\n userid: userid,\n \n following: following,\n favs: favs,\n updatefavs: updatefavs,\n updatefollowing: updatefollowing,\n isadmin: isadmin,\n updatejobs:updatejobs,\n test: test\n }\n \n useEffect(() => {\n \n },[test]);\n const logout=()=>{\n setIslogged(\"false\")\n setEmail2(\"Login\")\n setUser3(\"Login\")\n setUserid(\"eww\")\n setUser2(\"\")\n setTest(test+1)\n }\n \n \n \n return (<Router>\n <div>\n <>\n <NabBar2 islogged={islogged} setIsadmin={setIsadmin} isadmin={isadmin} user3={user3} user2={user2} logout={logout} userid={userid} />\n <br></br>\n <div className=\"auth-wrapper\">\n <div className=\"auth-inner\">\n \n <Switch>\n <UserContext.Provider value={ value12 }>\n <Route exact path=\"/\" >\n \n \n <ShowJobs />\n </Route>\n <Route path=\"/savedads\" component={Savedads}/>\n <Route path=\"/ads/brand/:brand\" component={Showbrandads}/>\n <Route path=\"/ads/part/:part\" component={Showbrandads}/>\n <Route path=\"/admin\" >\n <Adminlogin setIsadmin={setIsadmin}/>\n </Route>\n <Route path=\"/bannedusers\" >\n <Bannedusers isadmin={isadmin}/>\n </Route>\n <Route path=\"/users\" >\n <Users isadmin={isadmin}/>\n </Route>\n <Route path=\"/search/:query\" component={Searchedusers}/>\n <Route path=\"/ad/:id\" component={Addetails}/>\n <Route path=\"/addbikead\">\n <Bikepost setTest={setTest} userid={userid} email2= {email2} />\n </Route>\n \n <Route path=\"/sign-in\" >\n <LoginForm setFavs={setFavs} setFollowing={setFollowing} setEmail2={setEmail2} setUserid={setUserid} setIslogged={setIslogged} setUser2={setUser2} user2={user2}/>\n </Route>\n <Route path=\"/sign-up\" component={SignupForm} />\n <Route path=\"/edit/:id\" component={EditJob} />\n <Route path=\"/settings\" >\n <Settings/>\n </Route>\n <Route path=\"/profile/:id\" >\n <Profile email2={email2} userid={userid} updatefollowing={updatefollowing}/>\n </Route>\n </UserContext.Provider>\n </Switch>\n \n \n \n </div>\n </div>\n </>\n \n </div></Router>\n )\n}", "function App() {\n // // tracking\n // let linkText = window.location.href;\n // console.log(linkText);\n // let entrySource = (linkText.match(/#/)) ? linkText.match(/#(.*?)(&|$|\\?)/)[1] : 'organic';\n // let article_id = (linkText.match(/utm_source=inline_article/)) ? linkText.match(/utm_source=inline_article_(.*?)(&|$|\\?)/)[1] : 'organic';\n // // const [entryS, setEntryS] = useState(entrySource);\n\n // switch(entrySource) {\n // case \"article\":\n // case \"base\":\n // case \"issue\":\n // break;\n // default:\n // entrySource = \"organic\";\n // TrackEvent.fireArticlePV(TrackEvent.removehash(window.location.href));\n // };\n return (\n <div>\n <Brand />\n <DistrictsEighteen >\n </DistrictsEighteen>\n </div>\n );\n}", "function App({ themeToggler, location }) {\n // Fetch current device\n const { isMobile, isTablet } = useWindowDimensions();\n // Page initialized as loading\n const [loading, setLoading] = useState(true);\n // User context data\n const { user, userRefresh, fbRefresh } = useUser();\n\n // Refresh user worksheet and FB data on page load\n useEffect(() => {\n const a = userRefresh(true);\n const b = fbRefresh(true);\n\n Promise.allSettled([a, b]).finally(() => {\n // Set loading to false after user info and fb info is fetched\n setLoading(false);\n });\n }, [userRefresh, fbRefresh]);\n\n // Determine if user is logged in\n const isLoggedIn = Boolean(user.worksheet != null);\n\n const MyRoute = Route;\n\n // Tutorial state\n const [isTutorialOpen, setIsTutorialOpen] = useState(false);\n\n // First tutorial state\n const [shownTutorial, setShownTutorial] = useLocalStorageState(\n 'shownTutorial',\n false\n );\n\n // Handle whether or not to open tutorial\n useEffect(() => {\n if (\n !isMobile &&\n !isTablet &&\n isLoggedIn &&\n !shownTutorial &&\n location &&\n location.pathname === '/catalog'\n ) {\n setIsTutorialOpen(true);\n }\n }, [\n isMobile,\n isTablet,\n isLoggedIn,\n shownTutorial,\n location,\n setIsTutorialOpen,\n ]);\n\n useEffect(() => {\n document.body.style.transition = `background-color ${lightTheme.trans_dur}`;\n }, []);\n\n // Render spinner if page loading\n if (loading) {\n return (\n <Row className=\"m-auto\" style={{ height: '100vh' }}>\n <Spinner className=\"m-auto\" animation=\"border\" role=\"status\">\n <span className=\"sr-only\">Loading...</span>\n </Spinner>\n </Row>\n );\n }\n\n return (\n <>\n <Navbar\n isLoggedIn={isLoggedIn}\n themeToggler={themeToggler}\n setIsTutorialOpen={setIsTutorialOpen}\n />\n <Switch>\n {/* Home Page */}\n <MyRoute exact path=\"/\">\n {isLoggedIn ? (\n /* <Home /> */ <Redirect to=\"/catalog\" />\n ) : (\n <Redirect to=\"/login\" />\n )}\n </MyRoute>\n\n {/* About */}\n <MyRoute exact path=\"/about\">\n <About />\n </MyRoute>\n\n {/* Catalog */}\n <MyRoute exact path=\"/catalog\">\n {!isLoggedIn ? (\n <Redirect push to=\"/login\" />\n ) : !user.hasEvals ? (\n <Redirect push to=\"/challenge\" />\n ) : (\n <Search />\n )}\n </MyRoute>\n\n {/* Auth */}\n <MyRoute exact path=\"/login\">\n {isLoggedIn ? <Redirect to=\"/\" /> : <Landing />}\n </MyRoute>\n\n <MyRoute exact path=\"/worksheetlogin\">\n {isLoggedIn ? <Redirect to=\"/worksheet\" /> : <WorksheetLogin />}\n </MyRoute>\n\n {/* OCE Challenge */}\n <MyRoute exact path=\"/challenge\">\n <Challenge />\n </MyRoute>\n\n {/* Worksheet */}\n <MyRoute exact path=\"/worksheet\">\n {isLoggedIn && user.hasEvals ? (\n <Worksheet />\n ) : (\n <Redirect to=\"/worksheetlogin\" />\n )}\n </MyRoute>\n\n {/* Graphiql explorer */}\n <MyRoute exact path=\"/graphiql\">\n {isLoggedIn ? <Graphiql /> : <GraphiqlLogin />}\n </MyRoute>\n\n {/* Thank You */}\n <MyRoute exact path=\"/thankyou\">\n <Thankyou />\n </MyRoute>\n\n {/* Join Us */}\n <MyRoute exact path=\"/joinus\">\n <Join />\n </MyRoute>\n\n {/* Footer Links */}\n\n <MyRoute exact path=\"/faq\">\n <FAQ />\n </MyRoute>\n\n {/* Privacy */}\n <MyRoute exact path=\"/privacypolicy\">\n <Privacy />\n </MyRoute>\n\n <MyRoute path=\"/Table\">\n <Redirect to=\"/catalog\" />\n </MyRoute>\n\n {/* Catch-all Route to NotFound Page */}\n <MyRoute path=\"/\">\n <NotFound />\n </MyRoute>\n </Switch>\n {/* Render footer if not on catalog */}\n <Route\n render={({ location: routeLocation }) => {\n return !['/catalog'].includes(routeLocation.pathname) && <Footer />;\n }}\n />\n {/* Tutorial for first-time users */}\n <Tutorial\n isTutorialOpen={isTutorialOpen}\n setIsTutorialOpen={setIsTutorialOpen}\n shownTutorial={shownTutorial}\n setShownTutorial={setShownTutorial}\n />\n </>\n );\n}", "function checkForIndexUpdate() {\n if (numThreads != document.getElementsByClassName(\"thread\").length) {\n \tnumThreads = document.getElementsByClassName(\"thread\").length\n addGreenPostsToIndex()\n }\n}", "function App() {\n useEffect(() => {\n TasksService.observerTasks(snap => {\n const allTasks = snap.docs.map(element => element.data());\n store.dispatch(saveDataFromFirebase(allTasks));\n });\n }, []);\n\n return (\n <Provider store={store}>\n <Layout style={{ minHeight: \"100%\" }}>\n <HeaderComponent />\n <Content>\n <Router>\n <Home path=\"/\" />\n <Done path=\"/done\" />\n <Error404 default />\n </Router>\n </Content>\n <Footer className=\"app-footer\">Created by Julian Valencia</Footer>\n </Layout>\n </Provider>\n );\n}", "renderPages(){\n return(\n <HashRouter>\n <div>\n <Redirect from=\"/\" to=\"/overview\" />\n <Route path=\"/overview\" component={POverview} />\n <Route path=\"/mm\" component={PMemoryManagement} />\n </div>\n </HashRouter>\n );\n }", "componentWillUnmount() {\n clearInterval(this.state.tic);\n }", "componentWillReceiveProps(nextProps) { \n let that = this; \n \n this.routes = nextProps.data; // an object\n this.selectedRoutes = nextProps.selectedRoutes; // an array\n\n if (this.selectedRoutes.includes(\"all\")) { // display all buses\n Object.keys(this.routes).map((routeTag) => this.routeOpacity[routeTag] = 1); \n } else { // only display the buses on the selected routes\n Object.keys(this.routes).map((routeTag) => this.routeOpacity[routeTag] = 0); \n if (this.selectedRoutes[0] !== \"\") {\n this.selectedRoutes.map((routeTag) => this.routeOpacity[routeTag] = 1); \n }\n } \n // console.log(this.routeOpacity);\n\n // call loadData & setInterval only when this.routes is loaded w/ routes info\n if (Object.keys(this.routes).length > 0) { \n // only call the setInterval func once\n if (!this.dataInterval) {\n this.loadData();\n \n this.dataInterval = setInterval(function() {\n that.loadData();\n }, 15000);\n } \n }\n }", "componentWillReceiveProps(props) {\n if (!this.props.topRoute && props.topRoute) this.props.refreshData();\n }", "componentDidUpdate(prevProps) {\n if(this.props.state.landing.featuredLandingPage[0].id !== prevProps.state.landing.featuredLandingPage[0].id){\n this.fetchTopicPageContent(this.state.topicId);\n }\n }", "function sync_hash() {\n var scrollTop = $window.scrollTop();\n var current_step = null;\n var min_scrollTop_diff = null;\n _.each($steps, function($step, n) {\n var scrollTop_diff = $steps[n].position().top - scrollTop;\n if (min_scrollTop_diff === null ||\n min_scrollTop_diff < 0 ||\n (scrollTop_diff >= 0 && scrollTop_diff < min_scrollTop_diff)) {\n min_scrollTop_diff = scrollTop_diff;\n current_step = n;\n }\n });\n if (current_step !== null) {\n var hash = '#step' + current_step;\n window.location.hash = hash;\n highlight_sidebar(hash);\n }\n }", "componentDidMount() {\n this.props.loadBg(\"mining\");\n this.getHistory();\n }", "componentDidMount() {\n this.stopList();\n this.routeList()\n }", "function App() {\n const [location, setLocation] = React.useState(history.location)\n React.useEffect(() => {\n return history.listen(l => setLocation(l))\n }, [])\n const {pathname} = location\n let ui = <Routes />\n if (pathname.startsWith('/isolated')) {\n const moduleName = pathname.split('/').slice(-1)[0]\n if (pathname.includes('-final')) {\n ui = <Isolated loader={() => import(`./exercises-final/${moduleName}`)} />\n } else {\n ui = <Isolated loader={() => import(`./exercises/${moduleName}`)} />\n }\n }\n return <React.Suspense fallback={<div>Loading...</div>}>{ui}</React.Suspense>\n}", "componentWillReceiveProps(nextProps) {\n if (nextProps.pageContent.app.name) {\n this.setState({\n loading: false,\n });\n }\n }", "UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps[this.props.section] && nextProps[this.props.section].favorites && nextProps[this.props.section].favorites.pageInfo.hasNextPage && nextProps[this.props.section].favorites.edges.length < 3) {\n this.props.relay.loadMore(\n 1, // Fetch the next 1 feed items\n (response, error) => {\n if (error) {\n console.error(error);\n }\n },\n );\n }\n }", "componentWillMount() {\n window.compList = [];\n }", "componentDidUpdate(prevProps) {\n if (prevProps === null || prevProps.match.params.workspaceId !== this.props.match.params.workspaceId) {\n //this.setState({recentWorkspaces: null}); // this is one solution but its ugly because the page goes white.\n\n this.getHeaderData(this.props.match.params.workspaceId);\n this.setState({currentLocation: \"gallery\"});\n }\n }", "componentDidUpdate(prevProps) {\n //to make the homepage only for the first video \n if (this.props.id !== prevProps.id) {\n this.props.getTaskList();\n }\n }", "componentDidMount(){\r\n // clear for debug\r\n //AsyncStorage.clear();\r\n \r\n this.updateFriends();\r\n this.updateState().then(()=>console.log(this.state));\r\n\r\n BackHandler.addEventListener('hardwareBackPress',\r\n () => {\r\n switch (this.state.page) {\r\n case 1:\r\n return false;\r\n case 2:\r\n this.setState({ page: 1 });\r\n this.updateFriends();//.then(()=>console.log(this.state.friends));\r\n return true;\r\n case 3:\r\n return true;\r\n }\r\n });\r\n }", "componentWillUpdate(nextProps) {\n if (!nextProps.authenticated) {\n this.context.router.push('/')\n }\n }", "forceUpdateHandler(){\n this.setState({ reRender: true})\n }", "function shouldFetchNewsThreads ( state = { \n\tids: new Map()\n}) {\n\treturn state.ids.size === 0;\n}", "componentDidUpdate () {\n\n if (this.props.recalculatePages === true) {\n this.checkForUpdate();\n };\n }", "componentWillMount() {\n this.unlisten = this.props.history.listen((location, action) => {\n if (location.pathname !== '/') {\n disabledSideBar();\n }\n\n if (document.body.clientWidth <= 750) {\n closeSideBar();\n }\n });\n }", "function App(props) {\n const { onAutoLogin } = props\n useEffect(() => {\n onAutoLogin()\n\n }, [onAutoLogin])\n\n return (\n\n <div className=\"App\">\n <BrowserRouter>\n <Suspense fallback={Spinner}>\n <Layout isAuth={props.isAuth} logout={props.onLogout}>\n <Switch>\n <Route path='/auth' component={Auth} />\n <Route path='/supermarket' component={ShoppingCartManager} />\n {/* <Route path='/tasks' component={TaskManager} /> */}\n <Redirect from='/' to='/auth' />\n </Switch>\n </Layout>\n </Suspense>\n </BrowserRouter>\n </div>\n );\n}", "componentWillUnmount() {\n this.clearTimers()\n }", "componentDidMount() {\n this.initializeMap();\n\n // Handles case when User navigates to About page\n // after initial App load.\n this.props.setPanWOFetch(false);\n }", "componentDidUpdate(){\n if(this.state.trail !== this.props.trail){\n this.setState({\n trail: this.props.trail,\n progress: 0\n })\n }\n }", "function RecommendedPage(props) {\n let history = useHistory();\n\n const RecipeView = () => {\n const [recipeData, setrecipeData] = useState([]);\n\n const user = Pool.getCurrentUser();\n useEffect(() => {\n trackPromise(\n axios.get(`/what-is-popular?userId=${user.username}`)\n .then(function (response) {\n console.log(response.data)\n // console.log(localStorage.getItem('ingredients'))\n setrecipeData(response.data);\n })\n .catch(function (error) {\n console.log(error);\n }));\n \n }, [window.location.pathname])\n\n\n function renderRecipes() {\n return (\n recipeData.map((x) =>\n <div>\n <CustomLink to={`/recipe/${x.id}`}>\n <Recipe data={x} />\n </CustomLink>\n </div>\n )\n )\n }\n return (\n <Container>\n <Row>\n <Col>\n <Link to=\"/home\">\n <Logo src={logo} />\n </Link>\n </Col>\n <Col>\n <Link to=\"/saved-recipes\">\n <Heart src={heart} />\n </Link>\n </Col>\n </Row>\n <Row>\n <Image src={Banner} fluid />\n </Row>\n <Row>\n <RecipeHeading>\n <Link onClick={() => { history.push('/home') }}><GoBack src={Back} />\n </Link>Recipes recommended for you\n </RecipeHeading>\n </Row>\n <Spacer height=\"3vh\" />\n <GridGenerator cols={3}>\n {recipeData.length ? renderRecipes() : null}\n </GridGenerator>\n </Container>\n )\n }\n\n return (\n <RecipeView />\n )\n\n}" ]
[ "0.58103335", "0.542898", "0.53228194", "0.5296358", "0.5247592", "0.5213371", "0.5190907", "0.51808065", "0.5070394", "0.506929", "0.5060426", "0.50431436", "0.50210977", "0.49881974", "0.49798256", "0.49666816", "0.49288386", "0.4918276", "0.491626", "0.4913396", "0.4911656", "0.48907083", "0.4878322", "0.4876636", "0.48667222", "0.48665133", "0.48630124", "0.4861002", "0.48428714", "0.48425075", "0.48399544", "0.4828072", "0.48082379", "0.4807125", "0.4800538", "0.47864527", "0.47802016", "0.4755521", "0.4751822", "0.47270638", "0.47219315", "0.4720671", "0.47175446", "0.47136626", "0.46961212", "0.46958357", "0.4675194", "0.46544427", "0.46412116", "0.46216083", "0.4616786", "0.46164972", "0.4612007", "0.46087727", "0.460704", "0.460704", "0.45905396", "0.45874006", "0.45856187", "0.45816204", "0.45805106", "0.45797667", "0.45796883", "0.4568661", "0.4567954", "0.45666438", "0.45636457", "0.45617408", "0.45608288", "0.45530495", "0.4548807", "0.45472288", "0.45350233", "0.4530861", "0.45282423", "0.4524366", "0.4520614", "0.45195583", "0.4515802", "0.45149758", "0.45123637", "0.4511921", "0.45109448", "0.45100313", "0.45079127", "0.45007834", "0.44936848", "0.44923964", "0.44889712", "0.4485789", "0.44845247", "0.44812235", "0.44802946", "0.44797847", "0.44678304", "0.44671667", "0.4466261", "0.44636127", "0.4457842", "0.445764" ]
0.62011886
0
an attempt to work around
function sendKeyframe(pc) { console.log('sendkeyframe', pc.iceConnectionState); if (pc.iceConnectionState !== 'connected') return; // safe... pc.setRemoteDescription( pc.remoteDescription, function () { pc.createAnswer( function (modifiedAnswer) { pc.setLocalDescription( modifiedAnswer, function () { // noop }, function (error) { console.log('triggerKeyframe setLocalDescription failed', error); UI.messageHandler.showError(); } ); }, function (error) { console.log('triggerKeyframe createAnswer failed', error); UI.messageHandler.showError(); } ); }, function (error) { console.log('triggerKeyframe setRemoteDescription failed', error); UI.messageHandler.showError(); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "static private internal function m121() {}", "static final private internal function m106() {}", "transient final protected internal function m174() {}", "static private protected internal function m118() {}", "transient private protected public internal function m181() {}", "static transient private protected internal function m55() {}", "static transient final private internal function m43() {}", "transient final private protected internal function m167() {}", "transient final private internal function m170() {}", "static transient final protected internal function m47() {}", "static transient final private protected internal function m40() {}", "__previnit(){}", "static private protected public internal function m117() {}", "static transient private protected public internal function m54() {}", "static transient final protected public internal function m46() {}", "static final private protected internal function m103() {}", "static transient private internal function m58() {}", "function StupidBug() {}", "obtain(){}", "static protected internal function m125() {}", "transient private public function m183() {}", "transient final private protected public internal function m166() {}", "static final protected internal function m110() {}", "static final private protected public internal function m102() {}", "static transient final protected function m44() {}", "static transient private public function m56() {}", "function _____SHARED_functions_____(){}", "static transient final private protected public internal function m39() {}", "apply () {}", "transient final private public function m168() {}", "static final private public function m104() {}", "lastUsed() { }", "_firstRendered() { }", "function a(e){return void 0===e&&(e=null),Object(r[\"p\"])(null!==e?e:i)}", "function Hx(a){return a&&a.ic?a.Mb():a}", "static transient protected internal function m62() {}", "static transient final private protected public function m38() {}", "function TMP(){return;}", "function TMP(){return;}", "function TMP() {\n return;\n }", "function _0x329edd(_0x38ef9f){return function(){return _0x38ef9f;};}", "static get END() { return 6; }", "prepare() {}", "static transient final private public function m41() {}", "function o0(o1)\n{\n var o2 = -1;\n try {\nfor (var o259 = 0; o3 < o1.length; function (o502, name, o38, o781, o782, o837, o585, o838, o549) {\n try {\no839.o468();\n}catch(e){}\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var o840 = name ? o591.resolve(o591.o592(o502, name)) : o502;\n\n function o841(o842) {\n function o843(o842) {\n try {\nif (!o838) {\n try {\no474.o800(o502, name, o842, o781, o782, o549);\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o837) try {\no837();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n }\n var o844 = false;\n try {\nModule['preloadPlugins'].forEach(function (o845) {\n try {\nif (o844) try {\nreturn;\n}catch(e){}\n}catch(e){}\n try {\nif (o845['canHandle'](o840)) {\n try {\no845['handle'](o842, o840, o843, function () {\n try {\nif (o585) try {\no585();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n });\n}catch(e){}\n try {\no844 = true;\n}catch(e){}\n }\n}catch(e){}\n });\n}catch(e){}\n try {\nif (!o844) try {\no843(o842);\n}catch(e){}\n}catch(e){}\n }\n try {\no332('cp ' + o840);\n}catch(e){}\n try {\nif (typeof o38 == 'string') {\n try {\no839.o846(o38, function (o842) {\n try {\no841(o842);\n}catch(e){}\n }, o585);\n}catch(e){}\n } else {\n try {\no841(o38);\n}catch(e){}\n }\n}catch(e){}\n })\n {\n try {\nif (o1[o3] == undefined)\n {\n try {\nif (o2 == -1)\n {\n try {\no2 = o3;\n}catch(e){}\n }\n}catch(e){}\n }\n else\n {\n try {\nif (o2 != -1)\n {\n try {\no4.o5(o2 + \"-\" + (o3-1) + \" = undefined\");\n}catch(e){}\n try {\no2 = -1;\n}catch(e){}\n }\n}catch(e){}\n try {\no4.o5(o3 + \" = \" + o1[o3]);\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "static private public function m119() {}", "function fixIeBug(e){return browser.msie?e.length-e.replace(/\\r*/g,\"\").length:0}", "rolledBack() {}", "function o1109()\n{\n var o1 = {};\n var o2 = \"aabccddeeffaaggaabbaabaabaab\".e(/((aa))/);\n try {\nfor(var o3 in e)\n { \n try {\nif(o4.o11([7,8,9,10], o109, \"slice(-4) returns the last 4 elements - [7,8,9,10]\"))\n { \n try {\no4.o5(\"propertyFound\");\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o2;\n}catch(e){}\n}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function ze(a){return a&&a.ae?a.ed():a}", "function ea(){}", "static get elvl_info() {return 0;}", "function o0(stdlib,o1,buffer) {\n try {\no8[4294967294];\n}catch(e){}\n function o104(o49, o50, o73) {\n try {\no95(o49, o50, o73, this);\n}catch(e){}\n\n try {\no489.o767++;\n}catch(e){}\n\n try {\nif (o97 === o49) {\n try {\nreturn true;\n}catch(e){}\n }\n}catch(e){}\n\n try {\nreturn false;\n}catch(e){}\n };\n //views\n var o3 =this;\n\n function o4(){\n var o30\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "function l(){t={},u=\"\",w=\"\"}", "function miFuncion (){}", "function oi(){}", "function _p(t,e){0}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function o8() {\n var o1 = this;\n try {\ntry { o1(\"BLEND_DST_RGB\"); } catch(e) {}\n}catch(e){}\n var o2 = o1.o2(\"### SCORE: \" + (100 * o0 / o10));\n\n\n var o4 = new Proxy(o2, {\n getOwnPropertyDescriptor: function (target, o3) {\n try {\nprint('getOwnPropertyDescriptor on proxy2 : ' + o3.toString());\n}catch(e){}\n try {\nreturn Object.e(target, o3);\n}catch(e){}\n },\n\n ownKeys: function (target) {\n try {\nprint('ownKeys for proxy2');\n}catch(e){}\n try {\nreturn [\"prop2\", \"prop3\", Symbol(\"prop4\"), Symbol(\"prop5\")];\n}catch(e){}\n }\n });\n\n try {\nprint('***Testing Object.keys()');\n}catch(e){}\n try {\ntry{\n try {\nprint(Object.keys(o4));\n}catch(e){}\n try {\nprint('Should throw TypeError because ownKeys doesnt return non-configurable key.');\n}catch(e){}\n } catch (o5) {\n try {\nif (!(o5 instanceof o6)) {\n try {\nprint('incorrect instanceof Error');\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "Rewind() {}", "function forFixingBug(idx) {\n\treturn idx*10 + 6;\n}", "function undici () {}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}" ]
[ "0.67953676", "0.6461239", "0.642104", "0.6208531", "0.6102396", "0.6011876", "0.59634054", "0.59355253", "0.57962424", "0.573845", "0.56429243", "0.56102186", "0.5574703", "0.5557605", "0.54862726", "0.5471745", "0.5366237", "0.5313665", "0.52801836", "0.52556163", "0.5254971", "0.52526134", "0.5216255", "0.52046716", "0.51820713", "0.516138", "0.515362", "0.5067451", "0.5046297", "0.50301105", "0.50250584", "0.502167", "0.50131786", "0.4968673", "0.49548593", "0.49175343", "0.49166325", "0.49081773", "0.49052757", "0.48984352", "0.4898405", "0.48760468", "0.48380157", "0.48345986", "0.48345986", "0.4805914", "0.48005292", "0.47870556", "0.47743332", "0.47718635", "0.47671816", "0.47650632", "0.47161892", "0.46990305", "0.46711478", "0.465215", "0.465215", "0.465215", "0.46442488", "0.46279767", "0.4620392", "0.46102244", "0.46005908", "0.45987448", "0.45943877", "0.45915496", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.458735", "0.45786864", "0.45734966", "0.45730823", "0.45697182", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424", "0.45638424" ]
0.0
-1
this could be useful in Array.prototype.
function arrayEquals(array) { // if the other array is a falsy value, return if (!array) return false; // compare lengths - can save a lot of time if (this.length != array.length) return false; for (var i = 0, l=this.length; i < l; i++) { // Check if we have nested arrays if (this[i] instanceof Array && array[i] instanceof Array) { // recurse into the nested arrays if (!this[i].equals(array[i])) return false; } else if (this[i] != array[i]) { // Warning - two different object instances will never be equal: {x:20} != {x:20} return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ArrayUtils() {}", "function Array() {}", "[Symbol.iterator]() {\n return this.#array[Symbol.iterator]();\n }", "function arrayMethodFix(fn){ // 809\n return function(){ // 810\n return fn.apply($.ES5Object(this), arguments); // 811\n } // 812\n} // 813", "function r(t){return t&&Object(i[\"l\"])(t.getArray)}", "function SpecialArray() {\n\t \t\t\t// create array;\n\t \t\t\tvar values = new Array();\n\n\t \t\t\t// add values\n\t \t\t\t// we're borrowing the push method, from Array, but since values is an instance of array, we only need to explicitly set the context to values\n\t \t\t\t// a new array is created an initialized using the push() method, which has all the constructor arguments passed to it\n\t \t\t\t// we are pushing everything from the arguments with apply, which takes a context object, and an array\n\t \t\t\tvalues.push.apply(values, arguments);\n\n\n\t \t\t\t// i just tried for (var i = 0; i < array.length; i++) { values.push(arguments[i])}\n\t \t\t\t// but using an apply makes much more sense when its with the arguments object\n\n\t \t\t\t// assign method\n\t \t\t\tvalues.toPipedString = function() {\n\t \t\t\t\treturn this.join(\"|\");\n\t \t\t\t};\n\n\t \t\t\t// return it\n\t \t\t\treturn values;\n\t \t\t}", "function a(c){(0,b.default)(this,a),(0,d.default)(this,\"arr\",void 0),(0,d.default)(this,\"arrIterator\",void 0),this.arr=c,this.arrIterator=c[Symbol.iterator]()}", "GetArrayElementAtIndex() {}", "function _b(){this.__data__={array:[],map:null}}", "function jt(t){return\"[object Array]\"===Rt.call(t)}", "function r(){this._array=[],this._set={}}", "spliceToArray() {\n return this.splice.apply(this, arguments).base;\n }", "toArray() {}", "toArray() {}", "toArray() {}", "function SpecialArray(){\n //Create the array\n var values = new Array()\n values.push.apply(values, arguments);\n\n //assign the method\n values.toPipedString = function (){\n return this.join(\"|\")\n }\n return values;\n}", "function n(){this._array=[],this._set={}}", "if (value.constructor != Array){\n value = [value, value];\n }", "function arrayToList() {\n\n}", "function $a(a) {\n\t\tif (!arguments.length) {\n\t\t\tfor (var i = $j - 1; i >= 0 && $k[i] !== Infinity; i--);\n\t\t\tif (i < 0) {\n\t\t\t\tthrow new Error('array-marker-not-found');\n\t\t\t}\n\t\t\ta = $k.splice(i + 1, $j - 1 - i);\n\t\t\t$j = i;\n\t\t} else if (!(a instanceof Array)) {\n\t\t\ta = new Array(+arguments[0]);\n\t\t\tfor (var i = 0, l = a.length; i < l; i++) {\n\t\t\t\ta[i] = null;\n\t\t\t}\n\t\t}\n\t\ta.b = a; // base array\n\t\ta.o = 0; // offset into base\n\t\treturn a;\n\t}", "ToArray() {\n\n }", "function iterifyArr(arr) {\r\n var cur = 0;\r\n arr.next = (function () { return (++cur >= this.length) ? false : this[cur]; });\r\n arr.prev = (function () { return (--cur < 0) ? false : this[cur]; });\r\n return arr;\r\n}", "function MyArray(arr=[]){\n\tthis.arr = arr\n\tthis.type = typeof arr\n\tthis.len = total_items\n\tthis.sum = function(){\n\t\ts = 0\n\t\tthis.arr.forEach(function(item){\n\t\t\ts += item\n\t\t})\n\t\treturn s\n\t}\n}", "function arrayEx(instance) {\n \n function isFunc (func) {\n return typeof func == 'function';\n }\n\n\n function sort ( field , dirc ) {\n dirc = dirc || 1 ;\n return instance.sort(function (x,y) {\n if (field) {\n if( x[field] > y[field]) {\n return dirc;\n } else {\n return -1 * dirc ;\n }\n } else {\n if( x > y ) {\n return dirc;\n } else {\n return -1 * dirc ;\n } \n } \n });\n }\n\n instance.asc = function(field) {\n return sort(field,1);\n }\n\n instance.desc = function (field){\n return sort(field,-1);\n }\n\n instance.each = function (func) {\n for (var i = 0; i < this.length; i++) {\n if (func(this[i], i) == false) {\n break;\n }\n }\n return this;\n }\n\n instance.where = function (func) {\n var results = [];\n results.ex();\n this.each(function (value, index) {\n if (func(value, index) == true) {\n results.push(value);\n }\n });\n return results;\n }\n\n instance.first = function (func) {\n if (this.length == 0) {\n return null;\n }\n if(isFunc(func)){\n return this.where(func).first();\n }else{\n return this[0];\n }\n }\n\n instance.last = function () {\n if (this.length == 0) {\n return null;\n }\n return this[this.length - 1];\n }\n\n instance.take = function (num) {\n var result = [];\n for (var i = 0; i < num; i++) {\n result.push(this[i]);\n }\n return result;\n }\n\n instance.skip = function (num) {\n var result = [];\n for (var i = num; i < this.length; i++) {\n result.push(this[i]);\n }\n return result;\n }\n\n instance.select = function (func) {\n var results = [];\n this.each(function (value, index) {\n results.push(func(value, index));\n });\n return results;\n }\n\n instance.remove = function (func) {\n var toRemove = [];\n toRemove.ex();\n this.each(function (val, index) {\n if (func(val, index)) { toRemove.push(index); }\n });\n var arr = this;\n toRemove.reverse().each(function (val) { arr.splice(val, 1) });\n return arr;\n }\n\n instance.removeElement = function (elment) {\n return this.remove(function (value, index) { return value == elment; });\n }\n\n instance.removeAt = function (index) {\n return this.remove(function (value, index) { return index == index; });\n }\n\n instance.indexOf = function (element) {\n var i = -1;\n this.each(function (value, index) {\n if (value == element) {\n i = index;\n return false;\n }\n });\n\n return i;\n }\n\n instance.contain = function (element) {\n return this.indexOf(element) >= 0;\n }\n\n return instance;\n }", "function e(){return [0,0,0,1]}", "function j(n){return\"[object Array]\"===x.call(n)}", "function Array$prototype$extend(f) {\n return this.map (function(_, idx, xs) { return f (xs.slice (idx)); });\n }", "MoveArrayElement() {}", "function arrayWrapper(thisArray) {\n this.arrayContent = thisArray;\n this.getElement = getElement; \n this.getSizeContent = getSizeContent;\n return this;\n}", "if (!this._array.hasOwnProperty(indexStart)) {\n indexStart = this._count;\n }", "function Arr(){ return Literal.apply(this,arguments) }", "function taintArray() {\n taintDataProperty(Array.prototype, \"0\");\n taintMethod(Array.prototype, \"indexOf\");\n taintMethod(Array.prototype, \"join\");\n taintMethod(Array.prototype, \"push\");\n taintMethod(Array.prototype, \"slice\");\n taintMethod(Array.prototype, \"sort\");\n}", "function Array$prototype$extend(f) {\n return this.map(function(_, idx, xs) { return f(xs.slice(idx)); });\n }", "function ArrayIterable(arr){\n this.arr = arr\n}", "function Array(){\n return false;\n}", "p(i) { return this.#p[i]; }", "function ArrayUtils() {\n\n /**\n *\n * <pre>\n *\n * @unit ArrayUtils.list#1\n * -> array of objects\n * -> property containing a property\n * -> value of the property\n * <- array with the occurrences\n *\n * @unit ArrayUtils.list#2\n * -> an invalid array\n * -> property containing a property\n * -> value of the property\n * <- empty array\n *\n * @unit ArrayUtils.list#3\n * -> array of objects\n * -> property\n * -> value of the property\n * <- empty array\n *\n * @unit ArrayUtils.list#4\n * -> array of objects\n * -> property containing an invalid property\n * -> value of the property\n * <- empty array\n *\n * @unit ArrayUtils.list#5\n * -> array of objects containing numbers\n * -> valid property\n * -> value of the property\n * <- array with the occurrences\n *\n * @unit ArrayUtils.list#6\n * -> array of objects containing arrays\n * -> valid property\n * -> value of the property\n * <- array with the occurrences\n *\n * @unit ArrayUtils.list#7\n * -> array of objects containing objects\n * -> valid property\n * -> value of the property\n * <- array with the occurrences\n *\n * </pre>\n *\n * TODO - description\n *\n * @param {Array} array - the array to be searched(must be an array of objects)\n * @param {String} property - the property we are looking for\n * @param {Object} value - the value the property must have to be included in the\n * filter\n *\n * @return []\n */\n this.list = function (array, property, value) {\n\n var response = [];\n\n for (var idx in array) {\n var item = array[idx];\n\n if (!_.isObject(item)) {\n continue;\n }\n\n if (item[property] === value) {\n response.push(item);\n }\n }\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.find#1\n * -> array of objects without duplicated entries\n * -> property containing a valid property\n * -> value of the property\n * <- object ocurrence\n *\n * @unit ArrayUtils.find#2\n * -> array of objects with array\n * -> property containing a valid property\n * -> value of the property\n * <- object ocurrence\n *\n * @unit ArrayUtils.find#3\n * -> array of objects with numbers\n * -> property containing a valid property\n * -> value of the property\n * <- object ocurrence\n *\n * @unit ArrayUtils.find#4\n * -> array of objects with objects\n * -> property containing a valid property\n * -> value of the property\n * <- object ocurrence\n *\n * @unit ArrayUtils.find#5\n * -> an invalid array\n * -> property containing a valid property\n * -> value of the property\n * <- null\n *\n * @unit ArrayUtils.find#6\n * -> array of objects\n * -> property containing an invalid property\n * -> value of the property\n * <- null\n *\n * @unit ArrayUtils.find#7\n * -> array with duplicate entries\n * -> property containing a valid property\n * -> value of the property\n * <- throw error\n * </pre>\n */\n this.find = function (array, property, value) {\n\n var response = this.list(array, property, value);\n\n if (response.length === 1) {\n response = response[0];\n } else if (response.length === 0) {\n response = null;\n } else {\n throw 'find returned ' + response.length + ' results, a maximum of one expected';\n }\n\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.distinct#1\n * -> array of objects\n * -> property containing an array\n * <- array with the occurrences\n *\n * @unit ArrayUtils.distinct#2\n * -> array of objects\n * -> property containing an objects\n * <- array with the occurrences\n *\n * @unit ArrayUtils.distinct#3\n * -> array of objects\n * -> property containing a string\n * <- array with the occurrences\n *\n * @unit ArrayUtils.distinct#4\n * -> array of objects\n * -> property containing a number\n * <- array with the occurrences must be returned\n *\n * @unit ArrayUtils.distinct#5\n * -> array of objects\n * -> property which the value is an array\n * <- the array of the given property\n *\n * @unit ArrayUtils.distinct#6\n * -> array of objects\n * -> non existing property\n * <- array with a single undefined element\n *\n * TODO - not sure what it should be o.O\n * @unit ArrayUtils.distinct#7\n * -> invalid array\n * -> ?\n * <- empty array\n *\n * </pre>\n *\n * Return a deduplicated list of values for the given property\n *\n * @param array - the array to be searched\n * @param property - the property we are looking for\n *\n * @return []\n */\n this.distinct = function (array, property) {\n\n var response = [];\n\n for (var idx in array) {\n\n var item = array[idx];\n\n if (!_.isObject(item)) {\n continue;\n }\n\n if (response.indexOf(item[property]) === -1) {\n response.push(item[property]);\n }\n }\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.filter#1\n * -> array of objects\n * -> a filter with properties containing strings, numbers, arrays and objects)\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.filter#2\n * -> array of objects\n * -> non matching filter\n * <- empty array\n *\n * @unit ArrayUtils.filter#4\n * -> invalid array\n * -> ?\n * <- empty array\n *\n * </pre>\n *\n * Return a list of values that match the given filter\n * TODO make it work properly on filters with properties containing arrays or objects\n *\n * @param array - the array to be searched\n * @param filter - An Object in which the keys are property names and\n * the values are the expected values\n *\n * @return []\n */\n this.filter = function (array, filter) {\n\n var response = array;\n\n for (var keyName in filter) {\n response = this.list(response, keyName, filter[keyName]);\n }\n\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.isIn#1\n * -> array of objects\n * -> existing property\n * -> list of strings\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.isIn#2\n * -> array of objects\n * -> existing property\n * -> list of numbers\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.isIn#3\n * -> array of objects\n * -> existing property\n * -> list of arrays\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.isIn#4\n * -> array of objects\n * -> existing property\n * -> list of objects\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.isIn#5\n * -> invalid array\n * -> ?\n * -> ?\n * <- empty array\n *\n * @unit ArrayUtils.isIn#6\n * -> array of objects\n * -> non existent property\n * -> ?\n * <- empty array\n *\n * @unit ArrayUtils.isIn#7\n * -> array of objects\n * -> existing property\n * -> string\n * <- empty array\n *\n * </pre>\n *\n *\n * TODO Succinctly describe this methods behavior\n *\n * @param array - the array to be searched\n * @param property - the property in which we will be searching\n * @param ids - the values we will be searching for in that property\n *\n * @return []\n */\n this.isIn = function (array, property, ids) {\n\n var response = [];\n\n for (var idx in array) {\n var item = array[idx];\n\n if (!_.isObject(item)) {\n continue;\n }\n\n if (ids.indexOf(item[property]) !== -1) {\n response.push(item);\n }\n }\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.innerJoin#1\n * -> array of objects\n * -> array of objects\n * -> property containing string\n * <- an array of joined objects\n *\n * @unit ArrayUtils.innerJoin#2\n * -> array of objects\n * -> array of objects\n * -> property containing number\n * <- an array of joined objects\n *\n * @unit ArrayUtils.innerJoin#3\n * -> array of objects\n * -> array of objects\n * -> property containing object\n * <- an array of joined objects\n *\n * @unit ArrayUtils.innerJoin#4\n * -> array of objects\n * -> array of objects\n * -> property containing array\n * <- an array of joined objects\n *\n * @unit ArrayUtils.innerJoin#5\n * -> array of objects\n * -> array of objects\n * -> property existing only in a1\n * <- an empty array\n *\n * @unit ArrayUtils.innerJoin#6\n * -> array of objects\n * -> array of objects\n * -> property existing only in a2\n * <- an empty array\n *\n * @unit ArrayUtils.innerJoin#7\n * -> array of objects\n * -> array of objects\n * -> non existent property\n * <- an empty array\n *\n * @unit ArrayUtils.innerJoin#8\n * -> invalid array\n * -> ?\n * -> ?\n * <- an empty array\n *\n * @unit ArrayUtils.innerJoin#9\n * -> array of objects\n * -> invalid array\n * -> ?\n * <- an empty array\n *\n * </pre>\n *\n *\n * TODO Joins two arrays on a matching property\n *\n * @param a1 - the first array of the join\n * @param a2 - the second array of the join\n * @param on - the property to join in\n *\n * @return []\n */\n this.innerJoin = function (a1, a2, on1, on2) {\n\n var a1f = [];\n var a2f = [];\n\n on2 = on2 ? on2 : on1;\n\n // TODO no need to initialize, but jshint keeps complaining :/\n var idx1 = 0, idx2 = 0;\n\n for (idx1 in a1) {\n if (_.isObject(a1[idx1]) && a1[idx1][on1] !== undefined) {\n a1f.push(a1[idx1]);\n }\n }\n\n for (idx2 in a2) {\n if (_.isObject(a2[idx2]) && a2[idx2][on2] !== undefined) {\n a2f.push(a2[idx2]);\n }\n }\n\n var response = [];\n\n for (idx1 in a1f) {\n var item1 = a1f[idx1];\n\n for (idx2 in a2f) {\n var item2 = a2f[idx2];\n\n if (item1[on1] === item2[on2]) {\n var obj = {};\n _.extend(obj, item1, item2);\n response.push(obj);\n }\n }\n }\n return response;\n };\n}", "function a(e,t){var n=i.length?i.pop():[],a=o.length?o.pop():[],s=r(e,t,n,a);return n.length=0,a.length=0,i.push(n),o.push(a),s}", "function ObservableArray$_overrideNativeMethods() {\n this[\"copyWithin\"] = ObservableArray$copyWithin;\n this[\"fill\"] = ObservableArray$fill;\n this[\"pop\"] = ObservableArray$pop;\n this[\"push\"] = ObservableArray$push;\n this[\"reverse\"] = ObservableArray$reverse;\n this[\"shift\"] = ObservableArray$shift;\n this[\"sort\"] = ObservableArray$sort;\n this[\"splice\"] = ObservableArray$splice;\n this[\"unshift\"] = ObservableArray$unshift;\n}", "function me(){this.i=0,this.j=0,this.S=new Array}", "toArray() {\n\n }", "function MjArray() {\n}", "function arrayLengthTest2() {\n var arr;\n\n arr = [ 1, 2 ];\n Array.prototype[2] = 'entry-in-proto';\n\n print(arr.length, arr[0], arr[1], arr[2], arr[3]);\n\n print(JSON.stringify(arr));\n}", "function t(a,b,e){this.f=a;this.i=void 0===b?function(){}:b;this.g=!1;this.b={};this.c=[];this.a={};this.h=w(this);x(this,a,!(void 0===e?0:e));y(this,function(){if(1===arguments.length&&\"object\"===k(arguments[0]))q(arguments[0],this);else if(2===arguments.length&&\"string\"===k(arguments[0])){var f=p(arguments[0],arguments[1]);q(f,this)}});var c=a.push,d=this;a.push=function(){var f=[].slice.call(arguments,0),l=c.apply(a,f);x(d,f);return l}}", "function MyArray() {\n\n let values = new Array();\n if (arguments.length > 0) { values.push.apply(values, arguments) };\n\n // convertir un array a string separado por |\n values.__proto__.toPipedString = function() {\n return values.join(\"|\")\n }\n\n // convertir un array a string separado por /\n values.__proto__.toDirectoryString = function() {\n return values.join(\"/\")\n };\n\n // clasificar un array de strings de forma ascendente\n values.__proto__.arrayStringAsc = function() {\n return values.sort(function(a, b) {\n return a.localeCompare(b)\n })\n };\n\n // clasificar un array de strings de forma descendente\n values.__proto__.arrayStringDesc = function() {\n return values.sort(function(a, b) {\n return b.localeCompare(a)\n })\n };\n\n // clasificar un array de numeros de forma ascendente\n values.__proto__.arrayNumberAsc = function() {\n return values.sort((a, b) => a - b)\n };\n\n // clasificar un array de numeros de forma descendente\n values.__proto__.arrayNumberDesc = function() {\n return values.sort((a, b) => b - a)\n };\n\n // clasificar un array de objetos por una de sus propiedades de forma ascendente\n values.__proto__.arrayObjAsc = function(propertyName) {\n return values.sort(\n function(propertyName) {\n\n // hem de retornar una funcio de 2 parametres\n return function(object1, object2) {\n let value1 = object1[propertyName];\n let value2 = object2[propertyName];\n\n if (value1 < value2) {\n return -1;\n } else if (value1 > value2) {\n return 1;\n } else {\n return 0;\n }\n };\n }(propertyName)\n\n )\n };\n\n // clasificar un array de objetos por una de sus propiedades de forma descendente\n values.__proto__.arrayObjDesc = function(propertyName) {\n return values.sort(\n function(propertyName) {\n\n // hem de retornar una funcio de 2 parametres\n return function(object1, object2) {\n let value1 = object1[propertyName];\n let value2 = object2[propertyName];\n\n if (value1 < value2) {\n return 1;\n } else if (value1 > value2) {\n return -1;\n } else {\n return 0;\n }\n };\n }(propertyName)\n\n )\n };\n\n // eliminar elementos duplicados de una array o un string\n values.__proto__.delItemDup = (itemIterale) => {\n return [...new Set(itemIterale)]\n };\n\n return values;\n }", "peek() {\n return this.arr[this.items.length - 1]\n }", "function lt(){try{var n=new Uint8Array(1);return n.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},n.foo()===42&&typeof n.subarray==\"function\"&&n.subarray(1,1).byteLength===0}catch(t){return!1}}", "function Array$prototype$map(f) {\n return this.map (function(x) { return f (x); });\n }", "function ie(){this.i=0,this.j=0,this.S=new Array}", "map(callback, thisArg = undefined) {\n const ret = new Arr();\n let i = 0;\n for (let p in this)\n ret.push(callback.call(thisArg, this[p], i++, this));\n return ret;\n }", "function w$(e){return Array.isArray(e)}", "testarrayoftables(index, obj) {\n const offset = this.bb.__offset(this.bb_pos, 26);\n return offset ? (obj || new Monster()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;\n }", "identity(arr) {\n return arr;\n }", "peek() {\n return this.array[this.array.length - 1];\n }", "function i(t,e){for(var n,r=0,o=t.length;r<o;r++)n=t[r],Array.isArray(n)?i(n,e):e.push(n);return e}", "get array_blks() {return(this.#ablks)}", "function helper(arr,set,index=0, step=0){\n \n\n}", "push(...el) {\n let i = Object.keys(this).length;\n for (let a of el)\n this[i++] = a;\n __classPrivateFieldSet(this, _length, __classPrivateFieldGet(this, _length) + el.length);\n return __classPrivateFieldGet(this, _length);\n }", "function re(){this.i=0,this.j=0,this.S=new Array}", "function B(t,e){var n=\"function\"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{while((void 0===e||e-- >0)&&!(r=i.next()).done)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i[\"return\"])&&n.call(i)}finally{if(o)throw o.error}}return a}", "function Array$prototype$map(f) {\n return this.map(function(x) { return f(x); });\n }", "function It(){this.i=0,this.j=0,this.S=new Array}", "arrayd(obj) {\n\n if (Array.isArray(obj)) {\n\n return {\n\n at(skip, pos) { return obj[pos] },\n rest(skip, pos) { return obj.slice(pos) }\n };\n }\n\n var iter = _es6now.iter(toObject(obj));\n\n return {\n\n at(skip) {\n\n var r;\n\n while (skip--)\n r = iter.next();\n\n return r.value;\n },\n\n rest(skip) {\n\n var a = [], r;\n\n while (--skip)\n r = iter.next();\n\n while (r = iter.next(), !r.done)\n a.push(r.value);\n\n return a;\n }\n };\n }", "function gSlist(value) {\n //var object = inherit(Array.prototype,'ArrayList');\n //console.log('gSlist->'+(value instanceof Array)+' - '+value);\n var data = [];\n\n if (value && value.length>0) {\n var i;\n for (i=0;i<value.length;i++) {\n if (value[i] instanceof GSspread) {\n var values = value[i].values;\n if (values.length>0) {\n var j;\n for (j=0;j<values.length;j++) {\n data[data.length]=values[j];\n }\n }\n } else {\n data[data.length]=value[i];\n }\n }\n }\n var object = data;\n\n gScreateClassNames(object,['java.util.ArrayList']);\n\n object.get = function(pos) {\n\n //Maybe comes a second parameter with default value\n if (arguments.length==2) {\n //console.log('uh->'+this[pos]);\n if (this[pos]==null || this[pos]==undefined) {\n return arguments[1];\n } else {\n return this[pos];\n }\n } else {\n return this[pos];\n }\n }\n\n object.getAt = function(pos) {\n return this[pos];\n }\n\n object.gSwith = function(closure) {\n //closure.apply(this,closure.arguments);\n gSinterceptClosureCall(closure, this);\n }\n\n object.size = function() {\n return this.length;\n }\n\n object.isEmpty = function() {\n return this.length == 0;\n }\n\n object.add = function(element) {\n this[this.length]=element;\n return this;\n }\n\n object.addAll = function(elements) {\n if (arguments.length == 1) {\n if (elements instanceof Array) {\n var i;\n\n for (i=0;i<elements.length;i++) {\n this.add(elements[i]);\n }\n }\n } else {\n //Two parameters index and collection\n var index = arguments[0];\n var data = arguments[1],i;\n for (i=0;i<data.length;i++) {\n this.splice(index+i,0,data[i]);\n }\n }\n return true;\n //return this;\n }\n\n object.clone = function() {\n var result = gSlist([]);\n result.addAll(this);\n return result;\n }\n\n object.plus = function(other) {\n var result = this.clone();\n result.addAll(other);\n return result;\n }\n\n object.minus = function(other) {\n var result = this.clone();\n result.removeAll(other);\n return result;\n }\n\n object.leftShift = function(element) {\n return this.add(element);\n }\n\n object.contains = function(object) {\n var gotIt,i;\n for (i=0;!gotIt && i<this.length;i++) {\n if (gSequals(this[i],object)) {\n //if (typeof this[i] === \"function\") continue;\n gotIt = true;\n }\n }\n return gotIt;\n }\n\n object.each = function(closure) {\n var i;\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n\n //TODO Beware this change, have to apply to all closure calls\n gSinterceptClosureCall(closure, this[i]);\n //closure(this[i]);\n }\n return this;\n }\n\n object.reverseEach = function(closure) {\n var i;\n for (i=this.length-1;i>=0;i--) {\n gSinterceptClosureCall(closure, this[i]);\n }\n return this;\n }\n\n object.eachWithIndex = function(closure,index) {\n for (index=0;index<this.length;index++) {\n //if (typeof this[index] === \"function\") continue;\n closure(this[index],index);\n }\n return this;\n }\n\n object.any = function(closure) {\n var i;\n for (i=0;i<this.length;i++) {\n if (closure(this[i])) {\n return true;\n }\n }\n return false;\n }\n\n object.values = function() {\n var result = [];\n var i;\n for (i=0;i<this.length;i++) {\n result[i]=this[i];\n }\n return result;\n }\n //Remove only 1 item from the list\n object.remove = function(indexOrValue) {\n var index = -1;\n if (typeof indexOrValue == 'number') {\n index = indexOrValue;\n } else {\n index = this.indexOf(indexOrValue);\n }\n if (index>=0) {\n this.splice(index,1);\n }\n return this;\n }\n\n //Maybe too much complex, not much inspired\n object.removeAll = function(data) {\n if (data instanceof Array) {\n var result = [];\n this.forEach(function(v, i, a) {\n if (data.contains(v)) {\n result.push(i);\n }\n })\n //Now in result we have index of items to delete\n if (result.length>0) {\n var decremental = 0;\n var thisgSlist = this;\n result.forEach(function(v, i, a) {\n //Had tho change this for thisgSlist, other scope on this here\n thisgSlist.splice(v-decremental,1);\n decremental=decremental+1;\n })\n }\n } else if (typeof data === \"function\") {\n var i;\n for (i=this.length-1;i>=0;i--) {\n if (data(this[i])) {\n this.remove(i);\n }\n }\n\n }\n\n return this;\n }\n\n object.collect = function(closure) {\n //this.forEach(closure)\n var result = gSlist([]);\n var i;\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n result[i] = closure(this[i]);\n }\n\n return result;\n }\n\n object.collectMany = function(closure) {\n //this.forEach(closure)\n var result = gSlist([]);\n var i;\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n result.addAll(closure(this[i]));\n }\n\n return result;\n }\n\n object.takeWhile = function(closure) {\n //this.forEach(closure)\n var result = gSlist([]);\n var i;\n for (i=0;i<this.length;i++) {\n if (closure(this[i])) {\n result[i] = this[i];\n } else {\n break;\n }\n }\n\n return result;\n }\n\n object.dropWhile = function(closure) {\n //this.forEach(closure)\n var result = gSlist([]);\n var i,j=0, insert = false;\n for (i=0;i<this.length;i++) {\n if (!closure(this[i])) {\n insert=true;\n }\n if (insert) {\n result[j++] = this[i];\n }\n }\n\n return result;\n }\n\n object.findAll = function(closure) {\n var values = this.filter(closure)\n return gSlist(values)\n }\n\n object.find = function(closure) {\n var result,i;\n for (i=0;!result && i<this.length;i++) {\n if (closure(this[i])) {\n result = this[i];\n }\n }\n return result;\n\n }\n\n object.first = function() {\n return this[0];\n }\n\n object.head = function() {\n return this[0];\n }\n\n object.last = function() {\n return this[this.length-1];\n }\n\n object.sum = function() {\n\n var result = 0;\n\n //can pass a closure to sum\n if (arguments.length == 1) {\n var i;\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n result = result + arguments[0](this[i]);\n }\n } else {\n\n if (this.length>0 && this[0]['plus']) {\n var i;\n var item = this[0];\n for (i=0;i+1<this.length;i++) {\n item = item.plus(this[i+1]);\n }\n return item;\n } else {\n var i;\n for (i=0;i<this.length;i++) {\n result = result + this[i];\n }\n }\n }\n return result;\n }\n\n object.inject = function() {\n\n var acc;\n //only 1 argument, just the closure\n if (arguments.length == 1) {\n\n acc = this[0];\n var i;\n for (i=1;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n acc = arguments[0](acc,this[i]);\n }\n\n } else {\n //We suppose arguments = 2\n acc = arguments[0];\n //console.log('number->'+this.length);\n var j;\n for (j=0;j<this.length;j++) {\n //console.log('acc->'+acc);\n //if (typeof this[j] === \"function\") continue;\n acc = arguments[1](acc,this[j]);\n //console.log('fin acc->'+acc);\n }\n }\n return acc;\n }\n\n object.toList = function() {\n return this;\n }\n\n object.intersect = function(otherList) {\n var result = gSlist([]);\n var i;\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n if (otherList.contains(this[i])) {\n result.add(this[i]);\n }\n }\n return result;\n }\n\n object.max = function() {\n var result = null;\n var i;\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n if (result==null || this[i]>result) {\n result = this[i];\n }\n }\n return result;\n }\n\n object.min = function() {\n var result = null;\n var i;\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n if (result==null || this[i]<result) {\n result = this[i];\n }\n }\n return result;\n }\n\n object.toString = function() {\n\n if (this.length>0) {\n var i;\n var result = '[';\n for (i=0;i<this.length-1;i++) {\n //if (typeof this[i] === \"function\") continue;\n result = result + this[i] + ', ';\n }\n result = result + this[this.length-1] + ']';\n return result;\n } else {\n return '[]';\n }\n }\n\n object.grep = function(param) {\n if (param instanceof RegExp) {\n var i;\n var result = gSlist([]);\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n if (gSmatch(this[i],param)) {\n result.add(this[i]);\n }\n }\n return result;\n } else if (param instanceof Array) {\n return this.intersect(param);\n } else if (typeof param === \"function\") {\n var i;\n var result = gSlist([]);\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n if (param(this[i])) {\n result.add(this[i]);\n }\n }\n return result;\n\n } else {\n var i;\n var result = gSlist([]);\n for (i=0;i<this.length;i++) {\n //if (typeof this[i] === \"function\") continue;\n if (this[i]==param) {\n result.add(this[i]);\n }\n }\n return result;\n\n }\n }\n\n object.equals = function(other) {\n //console.log('EQUALS!');\n if (!(other instanceof Array) || other.length!=this.length) {\n return false;\n } else {\n var i;\n var result = true;\n for (i=0;i<this.length && result;i++) {\n if (!gSequals(this[i],other[i])) {\n result = false;\n }\n }\n //console.log('EQUALS RESULT-'+result);\n return result;\n }\n }\n\n object.gSjoin = function() {\n var separator = '';\n if (arguments.length == 1) {\n separator = arguments[0];\n }\n var i, result;\n result = '';\n for (i=0;i<this.length;i++) {\n result = result + this[i];\n if ((i+1)<this.length) {\n result = result + separator;\n }\n }\n return result;\n }\n\n object.sort = function() {\n var modify = true;\n if (arguments.length > 0 && arguments[0] == false) {\n modify = false;\n }\n var i,copy = [];\n //Maybe some closure as last parameter\n var tempFunction = null;\n if (arguments.length == 2 && typeof arguments[1] === \"function\") {\n tempFunction = arguments[1];\n }\n if (arguments.length == 1 && typeof arguments[0] === \"function\") {\n tempFunction = arguments[0];\n }\n //Copy all items\n for (i=0;i<this.length;i++) {\n //if (tempFunction!=null && tempFunction.length == 1) {\n //If closure has 1 parameter we apply it to all items\n // [i] = tempFunction(this[i]);\n //}\n copy[i] = this[i];\n }\n //console.log('tempFunction->'+tempFunction);\n //If function has 2 parameter, inside compare both and return a number\n if (tempFunction!=null && tempFunction.length == 2) {\n copy.sort(tempFunction);\n }\n //If function has 1 parameter, we have to compare transformed items\n if (tempFunction!=null && tempFunction.length == 1) {\n copy.sort(function(a, b) {\n return gSspaceShip(tempFunction(a),tempFunction(b));\n });\n }\n if (tempFunction==null) {\n //console.log('Before-'+copy);\n copy.sort();\n //console.log('After-'+copy);\n }\n var result = gSlist(copy);\n if (modify) {\n for (i=0;i<this.length;i++) {\n this[i] = copy[i];\n }\n //console.log('Modify'+this.toString());\n return this;\n } else {\n //console.log('Not Modify-'+copy);\n return gSlist(copy);\n }\n }\n\n object.reverse = function() {\n var result;\n if (arguments.length == 1 && arguments[0]==true) {\n var i,count=0;\n for (i=this.length-1;i>count;i--) {\n var temp = this[count];\n this[count++] = this[i];\n this[i] = temp;\n }\n return this;\n } else {\n result = [];\n var i,count=0;\n for (i=this.length-1;i>=0;i--) {\n result[count++] = this[i];\n }\n return gSlist(result);\n }\n }\n\n object.take = function(number) {\n var result = [];\n var i;\n for (i=0;i<number;i++) {\n if (i<this.length) {\n result[i] = this[i];\n }\n }\n\n return gSlist(result);\n }\n\n object.takeWhile = function(closure) {\n var result = [];\n var i,exit=false;\n for (i=0;!exit && i<this.length;i++) {\n if (closure(this[i])) {\n result[i] = this[i];\n } else {\n exit = true;\n }\n }\n\n return gSlist(result);\n }\n\n object.multiply = function(number) {\n if (number==0) {\n return gSlist([]);\n } else {\n var i, result = gSlist([]);\n for (i=0;i<number;i++) {\n var j;\n for (j=0;j<this.length;j++) {\n result.add(this[j]);\n }\n }\n //console.log('list multiply->'+result);\n return result;\n }\n }\n\n object.flatten = function() {\n var result = gSlist([]);\n gSflatten(result,this);\n\n return result;\n }\n\n object.collate = function(number) {\n var step = number,times = 0;\n if (arguments.length == 2) {\n step = arguments[1];\n }\n var result = gSlist([]);\n while (step * times < this.length) {\n var items = gSlist([]);\n var pos = step * times;\n while (pos<this.length && items.size()<number) {\n items.add(this[pos++]);\n }\n result.add(items);\n times++;\n }\n return result;\n }\n\n return object;\n}", "function at(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),a=0;for(e=0;e<r;e++)for(var i=arguments[e],o=0,c=i.length;o<c;o++,a++)n[a]=i[o];return n}", "function BaseArray() {\n for (var i=0; i < arguments.length; i++) {\n this[i] = arguments[i];\n };\n this.length = arguments.length;\n }", "function s(e){\n// Support: real iOS 8.2 only (not reproducible in simulator)\n// `in` check used to prevent JIT error (gh-2145)\n// hasOwn isn't used here due to false negatives\n// regarding Nodelist length in IE\nvar t=!!e&&\"length\"in e&&e.length,n=me.type(e);return\"function\"!==n&&!me.isWindow(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&0<t&&t-1 in e)}", "function m(e,t){this.fun=e,this.array=t}", "function f(arr) {\n \n}", "toString() {\n return arrayToString(this);\n }", "function ArrayLikeIterator (obj) {\n\t this._o = obj\n\t this._i = 0\n\t}", "function createArrayMethod(type){\r\n var isMap = type == 1\r\n , isFilter = type == 2\r\n , isSome = type == 3\r\n , isEvery = type == 4\r\n , isFindIndex = type == 6\r\n , noholes = type == 5 || isFindIndex;\r\n return function(callbackfn/*, that = undefined */){\r\n var O = Object(assertDefined(this))\r\n , that = arguments[1]\r\n , self = ES5Object(O)\r\n , f = ctx(callbackfn, that, 3)\r\n , length = toLength(self.length)\r\n , index = 0\r\n , result = isMap ? Array(length) : isFilter ? [] : undefined\r\n , val, res;\r\n for(;length > index; index++)if(noholes || index in self){\r\n val = self[index];\r\n res = f(val, index, O);\r\n if(type){\r\n if(isMap)result[index] = res; // map\r\n else if(res)switch(type){\r\n case 3: return true; // some\r\n case 5: return val; // find\r\n case 6: return index; // findIndex\r\n case 2: result.push(val); // filter\r\n } else if(isEvery)return false; // every\r\n }\r\n }\r\n return isFindIndex ? -1 : isSome || isEvery ? isEvery : result;\r\n }\r\n}", "slice() {\n // redefine method in derived classes\n }", "size() { return 1; }", "function likeArray(obj) {\n return obj && typeof obj === \"object\" && typeof obj.length === \"number\";\n }", "function f0() {\n var printArr = [];\n Object.prototype.m = {};\n Object.defineProperty(Array.prototype, \"5\", {writable : true});\n\n for (var iterator = 0; iterator < 10; iterator++) {\n var arr0 = [];\n arr0[10] = \"Should not see this\";\n arr0.shift();\n for (var arr0Elem in arr0) {\n if (arr0Elem.indexOf('m')) {\n continue;\n }\n for (var i = 9.1 | 0; i < arr0.length; i++) {\n arr0[i] = \"\";\n }\n printArr.push(arr0);\n }\n }\n WScript.Echo(printArr);\n}", "since(p)\n {\n return this.buf.subarray(p, this.o);\n }", "function r(t,e){for(var n,i=0,o=t.length;i<o;i++)n=t[i],Array.isArray(n)?r(n,e):e.push(n);return e}", "private public function m246() {}", "function i(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}", "function SpecialArray() {\n var values = new Array();\n\n values.push.apply(values, arguments);\n \n values.toPipedString = function() {\n return this.join(\"|\");\n };\n \n return values;\n}", "function r(e,t){var n=i.length?i.pop():[],r=s.length?s.pop():[],a=o(e,t,n,r);return n.length=0,r.length=0,i.push(n),s.push(r),a}", "function myArray(len){\n\tvar a = [];\n\tfor(var i=0; i<len; i++){\n\t\ta[i] = {val:0};\n\t}\n\ta[len-1].val = 1;\n\treturn a;\n}", "function test_array_base() {\n let har, testItems;\n\n // Test normal additions\n har = new cal.HashedArray();\n testItems = [\"a\", \"b\", \"c\", \"d\"].map(hashedCreateItem);\n\n testItems.forEach(har.addItem, har);\n checkConsistancy(har, testItems);\n testRemoveModify(har, testItems);\n\n // Test adding in batch mode\n har = new cal.HashedArray();\n testItems = [\"e\", \"f\", \"g\", \"h\"].map(hashedCreateItem);\n har.startBatch();\n testItems.forEach(har.addItem, har);\n har.endBatch();\n checkConsistancy(har, testItems);\n testRemoveModify(har, testItems);\n}", "function test1(arr) {\n\tarr.push(arr.splice(arr.indexOf(0), 1)[0]);\n\n\treturn arr;\n}", "function m(e,n){this.fun=e,this.array=n}", "sliceToArray() {\n return this.slice.apply(this, arguments).base;\n }", "function Ac(t,e){var n;if(\"undefined\"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if(\"string\"==typeof t)return Tc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===n&&t.constructor&&(n=t.constructor.name);if(\"Map\"===n||\"Set\"===n)return Array.from(t);if(\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tc(t,e)}(t))||e&&t&&\"number\"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var a,o=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}", "function k(t){return[].slice.call(t)}", "function r(e,t){for(var n,i=0,o=e.length;i<o;i++)n=e[i],Array.isArray(n)?r(n,t):t.push(n);return t}", "function s(e,t){this.fun=e,this.array=t}", "function myArray(){\n this.size = 0,\n this.print = function(){\n for (let i = 0; i < this.size; i++){\n console.log(this[i]);\n }\n },\n this.push = function(item){\n this[this.size] = item;\n this.size++;\n },\n this.pop = function(){\n this[this.size-1] = undefined;\n this.size--;\n }\n}", "function e$1(){return [1,0,0,0,1,0,0,0,1]}", "_handleList(list, prev) {\n let value = prev || [];\n\n //\n // Run the functions that set and list share first\n //\n value = this._handleSetOrList(list, prev);\n\n if (list.prepend && Array.isArray(list.prepend)) {\n value.shift.apply(value, list.prepend);\n }\n\n if (list.index && this.typeOf(list.index) === 'object') {\n Object.keys(list.index).forEach(function (idx) {\n //\n // Don't allow any dangerous operations, and maybe error here\n //\n if (idx >= value.length) return;\n //\n // Set the value to the index value of the array\n //\n value[+idx] = list.index[idx];\n });\n }\n\n return value;\n }", "get x() { return this[0]; }", "function pr(a,b){this.e=[];this.q=a;this.o=b||null;this.c=this.a=!1;this.b=void 0;this.k=this.p=this.i=!1;this.f=0;this.d=null;this.g=0}", "function r(e,t){if(!Array.isArray(t))return e.slice();for(var n=t.length,r=e.length,o=-1,i=[];++o<r;){for(var a=e[o],s=!1,c=0;c<n;c++){if(a===t[c]){s=!0;break}}!1===s&&i.push(a)}return i}", "peek(){\n return this.array[0]\n }", "function f(){return{range:function(e,t,a){void 0===t?(t=e,e=0,a=1):a||(a=1);var n=[];if(a>0)for(var r=e;r<t;r+=a)n.push(r);else for(var f=e;f>t;f+=a)\n // eslint-disable-line for-direction\n n.push(f);return n},cycler:function(){return n(Array.prototype.slice.call(arguments))},joiner:function(e){return r(e)}}}", "array() {\n var track = this.track();\n return track ? track.array() : null;\n }", "minimo(arr = []) {\r\n Array.prototype.min = function () {\r\n return Math.min.apply(null, this);\r\n };\r\n return arr.min();\r\n }" ]
[ "0.696767", "0.66225266", "0.6128983", "0.60604686", "0.6013327", "0.6009423", "0.59820926", "0.59453964", "0.5943842", "0.59429765", "0.5881751", "0.58740425", "0.5865706", "0.5865706", "0.5865706", "0.58581585", "0.5850747", "0.5845911", "0.582462", "0.5821777", "0.5789929", "0.5720507", "0.5719355", "0.5696171", "0.56835943", "0.5676633", "0.5666919", "0.56650853", "0.56590706", "0.56583214", "0.5627237", "0.5622582", "0.5612012", "0.5609169", "0.5600893", "0.5596405", "0.5587511", "0.55624735", "0.5549513", "0.5547626", "0.5546123", "0.55436516", "0.55418694", "0.5538319", "0.5517367", "0.55030984", "0.5493735", "0.54931164", "0.54903597", "0.5485662", "0.5479707", "0.5463853", "0.54449844", "0.5440415", "0.5439941", "0.543873", "0.54350066", "0.543369", "0.5422874", "0.54213697", "0.54106796", "0.5389398", "0.53880256", "0.53848094", "0.538144", "0.5380491", "0.53756285", "0.53734446", "0.53691524", "0.53674394", "0.5366236", "0.5365371", "0.5362695", "0.5361863", "0.5361468", "0.5360759", "0.5354185", "0.534817", "0.5347322", "0.5345509", "0.53430545", "0.5341966", "0.5340323", "0.5339172", "0.5336692", "0.5334309", "0.532477", "0.5324025", "0.5323177", "0.532031", "0.53188515", "0.53178567", "0.53160584", "0.5315724", "0.53068846", "0.52970076", "0.52921695", "0.5291504", "0.52913964", "0.52902514", "0.5288393" ]
0.0
-1
Sends a COLIBRI message which enables or disables (according to 'state') the recording on the bridge. Waits for the result IQ and calls 'callback' with the new recording state, according to the IQ.
function setRecordingColibri(state, token, callback, connection) { var elem = $iq({to: connection.emuc.focusMucJid, type: 'set'}); elem.c('conference', { xmlns: 'http://jitsi.org/protocol/colibri' }); elem.c('recording', {state: state, token: token}); connection.sendIQ(elem, function (result) { console.log('Set recording "', state, '". Result:', result); var recordingElem = $(result).find('>conference>recording'); var newState = ('true' === recordingElem.attr('state')); recordingEnabled = newState; callback(newState); }, function (error) { console.warn(error); callback(recordingEnabled); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onCdr(callback)\n{\n if ( !callback || typeof (callback) !== 'function' ) { return; }\n webphone_api.cdrcb.push(callback);\n}", "function connect() {\n sb = new SendBird({appId: APP_ID.value});\n sb.connect(USER_ID.value, (user, error) => {\n if (error) {\n alert(error);\n } else {\n setChannelHandler();\n connected = true;\n recordingArea.style.display = 'inline-block';\n butConnect.style.display = 'none';\n }\n });\n}", "function onCallStateChange(callback)\n{\n if ( !callback || typeof (callback) !== 'function' ) { return; }\n webphone_api.callstatechangecb.push(callback);\n}", "function handleAQIPM100StateChanged (event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"started blinking\" or \"stopped blinking\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at); // the timestamp of the event\n\n // the data we want to send to the clients\n let data2 = {\n message: evData, // just forward \"started blinking\" or \"stopped blinking\"\n }\n\n // send data to all connected clients\n sendData(\"AQIPM100StateChanged\", data2, evDeviceId, evTimestamp );\n}", "function _connected(){// send response to agent-js\nutils.fireCallback(UIModel.getInstance().libraryInstance,CALLBACK_TYPES.SIP_CONNECTED,{message:\"SIP connected\"});}", "function onBLFStateChange(callback)\n{\n if ( !callback || typeof (callback) !== 'function' ) { return; }\n webphone_api.blfcb.push(callback);\n}", "function pirState(err, state) {\n\n if (err) {\n console.log(\"err: \" + err);\n throw err;\n }\n if(state == 1) {\n // turn LED on\n console.log(\"PIR detected\");\n streamData(state);\n //led1.writeSync(1);\n } else {\n // turn LED off\n //console.log(\"PIR off\");\n //led1.writeSync(0);\n }\n}", "function onRegStateChange(callback)\n{\n if ( !callback || typeof (callback) !== 'function' ) { return; }\n webphone_api.regstatechangecb.push(callback);\n}", "function peerConnectionStateChanged(peerIdentifier, state) {\n\n if (isFunction(peerConnectionStatusCallback)) {\n console.log(\"peerConnectionStateChanged \" + peerIdentifier + \" to state \" + state);\n peerConnectionStatusCallback(peerIdentifier, state);\n } else {\n console.log(\"peerConnectionStatusCallback not set !!!!\");\n }\n }", "_emitIceConnectionStateChange() {\n if (this._closed && this.iceConnectionState !== 'closed') {\n return;\n }\n\n logger.debug(\n 'emitting \"iceconnectionstatechange\", iceConnectionState:',\n this.iceConnectionState);\n\n const event = new yaeti.Event('iceconnectionstatechange');\n\n this.dispatchEvent(event);\n }", "function handleReceiveChannelStateChange() {\n var readyState = receiveChannel.readyState;\n weblog('Receive channel state is: ' + readyState);\n}", "bindChangeQcmAnswer(callback){\n this.onChangeQcm = callback;\n }", "function callCB(event) {\n console.log('SimpleCTI.callCB | event: ', event);\n }", "function onPresenceStateChange(callback)\n{\n if ( !callback || typeof (callback) !== 'function' ) { return; }\n webphone_api.presencecb.push(callback);\n}", "function handleICEConnectionStateChange(event){\n log(\"ICEConnectionStateChange: \"+pc.iceConnectionState)\n}", "onDataReceived (cb) {\n dbg('data received')\n this.delegate.didRangeBeaconsInRegion = cb\n }", "function _rsChng(x, callback){\n return function(){\n _readystatechange.fire(x);\n if (x.readyState === 4){\n _status[Math.floor(x.status/100)].fire(x);\n if (x.status === 200 && $L.typeCheck.func(callback)){\n callback(x);\n }\n }\n }\n }", "function IVRclientLoaded(err, ari_ivr) {\n \n \n io.on('connection', function (socket) {\n \n socket.on('call_ivr_hangup', function (channelin) {\n \n \n ari_ivr.channels.hangup({\n channelId: channelin\n })\n .then(function () {\n console.log('Hang up on IVR');\n\n \n })\n .catch(function (err) { });\n\n });\n \n \n \n \n \n \n socket.on('load_audio', function (job_num, fn) {\n \n \n var audio_job_arr_obj = [];\n \n \n \n ari_ivr.recordings.listStored().then(function (storedrecordings) {\n \n \n \n storedrecordings.forEach(function (rec_file, idx) {\n \n console.log('Recording for each : ' + rec_file.name);\n \n if (rec_file.name.startsWith(job_num + '_') == true) {\n \n var audio_job_obj = {};\n \n audio_job_obj.audioname = rec_file.name;\n data = fs.readFileSync(\"/var/spool/asterisk/recording/\" + rec_file.name + \".wav\");\n audio_job_obj.encodeb64out = data.toString('base64')\n \n audio_job_obj.msg_num = rec_file.name.split(\"_\")[rec_file.name.split(\"_\").length - 1];\n \n audio_job_arr_obj.push(audio_job_obj);\n console.log('Recording : ' + rec_file.name);\n\n\n }\n\n \n });\n \n fn(audio_job_arr_obj);\n \n });\n\n \n \n \n \n \n\n //console.log(file_name_wav);\n });\n \n \n \n socket.on('call_ivr', function (jobnum_in, campname_in, phonenum_in, fn) {\n \n \n console.log('calll ivr');\n \n console.log(phonenum_in);\n \n \n \n //new channel for dial out \n var channeloutivr = ari_ivr.Channel();\n \n var dialoutnum = phonenum_in;\n //'3865473629';\n //3865470958 3865068138\n //'3865470958';\n //3862564181\n \n var ivrsipgway = '5287389267GW1';\n var ivr_msg_recording = ari_ivr.LiveRecording();\n var recordingname = 'test_recording'\n var playbackIVR = ari_ivr.Playback();\n \n var job_name = campname_in;\n var job_num = jobnum_in;\n \n //0 intro\n //1 recording menu\n //2 after record menu\n //3 play back menu \n //4 return to intro\n ari_ivr.start('smivrout');\n \n \n \n //test IVR \n var obj_ivr_play = {};\n obj_ivr_play.intro_ivr_play_current_indx = 0;\n obj_ivr_play.ivrmenu = 0;\n obj_ivr_play.msg_rec_num = 0;\n obj_ivr_play.msg_rec_max = 9;\n obj_ivr_play.rec_arr = [];\n obj_ivr_play.intro_ivr_play = [\"intro_msg1\", \"b_\" , \"intro_msg2\", \"intro_msg3\", \"record_key_1\", \"record_msg_prompt_1\", \"record_msg_prompt_2\", \"record_msg_prompt_3\", \"record_msg_prompt_4\", \"record_msg_prompt_5\", \"record_msg_prompt_6\", \"record_msg_prompt_7\", \"record_msg_prompt_8\", \"record_msg_prompt_9\"];\n obj_ivr_play.current_msg_rec_edit = 0;\n obj_ivr_play.last_good_dtmf = 0;\n obj_ivr_play.rec_yn = 0;\n \n obj_ivr_play.rec_type = 'overwrite';\n \n \n \n \n \n \n\n //get job record info\n function getjobinfo_ivr(job_num, job_name, callback) {\n \n var recarray = [];\n \n \n ari_ivr.recordings.listStored().then(function (storedrecordings) {\n \n \n \n storedrecordings.forEach(function (rec_file, idx) {\n if (rec_file.name.indexOf(job_num + '_' + job_name.replace(' ', '_')) >= 0) {\n \n \n recarray.push(rec_file.name);\n console.log('Recording : ' + rec_file.name);\n\n }\n\n \n });\n \n \n obj_ivr_play.rec_arr = recarray;\n obj_ivr_play.msg_rec_num = recarray.length;\n \n if (recarray.length == 0) {\n obj_ivr_play.intro_ivr_play = [\"intro_msg1_aft\", \"b_\" + obj_ivr_play.msg_rec_max , \"intro_msg2\", \"intro_msg3\"];\n } else {\n \n obj_ivr_play.intro_ivr_play = [\"intro_msg1_aft\", \"b_\" + obj_ivr_play.msg_rec_max , \"intro_msg2\", \"msg_word\"];\n\n }\n \n \n \n \n //add for variable message read out for job that has messages recorded \n \n recarray.forEach(function (rec_file, idx) {\n //push for the and on the last already recorded msgs\n if (idx + 1 == recarray.length) {\n \n \n if (recarray.length == 1) {\n \n obj_ivr_play.intro_ivr_play.push('b_' + rec_file.substring(rec_file.length - 1 , rec_file.length), 'msg_have_been_4');\n \n } else {\n \n obj_ivr_play.intro_ivr_play.push('msg_have_been_3_and', 'b_' + rec_file.substring(rec_file.length - 1 , rec_file.length), 'msg_have_been_4');\n \n\n }\n \n } else {\n \n obj_ivr_play.intro_ivr_play.push('b_' + rec_file.substring(rec_file.length - 1 , rec_file.length));\n }\n\n });\n \n \n \n \n obj_ivr_play.intro_ivr_play.push('record_key_1', 'record_msg_prompt_1', 'record_msg_prompt_2', 'record_msg_prompt_3', 'record_msg_prompt_4', 'record_msg_prompt_5', 'record_msg_prompt_6', 'record_msg_prompt_7', 'record_msg_prompt_8', 'record_msg_prompt_9');\n \n console.log(obj_ivr_play.intro_ivr_play);\n \n callback(obj_ivr_play.msg_rec_num);\n\n\n }).catch(function (err) {\n \n \n });\n \n }\n \n \n \n //dtmf function \n \n \n \n function ondtmf_sc(event, channel) {\n console.log(event.digit);\n console.log(\"IVR dtmf event\");\n console.log(channel.id);\n \n //sound:custom/recordatendpress_pnd\n //recording:testrecording1\n \n \n \n function stop_playback(dtmfin, callback) {\n \n \n if (dtmfin != '#') {\n \n //stop loop playback for intro \n obj_ivr_play.intro_ivr_play_current_indx = -1;\n \n \n console.log('stop play back');\n \n if (obj_ivr_play.ivrmenu != 1) {\n playbackIVR.stop(function (err) {\n \n \n \n \n \n if (err) { \n //ignore errors\n \n }\n \n callback();\n });\n }\n\n\n } else {\n callback();\n }\n\n }\n \n \n \n \n \n \n \n \n \n \n \n function dtmfhandle(digit_dtmf, skipcheck) {\n \n \n var reckey = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];\n var reckeyafter = ['1', '2', '3', '0'];\n \n if (digit_dtmf == 0 && obj_ivr_play.ivrmenu == 4) {\n //intro \n obj_ivr_play.ivrmenu = 0;\n \n \n obj_ivr_play.last_good_dtmf = digit_dtmf;\n \n \n getjobinfo_ivr(job_num, job_name, function (msg_already_rec) {\n \n obj_ivr_play.intro_ivr_play_current_indx = 0;\n console.log('getting ready already rec' + msg_already_rec);\n \n \n obj_ivr_play.ivrmenu = 0;\n \n \n \n \n \n \n channel.play({ media: 'sound:custom/' + obj_ivr_play.intro_ivr_play[obj_ivr_play.intro_ivr_play_current_indx], skipms: 0 }, playbackIVR).then(function (playback) {\n\n\n\n }).catch(function (err) {\n obj_ivr_play.intro_ivr_play_current_indx = -1;\n \n \n console.log('Error Playback ivr');\n });\n\n\n \n });\n \n\n\n\n\n } else if (reckey.indexOf(digit_dtmf) >= 0 && obj_ivr_play.ivrmenu == 0) {\n \n obj_ivr_play.last_good_dtmf = digit_dtmf;\n //recording success yes no\n obj_ivr_play.rec_yn = 0;\n \n obj_ivr_play.ivrmenu = 1;\n obj_ivr_play.current_msg_rec_edit = digit_dtmf;\n \n //recording \n \n \n \n if (obj_ivr_play.rec_arr.indexOf(job_num + '_' + job_name.replace(' ', '_') + \"_\" + digit_dtmf) >= 0 && skipcheck == 0) {\n \n \n obj_ivr_play.ivrmenu = 1;\n obj_ivr_play.rec_yn = 1;\n obj_ivr_play.rec_type = 'overwrite';\n obj_ivr_play.current_msg_rec_edit = digit_dtmf;\n \n dtmfhandle('#', 0);\n\n\n } else {\n \n \n \n \n channel.play({ media: \"sound:custom/recstart_b\", skipms: 0 }, playbackIVR).then(function (playback) {\n console.log('Play Back IVR : recordatendpress_pnd')\n \n \n playback.once('PlaybackFinished', function (event, playback) {\n //record audio \n ari_ivr.channels.record({\n channelId: channel.id,\n format: 'wav',\n name: job_num + '_' + job_name.replace(' ', '_') + \"_\" + digit_dtmf,\n ifExists: obj_ivr_play.rec_type,\n beep: true,\n terminateOn : '#',\n maxSilenceSeconds : 10\n\n })\n .then(function (ivr_msg_recording) {\n console.log('succsess record');\n obj_ivr_play.rec_yn = 1;\n obj_ivr_play.rec_type = 'overwrite';\n \n \n // trim audio after record 1 sec on each end \n ivr_msg_recording.once('RecordingFinished', function (event, recording) {\n \n\n if (parseInt(event.recording.duration) > 4)\n {\n trimaudio_func('/var/spool/asterisk/recording/' + job_num + '_' + job_name.replace(' ', '_') + \"_\" + digit_dtmf, 1, parseInt(event.recording.duration) - 1);\n }\n\n });\n\n \n })\n .catch(function (err) {\n \n obj_ivr_play.rec_yn = 0;\n obj_ivr_play.rec_type = 'overwrite';\n console.log(err);\n console.log('recordingerror')\n });\n \n });\n\n }).catch(function (err) { console.log('Error Playback ivr recordatendpress_pnd'); });\n\n }\n\n\n } else if (digit_dtmf == '#' && obj_ivr_play.ivrmenu == 1 && obj_ivr_play.rec_yn == 1) {\n obj_ivr_play.last_good_dtmf = digit_dtmf;\n \n \n \n obj_ivr_play.rec_yn = 0;\n \n \n \n //console.log('Stop recording # input');\n \n obj_ivr_play.ivrmenu = 2;\n \n \n \n channel.play({ media: \"sound:custom/to_listen_1\", skipms: 0 }, playbackIVR).then(function (playback) {\n \n console.log('to listen play');\n \n \n playback.once('PlaybackFinished', function (event, playback) {\n \n channel.play({ media: \"sound:custom/b_\" + obj_ivr_play.current_msg_rec_edit, skipms: 0 }, playbackIVR).then(function (playback) {\n \n \n playback.once('PlaybackFinished', function (event, playback) {\n \n channel.play({ media: \"sound:custom/after_rec_2\" , skipms: 0}, playbackIVR).then(function (playback) { }).catch(function (err) { console.log('Error Playback ivr listen or recrecord'); });\n\n });\n \n \n }).catch(function (err) { console.log('sound play back 1 error'); });\n \n });\n\n\n \n }).catch(function (err) { console.log(err); console.log('Listen 1 error'); });\n \n \n } else if (obj_ivr_play.ivrmenu == 3) {\n //listen menu \n \n \n \n \n\n channeloutivr.removeListener('ChannelDtmfReceived', ondtmf_sc);\n \n channel.play({ media: 'recording:' + job_num + '_' + job_name.replace(' ', '_') + \"_\" + digit_dtmf }, playbackIVR).then(function (playback) {\n \n \n \n \n \n playback.once('PlaybackFinished', function (event, playback) {\n obj_ivr_play.rec_yn = 1;\n \n obj_ivr_play.ivrmenu = 1;\n \n \n obj_ivr_play.intro_ivr_play_current_indx = -1;\n \n \n dtmfhandle('#', 0);\n \n channeloutivr.on('ChannelDtmfReceived', ondtmf_sc);\n\n });\n }).catch(function (err) { console.log('Error Playback ivr Playback audio'); });\n\n \n \n \n } else if (reckeyafter.indexOf(digit_dtmf) >= 0 && obj_ivr_play.ivrmenu == 2) {\n \n obj_ivr_play.last_good_dtmf = digit_dtmf;\n \n if (digit_dtmf == 1) {\n obj_ivr_play.ivrmenu = 3;\n dtmfhandle(obj_ivr_play.current_msg_rec_edit, 0);\n\n } else if (digit_dtmf == 2) {\n \n \n \n obj_ivr_play.ivrmenu = 0;\n obj_ivr_play.rec_type = 'overwrite';\n \n dtmfhandle(obj_ivr_play.current_msg_rec_edit, 1);\n \n } else if (digit_dtmf == 3) {\n \n obj_ivr_play.ivrmenu = 0;\n obj_ivr_play.rec_type = 'append';\n dtmfhandle(obj_ivr_play.current_msg_rec_edit, 1);\n\n\n //append\n\n } else if (digit_dtmf == 0) {\n \n \n //back to intro \n \n obj_ivr_play.ivrmenu = 4;\n dtmfhandle(0, 0);\n }\n\n\n } else if (obj_ivr_play.ivrmenu != 1) {\n \n \n console.log(obj_ivr_play.last_good_dtmf);\n channeloutivr.removeListener('ChannelDtmfReceived', ondtmf_sc);\n \n stop_playback(666, function () {\n \n channel.play({ media: \"sound:custom/invaildresp\" , skipms: 0}, playbackIVR).then(function (playback) {\n \n \n console.log('hang up ivr');\n \n playback.once('PlaybackFinished', function (event, playback) {\n \n \n if (obj_ivr_play.last_good_dtmf == '0') {\n \n obj_ivr_play.ivrmenu = 4;\n\n } else if (obj_ivr_play.last_good_dtmf == '#') {\n \n \n obj_ivr_play.rec_yn = 1;\n obj_ivr_play.ivrmenu = 1;\n }\n \n \n \n \n dtmfhandle(obj_ivr_play.last_good_dtmf, 0);\n \n channeloutivr.on('ChannelDtmfReceived', ondtmf_sc);\n \n \n });\n \n }).catch(function (err) { console.log('INvaild response Playback ivr'); });\n });\n\n\n }\n \n }\n \n \n \n var vaildkey = ['#', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];\n \n \n if (vaildkey.indexOf(event.digit) >= 0) {\n \n console.log('vaild key');\n stop_playback(event.digit, function () {\n console.log(event.digit);\n dtmfhandle(event.digit, 0);\n })\n }\n \n\n \n\n \n }\n \n \n channeloutivr.on('ChannelDtmfReceived', ondtmf_sc);\n \n \n \n \n //Main play back finished loop event. \n \n playbackIVR.on(\"PlaybackFinished\", on_playback_finished);\n \n function on_playback_finished(event) {\n console.log(obj_ivr_play.intro_ivr_play_current_indx)\n \n \n \n \n \n if (obj_ivr_play.intro_ivr_play_current_indx < obj_ivr_play.intro_ivr_play.length - 1 && obj_ivr_play.intro_ivr_play_current_indx != -1) {\n \n obj_ivr_play.intro_ivr_play_current_indx += 1;\n \n console.log('Playing file : ' + obj_ivr_play.intro_ivr_play[obj_ivr_play.intro_ivr_play_current_indx]);\n \n \n \n \n channeloutivr.play({ media: 'sound:custom/' + obj_ivr_play.intro_ivr_play[obj_ivr_play.intro_ivr_play_current_indx] , skipms: 0}, playbackIVR).then(function (playback) {\n\n }).catch(function (err) {\n \n obj_ivr_play.intro_ivr_play_current_indx = -1;\n console.log('Error Playback ivr');\n });\n \n\n\n\n\n\n\n\n\n }\n\n }\n \n channeloutivr.on('StasisStart', function (event, channel) {\n \n console.log('StasisStart')\n socket.emit('ivr_status_msg', '<span class=\"text-success\">In IVR</span>');\n obj_ivr_play.ivrmenu = 0;\n \n \n console.log(obj_ivr_play.intro_ivr_play[obj_ivr_play.intro_ivr_play_current_indx]);\n \n \n \n \n channel.play({ media: 'sound:custom/' + 'intro_msg1' , skipms: 0}, playbackIVR).then(function (playback) {\n\n }).catch(function (err) {\n obj_ivr_play.intro_ivr_play_current_indx = -1;\n \n \n console.log('Error Playback ivr');\n });\n\n \n\n });\n \n \n \n \n channeloutivr.on('ChannelDestroyed', function (event, channel) {\n \n \n socket.emit('ivr_status_msg', '<span class=\"text-danger\">Hung Up</span>');\n console.log('ChannelDestroyed');\n socket.emit('ChannelDestroyed_ivr', channel.id);\n\n\n });\n \n \n \n // channeloutivr.on('ChannelHangupRequest', function (event, channel) {\n \n // console.log('ChannelHangupRequest');\n \n // socket.emit('ChannelDestroyed_ivr', channel.id);\n \n \n // });\n \n \n \n \n //intro \n \n \n \n \n //dial out procedure\n getjobinfo_ivr(job_num, job_name, function (msg_already_rec) {\n \n console.log('getting ready already rec' + msg_already_rec);\n \n channeloutivr.originate({ endpoint: 'SIP/' + ivrsipgway + '/1' + dialoutnum, app: 'smivrout', appArgs: 'dialed', callerId: '3862710666', \"variables\": { 'userobj': \"Alice\" } }).then(function (channel) {\n \n fn(channel.id);\n \n channel.once('ChannelStateChange', function (event, channel) {\n console.log(event);\n\n });\n\n \n socket.emit('ivr_status_msg', '<span class=\"text-warning\">Dialing Out</span>');\n \n \n console.log('ivr dial out' + channel.id);\n });\n\n \n });\n \n\n\n });\n });\n\n \n \n\n}", "function onConnectCallback() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"connected\");\r\n client.publish(\"lightControl1\", \"connected\", 0, false); //publish a message to the broker\r\n client.publish(\"lightControl2\", \"connected\", 0, false); //publish a message to the broker\r\n}", "function cb () {\n\t\tcallback();\n\t}", "function setBridgeDBRequestState(aState)\n{\n let overlay = document.getElementById(kBridgeDBRequestOverlay);\n if (overlay)\n {\n if (aState)\n overlay.setAttribute(\"state\", aState);\n else\n overlay.removeAttribute(\"state\");\n }\n\n let key = (aState) ? \"contacting_bridgedb\" : \"captcha_prompt\";\n setElemValue(kBridgeDBPrompt, TorLauncherUtil.getLocalizedString(key));\n\n let textBox = document.getElementById(kBridgeDBCaptchaSolution);\n if (textBox)\n {\n if (aState)\n textBox.setAttribute(\"disabled\", \"true\");\n else\n textBox.removeAttribute(\"disabled\");\n }\n\n // Show the network activity spinner or the reload button, as appropriate.\n let deckElem = document.getElementById(\"bridgeDBReloadDeck\");\n if (deckElem)\n {\n let panelID = aState ? kBridgeDBNetworkActivity\n : kBridgeDBReloadCaptchaButton;\n deckElem.selectedPanel = document.getElementById(panelID);\n }\n}", "connectedCallback() {\n super.connectedCallback();\n this.addEventListener(this._leaveEvent, this._iStateOnLeave);\n this.addEventListener(this._valueChangedEvent, this._iStateOnValueChange);\n this.initInteractionState();\n }", "function toggle_features(callback) {\n csnLow();\n spi.transfer(ACTIVATE);\n Q().then(function() {\n var deferred = Q.defer();\n var buf = new Buffer(1);\n buf[0] = consts.ACTIVATE;\n spi.transfer(buf, new Buffer(buf.length), deferred.makeNodeResolver());\n return deferred.promise;\n }).then(function() {\n var deferred = Q.defer();\n var buf = new Buffer(1);\n buf[0] = 0x73;\n spi.transfer(buf, new Buffer(buf.length), deferred.makeNodeResolver());\n return deferred.promise;\n }).then(function() {\n csnHigh();\n callback();\n });\n }", "function handleReceiveChannelStateChange() {\n var readyState = receiveChannel.readyState;\n trace('Receive channel state is: ' + readyState);\n\n // If channel ready, enable user's input\n if (readyState == \"open\") {\n\t dataChannelSend.disabled = false;\n\t dataChannelSend.focus();\n\t dataChannelSend.placeholder = \"\";\n\t sendButton.disabled = false;\n\t } else {\n\t dataChannelSend.disabled = true;\n\t sendButton.disabled = true;\n\t }\n}", "function registerReadCallback(callback){\n\t\t\t\n\t\t\tserial.registerReadCallback(callback,\n\t\t\t\tfunction error(){\n\t\t\t\t\tnew Error(\"Failed to register read callback\");\n\t\t\t\t});\n\t\t\t\n\t\t}", "function blink() {\n characteristic.read(changeState);\n }", "function chromeComplete(rtcPeerConnection){\n\t\tconsole.log(\"Signaling Complete!\");\n\t}", "static on_changed(chr, _retval) {\n let uuid = chr.getUuid()\n console.log(colours.fg.blue + \"[BLE] [CHANGE ]\" + colours.fg.yellow + \" UUID: \" + uuid.toString() + colours.fg.magenta + \" | data: 0x\" + bytes2hex(chr.getValue()) + colours.reset);\n }", "function changeRecorderStateRequest(recorderState,taskName){\n\n\n let rq= {command: 'Notify Recorder',recorder_state:recorderState,task_name:taskName}\n\n return browser.runtime.sendMessage(rq)\n}", "onCapabilityBoolean( value, opts, callback ) {\n\n // Switch Surveillance Mode is clicked\n if ( this.getData().id == \"aMode\" ){\n // this.log('Alarm button clicked: ' + value);\n Homey.app.deactivateAlarm(false, 'Alarm Off Button' ,function(err){\n if( err ) return Homey.alert( err );\n });\n }\n\n // Then, emit a callback ( err, result )\n callback( null );\n\n // or, return a Promise\n return Promise.reject( new Error('Switching the device failed!') );\n }", "cancelConnect(callback) {\n this._adapter.gapCancelConnect(err => {\n if (err) {\n // TODO: log more\n const newError = _makeError('Error occured when canceling connection', err);\n this.emit('error', newError);\n if (callback) { callback(newError); }\n } else {\n delete this._gapOperationsMap.connecting;\n this._changeState({connecting: false});\n if (callback) { callback(undefined); }\n }\n });\n }", "function connectionStatusListener(event) {\n trace(event.status);\n if (event.status == ConnectionStatus.Established) {\n trace('Connection has been established. You can start a new call.');\n $(\"#connectBtn\").text(\"Disconnect\").prop('disabled',false);\n $(\"#publishBtn\").prop('disabled', false);\n $(\"#playBtn\").prop('disabled', false);\n } else {\n if (event.status == ConnectionStatus.Disconnected) {\n if (recordFileName) {\n showDownloadLink(recordFileName);\n }\n }\n resetStates();\n }\n setConnectionStatus(event.status);\n}", "function callbackRecordCall(param)\r\n{\r\n if(param == 'STOP'){\r\n $('#btnRecordCall').attr('recordId','');\r\n $('#btnRecordCall').html('<i class=\"fa fa-microphone\"></i> Stop Recorder');\r\n }else{\r\n $('#btnRecordCall').attr('recordId',param);\r\n $('#btnRecordCall').html('<i class=\"fa fa-stop\"></i> Stop Recorder');\r\n }\r\n}", "connectedCallback(){\r\n }", "connectedCallback(){\r\n }", "function IVRclientLoadedv2test(err, ari_ivr) {\n \n \n \n ari_ivr.start('smivroutz');\n \n io.on('connection', function (socket) {\n \n socket.on('call_ivr_hangup', function (channelin) {\n \n \n ari_ivr.channels.hangup({\n channelId: channelin\n })\n .then(function () {\n console.log('Hang up on IVR');\n\n \n })\n .catch(function (err) { });\n\n });\n \n \n \n \n \n \n socket.on('load_audio', function (job_num, fn) {\n \n \n var audio_job_arr_obj = [];\n \n \n \n ari_ivr.recordings.listStored().then(function (storedrecordings) {\n \n \n \n storedrecordings.forEach(function (rec_file, idx) {\n \n console.log('Recording for each : ' + rec_file.name);\n \n if (rec_file.name.startsWith(job_num + '_') == true) {\n \n var audio_job_obj = {};\n \n audio_job_obj.audioname = rec_file.name;\n data = fs.readFileSync(\"/var/spool/asterisk/recording/\" + rec_file.name + \".wav\");\n audio_job_obj.encodeb64out = data.toString('base64')\n \n audio_job_obj.msg_num = rec_file.name.split(\"_\")[rec_file.name.split(\"_\").length - 1];\n \n audio_job_arr_obj.push(audio_job_obj);\n console.log('Recording : ' + rec_file.name);\n\n\n }\n\n \n });\n \n fn(audio_job_arr_obj);\n \n });\n\n \n \n \n \n \n\n //console.log(file_name_wav);\n });\n \n \n \n socket.on('call_ivr', function (jobnum_in, campname_in, phonenum_in, fn) {\n \n \n console.log('call testing 2 ivr');\n \n console.log(phonenum_in);\n \n \n \n //new channel for dial out \n var channeloutivr = ari_ivr.Channel();\n \n var dialoutnum = phonenum_in;\n //'3865473629';\n //3865470958 3865068138\n //'3865470958';\n //3862564181\n \n var ivrsipgway = '5287389267GW1';\n var ivr_msg_recording = ari_ivr.LiveRecording();\n var recordingname = 'test_recording'\n var playbackIVR = ari_ivr.Playback();\n \n var job_name = campname_in;\n var job_num = jobnum_in;\n \n //0 intro\n //1 recording menu\n //2 after record menu\n //3 play back menu \n //4 return to intro\n ari_ivr.start('smivrout');\n \n \n \n //test IVR \n var obj_ivr_play = {};\n obj_ivr_play.intro_ivr_play_current_indx = 0;\n obj_ivr_play.concat_intro = '';\n\n obj_ivr_play.ivrmenu = 0;\n obj_ivr_play.msg_rec_num = 0;\n obj_ivr_play.msg_rec_max = 9;\n obj_ivr_play.rec_arr = [];\n obj_ivr_play.intro_ivr_play = [\"intro_msg1\", \"b_\" , \"intro_msg2\", \"intro_msg3\", \"record_key_1\", \"record_msg_prompt_1\", \"record_msg_prompt_2\", \"record_msg_prompt_3\", \"record_msg_prompt_4\", \"record_msg_prompt_5\", \"record_msg_prompt_6\", \"record_msg_prompt_7\", \"record_msg_prompt_8\", \"record_msg_prompt_9\"];\n var fileNameListintro = \n [\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/intro_msg1.wav', \n 'varname': 'a'\n }, \n \n {\n 'file': '/var/lib/asterisk/sounds/en/custom/b_', \n 'varname': 'c' \n }, \n {\n 'file': '/var/lib/asterisk/sounds/en/custom/intro_msg2.wav', \n 'varname': 'c'\n }, \n \n {\n 'file': '/var/lib/asterisk/sounds/en/custom/intro_msg3.wav', \n 'varname': 'd'\n }, \n\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/msg_word.wav', \n 'varname': 'e'\n }\n ];\n\n \n var fileNameListintro_tolisten = \n [\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/to_listen_1.wav', \n 'varname': 'a'\n }, \n {\n 'file': '/var/lib/asterisk/sounds/en/custom/b_', \n 'varname': 'b' \n }, \n {\n 'file': '/var/lib/asterisk/sounds/en/custom/after_rec_2.wav', \n 'varname': 'c'\n }];\n \n \n \n \n\n\n obj_ivr_play.current_msg_rec_edit = 0;\n obj_ivr_play.last_good_dtmf = 0;\n obj_ivr_play.rec_yn = 0;\n \n obj_ivr_play.rec_type = 'overwrite';\n //get job record info\n function getjobinfo_ivr(job_num, job_name, callback) {\n \n var recarray = [];\n \n \n ari_ivr.recordings.listStored().then(function (storedrecordings) {\n \n \n \n storedrecordings.forEach(function (rec_file, idx) {\n if (rec_file.name.indexOf(job_num + '_' + job_name.replace(' ', '_')) >= 0) {\n \n \n recarray.push(rec_file.name);\n console.log('Recording : ' + rec_file.name);\n\n }\n\n \n });\n \n \n obj_ivr_play.rec_arr = recarray;\n obj_ivr_play.msg_rec_num = recarray.length;\n \n \n if (recarray.length == 0) {\n fileNameListintro[1].file = fileNameListintro[1].file + obj_ivr_play.msg_rec_max + '.wav'\n fileNameListintro[1].varname = fileNameListintro[1].varname + '_' + obj_ivr_play.msg_rec_max \n fileNameListintro.splice(4, 1);\n } else {\n fileNameListintro[1].file = fileNameListintro[1].file + obj_ivr_play.msg_rec_max + '.wav'\n fileNameListintro[1].varname = fileNameListintro[1].varname + '_' + obj_ivr_play.msg_rec_max \n fileNameListintro.splice(3,1);\n }\n \n \n \n \n \n \n \n \n // console.log(fileNameListintro);\n \n //add for variable message read out for job that has messages recorded \n \n recarray.forEach(function (rec_file, idx) {\n //push for the and on the last already recorded msgs\n if (idx + 1 == recarray.length) {\n \n if (recarray.length == 1) {\n \n\n fileNameListintro.push(\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/' + 'b_' + rec_file.substring(rec_file.length - 1 , rec_file.length) + '.wav', \n 'varname': 'f_' + rec_file.substring(rec_file.length - 1 , rec_file.length)\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/msg_have_been_4.wav', \n 'varname': 'g'\n });\n\n \n } else {\n \n \n fileNameListintro.push(\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/msg_have_been_3_and.wav', \n 'varname': 'h'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/' + 'b_' + rec_file.substring(rec_file.length - 1 , rec_file.length) + '.wav', \n 'varname': 'i_' + rec_file.substring(rec_file.length - 1 , rec_file.length)\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/msg_have_been_4.wav', \n 'varname': 'g'\n });\n\n\n\n }\n \n } else {\n \n \n \n fileNameListintro.push({\n 'file': '/var/lib/asterisk/sounds/en/custom/' + 'b_' + rec_file.substring(rec_file.length - 1 , rec_file.length) + '.wav', \n 'varname': 'k_' + rec_file.substring(rec_file.length - 1 , rec_file.length)\n });\n \n }\n\n });\n \n \n \n \n fileNameListintro.push({\n 'file': '/var/lib/asterisk/sounds/en/custom/record_key_1.wav', \n 'varname': 'l'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_1.wav', \n 'varname': 'm'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_2.wav', \n 'varname': 'n'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_3.wav', \n 'varname': 'o'\n },\n { \n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_4.wav', \n 'varname': 'p'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_5.wav', \n 'varname': 'q'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_6.wav', \n 'varname': 'r'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_7.wav', \n 'varname': 's'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_8.wav', \n 'varname': 't'\n },\n {\n 'file': '/var/lib/asterisk/sounds/en/custom/record_msg_prompt_9.wav', \n 'varname': 'u'\n });\n \n var filename = '';\n\n for (var i = 0, len = fileNameListintro.length; i < len; i++) {\n \n filename += fileNameListintro[i].varname\n \n } \n \n var msgarray = [obj_ivr_play.msg_rec_num, fileNameListintro, 'intro_' + job_num + '_' + filename + '.wav'];\n\n callback(msgarray);\n\n }).catch(function (err) {\n \n \n });\n \n }\n \n \n \n //dtmf function \n \n \n \n function ondtmf_sc(event, channel) {\n console.log(event.digit);\n console.log(\"IVR dtmf event\");\n console.log(channel.id);\n \n //sound:custom/recordatendpress_pnd\n //recording:testrecording1\n \n \n \n function stop_playback(dtmfin, callback) {\n \n \n if (dtmfin != '#') {\n \n //stop loop playback for intro \n obj_ivr_play.intro_ivr_play_current_indx = -1;\n \n \n console.log('stop play back');\n \n if (obj_ivr_play.ivrmenu != 1) {\n playbackIVR.stop(function (err) {\n \n \n \n \n \n if (err) { \n //ignore errors\n \n }\n \n callback();\n });\n }\n\n\n } else {\n callback();\n }\n\n }\n \n \n \n \n //get after job info dtmf press\n function getjobinfo_ivr_dtmf(dtmfin, job_num, callback) {\n \n var filename = '';\n fileNameListintro_tolisten[1].file = fileNameListintro_tolisten[1].file + dtmfin + '.wav';\n fileNameListintro_tolisten[1].varname = fileNameListintro_tolisten[1].varname + '_' + dtmfin;\n \n for (var i = 0, len = fileNameListintro_tolisten.length; i < len; i++) {\n filename += fileNameListintro_tolisten[i].varname;\n }\n \n \n fs.stat('/var/lib/asterisk/sounds/en/custom/' + 'dtmf_' + job_num + '_' + filename + '.wav', function (err, stat) {\n if (err == null) {\n console.log('File exists');\n \n callback('dtmf_' + job_num + '_' + filename);\n } else if (err.code == 'ENOENT') {\n \n console.log('no file')\n concat_audio_func_arr(fileNameListintro_tolisten, '/var/lib/asterisk/sounds/en/custom/' + 'dtmf_' + job_num + '_' + filename + '.wav');\n \n callback('dtmf_' + job_num + '_' + filename);\n } else {\n console.log('Some other error: ', err.code);\n\n\n }\n });\n\n\n \n\n }\n \n \n \n \n \n \n \n function dtmfhandle(digit_dtmf, skipcheck) {\n \n \n var reckey = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];\n var reckeyafter = ['1', '2', '3', '0'];\n \n if (digit_dtmf == 0 && obj_ivr_play.ivrmenu == 4) {\n //intro \n obj_ivr_play.ivrmenu = 0;\n \n \n obj_ivr_play.last_good_dtmf = digit_dtmf;\n \n \n getjobinfo_ivr(job_num, job_name, function (msg_arr) {\n \n console.log(msg_arr[0]);\n console.log(msg_arr[1]);\n \n \n obj_ivr_play.concat_intro = msg_arr[2];\n \n \n fs.stat('/var/lib/asterisk/sounds/en/custom/' + obj_ivr_play.concat_intro, function (err, stat) {\n if (err == null) {\n console.log('File exists');\n } else if (err.code == 'ENOENT') {\n \n console.log('no file')\n concat_audio_func_arr(msg_arr[1], '/var/lib/asterisk/sounds/en/custom/' + msg_arr[2]);\n } else {\n console.log('Some other error: ', err.code);\n }\n });\n\n\n\n obj_ivr_play.intro_ivr_play_current_indx = 0;\n console.log('getting ready already rec ' + obj_ivr_play.concat_intro);\n \n \n obj_ivr_play.ivrmenu = 0;\n \n \n \n \n \n \n channel.play({ media: 'sound:custom/' + obj_ivr_play.concat_intro}, playbackIVR).then(function (playback) {\n\n\n\n }).catch(function (err) {\n obj_ivr_play.intro_ivr_play_current_indx = -1;\n \n console.log(err);\n\n console.log('Error Playback ivr');\n });\n\n\n \n });\n \n\n\n\n\n } else if (reckey.indexOf(digit_dtmf) >= 0 && obj_ivr_play.ivrmenu == 0) {\n \n obj_ivr_play.last_good_dtmf = digit_dtmf;\n //recording success yes no\n obj_ivr_play.rec_yn = 0;\n \n obj_ivr_play.ivrmenu = 1;\n obj_ivr_play.current_msg_rec_edit = digit_dtmf;\n \n //recording \n \n \n \n if (obj_ivr_play.rec_arr.indexOf(job_num + '_' + job_name.replace(' ', '_') + \"_\" + digit_dtmf) >= 0 && skipcheck == 0) {\n \n \n obj_ivr_play.ivrmenu = 1;\n obj_ivr_play.rec_yn = 1;\n obj_ivr_play.rec_type = 'overwrite';\n obj_ivr_play.current_msg_rec_edit = digit_dtmf;\n \n dtmfhandle('#', 0);\n\n\n } else {\n \n \n \n \n channel.play({ media: \"sound:custom/recstart_b\" }, playbackIVR).then(function (playback) {\n console.log('Play Back IVR : recordatendpress_pnd')\n \n \n playback.once('PlaybackFinished', function (event, playback) {\n //record audio \n ari_ivr.channels.record({\n channelId: channel.id,\n format: 'wav',\n name: job_num + '_' + job_name.replace(' ', '_') + \"_\" + digit_dtmf,\n ifExists: obj_ivr_play.rec_type,\n beep: true,\n terminateOn : '#',\n maxSilenceSeconds : 10\n\n })\n .then(function (ivr_msg_recording) {\n console.log('succsess record');\n obj_ivr_play.rec_yn = 1;\n obj_ivr_play.rec_type = 'overwrite';\n \n \n // trim audio after record 1 sec on each end \n ivr_msg_recording.once('RecordingFinished', function (event, recording) {\n \n \n if (parseInt(event.recording.duration) > 4) {\n trimaudio_func('/var/spool/asterisk/recording/' + job_num + '_' + job_name.replace(' ', '_') + \"_\" + digit_dtmf, 1, parseInt(event.recording.duration) - 1);\n }\n\n });\n\n \n })\n .catch(function (err) {\n \n obj_ivr_play.rec_yn = 0;\n obj_ivr_play.rec_type = 'overwrite';\n console.log(err);\n console.log('recordingerror')\n });\n \n });\n\n }).catch(function (err) { console.log('Error Playback ivr recordatendpress_pnd'); });\n\n }\n\n\n } else if (digit_dtmf == '#' && obj_ivr_play.ivrmenu == 1 && obj_ivr_play.rec_yn == 1) {\n obj_ivr_play.last_good_dtmf = digit_dtmf;\n \n obj_ivr_play.rec_yn = 0;\n obj_ivr_play.ivrmenu = 2;\n \n\n \n \n\n\n\n\n getjobinfo_ivr_dtmf(obj_ivr_play.current_msg_rec_edit, job_num , function (varback) {\n \n console.log('playfile');\n\n \n channel.play({ media: 'sound:custom/' + varback}, playbackIVR).then(function (playback) {\n \n }).catch(function (err) { console.log(err); console.log('Listen 1 error'); });\n \n \n })\n\n\n\n\n\n /*\n channel.play({ media: \"sound:custom/to_listen_1\", skipms: 0 }, playbackIVR).then(function (playback) {\n \n console.log('to listen play');\n \n \n playback.once('PlaybackFinished', function (event, playback) {\n \n channel.play({ media: \"sound:custom/b_\" + obj_ivr_play.current_msg_rec_edit}, playbackIVR).then(function (playback) {\n \n \n playback.once('PlaybackFinished', function (event, playback) {\n \n channel.play({ media: \"sound:custom/after_rec_2\"}, playbackIVR).then(function (playback) { }).catch(function (err) { console.log('Error Playback ivr listen or recrecord'); });\n\n });\n \n \n }).catch(function (err) { console.log('sound play back 1 error'); });\n \n });\n\n\n \n }).catch(function (err) { console.log(err); console.log('Listen 1 error'); });\n */\n \n \n } else if (obj_ivr_play.ivrmenu == 3) {\n //listen menu \n \n \n \n \n \n channeloutivr.removeListener('ChannelDtmfReceived', ondtmf_sc);\n \n channel.play({ media: 'recording:' + job_num + '_' + job_name.replace(' ', '_') + \"_\" + digit_dtmf }, playbackIVR).then(function (playback) {\n \n \n \n \n \n playback.once('PlaybackFinished', function (event, playback) {\n obj_ivr_play.rec_yn = 1;\n \n obj_ivr_play.ivrmenu = 1;\n \n \n obj_ivr_play.intro_ivr_play_current_indx = -1;\n \n \n dtmfhandle('#', 0);\n \n channeloutivr.on('ChannelDtmfReceived', ondtmf_sc);\n\n });\n }).catch(function (err) { console.log('Error Playback ivr Playback audio'); });\n\n \n \n \n } else if (reckeyafter.indexOf(digit_dtmf) >= 0 && obj_ivr_play.ivrmenu == 2) {\n \n obj_ivr_play.last_good_dtmf = digit_dtmf;\n \n if (digit_dtmf == 1) {\n obj_ivr_play.ivrmenu = 3;\n dtmfhandle(obj_ivr_play.current_msg_rec_edit, 0);\n\n } else if (digit_dtmf == 2) {\n \n \n \n obj_ivr_play.ivrmenu = 0;\n obj_ivr_play.rec_type = 'overwrite';\n \n dtmfhandle(obj_ivr_play.current_msg_rec_edit, 1);\n \n } else if (digit_dtmf == 3) {\n \n obj_ivr_play.ivrmenu = 0;\n obj_ivr_play.rec_type = 'append';\n dtmfhandle(obj_ivr_play.current_msg_rec_edit, 1);\n\n\n //append\n\n } else if (digit_dtmf == 0) {\n \n \n //back to intro \n \n obj_ivr_play.ivrmenu = 4;\n dtmfhandle(0, 0);\n }\n\n\n } else if (obj_ivr_play.ivrmenu != 1) {\n \n \n console.log(obj_ivr_play.last_good_dtmf);\n channeloutivr.removeListener('ChannelDtmfReceived', ondtmf_sc);\n \n stop_playback(666, function () {\n \n channel.play({ media: \"sound:custom/invaildresp\" , skipms: 0 }, playbackIVR).then(function (playback) {\n \n \n console.log('hang up ivr');\n \n playback.once('PlaybackFinished', function (event, playback) {\n \n \n if (obj_ivr_play.last_good_dtmf == '0') {\n \n obj_ivr_play.ivrmenu = 4;\n\n } else if (obj_ivr_play.last_good_dtmf == '#') {\n \n \n obj_ivr_play.rec_yn = 1;\n obj_ivr_play.ivrmenu = 1;\n }\n \n \n \n \n dtmfhandle(obj_ivr_play.last_good_dtmf, 0);\n \n channeloutivr.on('ChannelDtmfReceived', ondtmf_sc);\n \n \n });\n \n }).catch(function (err) { console.log('INvaild response Playback ivr'); });\n });\n\n\n }\n \n }\n \n \n \n var vaildkey = ['#', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];\n \n \n if (vaildkey.indexOf(event.digit) >= 0) {\n \n console.log('vaild key');\n stop_playback(event.digit, function () {\n console.log(event.digit);\n dtmfhandle(event.digit, 0);\n })\n }\n \n\n \n\n \n }\n \n \n channeloutivr.on('ChannelDtmfReceived', ondtmf_sc);\n \n \n \n \n //Main play back finished loop event. \n \n // playbackIVR.on(\"PlaybackFinished\", on_playback_finished);\n \n function on_playback_finished(event) {\n console.log(obj_ivr_play.intro_ivr_play_current_indx)\n \n \n \n \n \n if (obj_ivr_play.intro_ivr_play_current_indx < obj_ivr_play.intro_ivr_play.length - 1 && obj_ivr_play.intro_ivr_play_current_indx != -1) {\n \n obj_ivr_play.intro_ivr_play_current_indx += 1;\n \n console.log('Playing file : ' + obj_ivr_play.intro_ivr_play[obj_ivr_play.intro_ivr_play_current_indx]);\n \n \n \n \n channeloutivr.play({ media: 'sound:custom/' + obj_ivr_play.intro_ivr_play[obj_ivr_play.intro_ivr_play_current_indx] }, playbackIVR).then(function (playback) {\n\n }).catch(function (err) {\n \n obj_ivr_play.intro_ivr_play_current_indx = -1;\n console.log('Error Playback ivr');\n });\n \n\n\n\n\n\n\n\n\n }\n\n }\n \n \n channeloutivr.on('ChannelDestroyed', function (event, channel) {\n \n \n socket.emit('ivr_status_msg', '<span class=\"text-danger\">Hung Up</span>');\n console.log('ChannelDestroyed');\n socket.emit('ChannelDestroyed_ivr', channel.id);\n\n\n });\n \n \n \n \n \n \n \n \n console.log('on top of the dial out');\n\n // channeloutivr.originate({ endpoint: 'SIP/' + ivrsipgway + '/1' + '3865473629', app: 'smivrout', appArgs: 'dialed', callerId: '3862710666', \"variables\": { 'userobj': \"Alice\" } }).then(function (channel) { fn(channel.id);});\n\n \n \n\n //dial out procedure test\n getjobinfo_ivr(job_num, job_name, function (msg_arr) {\n \n // console.log('getting ready already rec' + msg_arr[0]);\n console.log(msg_arr[2]);\n console.log(msg_arr[0]);\n console.log(msg_arr[1]); \n \n \n obj_ivr_play.concat_intro = msg_arr[2];\n\n\n fs.stat('/var/lib/asterisk/sounds/en/custom/' + obj_ivr_play.concat_intro, function (err, stat) {\n if (err == null) {\n console.log('File exists');\n } else if (err.code == 'ENOENT') {\n \n console.log('no file')\n concat_audio_func_arr(msg_arr[1], '/var/lib/asterisk/sounds/en/custom/' + msg_arr[2]);\n } else {\n console.log('Some other error: ', err.code);\n }\n });\n\n \n \n\n console.log('in job info call');\n \n channeloutivr.originate({ endpoint: 'SIP/' + ivrsipgway + '/1' + dialoutnum, app: 'smivrout', appArgs: 'dialed', callerId: '3862710666', \"variables\": { 'userobj': \"Alice\" } }).then(function (channel) {\n \n fn(channel.id);\n \n channel.once('ChannelStateChange', function (event, channel) {\n console.log(event);\n\n });\n \n \n \n //intro \n channeloutivr.on('StasisStart', function (event, channel) {\n \n console.log('StasisStart')\n socket.emit('ivr_status_msg', '<span class=\"text-success\">In IVR</span>');\n obj_ivr_play.ivrmenu = 0;\n \n console.log('Playing file' + msg_arr[2].replace('.wav', ''));\n \n channel.play({ media: 'sound:custom/' + msg_arr[2].replace('.wav','') }, playbackIVR).then(function (playback) {\n\n }).catch(function (err) {\n obj_ivr_play.intro_ivr_play_current_indx = -1;\n \n console.log('Error Playback ivr');\n });\n\n });\n \n \n\n //start of IVR pick up \n \n \n socket.emit('ivr_status_msg', '<span class=\"text-warning\">Dialing Out</span>');\n \n });\n \n \n });\n \n\n\n });\n });\n\n \n \n\n}", "function changeState(error, data) {\n if (error) throw error;\n var ledState = data[0];\n // if the current state is 1, make it 0, and vice versa:\n data[0] = !ledState;\n // write it back out to the peripheral:\n characteristic.write(data, false, callback);\n }", "function characteristic_startNotifications(characteristicID, callback)\n{\n characteristicTable[characteristicID].startNotifications().then(char => {\n console.log('notifications started');\n let onchanged = (event) => {\n callback(characteristicID, event.target.value.buffer);\n };\n characteristicNotificationTable[characteristicID] = onchanged;\n char.addEventListener('characteristicvaluechanged', onchanged);\n });\n}", "function peer__CONNECTION__ACTIVE_ques_(peerConnectionReadyState) /* (peerConnectionReadyState : peerConnectionReadyState) -> bool */ {\n return (peerConnectionReadyState === 3);\n}", "function writeCompleted(id, cb) {\n\n // console.log(`${id} entering writeCompleted`);\n // console.log(JSON.stringify(outstandingCbs));\n // console.log(typeof outstandingCbs[id]);\n\n if( typeof outstandingCbs[id] !== 'undefined' ) {\n throw(new Error('writeCompleted sees existing callback, something is not right'));\n }\n\n // console.log(`${id} check ok`);\n\n outstandingCbs[id] = cb;\n // console.log(outstandingCbs);\n\n let countOk = 0;\n\n for(let i = 0; i < radioCount; i++) {\n let res = typeof outstandingCbs[i] !== 'undefined';\n if( res ) {\n countOk ++;\n }\n // console.log('' + id + ' checking:' + i + ' result: ' + res);\n }\n\n // console.log(countOk + \" - \" + countOk);\n // console.log();\n\n if(countOk === radioCount) {\n // console.log('ok to go');\n writeReceivedData();\n }\n}", "_updateAndEmitIceGatheringStateChange(state) {\n if (this._closed || state === this.iceGatheringState) {\n return;\n }\n\n this._iceGatheringState = state;\n\n logger.debug(\n 'emitting \"icegatheringstatechange\", iceGatheringState:',\n this.iceGatheringState);\n\n const event = new yaeti.Event('icegatheringstatechange');\n\n this.dispatchEvent(event);\n }", "function ConnectionChagnedListener(state) {\n\tconsole.log(\"ConnectionChangedListener: \" + state);\n\tif(state == 'connected')\n\t{\n\t\t// TODO: Trigger an event to the Device Component which named \"ConnectionChangedListener\" with 'onConnected'\n\t\tvar evtObjs = $app.getTriggerObjects(\"onConnected\");\n for (var i = 0; i < evtObjs.length; i++)\n {\n $(evtObjs[i]).trigger({\n interfaceparam: true,\n type: \"onConnected\",\n value: true\n });\n }\n\t}\n\telse if(state == 'disconnected')\n\t{\n\t\t// TODO: Trigger an event to the Device Component which named \"ConnectionChangedListener\" with 'onDisconnected'\n\t\tvar evtObjs = $app.getTriggerObjects(\"onDisconnected\");\n for (var i = 0; i < evtObjs.length; i++)\n {\n $(evtObjs[i]).trigger({\n interfaceparam: true,\n type: \"onDisconnected\",\n value: false\n });\n }\n\t}\n\telse if(state == 'attached')\n\t{\n\t\t// TODO: Trigger an event to the Device Component which named \"ConnectionChangedListener\" with 'onAttachedUSB'\n\t\tvar evtObjs = $app.getTriggerObjects(\"onAttachedUSB\");\n for (var i = 0; i < evtObjs.length; i++)\n {\n $(evtObjs[i]).trigger({\n interfaceparam: true,\n type: \"onAttachedUSB\",\n value: true\n });\n }\n\t}\n\telse if(state == 'detached')\n\t{\n\t\t// TODO: Trigger an event to the Device Component which named \"ConnectionChangedListener\" with 'onDetachedUSB'\n\t\tvar evtObjs = $app.getTriggerObjects(\"onDetachedUSB\");\n for (var i = 0; i < evtObjs.length; i++)\n {\n $(evtObjs[i]).trigger({\n interfaceparam: true,\n type: \"onDetachedUSB\",\n value: false\n });\n }\n\t}\t\t\t\n}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function handleAQIPM25StateChanged (event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"started blinking\" or \"stopped blinking\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at); // the timestamp of the event\n\n // the data we want to send to the clients\n let data1 = {\n message: evData, // just forward \"started blinking\" or \"stopped blinking\"\n }\n\n // send data to all connected clients\n sendData(\"AQIPM25StateChanged\", data1, evDeviceId, evTimestamp );\n}", "function shimConnectionState(window) {\n if (!window.RTCPeerConnection || 'connectionState' in window.RTCPeerConnection.prototype) {\n return;\n }\n\n var proto = window.RTCPeerConnection.prototype;\n Object.defineProperty(proto, 'connectionState', {\n get: function get() {\n return {\n completed: 'connected',\n checking: 'connecting'\n }[this.iceConnectionState] || this.iceConnectionState;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(proto, 'onconnectionstatechange', {\n get: function get() {\n return this._onconnectionstatechange || null;\n },\n set: function set(cb) {\n if (this._onconnectionstatechange) {\n this.removeEventListener('connectionstatechange', this._onconnectionstatechange);\n delete this._onconnectionstatechange;\n }\n\n if (cb) {\n this.addEventListener('connectionstatechange', this._onconnectionstatechange = cb);\n }\n },\n enumerable: true,\n configurable: true\n });\n ['setLocalDescription', 'setRemoteDescription'].forEach(function (method) {\n var origMethod = proto[method];\n\n proto[method] = function () {\n if (!this._connectionstatechangepoly) {\n this._connectionstatechangepoly = function (e) {\n var pc = e.target;\n\n if (pc._lastConnectionState !== pc.connectionState) {\n pc._lastConnectionState = pc.connectionState;\n var newEvent = new Event('connectionstatechange', e);\n pc.dispatchEvent(newEvent);\n }\n\n return e;\n };\n\n this.addEventListener('iceconnectionstatechange', this._connectionstatechangepoly);\n }\n\n return origMethod.apply(this, arguments);\n };\n });\n }", "function receiveChannelCallback(event) {\n\t\treceiveChannel = event.channel;\n\t\treceiveChannel.onmessage = function (event) {\n\t\t\tvar el = document.createElement(\"p\");\n\t\t\tvar txtNode = document.createTextNode(event.data);\n\t\t\tel.appendChild(txtNode);\n\t\t\treceiveBox.appendChild(el);\n\t\t};\n\t\treceiveChannel.onopen = function (event) {\n\t\t\tif (receiveChannel) {\n\t\t\t\tconsole.log(\"Receive channel's status has changed to \" + receiveChannel.readyState);\n\t\t\t}\n\t\t\t\n\t\t};\n\t}", "baseStatus(arg, callback) {\n if(arg.status == '1'){\n var up_status = 0;\n }else{\n var up_status = 1;\n }\n db.run(`UPDATE base_mast SET is_active = ? WHERE bid = ?`, [up_status, arg.unique], function (err) {\n if (err) {\n callback(err.message);\n }\n callback('1');\n })\n\t\t\t\n\t\t\n\t}", "function myCallback(result) {\n\tif (result == \"OK\") {\n\t\tif (undefined !== wait_image) {\n\t\t\twait_image.css(\"visibility\", \"hidden\");\n\t\t}\n\t\tif (undefined !== message_div) {\n\t\t\tmessage_div.html('');\n\t\t}\n\t} else {\n\t\twait_image.css(\"visibility\", \"hidden\");\n\t\tmessage_div.html('<font color=\"red\">' + result + '</font>');\n\t}\n}", "function firefoxComplete(rtcPeerConnection){\n\t\tconsole.log(\"Signaling Complete!\");\n\t}", "function initiateRC() {\n data.recordDataCallback = function(state) {\n kemper.update(state.timech);\n var commandArr = [\n kemper.phiCommand,\n kemper.thetaCommand,\n kemper.thrustCommand,\n kemper.psiCommand,\n ];\n tello.command(new Buffer.from(\"rc \" + commandArr.join(\" \")));\n }\n}", "function callbackDriver() {\n cb();\n }", "waitCookieMsg (callback) {\n var handler = () => {\n if (!this._cookieMsgInProgress()) {\n this.off(this.MSG_RECEIVED_EVENT, handler);\n\n callback();\n }\n };\n\n if (this._cookieMsgInProgress())\n this.on(this.MSG_RECEIVED_EVENT, handler);\n else\n callback();\n }", "function signalingComplete(){\n\t\tif(webrtcDetectedBrowser && webrtcDetectedBrowser === \"firefox\"){\n\t\t\tfirefoxComplete.apply(this, arguments);\n\t\t}else{\n\t\t\tchromeComplete.apply(this, arguments);\n\t\t}\n\t}", "function callbackPir(data, dev) {\n // show pir state\n console.log('[ debug message ] PIR@' + dev.addr + ' State: ' + data.dInState);\n /*** write your application here ***/\n}", "function RemoteControlRequestCompleteHandler( status )\n{\n\talert(\"RCStatus: \" + status);\n}", "@wire(getRecord, { recordId: \"$recordId\", fields: FIELDS })\n csRecord({ data, error }) {\n if (data) {\n this.record = data;\n this.currentStatus = this.record.fields.Status.value;\n if (this.caseStatuses){\n // invoke buildValuesModel and pass in parameters\n this.buildValuesModel(\n this.caseStatuses,\n this.currentStatus\n );\n }\n } else if (error) {\n this.error = error;\n }\n }", "function receive()\n{\n const r = window.radioclient;\n\n if ( r.transmitting ) {\n r.transmitting = false;\n\n r.delayed_receive_packets = 0;\n r.on_time_receive_packets = 0;\n r.delayed_receive_packet_ratio = 0;\n\n receivingNotice();\n\n const text = { command: \"receive\" };\n r.soc.send(JSON.stringify(text));\n\n r.in.source.disconnect(r.in.level);\n r.in.worker.disconnect(r.context.destination);\n r.out.worker.connect(r.context.destination);\n document.getElementsByClassName('TransmitButton')[0].id = 'TransmitButtonReceiving';\n }\n}", "function handleAnswer(answer) { \n console.log('answer: ', answer)\n yourConn.setRemoteDescription(new RTCSessionDescription(answer));\n\n window.clearTimeout(callTimeout);\n document.getElementById('canvas').hidden = true;\n document.getElementById('show_IfCalling').innerHTML = '-- on call --';\n document.getElementById('visitor_callOngoing').style.display = 'block';\n \n}", "function get_status(callback) {\n csnLow();\n \n var buf1 = new Buffer(1);\n buf1[0] = consts.NOP;\n\n spi.transfer(buf1, new Buffer(1), function(device, buf) {\n csnHigh();\n callback(null,buf[0]);\n });\n\n }", "connectedCallback(){}", "connectedCallback () {\n\n }", "connectedCallback() {\n //\n }", "function updateCsq( cb ) {\n commPort.write( 'AT+CSQ\\r\\n', function( err ) {\n if ( err ) {\n console.log( err )\n } else {\n commPort.drain( function( err ) {\n if ( err ) {\n console.log( err )\n } else {\n csq = lastCommData\n if ( cb ) cb( csq )\n }\n })\n }\n })\n}", "function activateGuidance(newStatus = true) \n{\n //Check ROSBridge connection before subscribe a topic\n IsROSBridgeConnected();\n\n console.log('new guidance'+ newStatus);\n //Call the service to engage guidance.\n var setGuidanceClient = new ROSLIB.Service({\n ros:g_ros,\n name: S_GUIDANCE_ACTIVATED,\n serviceType: M_GUIDANCE_ACTIVATE\n });\n\n //Setup the request.\n var request = new ROSLIB.ServiceRequest({\n guidance_active: newStatus\n });\n\n // Call the service and get back the results in the callback.\n setGuidanceClient.callService(request, function (result) \n {\n //Check ROSBridge connection before subscribe a topic\n IsROSBridgeConnected();\n if (Boolean(result.guidance_status) != newStatus) //NOT SUCCESSFUL.\n {\n $('#divCapabilitiesContent').html('');\n $('#divCapabilitiesContent').html('Guidance failed to set the value, please try again.');\n $('#divCapabilitiesContent').css('display','inline-block');\n return;\n }\n\n //When active = false, this is equivalent to disengaging guidance. Would not be INACTIVE since inactivity is set by guidance.\n if (newStatus == false)\n {\n //setCAVButtonState('DISENGAGED');\n //This disengage means DRIVERS_READY state\n session_isGuidance.active = false;\n session_isGuidance.engaged = false;\n return;\n }\n\n if (newStatus == true)\n {\n // openTab(event, 'divDriverView');\n // CarmaJS.WidgetFramework.loadWidgets(); //Just loads the widget\n // checkAvailability(); //Start checking availability (or re-subscribe) if Guidance has been engaged.\n session_isGuidance.active = true;\n session_isGuidance.engaged = false;\n return;\n }\n });\n}", "function setInactive(callback) {\n onDisconnect = callback;\n}", "function A(){Q.state.isEnabled=!1}", "_handleIceConnectionChange (event) {\n if (this.pc) {\n const { iceConnectionState } = this.pc\n // TronDebugger('iceconnectionchange', iceConnectionState)\n switch (iceConnectionState) {\n // meaning call is accepted.\n case 'connected':\n return this._callAccepted()\n // meaning call is droped\n case 'disconnected': case 'closed':\n // passed how the call ended\n // we need to delete also our this.pc since its causing issue with us\n // we need to recreate it.\n return this._callDropped(iceConnectionState)\n default:\n return null\n }\n }\n }", "function onBlxDisconnected () {\n // NUS_device = undefined; - Keep Device data\n NUS_data_chara_write = undefined\n NUS_data_chara_read_noti = undefined\n full_connected_flag = false\n blxID_dirtyflag = false\n identify_ok_flag = false\n if(blxCmdBusy === true && blxCmdLast !== 'R' ){ // Reset Command is OK\n terminalPrint(\"Disconnected while Busy('\"+ blxCmdLast +\"')\")\n blxErrMsg = \"ERROR: Disconnected ('\"+ blxCmdLast +\"')\"\n }else{\n terminalPrint('Disconnected')\n }\n blxCmdBusy = false \n if(blxUserCB) {\n if(NUS_device !== undefined) blxUserCB('CON',1,'Reconnectable') \n else blxUserCB('CON',0,'Disconnected') \n }\n }", "stateChangedCallback(yfct,value)\n { \n \n // memorize the new state\n this._state = (value ==\"B\" ); \n console.log(\"relay change (\"+value+\", state is now \"+this._state);\n // notify the NEEO server about the change\n this.notifyNEEOServer({uniqueDeviceId: this._neeoID, component:this._hwdID, value:this._state} );\n // this.notifyNEEOServer({uniqueDeviceId: \"default\" , component:this._hwdID, value:this._state } );\n }", "function capture (cb) {\n console.log(cb);\n var vw = 640;\n var vh = 480;\n var fr = 24;\n var config = {\n audio: false,\n video: {\n width: vw,\n height: vh,\n frameRate: fr\n }\n };\n var p = undefined\n p = navigator.mediaDevices.getUserMedia(config)\n p.then(cb).catch(function (error) {\n console.error(error);\n });\n $.alert({\n title: 'Attention!',\n content:'Connection in progress! Please stand by! Click ok to continue!',\n });\n // document.getElementById(\"presenter\").style.display = \"none\";\n if(!$('#xprowebinarPublisherCamera').length){\n $( \"#xprowebinarSubscriberCamera\" ).css('display', 'none');\n $('.selectvidimage').before('<video id=\"xprowebinarPublisherCamera\" class=\"red5pro-media red5pro-media-background\" autoplay controls muted></video>');\n\n if(!$('#selectvidimage').length){\n $( \"#selectvidimage\" ).css('display', 'initial');\n }else{\n $( \"#selectvidimage\" ).css('display', 'none');\n }\n \n }\n }", "function callback(){}", "async _init() {\n Circuit.logger.setLevel(1);\n\n if (this._guestToken) {\n // Use the guest SDK instead\n this._client = Circuit.GuestClient({\n domain: this._domain,\n client_id: this._clientId\n });\n } else {\n this._client = Circuit.Client({\n domain: this._domain,\n client_id: this._clientId\n }); \n }\n\n this._client.addEventListener('connectionStateChanged', e => {\n this._connected = e.state === 'Connected';\n });\n\n this._client.addEventListener('callStatus', e => {\n this.call = e.call;\n\n // Update 'inprogress' attribute and button text\n if (e.call.state === 'Initiated') {\n this.removeAttribute('inprogress');\n this._btn.textContent = this._callingText;\n } else if (e.call.state === 'Started') {\n // Another user has started the conference\n this._btn.textContent = this._joinText;\n this.removeAttribute('inprogress'); // remote call is in progress, but not the local call \n } else if (e.call.state === 'ActiveRemote') {\n // User has joined the conference on another device\n // TODO: Offer pulling the call\n this.removeAttribute('inprogress');\n this._btn.textContent = this._callingText;\n } else {\n this.setAttribute('inprogress', '');\n this._btn.textContent = this._hangupText;\n this.removeAttribute('disabled', '');\n }\n\n // Set/clear ringback tone\n const ringbackEl = this.shadowRoot.querySelector('#ringback');\n if (e.call.state === 'Delivered') {\n ringbackEl.src = this._ringbackTone;\n } else {\n ringbackEl.removeAttribute('src');\n ringbackEl.load();\n }\n\n // Set remote audio stream\n this.shadowRoot.querySelector('#audio').srcObject = e.call.remoteAudioStream;\n\n this.dispatchEvent(new CustomEvent('callchange', { detail: e.call }));\n });\n\n this._client.addEventListener('callEnded', e => {\n this.call = null;\n this.removeAttribute('inprogress');\n this._btn.textContent = this._defaultText;\n\n const ringbackEl = this.shadowRoot.querySelector('#ringback');\n ringbackEl.removeAttribute('src');\n ringbackEl.load();\n\n // Raise without a call object as parameter\n this.dispatchEvent(new CustomEvent('callchange'));\n\n // Wait a bit to ensure call is successfully terminated, then logout\n // Comment out for now due to a presence bug.\n //setTimeout(this._client.logout, 200);\n });\n\n this.dispatchEvent(new CustomEvent('initialized', { detail: this.client }));\n }", "function handleStatusCallback(msg) {\n IALOG.debug(\"Enter - handleStatusCallback\");\n\n var incidentId = msg.additionalTokens.incident_id;\n var xmStatus = msg.status;\n\n // Create an annotation for xMatters Event status updates.\n var annotation = \"\";\n annotation = \"xMatters incident for BPPM event: \" + incidentId + \" | \" + xmStatus;\n\n IALOG.debug(\"Starting call to management system for status annotation for BPPM event: [\" + incidentId + \"]\");\n\n try {\n var bppmws = new BPPMWS();\n\n var result = bppmws.updateEvent(incidentId, bppmws.IMWS_STATUS_NONE, NO_ASSIGNEE, CALLOUT_USER, NO_LOGS, NOTE_PREFIX + annotation, false);\n\n IALOG.debug(\"Finished call to management system for status annotation for BPPM event: [\" + incidentId + \"] with result \" + result);\n } catch (e) {\n IALOG.error(\"Caught exception processing status annotation for BPPM event: [\" + incidentId + \"] Exception:\" + e);\n throw e;\n }\n IALOG.debug(\"Exit - handleStatusCallback\");\n}", "connectedCallback() {\n this.attributeReadonly = this.readonly;\n setTimeout(() => {\n super.connectedCallback();\n }, 0);\n }", "function onStateChange(arg) {\r\n if ( arg.partitionName == CAUSALITY_CHAIN_STATE )\r\n console.log(`State Change: ${arg.type}.`);\r\n}", "connectedCallback() {\n console.log(\"Connected Callback called\")\n }", "function sndRecPairClick() {\n if (buttonChecked == button_options.SENDREC) {\n //Clear colours\n buttonChecked = button_options.NONE;\n }\n else {\n //Clear button method, change to selected\n buttonChecked = button_options.SENDREC;\n }\n consoleAdd(\"Button Selected: \" + buttonChecked);\n}", "connectedCallback () {\n this.log_('connected');\n this.connected_ = true;\n }", "connectedCallback() {\n }", "connectedCallback() {\n }", "function ongoingCall() {\n phone.state = PhoneState.Ongoing;\n log(\"Ongoing call with \" + phone.name);\n}", "function callback(cb){\n\n cb(1);\n}", "evaluateStatus() {\n const oldStatus = this._jvb121;\n const newStatus = !this._conference.isP2PActive() && this._conference.getParticipantCount() <= 2;\n\n if (oldStatus !== newStatus) {\n this._jvb121 = newStatus;\n logger.debug(`JVB121 status ${oldStatus} => ${newStatus}`);\n\n this._conference.eventEmitter.emit(_JitsiConferenceEvents__WEBPACK_IMPORTED_MODULE_1__[\"JVB121_STATUS\"], oldStatus, newStatus);\n }\n }", "function bt_OnConnect(ok) {\n if (ok) {\n setTimeout(communicate, 100);\n //hide the connect button\n }\n else app.ShowPopup(\"Failed to connect!\");\n}", "connectedCallback() {\n \n }", "function onOpen(evt) {\n\n \n console.log(\"Connected\"); // Log connection state\n \n doSend(\"getLEDState\"); // Get the current state of the LED\n}", "function _eventConnect() {\n if (window.jabberwerx) {\n var\n //Construct JID with username and domain.\n jid = _username + \"@\" + _domain,\n\n //Create JabbwerWerx object.\n _jwClient = new jabberwerx.Client(\"cisco\");\n\n //Arguments to feed into the JabberWerx client on creation.\n jwArgs = {\n //Defines the BOSH path. Should match the path pattern in the proxy\n //so that it knows where to forward the BOSH request to.\n httpBindingURL: \"http://10.10.20.10:7071/http-bind/\",\n //Calls this function callback on successful BOSH connection by the\n //JabberWerx library.\n\t\t\terrorCallback: onClientError,\n successCallback: function () {\n //Get the server generated resource ID to be used for subscriptions.\n _finesse.setResource(_jwClient.resourceName);\n }\n };\n\n \n jabberwerx._config.unsecureAllowed = true;\n //Bind invoker function to any events that is received. Only invoke\n //handler if XMPP message is in the specified structure.\n _jwClient.event(\"messageReceived\").bindWhen(\n \"event[xmlns='http://jabber.org/protocol/pubsub#event'] items item notification\",\n _eventHandler);\n\n\t\t_jwClient.event(\"clientStatusChanged\").bind(function(evt) {\n if (evt.data.next == jabberwerx.Client.status_connected) {\n // attempt to login the agent \n _finesse.signIn(_username, _extension, true, _signInHandler, _signInHandler);\n\t\t } else if ( evt.data.next == jabberwerx.Client.status_disconnected) {\n _finesse.signOut(_username, _extension, null, _signOutHandler, _signOutHandler);\n\t\t }\t\t\n\t\t});\n\n //Connect to BOSH connection.\n _jwClient.connect(jid, _password, jwArgs);\n } else {\n alert(\"CAXL library not found. Please download from http://developer.cisco.com/web/xmpp/resources\")\n }\n}", "function shimConnectionState(window) {\n\t var _context3;\n\n\t if (!window.RTCPeerConnection || 'connectionState' in window.RTCPeerConnection.prototype) {\n\t return;\n\t }\n\n\t const proto = window.RTCPeerConnection.prototype;\n\n\t defineProperty$4(proto, 'connectionState', {\n\t get() {\n\t return {\n\t completed: 'connected',\n\t checking: 'connecting'\n\t }[this.iceConnectionState] || this.iceConnectionState;\n\t },\n\n\t enumerable: true,\n\t configurable: true\n\t });\n\n\t defineProperty$4(proto, 'onconnectionstatechange', {\n\t get() {\n\t return this._onconnectionstatechange || null;\n\t },\n\n\t set(cb) {\n\t if (this._onconnectionstatechange) {\n\t this.removeEventListener('connectionstatechange', this._onconnectionstatechange);\n\t delete this._onconnectionstatechange;\n\t }\n\n\t if (cb) {\n\t this.addEventListener('connectionstatechange', this._onconnectionstatechange = cb);\n\t }\n\t },\n\n\t enumerable: true,\n\t configurable: true\n\t });\n\n\t forEach$3(_context3 = ['setLocalDescription', 'setRemoteDescription']).call(_context3, method => {\n\t const origMethod = proto[method];\n\n\t proto[method] = function () {\n\t if (!this._connectionstatechangepoly) {\n\t this._connectionstatechangepoly = e => {\n\t const pc = e.target;\n\n\t if (pc._lastConnectionState !== pc.connectionState) {\n\t pc._lastConnectionState = pc.connectionState;\n\t const newEvent = new Event('connectionstatechange', e);\n\t pc.dispatchEvent(newEvent);\n\t }\n\n\t return e;\n\t };\n\n\t this.addEventListener('iceconnectionstatechange', this._connectionstatechangepoly);\n\t }\n\n\t return origMethod.apply(this, arguments);\n\t };\n\t });\n\t}", "function shimConnectionState(window) {\n if (!window.RTCPeerConnection ||\n 'connectionState' in window.RTCPeerConnection.prototype) {\n return;\n }\n const proto = window.RTCPeerConnection.prototype;\n Object.defineProperty(proto, 'connectionState', {\n get() {\n return {\n completed: 'connected',\n checking: 'connecting'\n }[this.iceConnectionState] || this.iceConnectionState;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(proto, 'onconnectionstatechange', {\n get() {\n return this._onconnectionstatechange || null;\n },\n set(cb) {\n if (this._onconnectionstatechange) {\n this.removeEventListener('connectionstatechange',\n this._onconnectionstatechange);\n delete this._onconnectionstatechange;\n }\n if (cb) {\n this.addEventListener('connectionstatechange',\n this._onconnectionstatechange = cb);\n }\n },\n enumerable: true,\n configurable: true\n });\n\n ['setLocalDescription', 'setRemoteDescription'].forEach((method) => {\n const origMethod = proto[method];\n proto[method] = function() {\n if (!this._connectionstatechangepoly) {\n this._connectionstatechangepoly = e => {\n const pc = e.target;\n if (pc._lastConnectionState !== pc.connectionState) {\n pc._lastConnectionState = pc.connectionState;\n const newEvent = new Event('connectionstatechange', e);\n pc.dispatchEvent(newEvent);\n }\n return e;\n };\n this.addEventListener('iceconnectionstatechange',\n this._connectionstatechangepoly);\n }\n return origMethod.apply(this, arguments);\n };\n });\n}", "function shimConnectionState(window) {\n if (!window.RTCPeerConnection ||\n 'connectionState' in window.RTCPeerConnection.prototype) {\n return;\n }\n const proto = window.RTCPeerConnection.prototype;\n Object.defineProperty(proto, 'connectionState', {\n get() {\n return {\n completed: 'connected',\n checking: 'connecting'\n }[this.iceConnectionState] || this.iceConnectionState;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(proto, 'onconnectionstatechange', {\n get() {\n return this._onconnectionstatechange || null;\n },\n set(cb) {\n if (this._onconnectionstatechange) {\n this.removeEventListener('connectionstatechange',\n this._onconnectionstatechange);\n delete this._onconnectionstatechange;\n }\n if (cb) {\n this.addEventListener('connectionstatechange',\n this._onconnectionstatechange = cb);\n }\n },\n enumerable: true,\n configurable: true\n });\n\n ['setLocalDescription', 'setRemoteDescription'].forEach((method) => {\n const origMethod = proto[method];\n proto[method] = function() {\n if (!this._connectionstatechangepoly) {\n this._connectionstatechangepoly = e => {\n const pc = e.target;\n if (pc._lastConnectionState !== pc.connectionState) {\n pc._lastConnectionState = pc.connectionState;\n const newEvent = new Event('connectionstatechange', e);\n pc.dispatchEvent(newEvent);\n }\n return e;\n };\n this.addEventListener('iceconnectionstatechange',\n this._connectionstatechangepoly);\n }\n return origMethod.apply(this, arguments);\n };\n });\n}", "function shimConnectionState(window) {\n if (!window.RTCPeerConnection || 'connectionState' in window.RTCPeerConnection.prototype) {\n return;\n }\n\n const proto = window.RTCPeerConnection.prototype;\n Object.defineProperty(proto, 'connectionState', {\n get() {\n return {\n completed: 'connected',\n checking: 'connecting'\n }[this.iceConnectionState] || this.iceConnectionState;\n },\n\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(proto, 'onconnectionstatechange', {\n get() {\n return this._onconnectionstatechange || null;\n },\n\n set(cb) {\n if (this._onconnectionstatechange) {\n this.removeEventListener('connectionstatechange', this._onconnectionstatechange);\n delete this._onconnectionstatechange;\n }\n\n if (cb) {\n this.addEventListener('connectionstatechange', this._onconnectionstatechange = cb);\n }\n },\n\n enumerable: true,\n configurable: true\n });\n ['setLocalDescription', 'setRemoteDescription'].forEach(method => {\n const origMethod = proto[method];\n\n proto[method] = function () {\n if (!this._connectionstatechangepoly) {\n this._connectionstatechangepoly = e => {\n const pc = e.target;\n\n if (pc._lastConnectionState !== pc.connectionState) {\n pc._lastConnectionState = pc.connectionState;\n const newEvent = new Event('connectionstatechange', e);\n pc.dispatchEvent(newEvent);\n }\n\n return e;\n };\n\n this.addEventListener('iceconnectionstatechange', this._connectionstatechangepoly);\n }\n\n return origMethod.apply(this, arguments);\n };\n });\n}", "connectedCallback()\n\t{\n\n\t}", "connectedCallback() {\n }", "pollInterrogateOperationState_() {\n var url = 'clients/' + this.clientId + '/actions/interrogate/' +\n this.interrogateOperationId;\n\n this.grrApiService_.get(url).then(\n function success(response) {\n if (response['data']['state'] === 'FINISHED') {\n this.stopMonitorInterrogateOperation_();\n\n this.clientVersion = null; // Newest.\n this.fetchClientDetails_();\n }\n }.bind(this),\n function failure(response) {\n this.stopMonitorInterrogateOperation_();\n }.bind(this));\n }", "function onChat(callback)\n{\n if ( !callback || typeof (callback) !== 'function' ) { return; }\n webphone_api.chatcb.push(callback);\n}" ]
[ "0.55292344", "0.49632838", "0.4924295", "0.49182978", "0.49025458", "0.47946677", "0.47543642", "0.4711298", "0.46959478", "0.46685758", "0.46531543", "0.46503454", "0.4637619", "0.46288246", "0.4626916", "0.45827892", "0.4579811", "0.45359525", "0.44989538", "0.44596183", "0.44574192", "0.44359162", "0.4433913", "0.4412874", "0.4411669", "0.4397036", "0.43963504", "0.43895888", "0.43784598", "0.43634075", "0.43598396", "0.43502143", "0.4344182", "0.4337923", "0.4337923", "0.43336487", "0.43298295", "0.432065", "0.43200517", "0.4307999", "0.4297327", "0.42893648", "0.42839095", "0.42839095", "0.42839095", "0.42839095", "0.42839095", "0.42750996", "0.42722267", "0.42686877", "0.42671177", "0.4258425", "0.42583057", "0.425678", "0.42557812", "0.42540893", "0.42525148", "0.4249426", "0.42480943", "0.42470914", "0.42455983", "0.42416912", "0.424136", "0.42388082", "0.4236488", "0.42356658", "0.42298555", "0.42298034", "0.42227772", "0.42162812", "0.42109242", "0.42076987", "0.42044726", "0.42015746", "0.41993707", "0.41964325", "0.4195763", "0.41955867", "0.4195551", "0.41944465", "0.41941372", "0.41867492", "0.41842768", "0.41842768", "0.41596267", "0.41540185", "0.41471666", "0.41409114", "0.41311973", "0.4117439", "0.41138875", "0.41121972", "0.41087466", "0.41087466", "0.40979683", "0.40978846", "0.40969768", "0.40935996", "0.40902874" ]
0.66643995
1
deflate(data[, options]) > Uint8Array|Array|String data (Uint8Array|Array|String): input data to compress. options (Object): zlib deflate options. Compress `data` with deflate alrorythm and `options`. Supported options are: level windowBits memLevel strategy [ for more information on these. Sugar (options): `raw` (Boolean) say that we work with raw stream, if you don't wish to specify negative windowBits implicitly. `to` (String) if equal to 'string', then result will be "binary string" (each char code [0..255]) Example: ```javascript var pako = require('pako') , data = Uint8Array([1,2,3,4,5,6,7,8,9]); console.log(pako.deflate(data)); ```
function deflate(input, options) { var deflator = new Deflate(options); deflator.push(input, true); // That will never happens, if you don't cheat with options :) if (deflator.err) { throw deflator.msg; } return deflator.result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gzip(input,options){options=options||{};options.gzip=true;return deflate$1(input,options);}", "function deflate$1(input,options){const deflator=new Deflate(options);deflator.push(input,true);// That will never happens, if you don't cheat with options :)\nif(deflator.err){throw deflator.msg||messages[deflator.err];}return deflator.result;}", "function deflate$1(input, options) {\n\t var deflator = new Deflate(options);\n\t\n\t deflator.push(input, true);\n\t\n\t // That will never happens, if you don't cheat with options :)\n\t if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\t\n\t return deflator.result;\n\t }", "function deflate$1(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || messages[deflator.err]; }\n\n return deflator.result;\n}", "function deflate$1(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || messages[deflator.err]; }\n\n return deflator.result;\n}", "function deflateRaw(input,options){options=options||{};options.raw=true;return deflate$1(input,options);}", "function deflate$1(input, options) {\n\t var deflator = new Deflate(options);\n\n\t deflator.push(input, true);\n\n\t // That will never happens, if you don't cheat with options :)\n\t if (deflator.err) { throw deflator.msg; }\n\n\t return deflator.result;\n\t}", "function gzip$1(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$3(input, options);\n\t}", "function deflate$1(buffer, opts, callback) {\n\t if (typeof opts === 'function') {\n\t callback = opts;\n\t opts = {};\n\t }\n\t return zlibBuffer(new Deflate(opts), buffer, callback);\n\t}", "function deflate$1(input, options) {\n\t var deflator = new Deflate(options);\n\n\t deflator.push(input, true);\n\n\t // That will never happens, if you don't cheat with options :)\n\t if (deflator.err) { throw deflator.msg || messages[deflator.err]; }\n\n\t return deflator.result;\n\t}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n deflator.push(input, true); // That will never happens, if you don't cheat with options :)\n\n if (deflator.err) {\n throw deflator.msg || msg[deflator.err];\n }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n const deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n deflator.push(input, true); // That will never happens, if you don't cheat with options :)\n\n if (deflator.err) {\n throw deflator.msg;\n }\n\n return deflator.result;\n }", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || messages[deflator.err]; }\n\n return deflator.result;\n}", "function deflate$3(input, options) {\n\t var deflator = new Deflate$1(options);\n\n\t deflator.push(input, true);\n\n\t // That will never happens, if you don't cheat with options :)\n\t if (deflator.err) { throw deflator.msg || messages[deflator.err]; }\n\n\t return deflator.result;\n\t}", "function deflate(input, options) {\n\t var deflator = new Deflate(options);\n\n\t deflator.push(input, true);\n\n\t // That will never happens, if you don't cheat with options :)\n\t if (deflator.err) { throw deflator.msg; }\n\n\t return deflator.result;\n\t}", "function deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n }", "function deflate(input, options) {\n var deflator = new Deflate(options);\n \n deflator.push(input, true);\n \n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n \n return deflator.result;\n }", "function deflate(input, options) {\n var deflator = new Deflate(options);\n deflator.push(input, true); // That will never happens, if you don't cheat with options :)\n\n if (deflator.err) {\n throw deflator.msg || msg[deflator.err];\n }\n\n return deflator.result;\n }", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$1(input, options);\n\t }", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t }", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n }", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$1(input, options);\n\t}", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$1(input, options);\n\t}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate$1(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate$1(input, options);\n}", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate(input, options);\n\t}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n }", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n }", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n }", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}" ]
[ "0.6332804", "0.6329344", "0.61815435", "0.61335", "0.61335", "0.61122954", "0.6091908", "0.608164", "0.60806566", "0.6079221", "0.6062083", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.6038355", "0.60317326", "0.6030395", "0.6022219", "0.6001596", "0.5998618", "0.5996897", "0.59900886", "0.5986734", "0.59793484", "0.5925294", "0.5915371", "0.5911983", "0.5911983", "0.5891437", "0.5891437", "0.5879043", "0.58683777", "0.58683777", "0.5867301", "0.58663213", "0.5861555", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756", "0.58567756" ]
0.6034561
56
deflateRaw(data[, options]) > Uint8Array|Array|String data (Uint8Array|Array|String): input data to compress. options (Object): zlib deflate options. The same as [[deflate]], but creates raw data, without wrapper (header and adler32 crc).
function deflateRaw(input, options) { options = options || {}; options.raw = true; return deflate(input, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deflateRaw$1(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$3(input, options);\n\t}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate$1(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate$1(input, options);\n}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t }", "function deflateRaw(input,options){options=options||{};options.raw=true;return deflate$1(input,options);}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate(input, options);\n\t}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n }", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n }", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n }", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n }", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}" ]
[ "0.7680796", "0.76410246", "0.76410246", "0.7620591", "0.7620591", "0.7614947", "0.7574728", "0.75647724", "0.755764", "0.7534994", "0.7517278", "0.75154525", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635", "0.6568635" ]
0.7583417
46
gzip(data[, options]) > Uint8Array|Array|String data (Uint8Array|Array|String): input data to compress. options (Object): zlib deflate options. The same as [[deflate]], but create gzip wrapper instead of deflate one.
function gzip(input, options) { options = options || {}; options.gzip = true; return deflate(input, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gzip(input,options){options=options||{};options.gzip=true;return deflate$1(input,options);}", "function gzip$1(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$3(input, options);\n\t}", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$1(input, options);\n\t}", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$1(input, options);\n\t}", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate(input, options);\n\t}", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$1(input, options);\n\t }", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate$1(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate$1(input, options);\n}", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n }", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n }", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n }", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n }", "function gzipSync(data, opts) {\n if (opts === void 0) { opts = {}; }\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}", "function gzipSync(data, opts) {\n if (opts === void 0) { opts = {}; }\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}", "function gzipSync(data, opts) {\n if (opts === void 0) { opts = {}; }\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}", "function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n }", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib$1.call(this, opts, binding$1.GZIP);\n\t}", "function compress(self, dataToBeCompressed, callback) {\n switch (self.options.agreedCompressor) {\n case 'snappy':\n Snappy.compress(dataToBeCompressed, callback);\n break;\n case 'zlib':\n // Determine zlibCompressionLevel\n var zlibOptions = {};\n if (self.options.zlibCompressionLevel) {\n zlibOptions.level = self.options.zlibCompressionLevel;\n }\n zlib.deflate(dataToBeCompressed, zlibOptions, callback);\n break;\n default:\n throw new Error(\n 'Attempt to compress message using unknown compressor \"' +\n self.options.agreedCompressor +\n '\".'\n );\n }\n}", "function compress(self, dataToBeCompressed, callback) {\n switch (self.options.agreedCompressor) {\n case 'snappy':\n Snappy.compress(dataToBeCompressed, callback);\n break;\n case 'zlib':\n // Determine zlibCompressionLevel\n var zlibOptions = {};\n if (self.options.zlibCompressionLevel) {\n zlibOptions.level = self.options.zlibCompressionLevel;\n }\n zlib.deflate(dataToBeCompressed, zlibOptions, callback);\n break;\n default:\n throw new Error(\n 'Attempt to compress message using unknown compressor \"' +\n self.options.agreedCompressor +\n '\".'\n );\n }\n}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}", "function Gzip(opts) {\n if (!(this instanceof Gzip)) return new Gzip(opts);\n Zlib.call(this, opts, binding.GZIP);\n}" ]
[ "0.75869906", "0.7519991", "0.7475314", "0.7475314", "0.74652964", "0.74602276", "0.73579544", "0.73579544", "0.7340525", "0.73362404", "0.7313697", "0.730394", "0.6607629", "0.6607629", "0.6607629", "0.65512145", "0.6153322", "0.6144623", "0.6144623", "0.6116595", "0.6116595", "0.6116595", "0.6116595", "0.6116595", "0.6116595", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942", "0.6076942" ]
0.7335155
53
inflateRaw(data[, options]) > Uint8Array|Array|String data (Uint8Array|Array|String): input data to decompress. options (Object): zlib inflate options. The same as [[inflate]], but creates raw data, without wrapper (header and adler32 crc).
function inflateRaw(input, options) { options = options || {}; options.raw = true; return inflate(input, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate$1(input, options);\n}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate$1(input, options);\n}", "function inflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return inflate(input, options);\n\t}", "function inflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return inflate$1(input, options);\n\t }", "function inflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return inflate$1(input, options);\n\t}", "function inflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return inflate$1(input, options);\n\t}", "function inflateRaw(input,options){options=options||{};options.raw=true;return inflate$1(input,options);}", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n }", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n }", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n }", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n }", "function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n }", "function inflateRaw$1(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return inflate$3(input, options);\n\t}", "function deflateRaw$1(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$3(input, options);\n\t}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate$1(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate$1(input, options);\n}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate$1(input, options);\n\t }", "function deflateRaw(input,options){options=options||{};options.raw=true;return deflate$1(input,options);}", "function deflateRaw(input, options) {\n\t options = options || {};\n\t options.raw = true;\n\t return deflate(input, options);\n\t}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n }", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}", "function deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}" ]
[ "0.7418727", "0.7418727", "0.74137247", "0.74064463", "0.7394453", "0.7394453", "0.73830867", "0.7376981", "0.73463386", "0.7340878", "0.7328237", "0.7328237", "0.7274889", "0.72629726", "0.7207871", "0.7207871", "0.72034985", "0.72034985", "0.7195765", "0.719202", "0.7128862", "0.7111967", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267", "0.71084267" ]
0.74284965
41
Helper (used in 2 places)
function buf2binstring(buf, len) { // use fallback for big arrays to avoid stack overflow if (len < 65537) { if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); } } var result = ''; for(var i=0; i < len; i++) { result += String.fromCharCode(buf[i]); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static private internal function m121() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "static private protected internal function m118() {}", "transient final protected internal function m174() {}", "function Helper() {}", "transient private internal function m185() {}", "static final private internal function m106() {}", "function _____SHARED_functions_____(){}", "static transient final private internal function m43() {}", "obtain(){}", "static transient private protected internal function m55() {}", "static transient final protected internal function m47() {}", "static protected internal function m125() {}", "transient private protected public internal function m181() {}", "function Utils() {}", "function Utils() {}", "static transient private protected public internal function m54() {}", "transient final private protected internal function m167() {}", "static private protected public internal function m117() {}", "static transient final protected public internal function m46() {}", "static final private protected internal function m103() {}", "function DWRUtil() { }", "function customHandling() { }", "static transient final private protected internal function m40() {}", "function TMP(){return;}", "function TMP(){return;}", "function Utils(){}", "function TMP() {\n return;\n }", "function AeUtil() {}", "transient final private internal function m170() {}", "static transient final protected function m44() {}", "function Util() {}", "static transient private internal function m58() {}", "__previnit(){}", "static final private public function m104() {}", "transient private public function m183() {}", "static final private protected public internal function m102() {}", "static transient private public function m56() {}", "function miFuncion (){}", "function __func(){}", "_firstRendered() { }", "function ea(){}", "function __it() {}", "function fm(){}", "static private public function m119() {}", "function StupidBug() {}", "static final protected internal function m110() {}", "function TMP(){}", "function TMP(){}", "static transient final private protected public internal function m39() {}", "function oi(){}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "transient final private protected public internal function m166() {}", "prepare() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "function FAADataHelper() {\n}", "function Utils() {\n}", "static transient final private public function m41() {}", "static transient final private protected public function m38() {}", "function HelperConstructor() {}", "function fn() {\n\t\t }", "function FunctionUtils() {}", "function wa(){}", "apply () {}", "_render() {}", "static rendered () {}", "static rendered () {}", "function normal() {}", "function SelectionUtil() {\n}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function Scdr() {\r\n}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "_validate() {\n\t}", "static method(){}", "function Alerter() {}", "function dummy() {}", "function dummy() {}" ]
[ "0.68026626", "0.67003596", "0.665479", "0.62646127", "0.62632245", "0.6196471", "0.6128034", "0.60641336", "0.60158974", "0.60106325", "0.59154373", "0.58908814", "0.57922685", "0.5754438", "0.57025576", "0.56650496", "0.5632441", "0.56095976", "0.5585894", "0.5585894", "0.5574582", "0.55715", "0.55095106", "0.55094707", "0.55066913", "0.5502726", "0.5476795", "0.5459271", "0.54381186", "0.54381186", "0.54362404", "0.54175264", "0.5415193", "0.5387827", "0.5362933", "0.5353008", "0.5345916", "0.5336998", "0.53367704", "0.5334769", "0.53049093", "0.5297081", "0.5281474", "0.5273744", "0.52603775", "0.52422166", "0.5236994", "0.5230695", "0.5195437", "0.5191885", "0.51714987", "0.5161283", "0.5161283", "0.5158311", "0.51568216", "0.51456314", "0.51456314", "0.51456314", "0.5140228", "0.5129312", "0.51255065", "0.51255065", "0.51255065", "0.51091325", "0.50578946", "0.50520307", "0.50478005", "0.50342906", "0.5028264", "0.50174016", "0.4997153", "0.4965289", "0.49643573", "0.49474466", "0.4932227", "0.4932227", "0.4925677", "0.49200922", "0.49037743", "0.49037743", "0.49037743", "0.49037743", "0.488266", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.48810688", "0.4874204", "0.48727968", "0.48703274", "0.48586372", "0.48586372" ]
0.0
-1
Note: adler32 takes 12% for level 0 and 2% for level 6. It doesn't worth to make additional optimizationa as in original. Small size is preferable.
function adler32(adler, buf, len, pos) { var s1 = (adler & 0xffff) |0 , s2 = ((adler >>> 16) & 0xffff) |0 , n = 0; while (len !== 0) { // Set limit ~ twice less than 5552, to keep // s2 in 31-bits, because we force signed ints. // in other case %= will fail. n = len > 2000 ? 2000 : len; len -= n; do { s1 = (s1 + buf[pos++]) |0; s2 = (s2 + s1) |0; } while (--n); s1 %= 65521; s2 %= 65521; } return (s1 | (s2 << 16)) |0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "function adler32(data) {\r\n\t var a = 1;\r\n\t var b = 0;\r\n\t var i = 0;\r\n\t var l = data.length;\r\n\t var m = l & ~0x3;\r\n\t while (i < m) {\r\n\t var n = Math.min(i + 4096, m);\r\n\t for (; i < n; i += 4) {\r\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\r\n\t }\r\n\t a %= MOD;\r\n\t b %= MOD;\r\n\t }\r\n\t for (; i < l; i++) {\r\n\t b += a += data.charCodeAt(i);\r\n\t }\r\n\t a %= MOD;\r\n\t b %= MOD;\r\n\t return a | b << 16;\r\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t\t var a = 1;\n\t\t var b = 0;\n\t\t var i = 0;\n\t\t var l = data.length;\n\t\t var m = l & ~0x3;\n\t\t while (i < m) {\n\t\t var n = Math.min(i + 4096, m);\n\t\t for (; i < n; i += 4) {\n\t\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t }\n\t\t for (; i < l; i++) {\n\t\t b += a += data.charCodeAt(i);\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t return a | b << 16;\n\t\t}", "function adler32(data) {\n\t\t var a = 1;\n\t\t var b = 0;\n\t\t var i = 0;\n\t\t var l = data.length;\n\t\t var m = l & ~0x3;\n\t\t while (i < m) {\n\t\t var n = Math.min(i + 4096, m);\n\t\t for (; i < n; i += 4) {\n\t\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t }\n\t\t for (; i < l; i++) {\n\t\t b += a += data.charCodeAt(i);\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t return a | b << 16;\n\t\t}", "function adler32(data) {\n\t\t var a = 1;\n\t\t var b = 0;\n\t\t var i = 0;\n\t\t var l = data.length;\n\t\t var m = l & ~0x3;\n\t\t while (i < m) {\n\t\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t }\n\t\t for (; i < l; i++) {\n\t\t b += a += data.charCodeAt(i);\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t return a | b << 16;\n\t\t}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n }", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n var i = 0;\n var l = data.length;\n var m = l & ~0x3;\n while (i < m) {\n var n = Math.min(i + 4096, m);\n for (; i < n; i += 4) {\n b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n }\n a %= MOD;\n b %= MOD;\n }\n for (; i < l; i++) {\n b += a += data.charCodeAt(i);\n }\n a %= MOD;\n b %= MOD;\n return a | b << 16;\n}" ]
[ "0.6453808", "0.6453808", "0.6453808", "0.6355045", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6333638", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6327762", "0.6319076", "0.6319076", "0.6304244", "0.6302299", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664", "0.6274664" ]
0.0
-1
Note: we can't get significant speed boost here. So write code to minimize size no pregenerated tables and array tools dependencies. Use ordinary array, since untyped makes no boost here
function makeTable() { var c, table = []; for(var n =0; n < 256; n++){ c = n; for(var k =0; k < 8; k++){ c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); } table[n] = c; } return table; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Array() {}", "function sumArrayPlain(arr) {\n\n window.performance.mark('pStart');\n\n var sum = 0;\n for (var i = 0; i < arr.length; i++)\n sum += arr[i];\n\n pEnd = new Date().getTime();\n /* Adding data to the global array */\n window.performance.mark('pEnd');\n console.log(\"sumArrayPlain result: \" + sum);\n }", "vectorize(po,pf,n){//a,b,k\n let data=new Array();\n var pts=(pf-po)/n;\n /*push agrega un valor al array */\n\n for(i=0; i<n;++i){\n data[i]=data+pts;\n }\n\n }", "function TypedArray(arg1) {\nvar result;\n if (typeof arg1 === \"number\") {\n result = new Array(arg1);\n \n for (var i = 0; i < arg1; ++i)\n result[i] = 0;\n } else\n result = arg1.slice(0)\n\n result.subarray = subarray\n result.buffer = result\n result.byteLength = result.length\n result.set = set_\n\n if (typeof arg1 === \"object\" && arg1.buffer)\n result.buffer = arg1.buffer\n \n return result\n\n}", "function makeArray(arrayLength)\n{\n //Solution goes here.\n}", "precArray(d, p, offset) {\n var tn = this.makeArray(d);\n tn[p] += offset || 0;\n for (var i = p + 1; i < 7; i++) {\n tn[i] = i < 3 ? 1 : 0;\n }\n return tn;\n }", "function ex_8_I(myarray)\n{\n var m = [];\n var n = Math.sqrt(myarray.length);\n for(var row = 0; row < n; row++)\n {\n m[row] = myarray.slice(row * n, (row+1) * n )\n }\n}", "function update_array()\n{\n array_size=inp_as.value;\n generate_array();\n}", "static dataArray (length = 0) {\n if (Uint8ClampedArray) {\n return new Uint8ClampedArray(length)\n }\n return new Array(length)\n }", "function makeNativeIntArray(size) {\n var arr = [];\n for (var i = 0; i < size; i++)\n arr[i] = 0;\n return arr;\n }", "extendArrayOfTypedArrays (array, elements, deltaSize) {\n array.typedArray =\n this.extendTypedArray(array.typedArray, (deltaSize * elements))\n for (let i = array.length, len = i + deltaSize; i < len; i++) {\n const start = i * elements\n const end = start + elements\n array[i] = array.typedArray.subarray(start, end)\n }\n // No return needed, array is mutated instead.\n }", "function ArrayUtils() {}", "function executeWithArrLength()\n{\n arr.length=0; //Empty the array\n for (var i = 0; i < 15000000; i++) { //repopulate the array\n arr[i]=Math.random();\n }\n}", "function X3domCreateArray(data, dim){\n if (dim ==1) return new x3dom.fields.MFFloat(data);\n let length = data.length/dim;\n let res = Array(length);\n let vectType = \"SFVec\"+String(dim)+\"f\";\n for (let i = 0; i < length ; i++) {\n // If dim == 2 , the third values are ignored\n res[i] = new x3dom.fields[vectType](data[dim*i],\n data[dim*i+1],\n data[dim*i+2]);\n }\n let arrayType = \"MFVec\"+String(dim)+\"f\";\n let out = new x3dom.fields[arrayType](res);\n return out;\n}", "function DynamicArray() {\n this.arr = new Array(1);\n this.size = 1;\n this.length = 0;\n this.start = 0;\n}", "function uuarray(source) { // @param Array/Mix/NodeList/Arguments: source\r\n // @return Array:\r\n var type = uutype(source), rv, i, iz;\r\n\r\n if (type === uutype.FAKEARRAY) { // [3][4]\r\n for (rv = [], i = 0, iz = source.length; i < iz; ++i) {\r\n rv[i] = source[i];\r\n }\r\n return rv;\r\n }\r\n return (type === uutype.ARRAY) ? source : [source]; // [1][2]\r\n}", "function TypedArray(arg1) {\n var result;\n if (typeof arg1 === \"number\") {\n result = new Array(arg1);\n for (var i = 0; i < arg1; ++i)\n result[i] = 0;\n } else {\n result = arg1.slice(0);\n }\n result.subarray = subarray;\n result.buffer = result;\n result.byteLength = result.length;\n result.set = set_;\n if (typeof arg1 === \"object\" && arg1.buffer)\n result.buffer = arg1.buffer;\n return result;\n }", "read_array() {\n // Get array size.\n let size = this.read_varint32();\n\n // Allocate array.\n let array = new Array(size);\n this.refs.push(array);\n\n // Read array elements.\n for (let i = 0; i < size; ++i) {\n array[i] = this.read();\n }\n\n return array;\n }", "function _toConsumableArray(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {arr2[i] = arr[i];}return arr2;} else {return Array.from(arr);}}", "function __getArray(arr) {\n const input = __getArrayView(arr);\n const len = input.length;\n const out = new Array(len);\n for (let i = 0; i < len; i++) out[i] = input[i];\n return out;\n }", "function parse_PtgArray(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n\treturn [type];\n}", "function getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b5f: // SAMPLER_3D\n\t\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\t\treturn setValueT3DArray;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\n\t\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\t\treturn setValueT2DArrayArray;\n\n\t\t}\n\n\t}", "function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}else return Array.from(arr)}", "extendTypedArray (array, deltaSize) {\n const ta = new array.constructor(array.length + deltaSize) // make new array\n ta.set(array) // fill it with old array\n return ta\n }", "function realSize(arr) {\n // var suma = 0;\n // arr.forEach(function arrFor(val) {\n // if(typeof val === \"object\"){\n // suma += realSize(val);\n // }else if(typeof val === \"number\"){\n // suma++;\n // }\n\n // });\n\n if(arr.length == 0) return 0;\n // return suma;\n var copy = arr.slice();\n\n //SubTotal: Para arrays internos\n var subTotal;\n\n //Copia de array\n copy.shift();\n if(typeof arr[0] === \"object\"){\n subTotal = realSize(arr[0]);\n return subTotal + realSize(copy);\n }\n\n \n return 1 + realSize(copy);\n}", "function getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3DArray;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArrayArray;\n\n\t}\n\n}", "function arrayManipulation(n, queries) {\n\n\n}", "function parse_PtgArray(blob, length, opts) {\n var type = (blob[blob.l++] & 0x60) >> 5;\n blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n return [type];\n }", "function makeNativeFloatArray(size) {\n var arr = [];\n if (!size)\n return arr;\n arr[0] = 0.1;\n for (var i = 0; i < size; i++)\n arr[i] = 0;\n return arr;\n }", "function createArray(arraySize) {\n // TODO implement\n return lodash.times(arraySize, lodash.uniqueId.bind(null, 'ball_'));\n}", "function toTypedArray(value, uniformLength, Type, cache) {\n const length = value.length;\n if (length % uniformLength) {\n log.warn(`Uniform size should be multiples of ${uniformLength}`, value)();\n }\n\n if (value instanceof Type) {\n return value;\n }\n let result = cache[length];\n if (!result) {\n result = new Type(length);\n cache[length] = result;\n }\n for (let i = 0; i < length; i++) {\n result[i] = value[i];\n }\n return result;\n}", "function create$6() {\n let out = new ARRAY_TYPE(4);\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}", "function __getArrayView(arr) {\n const U32 = new Uint32Array(memory.buffer);\n const id = U32[arr + ID_OFFSET >>> 2];\n const info = getArrayInfo(id);\n const align = getValueAlign(info);\n let buf = info & STATICARRAY\n ? arr\n : U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2];\n const length = info & ARRAY\n ? U32[arr + ARRAY_LENGTH_OFFSET >>> 2]\n : U32[buf + SIZE_OFFSET >>> 2] >>> align;\n return getView(align, info & VAL_SIGNED, info & VAL_FLOAT).subarray(buf >>>= align, buf + length);\n }", "toArray()\r\n {\r\n var a = [], list, k = size;\r\n for (var i = 0; i < k; i++)\r\n {\r\n list = this.#table[i];\r\n var l = list.length; \r\n \r\n for (var j = 0; j < l; j++)\r\n a.push(list[j]);\r\n }\r\n return a;\r\n }", "from(arr){\n let sq = SmallQuery.create();\n for(let i = 0, l = arr.length; i < l; i++){\n sq[i] = arr[i];\n }\n sq.length = arr.length;\n return sq;\n }", "function parse_PtgArray(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += 7;\n\treturn [type];\n}", "function parse_PtgArray(blob, length) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += 7;\n\treturn [type];\n}", "static ArrayMake(p_Size, p_Value) {\n let i_Array = [];\n \n for (let i_Sub = 0; i_Sub < p_Size;i_Sub++) {\n i_Array.push(p_Value); }\n return i_Array;\n }", "static fromArray(arr) {\n return Matrix.map(new Matrix(arr.length, 1), (_, i) => arr[i]);\n }", "function ex_8_I(a){\n n=Math.sqrt(a.length);\n b=[];\n for(var i=0; i<n; i++){\n b[i]=[];\n for(var j=0;j<n;j++){\n \tb[i][j]=a[n*i+j];\n }\n \n }\n return b;\n\n}", "function newArray(col, count) {\n if (!col.nullCount) {\n const { ArrayType, typeId: id } = col;\n if (id === 2 || id === 3 || id === 7 || id === 9 || id === 10) {\n return new ArrayType(count);\n }\n }\n\n return Array(count);\n}", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }", "function n$1(){return new Float32Array(4)}", "function typed_to_plain(tarr) {\n var retval = new Array(tarr.length)\n for (var i = 0; i < tarr.length; i++) {\n retval[i] = tarr[i]\n }\n return retval\n }", "function array(typeSpec) { return new TArray(parseSpec(typeSpec)); }", "function array(typeSpec) { return new TArray(parseSpec(typeSpec)); }", "function taintArray() {\n taintDataProperty(Array.prototype, \"0\");\n taintMethod(Array.prototype, \"indexOf\");\n taintMethod(Array.prototype, \"join\");\n taintMethod(Array.prototype, \"push\");\n taintMethod(Array.prototype, \"slice\");\n taintMethod(Array.prototype, \"sort\");\n}", "function create$7() {\n let out = new ARRAY_TYPE(2);\n out[0] = 0;\n out[1] = 0;\n return out;\n}", "function arrayFactory(numberOfElements,multiplier,offset) {\n\tvar array = new Array(numberOfElements);\n\tfor (var i=0; i<numberOfElements; i++)\n\t\tarray[i] = i * multiplier + offset;\n\treturn array;\n}", "function Arr(){ return Literal.apply(this,arguments) }", "function SquareArrayVals(arr){\n}", "function subarray(sum) {\n\n}", "function _gobbleArray(context) {\n context.index++;\n return {\n type: 9, // 'ArrayExpression'\n elements: _gobbleArguments(context, CBRACK_CODE)\n };\n }", "function toVector(arr)\n\t\t\t{\n\t\t\t\treturn concat.apply([], arr);\n\t\t\t}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}", "arrayd(obj) {\n\n if (Array.isArray(obj)) {\n\n return {\n\n at(skip, pos) { return obj[pos] },\n rest(skip, pos) { return obj.slice(pos) }\n };\n }\n\n var iter = _es6now.iter(toObject(obj));\n\n return {\n\n at(skip) {\n\n var r;\n\n while (skip--)\n r = iter.next();\n\n return r.value;\n },\n\n rest(skip) {\n\n var a = [], r;\n\n while (--skip)\n r = iter.next();\n\n while (r = iter.next(), !r.done)\n a.push(r.value);\n\n return a;\n }\n };\n }", "function r$2(s,r){return new s(new ArrayBuffer(r*s.ElementCount*e$6(s.ElementType)))}", "function convertArray( array, type, forceClone ) {\n\n\tif ( ! array || // let 'undefined' and 'null' pass\n\t\t! forceClone && array.constructor === type ) return array;\n\n\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\treturn new type( array ); // create typed array\n\n\t}\n\n\treturn Array.prototype.slice.call( array ); // create Array\n\n}", "function heavyDuty() {\n const bigArray = new Array(7000).fill('😊')\n return bigArray // return big array\n}", "function double_all(arr) {\n var ret = Array(arr.length);\n for (var i = 0; i < arr.length; ++i) {\n ret[i] = arr[i] * 2;\n }\n return ret;\n}", "function typed_to_plain(tarr) {\n var retval = new Array(tarr.length);\n for (var i = 0; i < tarr.length; i++) {\n retval[i] = tarr[i];\n }\n return retval;\n }", "function getArray() {\n var a = new Array(10);\n\n for (var i = 0; i < a.length; i++) {\n a[i] = i;\n }\n\n return a;\n}", "function double_all(arr) {\n var ret = Array(arr.length);\n for (var i = 0; i < arr.length; ++i) {\n ret[i] = arr[i] * 2;\n }\n return ret;\n}", "function double_all(arr) {\n var ret = Array(arr.length);\n for (var i = 0; i < arr.length; ++i) {\n ret[i] = arr[i] * 2;\n }\n return ret;\n}", "compileArrayIndex(opts, result) {\nopts.dereferencedPointer = false;\nhelper.assertArray(opts.identifier, opts.token);\nlet program = this._program;\nlet identifier = opts.identifier;\nlet arraySize = identifier.getArraySize();\n// Check if it's a number, string or pointer then the size is 1.\n// If it's a record then it's the size of the record...\nlet identifierSize = identifier.getType().typePointer ? 1 : helper.getIdentifierSize(identifier.getType().type);\nif (typeof arraySize === 'number') {\n// It's a single dimensional array...\nopts.index++;\nopts.identifierSize = identifierSize;\nopts.arraySize = 1;\nopts.maxArraySize = arraySize;\nresult.dataSize = identifierSize;\nthis.compileArrayIndexToReg(opts);\n} else {\n// It's a multi dimensional array...\n// Calculate the array sized with the nested arrays inside...\nlet arraySizes = [];\nlet size = identifierSize;\nfor (let i = arraySize.length - 1; i > 0; i--) {\nsize *= arraySize[i];\narraySizes.unshift(size);\n}\narraySizes.push(identifierSize);\nfor (let i = 0; i < arraySize.length; i++) {\nopts.index++;\nopts.identifierSize = 1;\nopts.arraySize = arraySizes[i];\nopts.maxArraySize = arraySize[i];\nthis.compileArrayIndexToReg(opts);\nopts.index++;\nif ((opts.index >= opts.expression.tokens.length) && (i < arraySize.length - 1)) {\n// It's part of a multidimensional array, create an intermediary result type...\nresult.fullArrayAddress = false;\nresult.dataSize = arraySize[i];\nlet resultArraySize = [];\nfor (let j = i + 1; j < arraySize.length; j++) {\nresultArraySize.push(arraySize[j]);\n}\nif (resultArraySize.length === 1) {\nresultArraySize = resultArraySize[0];\n}\nresult.type = new Var({\ncompiler: this._compiler,\nunionId: 0,\nname: '?',\narraySize: resultArraySize,\noffset: identifier.getOffset(),\ntoken: identifier.getToken(),\ntype: identifier.getType().type,\ntypePointer: identifier.getType().typePointer,\nglobal: identifier.getGlobal(),\npointer: identifier.getPointer()\n});\nbreak;\n}\n}\nopts.index--;\n}\n// When writing the last field then we don't dereference the pointer...\nif (identifier.getPointer() && (!opts.forWriting || (opts.index + 1 < opts.expression.tokens.length))) {\nif (opts.identifier.getType().typePointer && (opts.reg !== $.REG_PTR)) {\nprogram.addCommand(\n$.CMD_SET, $.T_NUM_G, $.REG_PTR, $.T_NUM_G, opts.reg,\n$.CMD_SET, $.T_NUM_G, $.REG_PTR, $.T_NUM_P, 0,\n$.CMD_SET, $.T_NUM_G, opts.reg, $.T_NUM_G, $.REG_PTR\n);\n} else {\nif (!opts.dereferencedPointer && !opts.dereferencedPointerForWriting) {\nprogram.addCommand($.CMD_SET, $.T_NUM_G, $.REG_PTR, $.T_NUM_P, 0);\n}\nopts.dereferencedPointerForWriting = false;\n}\nopts.dereferencedPointer = true;\n}\nreturn opts;\n}", "_pushTypedArray(gen, obj) {\n if(obj instanceof Uint8Array) {\n // treat Uint8Array as a simple byte string\n return gen._pushByteString(\n gen, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength));\n }\n\n // see https://tools.ietf.org/html/rfc8746\n\n let typ = 0b01000000;\n let sz = obj.BYTES_PER_ELEMENT;\n const {name} = obj.constructor;\n\n if(name.startsWith('Float')) {\n typ |= 0b00010000;\n sz /= 2;\n } else if(!name.includes('U')) {\n typ |= 0b00001000;\n }\n if(name.includes('Clamped') || ((sz !== 1) && !util.isBigEndian())) {\n typ |= 0b00000100;\n }\n typ |= {\n 1: 0b00,\n 2: 0b01,\n 4: 0b10,\n 8: 0b11\n }[sz];\n if(!gen._pushTag(typ)) {\n return false;\n }\n return gen._pushByteString(\n gen, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength));\n }", "function array(n) {\r\n for (i = 0; i < n; i++) {\r\n this[i] = 0;\r\n }\r\n this.length = n;\r\n}", "function createArray(length, width){\r\n var arr = new Array(length);\r\n for (var i = 0; i < arr.length; i++) {\r\n arr[i] = new Array(width);\r\n }\r\n return arr;\r\n\r\n}", "function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++){n[t]=e[t];}return n;}return Array.from(e);}", "function speedTest(sizeOfTestArray){\n let k = sizeOfTestArray;\n let myTestingArray = [];\n for(let i = 0; i< k; i++){\n myTestingArray.push(i);\n }\n return myTestingArray;\n}", "function _toConsumableArray(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n return arr2;\n } else {\n return Array.from(arr);\n }\n }", "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "function sumArr(array){\n\n}", "function executeWithArrEqualsEmpty()\n{\n arr=[]; //Empty the array\n for (var i = 0; i < 15000000; i++) { //repopulate the array\n arr[i]=Math.random();\n }\n}", "function augmentTypedArray(typedArray, numComponents) {\n let cursor = 0;\n typedArray.push = function () {\n for (let ii = 0; ii < arguments.length; ++ii) {\n const value = arguments[ii];\n if (value instanceof Array || (value.buffer && value.buffer instanceof ArrayBuffer)) {\n for (let jj = 0; jj < value.length; ++jj) {\n typedArray[cursor++] = value[jj];\n }\n } else {\n typedArray[cursor++] = value;\n }\n }\n };\n typedArray.reset = function (opt_index) {\n cursor = opt_index || 0;\n };\n typedArray.numComponents = numComponents;\n Object.defineProperty(typedArray, 'numElements', {\n get: function () {\n return this.length / this.numComponents | 0;\n },\n });\n return typedArray;\n }", "function padArray () {\n if (array.length < length[type]) {\n array = array.concat(new Array(length[type] - array.length).fill(0))\n }\n }" ]
[ "0.6351423", "0.626551", "0.61295223", "0.6040662", "0.60219103", "0.59781724", "0.5955053", "0.5879565", "0.5820634", "0.58065885", "0.5776067", "0.5773094", "0.5760899", "0.57540375", "0.5751431", "0.574649", "0.5744183", "0.5722956", "0.5664927", "0.5648365", "0.5645067", "0.5645067", "0.5645067", "0.5645067", "0.5645067", "0.5645067", "0.5645067", "0.5644806", "0.5643044", "0.5628182", "0.56260693", "0.56245035", "0.5617981", "0.56179804", "0.5608345", "0.5597156", "0.5594538", "0.5590469", "0.5576491", "0.55762285", "0.5571605", "0.55696064", "0.55696064", "0.55696064", "0.55696064", "0.5568679", "0.55676067", "0.55626905", "0.5560404", "0.5559563", "0.5559563", "0.5559563", "0.5559563", "0.5559563", "0.5559563", "0.5559563", "0.5559563", "0.5559563", "0.5559563", "0.55376714", "0.5536552", "0.55316937", "0.55316937", "0.55215347", "0.5519364", "0.5508353", "0.55025846", "0.54837704", "0.5473984", "0.5472762", "0.5464354", "0.54592466", "0.54592466", "0.54592466", "0.54592466", "0.54592466", "0.54592466", "0.54592466", "0.54592466", "0.54592466", "0.5451512", "0.5451064", "0.5450448", "0.5448162", "0.54446226", "0.5441249", "0.54378", "0.5435442", "0.5435442", "0.5435157", "0.54334396", "0.5430619", "0.5429789", "0.5417747", "0.54176617", "0.54165727", "0.54156756", "0.5404388", "0.5395054", "0.5393959", "0.5386161" ]
0.0
-1
Unix :) . Don't detect, use this default.
function err(strm, errorCode) { strm.msg = msg[errorCode]; return errorCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static mojangFriendlyOS(){\n const opSys = process.platform\n if (opSys === 'darwin') {\n return 'osx'\n } else if (opSys === 'win32'){\n return 'windows'\n } else if (opSys === 'linux'){\n return 'linux'\n } else {\n return 'unknown_os'\n }\n }", "function absUnix (p) {\n return p.charAt(0) === \"/\" || p === \"\";\n}", "function get_platform(){\n if (['darwin', 'win32', 'win64'].indexOf(process.platform) === -1) return 'linux';\n if (['darwin'].indexOf(process.platform) === -1) return 'win';\n return 'mac';\n }", "function mirrorbrain_getTagOS( file ) {\n\tvar retVal;\n if ( file != null && (\n\t\tfile.indexOf( \"_install-\" ) > -1 || (\n\t\t\tfile.indexOf( \"_install_\" ) > -1 && (\n\t\t\t\tfile.indexOf( \"_Linux_\" ) > -1 || file.indexOf( \"_MacOS_\" ) > -1 || file.indexOf( \"_Win_\" ) > -1 || file.indexOf( \"_Solaris_\" ) > -1\n\t\t\t)\n ) ) ) {\n\n\t\tvar s = file.split( \"_install\" );\n\t\ts = s[0].split( \"_\" );\n\t\tretVal = s[ s.length -2 ] + s[ s.length -1 ];\n\t\tretVal = retVal.toLowerCase();\n\t\tif ( retVal.indexOf( \"winx86\" ) > -1 ) {\n\t\t\tretVal = \"win\";\n\t\t} else if ( retVal == \"linuxx86\" ) {\n\t\t\tretVal = \"linuxintel\";\n\t\t} else if ( retVal == \"macosx86\" ) {\n\t\t\tretVal = \"macosxintel\";\n\t\t} else if ( retVal == \"macosppc\" ) {\n\t\t\tretVal = \"macosxppc\";\n\t\t}\n\t\tif ( file.toLowerCase().indexOf( \"wjre\" ) > -1 ) {\n\t\t\tretVal = retVal + \"wjre\";\n\t\t} else if ( file.indexOf( \"install-deb\" ) > -1 ) {\n\t\t\tretVal = retVal + \"deb\";\n\t\t}\n\t} else if ( file != null && file.indexOf( \"_install_\" ) > -1 ) {\n\t\tvar s = file.split( \"_install_\" );\n\t\ts = s[0].split( \"_\" );\n\t\tretVal = s[ s.length -1 ];\n\t\tretVal = retVal.toLowerCase();\n\t\tif ( retVal.indexOf( \"win32intel\" ) > -1 ) {\n\t\t\tretVal = \"win\";\n\t\t}\n\t\tif ( file.toLowerCase().indexOf( \"wjre\" ) > -1 ) {\n\t\t\tretVal = retVal + \"wjre\";\n\t\t} else if ( file.indexOf( \"_deb\" ) > -1 ) {\n\t\t\tretVal = retVal + \"deb\";\n\t\t} else if ( file.indexOf( \"install-deb\" ) > -1 ) {\n\t\t\tretVal = retVal + \"deb\";\n\t\t}\n\t}\n\treturn retVal;\n}", "function caml_sys_get_config (e) {\n return [0, new MlWrappedString(\"Unix\"), 32];\n}", "function trk_get_platform() {\n if (navigator.platform) {\n\treturn navigator.platform;\n } else {\n\treturn \"-\";\n }\n}", "function getDefaultSelectedOS() {\n var platform = navigator.platform.toLowerCase();\n for (var [navPlatformSubstring, os] of supportedOperatingSystems.entries()) {\n if (platform.indexOf(navPlatformSubstring) !== -1) {\n return os;\n }\n }\n // Just return something if user platform is not in our supported map\n return supportedOperatingSystems.values().next().value;\n}", "function osDetect() {\n\t\tif (s.u.match(/windows/i)) {\n\t\t\ts.prop9 = \"windows\"\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (s.u.match(/(kindle|silk-accelerated)/i)) {\n\t\t\tif(s.u.match(/(kindle fire|silk-accelerated)/i)){\n\t\t\t\ts.prop9 = \"kindle fire\"\n\t\t\t} else {\n\t\t\t\ts.prop9 = \"kindle\"\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (s.u.match(/(iphone|ipod|ipad)/i)) {\n\t\t\tvar match = s.u.match(/OS [0-9_]+/i);\n\t\t\ts.prop9 = 'i' + match[0].replace(/_/g,'.');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(s.u.match(/android/i)){\n\t\t\ts.prop9 = s.u.match(/android [0-9]\\.?[0-9]?\\.?[0-9]?/i);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(s.u.match(/webos\\/[0-9\\.]+/i)){\n\t\t\tvar match = s.u.match(/webos\\/[0-9]\\.?[0-9]?\\.?[0-9]?/i);\n\t\t\ts.prop9 = match[0].replace(/webos\\//i,'web os ');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(s.u.match(/rim tablet os [0-9\\.]+/i)){\n\t\t\tvar match = s.u.match(/rim tablet os [0-9]\\.?[0-9]?\\.?[0-9]?/i);\n\t\t\ts.prop9 = match[0].replace(/rim tablet os/i,'rim os ');\n\t\t\treturn;\n\t\t}\n\t\n\t\tif ((s.u.match(/firefox\\/(\\d{2}||[3-9])/i) || s.u.match(/AppleWebKit\\//)) && s.u.match(/Mac OS X [0-9_\\.]+/)){\n\t\t\tvar matches = s.u.match(/[0-9_\\.]+/g)\n\t\t\tmatches = matches[1].split(/_|\\./);\n\t\t\ts.prop9 = matches[0] + \".\" + matches[1]+\".x\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar mv = s.u.match(/AppleWebKit\\/\\d*/i) && s.u.match(/AppleWebKit\\/\\d*/i).toString().replace(/AppleWebKit\\//i,'');\n\t\tif (mv > 522) s.prop9 = \"10.5.x\";\n\t\telse if (mv > 400) s.prop9 = \"10.4.x\";\n\t\telse if (mv > 99) s.prop9 = \"10.3.x\";\n\t\telse if (mv > 80) s.prop9 = \"10.2.x\";\n\t\telse s.prop9 = \"mac unknown or non-safari\";\n\t}", "function convertPlatformName(name) {\n\t return PLATFORM_MAP[name] || name;\n\t}", "function platform() {\r\n return os.platform();\r\n}", "function convertPlatformName(name){return PLATFORM_MAP[name]||name;}", "function detectOS() {\n let OSName=\"unknown\";\n if (navigator.appVersion.indexOf(\"Win\")!=-1) OSName=\"windows\";\n if (navigator.appVersion.indexOf(\"Mac\")!=-1) OSName=\"mac\";\n if (navigator.appVersion.indexOf(\"X11\")!=-1) OSName=\"unix\";\n if (navigator.appVersion.indexOf(\"Linux\")!=-1) OSName=\"linux\";\n return OSName;\n}", "function checkPlatform(platform) {\n if (platform == \"PSN\" || platform == \"PS5\" || platform == \"PS\" || platform == \"PS4\")\n return \"PS4\";\n\n if (platform == \"XBOX\" || platform == \"X1\") return \"X1\";\n\n if (platform == \"PC\" || platform == \"STEAM\" || platform == \"ORIGIN\") return \"PC\";\n\n if (\n platform == \"SWITCH\" ||\n platform == \"NINTENDO\" ||\n platform == \"NINTENDO SWITCH\" ||\n platform == \"NS\"\n )\n return 1;\n\n return 0;\n }", "function realDeal() {\n var real = true;\n if (navigator.platform.substring(0, 3) == 'Mac') real = false;\n if (navigator.platform.substring(0, 3) == 'Win') real = false;\n //log('real deal?', real);\n return real;\n}", "function OSName() {\n if (navigator.appVersion.indexOf(\"Win\") != -1) return \"Windows\";\n if (navigator.appVersion.indexOf(\"Mac\") != -1) return \"MacOS\";\n if (navigator.appVersion.indexOf(\"X11\") != -1) return \"UNIX\";\n if (navigator.appVersion.indexOf(\"Linux\")!= -1) return \"Linux\";\n return \"Unknown OS\";\n}", "function getOs()\n{\n if (navigator.appVersion.indexOf(\"Win\") != -1)\n {\n return OS_WIN;\n }\n \n if (navigator.appVersion.indexOf(\"Mac\") != -1)\n {\n return OS_MAC;\n }\n\n if (navigator.appVersion.indexOf(\"X11\") != -1)\n {\n return OS_UNIX;\n }\n\n if (navigator.appVersion.indexOf(\"Linux\") != -1)\n {\n return OS_LINUX;\n }\n\n return OS_UNKNOWN;\n}", "function type() {\n if (exports.isWindows) {\n return Type.Windows;\n }\n if (exports.isOSX) {\n return Type.OSX;\n }\n return Type.Linux;\n }", "function checkLinux(platform) {\n\tvar lxReg=/linux/i;\n\tif(lxReg.test(platform)) return true;\n\telse return false;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function convertPlatformName(name) {\n return PLATFORM_MAP[name] || name;\n}", "function getDefaultEngine() {\n var name = \"defaultEngine=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for(var i = 0; i <ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n}", "function getOs(){\n\t\t//#ifdef iphone\n\t\tos = OS_IOS;\n\t\tkony.print(\"ifdef iphone: true\");\n\t\t//alert(\"ifdef iphone: true\");\n\t\t//#endif\n\n\t\t//#ifdef android\n\t\tos = OS_ANDROID;\n\t\tkony.print(\"ifdef android: true\");\n\t\t//alert(\"ifdef android: true\");\n\t\t//#endif\n\n\t\tif(typeof os === \"undefined\"){\n\n\t\t\t// Mobile web -> kony.os.deviceInfo().name === thinclient.\n\t\t\tvar message1 = `kony.os.deviceInfo().name: ${deviceInfo.name}\\n` +\n\t\t\t\t `kony.os.deviceInfo().osname: ${deviceInfo.osname}`;\n\t\t\tkony.print(message1);\n\t\t\t//alert(message1);\n\t\t\tos = deviceInfo.name /*android*/ ||\n\t\t\t\tdeviceInfo.osname /*iPhone*/;\n\t\t\tif(os === \"i-phone\" || os === \"i-pad\"){\n\t\t\t\tos = OS_IOS;\n\t\t\t}\n\t\t\telse if(kony.os.isWeb()){\n\t\t\t\t//TODO:This needs more thought. Web is not really an OS.\n\t\t\t\tos = OS_WEB;\n\t\t\t}\n\t\t}\n\t\tvar message2 = `os: ${os}`;\n\t\tkony.print(message2);\n\t\t//alert(message2);\n\t\treturn os;\n\t}", "function getDefaultPath() {\n return \"python3\";\n}", "function lc3_clean_is_linux_chrome()\n{\n return (navigator.userAgent.toLowerCase().indexOf('chrome') > -1)\n && (navigator.userAgent.toLowerCase().indexOf('linux') > -1);\n}", "function OSType() {\n var OSName=\"Unknown OS\";\n if (navigator.appVersion.indexOf(\"Win\")!=-1) OSName=\"Windows\";\n if (navigator.appVersion.indexOf(\"Mac\")!=-1) OSName=\"MacOS\";\n if (navigator.appVersion.indexOf(\"X11\")!=-1) OSName=\"UNIX\";\n if (navigator.appVersion.indexOf(\"Linux\")!=-1) OSName=\"Linux\";\n return OSName;\n}", "function getOS() {\n // default to linux because it is not always possible to tell it from\n // the\n // appVersion\n var os = TICloudAgent.OS.LINUX;\n if (navigator.appVersion.indexOf(\"Mac\") !== -1) {\n os = TICloudAgent.OS.OSX;\n }\n if (navigator.appVersion.indexOf(\"Win\") !== -1) {\n os = TICloudAgent.OS.WIN;\n }\n return os;\n }", "function unixToWinSlash() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Line,\n pat: /\\//g, repl: '\\\\',\n });\n }", "function resolvePlatform (input) {\n var rtn = null;\n\n switch (input) {\n case 'mac':\n case 'osx':\n case 'mac-64':\n case 'osx-64':\n rtn = 'osx-64';\n break;\n\n case 'linux':\n case 'linux-32':\n rtn = 'linux-32';\n break;\n\n case 'linux-64':\n rtn = 'linux-64';\n break;\n\n case 'linux-arm':\n case 'linux-armel':\n rtn = 'linux-armel';\n break;\n\n case 'linux-armhf':\n rtn = 'linux-armhf';\n break;\n\n case 'win':\n case 'win-32':\n case 'windows':\n case 'windows-32':\n rtn = 'windows-32';\n break;\n\n case 'win-64':\n case 'windows-64':\n rtn = 'windows-64';\n break;\n\n default:\n rtn = null;\n }\n return rtn;\n}", "function getDefaultLibraryFilename() {\n switch (os.platform()) {\n case 'win32':\n return 'fbclient.dll';\n case 'darwin':\n return 'libfbclient.dylib';\n default:\n return 'libfbclient.so';\n }\n}", "function getOs() {\n\n // mobile version\n //var isMobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.userAgent);\n\n // system\n var os = '';\n\n var clientStrings = [\n {s:'Windows 3.11', r:/Win16/},\n {s:'Windows 95', r:/(Windows 95|Win95|Windows_95)/},\n {s:'Windows ME', r:/(Win 9x 4.90|Windows ME)/},\n {s:'Windows 98', r:/(Windows 98|Win98)/},\n {s:'Windows CE', r:/Windows CE/},\n {s:'Windows 2000', r:/(Windows NT 5.0|Windows 2000)/},\n {s:'Windows XP', r:/(Windows NT 5.1|Windows XP)/},\n {s:'Windows Server 2003', r:/Windows NT 5.2/},\n {s:'Windows Vista', r:/Windows NT 6.0/},\n {s:'Windows 7', r:/(Windows 7|Windows NT 6.1)/},\n {s:'Windows 8', r:/(Windows 8|Windows NT 6.2)/},\n {s:'Windows 8.1', r:/(Windows 8.1|Windows NT 6.3)/},\n {s:'Windows 10', r:/(Windows 10|Windows NT 10.0)/},\n {s:'Windows NT 4.0', r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},\n {s:'Windows ME', r:/Windows ME/},\n {s:'Kindle', r:/Kindle|Silk|KFTT|KFOT|KFJWA|KFJWI|KFSOWI|KFTHWA|KFTHWI|KFAPWA|KFAPWI/},//more priority than android\n {s:'Android', r:/Android/},\n {s:'Open BSD', r:/OpenBSD/},\n {s:'Sun OS', r:/SunOS/},\n {s:'Linux', r:/(Linux|X11)/},\n {s:'iOS', r:/(iPhone|iPad|iPod)/},\n {s:'Mac OS X', r:/Mac OS X/},\n {s:'Mac OS', r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},\n {s:'QNX', r:/QNX/},\n {s:'UNIX', r:/UNIX/},\n {s:'BeOS', r:/BeOS/},\n {s:'OS/2', r:/OS\\/2/},\n {s:'Search Bot', r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\\/Teoma|ia_archiver)/}\n ];\n\n for (var index in clientStrings) {\n if (clientStrings[index].r.test(navigator.userAgent)) {\n os = clientStrings[index].s;\n break;\n }\n }\n\n if (os.indexOf('Mac OS') > -1) {\n os = 'macosx';\n } else if (os.indexOf('Android') > -1) {\n os = 'android';\n } else if (os.indexOf('Kindle') > -1) {\n os = 'kindle';\n } else if (os == 'iOS'){\n if (navigator.userAgent.indexOf('iPad') > -1) {\n os = 'ipad';\n } else {\n os = 'iphone';\n }\n } else {\n os = 'windows';\n }\n return os;\n}", "function winToUnixSlash() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Line,\n pat: /\\\\/g, repl: '/',\n });\n }", "function browser_detection(){\n\tif(navigator.appName == \"Netscape\"){\n\t\treturn \"NET\";\t\n\t}else{\n\t\treturn \"IE\";\n\t}\t\n}", "function isMac(){\n if(process.platform == 'darwin'){\n return 1;\n }\n return -1;\n}", "function system() { }", "function CP(e){var t=Wu(e);return\"default\".concat(t[0].toLocaleUpperCase()+t.slice(1))}", "isUNC() {\n const pl = this.#patternList;\n return this.#isUNC !== undefined\n ? this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3]);\n }", "function getLang() {\n const { env, platform } = process;\n const envValue = env.LC_ALL || env.LC_CTYPE || env.LANG;\n\n // If an env var is set for the locale that already includes UTF-8 in the\n // name, then assume we can go with that.\n if (envValue && envValue.includes(\"UTF-8\")) {\n return envValue;\n }\n\n // Otherwise, we're going to guess which encoding to use based on the system.\n // This is probably not the best approach in the world, as you could be on\n // linux and not have C.UTF-8, but in that case you're probably passing an env\n // var for it. This object below represents all of the possible values of\n // process.platform per:\n // https://nodejs.org/api/process.html#process_process_platform\n return {\n aix: \"C.UTF-8\",\n android: \"C.UTF-8\",\n cygwin: \"C.UTF-8\",\n darwin: \"en_US.UTF-8\",\n freebsd: \"C.UTF-8\",\n haiku: \"C.UTF-8\",\n linux: \"C.UTF-8\",\n netbsd: \"C.UTF-8\",\n openbsd: \"C.UTF-8\",\n sunos: \"C.UTF-8\",\n win32: \".UTF-8\"\n }[platform];\n}", "set LinuxEditor(value) {}", "function getSyscall() {\n return syscall;\n }", "get LinuxEditor() {}", "function setDefaultUid() {\n\n\t//Set \"default\" UID to current hardcoded version - for >= 2.26 we could leave it out and point to null, though this wouldn't work with custom forms\n\tvar currentDefault, defaultDefault, types = [\"categoryOptions\", \"categories\", \"categoryOptionCombos\", \"categoryCombos\"];\n\tfor (var k = 0; k < types.length; k++) {\n\t\tfor (var i = 0; metaData[types[k]] && i < metaData[types[k]].length; i++) {\n\t\t\tif (metaData[types[k]][i].name === \"default\") currentDefault = metaData[types[k]][i].id;\n\t\t}\n\n\t\tif (!currentDefault) continue;\n\n\t\tswitch (types[k]) {\n\t\t\tcase \"categoryOptions\":\n\t\t\t\tdefaultDefault = \"xYerKDKCefk\";\n\t\t\t\tbreak;\n\t\t\tcase \"categories\":\n\t\t\t\tdefaultDefault = \"GLevLNI9wkl\";\n\t\t\t\tbreak;\n\t\t\tcase \"categoryOptionCombos\":\n\t\t\t\tdefaultDefault = \"HllvX50cXC0\";\n\t\t\t\tbreak;\n\t\t\tcase \"categoryCombos\":\n\t\t\t\tdefaultDefault = \"bjDvmb4bfuf\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//search and replace metaData as text, to make sure customs forms are included\n\t\tvar regex = new RegExp(currentDefault, \"g\");\n\t\tmetaData = JSON.parse(JSON.stringify(metaData).replace(regex, defaultDefault));\n\t}\n}", "function getLogoFile(distro) {\n\tvar result = 'linux';\n\tif (distro.toLowerCase().indexOf('mac os') != -1) { result = 'apple' } else\n\tif (distro.toLowerCase().indexOf('arch') != -1)\t{ result = 'arch' } else\n\tif (distro.toLowerCase().indexOf('centos') != -1)\t{ result = 'centos' } else\n\tif (distro.toLowerCase().indexOf('coreos') != -1)\t{ result = 'coreos' } else\n\tif (distro.toLowerCase().indexOf('debian') != -1)\t{ result = 'debian' } else\n\tif (distro.toLowerCase().indexOf('elementary') != -1)\t{ result = 'elementary' } else\n\tif (distro.toLowerCase().indexOf('fedora') != -1)\t{ result = 'fedora' } else\n\tif (distro.toLowerCase().indexOf('gentoo') != -1)\t{ result = 'gentoo' } else\n\tif (distro.toLowerCase().indexOf('mageia') != -1)\t{ result = 'mageia' } else\n\tif (distro.toLowerCase().indexOf('mandriva') != -1)\t{ result = 'mandriva' } else\n\tif (distro.toLowerCase().indexOf('manjaro') != -1)\t{ result = 'manjaro' } else\n\tif (distro.toLowerCase().indexOf('mint') != -1)\t{ result = 'mint' } else\n\tif (distro.toLowerCase().indexOf('openbsd') != -1)\t{ result = 'openbsd' } else\n\tif (distro.toLowerCase().indexOf('opensuse') != -1)\t{ result = 'opensuse' } else\n\tif (distro.toLowerCase().indexOf('pclinuxos') != -1)\t{ result = 'pclinuxos' } else\n\tif (distro.toLowerCase().indexOf('puppy') != -1)\t{ result = 'puppy' } else\n\tif (distro.toLowerCase().indexOf('raspbian') != -1)\t{ result = 'raspbian' } else\n\tif (distro.toLowerCase().indexOf('reactos') != -1)\t{ result = 'reactos' } else\n\tif (distro.toLowerCase().indexOf('redhat') != -1)\t{ result = 'redhat' } else\n\tif (distro.toLowerCase().indexOf('slackware') != -1)\t{ result = 'slackware' } else\n\tif (distro.toLowerCase().indexOf('sugar') != -1)\t{ result = 'sugar' } else\n\tif (distro.toLowerCase().indexOf('steam') != -1)\t{ result = 'steam' } else\n\tif (distro.toLowerCase().indexOf('suse') != -1)\t{ result = 'suse' } else\n\tif (distro.toLowerCase().indexOf('mate') != -1)\t{ result = 'ubuntu-mate' } else\n\tif (distro.toLowerCase().indexOf('lubuntu') != -1)\t{ result = 'lubuntu' } else\n\tif (distro.toLowerCase().indexOf('xubuntu') != -1)\t{ result = 'xubuntu' } else\n\tif (distro.toLowerCase().indexOf('ubuntu') != -1)\t{ result = 'ubuntu' }\n\treturn result;\n}", "async function isCaseInsensitiveFS() {\n if (typeof module.exports._caseInsensitiveFS === 'undefined') {\n let lcStat;\n let ucStat;\n try {\n lcStat = await fse.stat(process.execPath.toLowerCase());\n } catch (err) {\n lcStat = false;\n }\n try {\n ucStat = await fse.stat(process.execPath.toUpperCase());\n } catch (err) {\n ucStat = false;\n }\n if (lcStat && ucStat) {\n module.exports._caseInsensitiveFS = lcStat.dev === ucStat.dev && lcStat.ino === ucStat.ino;\n } else {\n module.exports._caseInsensitiveFS = false;\n }\n }\n return module.exports._caseInsensitiveFS;\n}", "function _getDefaultFile() {\n\t\treturn \"resource://zotero/schema/\" + LOCATE_FILE_NAME;\n\t}", "function getDefaultKeyBinding(e){switch(e.keyCode){case 66:// B\r\n\treturn hasCommandModifier(e)?'bold':null;case 68:// D\r\n\treturn isCtrlKeyCommand(e)?'delete':null;case 72:// H\r\n\treturn isCtrlKeyCommand(e)?'backspace':null;case 73:// I\r\n\treturn hasCommandModifier(e)?'italic':null;case 74:// J\r\n\treturn hasCommandModifier(e)?'code':null;case 75:// K\r\n\treturn!isWindows&&isCtrlKeyCommand(e)?'secondary-cut':null;case 77:// M\r\n\treturn isCtrlKeyCommand(e)?'split-block':null;case 79:// O\r\n\treturn isCtrlKeyCommand(e)?'split-block':null;case 84:// T\r\n\treturn isOSX&&isCtrlKeyCommand(e)?'transpose-characters':null;case 85:// U\r\n\treturn hasCommandModifier(e)?'underline':null;case 87:// W\r\n\treturn isOSX&&isCtrlKeyCommand(e)?'backspace-word':null;case 89:// Y\r\n\tif(isCtrlKeyCommand(e)){return isWindows?'redo':'secondary-paste';}return null;case 90:// Z\r\n\treturn getZCommand(e)||null;case Keys.RETURN:return'split-block';case Keys.DELETE:return getDeleteCommand(e);case Keys.BACKSPACE:return getBackspaceCommand(e);// LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\r\n\tcase Keys.LEFT:return shouldFixFirefoxMovement&&hasCommandModifier(e)?'move-selection-to-start-of-block':null;case Keys.RIGHT:return shouldFixFirefoxMovement&&hasCommandModifier(e)?'move-selection-to-end-of-block':null;default:return null;}}", "function defaulttimestamps(hw, off){\n if (off == 1 ){\n\t switch (hw) {\n\t case 5: return 1358895453;\n\t case 6: return 1359640173;\n\t case 11: return 1360529471;\n\t case 13: return 1361748191;\n\t case 15: return 1362428898;\n\t case 17: return 1362882328;}\n\t}\n else {\n\t switch (hw) {\n\t case 5: return 1381054271;\n\t case 6: return 1382423851;\n\t case 11: return 1382807403;\n\t case 13: return 1383402021;\n\t case 15: return 1384777587;\n\t case 17: return 1384587218;}\n }\n}", "function no_overlib() { return ver3fix; }", "setDefault() { }", "function checkOS () {\n var os;\n var clientStrings = [{\n s:'Windows',\n r:/(Windows)/\n }, {\n s:'Android',\n r:/Android/\n }, {\n s:'Open BSD',\n r:/OpenBSD/\n }, {\n s:'Linux',\n r:/(Linux|X11)/\n }, {\n s:'iOS',\n r:/(iPhone|iPad|iPod)/\n }, {\n s:'Mac',\n r:/Mac/\n }, {\n s:'UNIX',\n r:/UNIX/\n }, {\n s:'Robot',\n r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\\/Teoma|ia_archiver)/\n }];\n\n for (var i = 0; i < clientStrings.length; i++) {\n var cs = clientStrings[i];\n if (cs.r.test(navigator.userAgent)) {\n return cs.s;\n }\n }\n}", "getBestEnvironment(callback) {\n\t\t// On platforms that don't have a shell, we just return process.env (e.g. Windows).\n\t\tif (!process.env.SHELL) {\n\t\t\tcallback(null, process.env);\n\t\t}\n\t\t\n\t\treturn this.getLoginEnvironmentFromShell(function(error, environment) {\n\t\t\tif (!environment) {\n\t\t\t\tconsole.warn(`ShellEnvironment.getBestEnvironment: ${error}`);\n\t\t\t\tenvironment = Object.assign({}, process.env);\n\t\t\t}\n\t\t\t\n\t\t\tif (!environment.LANG) {\n\t\t\t\tLocale().then((locale) => {\n\t\t\t\t\tenvironment.LANG = `${locale}.UTF-8`\n\t\t\t\t\tconsole.log(`ShellEnvironment.getBestEnvironment: LANG=${environment.LANG}`)\n\t\t\t\t\tcallback(error, environment);\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tcallback(error, environment);\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tcallback(error, environment);\n\t\t\t}\n\t\t});\n\t}", "function setDevice() {\n -1 !=\n (navigator.userAgent.indexOf(\"Opera\") || navigator.userAgent.indexOf(\"OPR\"))\n ? alert(\"Opera\")\n : -1 != navigator.userAgent.indexOf(\"Chrome\")\n ? (seek = 1.45)\n : -1 != navigator.userAgent.indexOf(\"Safari\")\n ? (seek = 0)\n : -1 != navigator.userAgent.indexOf(\"Firefox\")\n ? (seek = 0)\n : -1 < navigator.userAgent.indexOf(\"Edge\")\n ? (seek = 0)\n : -1 != navigator.userAgent.indexOf(\"MSIE\") || 1 == !!document.documentMode\n ? alert(\"IE\")\n : alert(\"unknown\");\n}", "function unixify( filepath ) {\n\t\treturn filepath.replace( /\\\\/g, '/' );\n\t}", "function mirrorbrain_getTagLang( file ) {\n var retVal;\n if ( file != null && (\n\t\tfile.indexOf( \"_install-\" ) > -1 || (\n\t\t\tfile.indexOf( \"_install_\" ) > -1 && (\n\t\t\t\tfile.indexOf( \"_Linux_\" ) > -1 || file.indexOf( \"_MacOS_\" ) > -1 || file.indexOf( \"_Win_\" ) > -1 || file.indexOf( \"_Solaris_\" ) > -1\n\t\t\t)\n ) ) ) {\n\n\t\tvar s = file.split( \"_install\" );\n\t\ts = s[1].split( \".\" );\n\t\ts = s[0].split( \"_\" );\n\t\tretVal = s[s.length-1];\n\n\t} else if ( file != null && file.indexOf( \"_install_\" ) > -1 ) {\n\t\tvar s = file.split( \"_install_\" );\n\t\ts = s[1].split( \".\" );\n\t\ts = s[0].split( \"_\" );\n\t\tif ( s[s.length-1].indexOf( \"deb\" ) > -1 ) {\n\t\t\tretVal = s[s.length-2];\n\t\t} else {\n\t\t\tretVal = s[s.length-1];\n\t\t}\n\t}\n return retVal;\n}", "function getOS() {\n var userAgent = window.navigator.userAgent,\n platform = window.navigator.platform,\n macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'],\n windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],\n iosPlatforms = ['iPhone', 'iPad', 'iPod'],\n os = null;\n \n if (macosPlatforms.indexOf(platform) !== -1) {\n os = 'Mac OS';\n } else if (iosPlatforms.indexOf(platform) !== -1) {\n os = 'iOS';\n } else if (windowsPlatforms.indexOf(platform) !== -1) {\n os = 'Windows';\n } else if (/Android/.test(userAgent)) {\n os = 'Android';\n } else if (!os && /Linux/.test(platform)) {\n os = 'Linux';\n }\n return os;\n }", "function getPlatform() {\n var userAgent = window.navigator.userAgent;\n return {\n isWin: userAgent.indexOf('Windows') >= 0,\n isMac: userAgent.indexOf('Macintosh') >= 0,\n isLinux: userAgent.indexOf('Linux') >= 0\n };\n}", "function getDefaultKeyBinding(e) {\n\t switch (e.keyCode) {\n\t case 66:\n\t // B\n\t return hasCommandModifier(e) ? 'bold' : null;\n\t case 68:\n\t // D\n\t return isCtrlKeyCommand(e) ? 'delete' : null;\n\t case 72:\n\t // H\n\t return isCtrlKeyCommand(e) ? 'backspace' : null;\n\t case 73:\n\t // I\n\t return hasCommandModifier(e) ? 'italic' : null;\n\t case 74:\n\t // J\n\t return hasCommandModifier(e) ? 'code' : null;\n\t case 75:\n\t // K\n\t return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n\t case 77:\n\t // M\n\t return isCtrlKeyCommand(e) ? 'split-block' : null;\n\t case 79:\n\t // O\n\t return isCtrlKeyCommand(e) ? 'split-block' : null;\n\t case 84:\n\t // T\n\t return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n\t case 85:\n\t // U\n\t return hasCommandModifier(e) ? 'underline' : null;\n\t case 87:\n\t // W\n\t return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n\t case 89:\n\t // Y\n\t if (isCtrlKeyCommand(e)) {\n\t return isWindows ? 'redo' : 'secondary-paste';\n\t }\n\t return null;\n\t case 90:\n\t // Z\n\t return getZCommand(e) || null;\n\t case Keys.RETURN:\n\t return 'split-block';\n\t case Keys.DELETE:\n\t return getDeleteCommand(e);\n\t case Keys.BACKSPACE:\n\t return getBackspaceCommand(e);\n\t // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n\t case Keys.LEFT:\n\t return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n\t case Keys.RIGHT:\n\t return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n\t default:\n\t return null;\n\t }\n\t}", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "function parse_FileMoniker(blob) {\n\tblob.l += 2; //var cAnti = blob.read_shift(2);\n\tvar ansiPath = blob.read_shift(0, 'lpstr-ansi');\n\tblob.l += 2; //var endServer = blob.read_shift(2);\n\tif(blob.read_shift(2) != 0xDEAD) throw new Error(\"Bad FileMoniker\");\n\tvar sz = blob.read_shift(4);\n\tif(sz === 0) return ansiPath.replace(/\\\\/g,\"/\");\n\tvar bytes = blob.read_shift(4);\n\tif(blob.read_shift(2) != 3) throw new Error(\"Bad FileMoniker\");\n\tvar unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,\"\");\n\treturn unicodePath;\n}", "function parse_FileMoniker(blob) {\n\tblob.l += 2; //var cAnti = blob.read_shift(2);\n\tvar ansiPath = blob.read_shift(0, 'lpstr-ansi');\n\tblob.l += 2; //var endServer = blob.read_shift(2);\n\tif(blob.read_shift(2) != 0xDEAD) throw new Error(\"Bad FileMoniker\");\n\tvar sz = blob.read_shift(4);\n\tif(sz === 0) return ansiPath.replace(/\\\\/g,\"/\");\n\tvar bytes = blob.read_shift(4);\n\tif(blob.read_shift(2) != 3) throw new Error(\"Bad FileMoniker\");\n\tvar unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,\"\");\n\treturn unicodePath;\n}", "function parse_FileMoniker(blob) {\n\tblob.l += 2; //var cAnti = blob.read_shift(2);\n\tvar ansiPath = blob.read_shift(0, 'lpstr-ansi');\n\tblob.l += 2; //var endServer = blob.read_shift(2);\n\tif(blob.read_shift(2) != 0xDEAD) throw new Error(\"Bad FileMoniker\");\n\tvar sz = blob.read_shift(4);\n\tif(sz === 0) return ansiPath.replace(/\\\\/g,\"/\");\n\tvar bytes = blob.read_shift(4);\n\tif(blob.read_shift(2) != 3) throw new Error(\"Bad FileMoniker\");\n\tvar unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,\"\");\n\treturn unicodePath;\n}", "function parse_FileMoniker(blob) {\n\tblob.l += 2; //var cAnti = blob.read_shift(2);\n\tvar ansiPath = blob.read_shift(0, 'lpstr-ansi');\n\tblob.l += 2; //var endServer = blob.read_shift(2);\n\tif(blob.read_shift(2) != 0xDEAD) throw new Error(\"Bad FileMoniker\");\n\tvar sz = blob.read_shift(4);\n\tif(sz === 0) return ansiPath.replace(/\\\\/g,\"/\");\n\tvar bytes = blob.read_shift(4);\n\tif(blob.read_shift(2) != 3) throw new Error(\"Bad FileMoniker\");\n\tvar unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,\"\");\n\treturn unicodePath;\n}", "function fixDriveCasingInWindows(pathToFix) {\n return process.platform === 'win32' && pathToFix\n ? pathToFix.substr(0, 1).toUpperCase() + pathToFix.substr(1)\n : pathToFix;\n}", "function fixDriveCasingInWindows(pathToFix) {\n return process.platform === 'win32' && pathToFix\n ? pathToFix.substr(0, 1).toUpperCase() + pathToFix.substr(1)\n : pathToFix;\n}", "function parse_FileMoniker(blob) {\n blob.l += 2; //var cAnti = blob.read_shift(2);\n\n var ansiPath = blob.read_shift(0, 'lpstr-ansi');\n blob.l += 2; //var endServer = blob.read_shift(2);\n\n if (blob.read_shift(2) != 0xDEAD) throw new Error(\"Bad FileMoniker\");\n var sz = blob.read_shift(4);\n if (sz === 0) return ansiPath.replace(/\\\\/g, \"/\");\n var bytes = blob.read_shift(4);\n if (blob.read_shift(2) != 3) throw new Error(\"Bad FileMoniker\");\n var unicodePath = blob.read_shift(bytes >> 1, 'utf16le').replace(chr0, \"\");\n return unicodePath;\n }", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function getDefaultKeyBinding(e) {\n switch (e.keyCode) {\n case 66:\n // B\n return hasCommandModifier(e) ? 'bold' : null;\n case 68:\n // D\n return isCtrlKeyCommand(e) ? 'delete' : null;\n case 72:\n // H\n return isCtrlKeyCommand(e) ? 'backspace' : null;\n case 73:\n // I\n return hasCommandModifier(e) ? 'italic' : null;\n case 74:\n // J\n return hasCommandModifier(e) ? 'code' : null;\n case 75:\n // K\n return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n case 77:\n // M\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 79:\n // O\n return isCtrlKeyCommand(e) ? 'split-block' : null;\n case 84:\n // T\n return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n case 85:\n // U\n return hasCommandModifier(e) ? 'underline' : null;\n case 87:\n // W\n return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n case 89:\n // Y\n if (isCtrlKeyCommand(e)) {\n return isWindows ? 'redo' : 'secondary-paste';\n }\n return null;\n case 90:\n // Z\n return getZCommand(e) || null;\n case Keys.RETURN:\n return 'split-block';\n case Keys.DELETE:\n return getDeleteCommand(e);\n case Keys.BACKSPACE:\n return getBackspaceCommand(e);\n // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n case Keys.LEFT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n case Keys.RIGHT:\n return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n default:\n return null;\n }\n}", "function detectBrowser() {\n if (firefoxBrowser >= 0) {\n return \"firefox\";\n } else if (operaBrowser >= 0) {\n return \"opera\";\n } else if (ieBrowser >= 0) {\n return \"ie\";\n } else if (edgeBrowser >= 0) {\n return \"edge\";\n } else if (chromeBrowser >= 0) {\n return \"chrome\";\n } else if (safariBrowser >= 0 && chromeBrowser < 0) {\n return \"safari\";\n } else {\n return \"unknown\";\n };\n}", "function getBrowser(){\n\t\tvar userAgent = navigator.userAgent.toLowerCase();\n\t\tjQuery.browser.chrome = /chrome/.test(userAgent);\n\t\tjQuery.browser.safari= /webkit/.test(userAgent);\n\t\tjQuery.browser.opera=/opera/.test(userAgent);\n\t\tjQuery.browser.msie=/msie/.test( userAgent ) && !/opera/.test( userAgent );\n\t\tjQuery.browser.mozilla= /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) || /firefox/.test(userAgent);\n\n\t\tif(jQuery.browser.chrome) return \"chrome\";\n\t\tif(jQuery.browser.mozilla) return \"mozilla\";\n\t\tif(jQuery.browser.opera) return \"opera\";\n\t\tif(jQuery.browser.safari) return \"safari\";\n\t\tif(jQuery.browser.msie) return \"ie\";\n\t}", "getPlatformInfo () {\n switch (this.props.platform) {\n case 'darwin':\n return 'Mac';\n case 'win32':\n return 'Windows';\n case 'linux':\n return 'Linux';\n default:\n return '';\n }\n }", "function getUnix() {\n return Math.floor(Date.now() / 1000);\n}", "bootOS () {\n switch (this.device) {\n case 'pc' :\n return this.windows.getMessage()\n break;\n\n case 'mac' :\n return this.apple.getMessage()\n break;\n\n case 'cellphone' :\n return this.android.getMessage()\n break;\n\n case 'server' :\n return this.linux.getMessage()\n break;\n }\n }", "function getDefaultUserAgentKey() {\n return \"x-ms-command-name\";\n }", "function sniffBrowsers() {\r\n\tns4 = document.layers;\r\n\top5 = (navigator.userAgent.indexOf(\"Opera 5\")!=-1) \r\n\t\t||(navigator.userAgent.indexOf(\"Opera/5\")!=-1);\r\n\top6 = (navigator.userAgent.indexOf(\"Opera 6\")!=-1) \r\n\t\t||(navigator.userAgent.indexOf(\"Opera/6\")!=-1);\r\n\t\r\n\tagt = navigator.userAgent.toLowerCase();\r\n\tmac = (agt.indexOf(\"mac\")!=-1);\r\n\tie = (agt.indexOf(\"msie\") != -1); \r\n\tmac_ie = mac && ie;\r\n\tffox = (agt.indexOf(\"firefox\") != -1);\r\n}", "isWindows() {\n return !!process.platform.match(/^win/);\n }", "_definePlatform() {\n const ua = window.navigator.userAgent\n const md = new MobileDetect(ua);\n\n client.platform.isMobile = (md.mobile() !== null); // true if phone or tablet\n client.platform.os = (function() {\n const os = md.os();\n\n if (os === 'AndroidOS')\n return 'android';\n else if (os === 'iOS')\n return 'ios';\n else\n return 'other';\n })();\n }", "function defaults_applications(){\n\tvar default_browser=defaultApplication(\"browser\").split(\" \")\n\tvar pathdefault_browser=\"file://\"+applicationPath(default_browser[0]+\".desktop\")\n\t\n\tvar default_filemanager=defaultApplication(\"filemanager\").split(\" \")\n\tvar pathdefault_filemanager=\"file://\"+applicationPath(default_filemanager[0]+\".desktop\")\n\t\n\tvar default_terminal=defaultApplication(\"terminal\").split(\" \")\n\tvar pathdefault_terminal=\"file://\"+applicationPath(default_terminal[0]+\".desktop\")\n\t\n\tvar default_office=defaultApplication(\"application/msword\")\n\tif(default_office.match(\"libreoffice\")){\n\tvar default_office=default_office.split(\" \")\n\tvar pathdefault_office=\"file://\"+applicationPath(default_office[0]+\"-writer\"+\".desktop\")\n \n\t}\n\telse{\n\tvar default_office=default_office.split(\" \")\n\tvar pathdefault_office=\"file://\"+applicationPath(default_office[0]+\".desktop\")\n\t}\n\t\n\tvar default_imclient=defaultApplication(\"imClient\").split(\" \")\n\tvar pathdefault_imclient=\"file://\"+applicationPath(default_imclient[0]+\".desktop\")\n\t\n\tvar default_mailer=defaultApplication(\"mailer\").split(\" \")\n\tvar pathdefault_mailer=\"file://\"+applicationPath(default_mailer[0]+\".desktop\")\t\n\t\n\tvar default_imageviewer=defaultApplication(\"image/png\").split(\" \")\n\tvar pathdefault_imageviewer=\"file://\"+applicationPath(default_imageviewer[0]+\".desktop\")\t\n\n\t\n\tvar default_videoplayer=defaultApplication(\"video/mp4\") \n\tif (default_videoplayer.match(\"/usr/bin/\") ){\n\t var default_videoplayer = default_videoplayer.replace(\"/usr/bin/\",\"\").split(\" \")\n\t \n\t}\n\telse {\n\t default_videoplayer.split(\" \")\n\t}\n \tvar pathdefault_videoplayer=\"file://\"+applicationPath(default_videoplayer[0]+\".desktop\")\t\n\n\tprint(applicationPath(\"systemsettings.desktop\"))\n \t print (pathdefault_browser+\" \" + pathdefault_imclient+\" \" +pathdefault_office+\" \" + pathdefault_terminal +\" \"+pathdefault_filemanager +\" \"+ pathdefault_mailer +\" \"+pathdefault_videoplayer+\" \"+pathdefault_imageviewer)\n }", "function nullCase() {\n console.log(\"\\n\" + \"\\033[38;5;9m\" + \"Command not found. Type 'node liri.js help' for more information\");\n}", "function fixUnixEnvironment(cb) {\n var didReturn = false;\n var done = function () {\n if (didReturn) {\n return;\n }\n didReturn = true;\n cb();\n };\n var child = cp.spawn(process.env.SHELL, ['-ilc', 'env'], {\n detached: true,\n stdio: ['ignore', 'pipe', process.stderr],\n });\n child.stdout.setEncoding('utf8');\n child.on('error', done);\n var buffer = '';\n child.stdout.on('data', function (d) {\n buffer += d;\n });\n child.on('close', function (code, signal) {\n if (code !== 0) {\n return done();\n }\n var hash = Object.create(null);\n buffer.split('\\n').forEach(function (line) {\n var p = line.split('=', 2);\n var key = p[0];\n var value = p[1];\n if (!key || hash[key]) {\n return;\n }\n hash[key] = true;\n process.env[key] = value;\n });\n done();\n });\n}", "_default() {\n return super._missingPreDefault();\n }", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function unixify(filepath) {\r\n return filepath.replace(/\\\\/g, '/');\r\n}", "function testOS() {\n var userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.match(/ipad/i) == \"ipad\") {\n return \"ipad\";\n } else if (userAgent.match(/iphone/i) == \"iphone\") {\n return \"iphone\";\n } else if (userAgent.match(/android/i) == \"android\") {\n return \"android\";\n } else {\n return \"win\";\n }\n}", "function isMac() {\n return /^darwin/i.test(process.platform);\n}", "function getDefaultAuthMechanism(ismaster) {\n if (ismaster) {\n // If ismaster contains saslSupportedMechs, use scram-sha-256\n // if it is available, else scram-sha-1\n if (Array.isArray(ismaster.saslSupportedMechs)) {\n return ismaster.saslSupportedMechs.indexOf('SCRAM-SHA-256') >= 0\n ? 'scram-sha-256'\n : 'scram-sha-1';\n }\n\n // Fallback to legacy selection method. If wire version >= 3, use scram-sha-1\n if (ismaster.maxWireVersion >= 3) {\n return 'scram-sha-1';\n }\n }\n\n // Default for wireprotocol < 3\n return 'mongocr';\n}", "function getDefaultAuthMechanism(ismaster) {\n if (ismaster) {\n // If ismaster contains saslSupportedMechs, use scram-sha-256\n // if it is available, else scram-sha-1\n if (Array.isArray(ismaster.saslSupportedMechs)) {\n return ismaster.saslSupportedMechs.indexOf('SCRAM-SHA-256') >= 0\n ? 'scram-sha-256'\n : 'scram-sha-1';\n }\n\n // Fallback to legacy selection method. If wire version >= 3, use scram-sha-1\n if (ismaster.maxWireVersion >= 3) {\n return 'scram-sha-1';\n }\n }\n\n // Default for wireprotocol < 3\n return 'mongocr';\n}", "function mirrorbrain_getPlatformForMirror( schema ) {\n\tvar a = getArray();\n\tif ( navigator.platform != null ) {\n\t\tif ( schema == \"old\" ) {\n\t\t\tif ( navigator.platform.indexOf( \"Win32\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win32Intel_install_wJRE\" : \"Win32Intel_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Win64\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win32Intel_install_wJRE\" : \"Win32Intel_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Win\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win32Intel_install_wJRE\" : \"Win32Intel_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Linux\" ) != -1 ) {\n\t\t\t\tif ( navigator.platform.indexOf( \"64\" ) != -1 ) {\n\t\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\t\treturn \"LinuxX86-64_install\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxX86-64_install_wJRE\" : \"LinuxX86-64_install\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxX86-64_install_wJRE\" : \"LinuxX86-64_install\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t}\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS i86pc\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Solarisx86_install_wJRE\" : \"Solarisx86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS sun4u\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"SolarisSparc_install_wJRE\" : \"SolarisSparc_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"SolarisSparc_install_wJRE\" : \"SolarisSparc_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 && navigator.platform.indexOf( \"Intel\" ) != -1 ) {\n\t\t\t\treturn \"MacOSXIntel_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 && navigator.platform.indexOf( \"PPC\" ) != -1 ) {\n\t\t\t\treturn \"MacOSXPPC_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 ) {\n\t\t\t\treturn \"MacOSXIntel_install\";\n\t\t\t// testing if this code will help to redirect the iPad, iPhone, iPod entries\n\t\t\t} else if ( navigator.platform.indexOf( \"iPad\" ) != -1 || navigator.platform.indexOf( \"iPhone\" ) != -1 || navigator.platform.indexOf( \"iPod\" ) != -1 ) {\n\t\t\t\treturn \"MacOSXIntel_install\" ;\n\t\t\t} else {\n\t\t\t\t// return plain platform\n\t\t\t\treturn navigator.platform;\n\t\t\t}\n\t\t} else if ( schema == \"new\" ) {\n\t\t\tif ( navigator.platform.indexOf( \"Win32\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win_x86_install-wJRE\" : \"Win_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Win64\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win_x86_install-wJRE\" : \"Win_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Win\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win_x86_install-wJRE\" : \"Win_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Linux\" ) != -1 ) {\n\t\t\t\tif ( navigator.platform.indexOf( \"64\" ) != -1 ) {\n\t\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\t\treturn \"Linux_x86-64_install-deb\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86-64_install-rpm-wJRE\" : \"Linux_x86-64_install-rpm\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86-64_install-rpm-wJRE\" : \"Linux_x86-64_install-rpm\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\t\treturn \"Linux_x86_install-deb\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86_install-rpm-wJRE\" : \"Linux_x86_install-rpm\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86_install-rpm-wJRE\" : \"Linux_x86_install-rpm\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\treturn \"Linux_x86_install-deb\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86_install-rpm-wJRE\" : \"Linux_x86_install-rpm\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86_install-rpm-wJRE\" : \"Linux_x86_install-rpm\";\n\t\t\t\t}\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS i86pc\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Solaris_x86_install-wJRE\" : \"Solaris_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS sun4u\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Solaris_Sparc_install-wJRE\" : \"Solaris_Sparc_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Solaris_Sparc_install-wJRE\" : \"Solaris_Sparc_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 && navigator.platform.indexOf( \"Intel\" ) != -1 ) {\n\t\t\t\treturn \"MacOS_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 && navigator.platform.indexOf( \"PPC\" ) != -1 ) {\n\t\t\t\treturn \"MacOS_PPC_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 ) {\n\t\t\t\treturn \"MacOS_x86_install\";\n\t\t\t// testing if this code will help to redirect the iPad, iPhone, iPod entries\n\t\t\t} else if ( navigator.platform.indexOf( \"iPad\" ) != -1 || navigator.platform.indexOf( \"iPhone\" ) != -1 || navigator.platform.indexOf( \"iPod\" ) != -1 ) {\n\t\t\t\treturn \"MacOS_x86_install\" ;\n\t\t\t} else {\n\t\t\t\t// return plain platform\n\t\t\t\treturn navigator.platform;\n\t\t\t}\n\t\t}\n\t}\n\treturn ( a[3] == 'y' ) ? \"Win_x86_install-wJRE\" : \"Win_x86_install\";\n}" ]
[ "0.60842496", "0.59525836", "0.58187497", "0.57424915", "0.57085973", "0.5652684", "0.5647002", "0.55350727", "0.54870725", "0.5475888", "0.54565", "0.54538655", "0.5415005", "0.5375714", "0.5364179", "0.5357404", "0.53541917", "0.53301984", "0.527862", "0.527862", "0.527862", "0.527862", "0.527862", "0.527862", "0.527862", "0.527862", "0.527862", "0.52266455", "0.52221304", "0.5177931", "0.51757157", "0.5164849", "0.514605", "0.513135", "0.51253045", "0.5115307", "0.5107217", "0.50776464", "0.5049383", "0.5032563", "0.5029265", "0.5028119", "0.501088", "0.4979701", "0.4976267", "0.49731785", "0.49603313", "0.4959942", "0.4951513", "0.4944969", "0.49371007", "0.49362534", "0.49349472", "0.49337393", "0.49326214", "0.49297112", "0.49148667", "0.49137592", "0.49035153", "0.49012372", "0.48911643", "0.4882969", "0.4880979", "0.48783308", "0.48758963", "0.48758963", "0.48758963", "0.48758963", "0.48665074", "0.48665074", "0.48496923", "0.48490465", "0.48490465", "0.48490465", "0.48490465", "0.48490465", "0.48490465", "0.48490465", "0.48490465", "0.48490465", "0.48432735", "0.48370484", "0.48360407", "0.48346767", "0.4833061", "0.48175085", "0.4810592", "0.47985053", "0.4795032", "0.4790708", "0.478883", "0.47869346", "0.47791445", "0.47760975", "0.47760975", "0.47760975", "0.4766167", "0.47594464", "0.47493243", "0.47493243", "0.47438827" ]
0.0
-1
========================================================================= Flush as much pending output as possible. All deflate() output goes through this function so some applications may wish to modify it to avoid allocating a large strm>output buffer and copying into it. (See also read_buf()).
function flush_pending(strm) { var s = strm.state; //_tr_flush_bits(s); var len = s.pending; if (len > strm.avail_out) { len = strm.avail_out; } if (len === 0) { return; } utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); strm.next_out += len; s.pending_out += len; strm.total_out += len; strm.avail_out -= len; s.pending -= len; if (s.pending === 0) { s.pending_out = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flush_pending(strm) {\n\t var s = strm.state;\n\t\n\t //_tr_flush_bits(s);\n\t var len = s.pending;\n\t if (len > strm.avail_out) {\n\t len = strm.avail_out;\n\t }\n\t if (len === 0) { return; }\n\t\n\t arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n\t strm.next_out += len;\n\t s.pending_out += len;\n\t strm.total_out += len;\n\t strm.avail_out -= len;\n\t s.pending -= len;\n\t if (s.pending === 0) {\n\t s.pending_out = 0;\n\t }\n\t }", "function deflate_stored(flush) {\n\t\t // Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t\t // to pending_buf_size, and each stored block has a 5 byte header:\n\t\t var max_block_size = 0xffff;\n\t\t var max_start;\n \n\t\t if (max_block_size > pending_buf_size - 5) {\n\t\t\tmax_block_size = pending_buf_size - 5;\n\t\t } // Copy as much as possible from input to output:\n \n \n\t\t while (true) {\n\t\t\t// Fill the window as much as possible:\n\t\t\tif (lookahead <= 1) {\n\t\t\t fill_window();\n\t\t\t if (lookahead === 0 && flush == Z_NO_FLUSH) return NeedMore;\n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t}\n \n\t\t\tstrstart += lookahead;\n\t\t\tlookahead = 0; // Emit a stored block if pending_buf will be full:\n \n\t\t\tmax_start = block_start + max_block_size;\n \n\t\t\tif (strstart === 0 || strstart >= max_start) {\n\t\t\t // strstart === 0 is possible when wraparound on 16-bit machine\n\t\t\t lookahead = strstart - max_start;\n\t\t\t strstart = max_start;\n\t\t\t flush_block_only(false);\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t} // Flush if we may have to slide, otherwise block_start may become\n\t\t\t// negative and the data will be gone:\n \n \n\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n\t\t\t flush_block_only(false);\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t}\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n\t\t if (strm.avail_out === 0) return flush == Z_FINISH ? FinishStarted : NeedMore;\n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "function flush_pending(strm) {\n var s = strm.state;\n \n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n \n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n }", "flush(callback) {\n compressFinish(compressor)\n .then(data => callback(null, data))\n .catch(callback);\n }", "function flush_pending(strm) {\n var s = strm.state; //_tr_flush_bits(s);\n\n var len = s.pending;\n\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n\n if (len === 0) {\n return;\n }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}", "function flush_pending(strm) {\n var s = strm.state; //_tr_flush_bits(s);\n\n var len = s.pending;\n\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n\n if (len === 0) {\n return;\n }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n }", "function flush_pending(strm) {\n\t var s = strm.state;\n\n\t //_tr_flush_bits(s);\n\t var len = s.pending;\n\t if (len > strm.avail_out) {\n\t len = strm.avail_out;\n\t }\n\t if (len === 0) {\n\t return;\n\t }\n\n\t arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n\t strm.next_out += len;\n\t s.pending_out += len;\n\t strm.total_out += len;\n\t strm.avail_out -= len;\n\t s.pending -= len;\n\t if (s.pending === 0) {\n\t s.pending_out = 0;\n\t }\n\t}", "function flush_pending(strm) {\n var s = strm.state; //_tr_flush_bits(s);\n\n var len = s.pending;\n\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n\n if (len === 0) {\n return;\n }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n }", "function flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) {\n return;\n }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}", "function flush_pending(strm) {\n\t var s = strm.state;\n\n\t //_tr_flush_bits(s);\n\t var len = s.pending;\n\t if (len > strm.avail_out) {\n\t len = strm.avail_out;\n\t }\n\t if (len === 0) { return; }\n\n\t common.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n\t strm.next_out += len;\n\t s.pending_out += len;\n\t strm.total_out += len;\n\t strm.avail_out -= len;\n\t s.pending -= len;\n\t if (s.pending === 0) {\n\t s.pending_out = 0;\n\t }\n\t}", "function flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n }", "function flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n common.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}", "function flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n common.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}", "function flush_pending(strm){var s=strm.state;//_tr_flush_bits(s);\n var len=s.pending;if(len>strm.avail_out){len=strm.avail_out;}if(len===0){return;}utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out);strm.next_out+=len;s.pending_out+=len;strm.total_out+=len;strm.avail_out-=len;s.pending-=len;if(s.pending===0){s.pending_out=0;}}" ]
[ "0.6295302", "0.62700987", "0.6267362", "0.6204446", "0.62010384", "0.6188399", "0.61843765", "0.6183771", "0.61774987", "0.6162318", "0.6162145", "0.6162057", "0.6162057", "0.6156232" ]
0.6159415
87
========================================================================= Put a short in the pending buffer. The 16bit value is put in MSB order. IN assertion: the stream state is correct and there is enough room in pending_buf.
function putShortMSB(s, b) { // put_byte(s, (Byte)(b >> 8)); // put_byte(s, (Byte)(b & 0xff)); s.pending_buf[s.pending++] = (b >>> 8) & 0xff; s.pending_buf[s.pending++] = b & 0xff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s,w){// put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++]=w&0xff;s.pending_buf[s.pending++]=w>>>8&0xff;}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short (s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}", "function put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n }", "function put_short(s, w) {\n // put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n }", "function put_short(s, w) {\n\t // put_byte(s, (uch)((w) & 0xff));\n\t // put_byte(s, (uch)((ush)(w) >> 8));\n\t s.pending_buf[s.pending++] = (w) & 0xff;\n\t s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n\t }", "function put_short(s, w) {\n\t // put_byte(s, (uch)((w) & 0xff));\n\t // put_byte(s, (uch)((ush)(w) >> 8));\n\t s.pending_buf[s.pending++] = (w) & 0xff;\n\t s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n\t}", "function put_short(s, w) {\n // put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n }", "function put_short(s, w) {\n // put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n}", "function put_short(s, w) {\n // put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = w >>> 8 & 0xff;\n}", "function put_short(s, w) {\n // put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n }", "function put_short(s, w) {\n\t// put_byte(s, (uch)((w) & 0xff));\n\t// put_byte(s, (uch)((ush)(w) >> 8));\n\t s.pending_buf[s.pending++] = (w) & 0xff;\n\t s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n\t}", "function put_short(s, w) {\n\t// put_byte(s, (uch)((w) & 0xff));\n\t// put_byte(s, (uch)((ush)(w) >> 8));\n\t s.pending_buf[s.pending++] = (w) & 0xff;\n\t s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n\t}" ]
[ "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.80095273", "0.7989712", "0.7986476", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7979618", "0.7975584", "0.79401505", "0.7939727", "0.793909", "0.7938163", "0.79170394", "0.79170394", "0.789417", "0.7862419", "0.7862419" ]
0.0
-1
=========================================================================== Read a new buffer from the current input stream, update the adler32 and total number of bytes read. All deflate() input goes through this function so some applications may wish to modify it to avoid allocating a large strm>input buffer and copying from it. (See also flush_pending()).
function read_buf(strm, buf, start, size) { var len = strm.avail_in; if (len > size) { len = size; } if (len === 0) { return 0; } strm.avail_in -= len; utils.arraySet(buf, strm.input, strm.next_in, len, start); if (strm.state.wrap === 1) { strm.adler = adler32(strm.adler, buf, len, start); } else if (strm.state.wrap === 2) { strm.adler = crc32(strm.adler, buf, len, start); } strm.next_in += len; strm.total_in += len; return len; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n \n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n \n strm.avail_in -= len;\n \n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n \n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n \n strm.next_in += len;\n strm.total_in += len;\n \n return len;\n }", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t // zmemcpy(buf, strm->next_in, len);\n\t utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t // zmemcpy(buf, strm->next_in, len);\n\t utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t // zmemcpy(buf, strm->next_in, len);\n\t utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t // zmemcpy(buf, strm->next_in, len);\n\t utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\t\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\t\n\t strm.avail_in -= len;\n\t\n\t // zmemcpy(buf, strm->next_in, len);\n\t arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32(strm.adler, buf, len, start);\n\t }\n\t\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32(strm.adler, buf, len, start);\n\t }\n\t\n\t strm.next_in += len;\n\t strm.total_in += len;\n\t\n\t return len;\n\t }", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t // zmemcpy(buf, strm->next_in, len);\n\t utils$h.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32$1(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32$3(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t // zmemcpy(buf, strm->next_in, len);\n\t common.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32_1(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32_1(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) {\n\t len = size;\n\t }\n\t if (len === 0) {\n\t return 0;\n\t }\n\n\t strm.avail_in -= len;\n\n\t // zmemcpy(buf, strm->next_in, len);\n\t arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32(strm.adler, buf, len, start);\n\t } else if (strm.state.wrap === 2) {\n\t strm.adler = crc32(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm,buf,start,size){var len=strm.avail_in;if(len>size){len=size;}if(len===0){return 0;}strm.avail_in-=len;// zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf,strm.input,strm.next_in,len,start);if(strm.state.wrap===1){strm.adler=adler32(strm.adler,buf,len,start);}else if(strm.state.wrap===2){strm.adler=crc32(strm.adler,buf,len,start);}strm.next_in+=len;strm.total_in+=len;return len;}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) {\n len = size;\n }\n\n if (len === 0) {\n return 0;\n }\n\n strm.avail_in -= len; // zmemcpy(buf, strm->next_in, len);\n\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n } else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n return len;\n }", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n }", "function read_buf$1(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t // zmemcpy(buf, strm->next_in, len);\n\t common$1.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32_1(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32_1$1(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n\t var len = strm.avail_in;\n\n\t if (len > size) { len = size; }\n\t if (len === 0) { return 0; }\n\n\t strm.avail_in -= len;\n\n\t utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\t if (strm.state.wrap === 1) {\n\t strm.adler = adler32(strm.adler, buf, len, start);\n\t }\n\n\t else if (strm.state.wrap === 2) {\n\t strm.adler = crc32(strm.adler, buf, len, start);\n\t }\n\n\t strm.next_in += len;\n\t strm.total_in += len;\n\n\t return len;\n\t}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n common.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32_1(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32_1(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n common.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32_1(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32_1(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) {\n len = size;\n }\n\n if (len === 0) {\n return 0;\n }\n\n strm.avail_in -= len;\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n } else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n return len;\n }", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n common$1.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32_1(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32_1(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) {\n len = size;\n }\n if (len === 0) {\n return 0;\n }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n } else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}", "function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) {\n len = size;\n }\n\n if (len === 0) {\n return 0;\n }\n\n strm.avail_in -= len; // zmemcpy(buf, strm->next_in, len);\n\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n } else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n return len;\n}", "function read_buf(strm, buf, start, size) {\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}" ]
[ "0.6806013", "0.6776525", "0.6776525", "0.6776525", "0.6776525", "0.6775718", "0.67708814", "0.674234", "0.6718914", "0.67015874", "0.66959625", "0.66921324", "0.66756624", "0.6658554", "0.6658554", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6612709", "0.6599045", "0.6599045", "0.6595326", "0.6556262", "0.6550681", "0.65287536", "0.65249205" ]
0.0
-1
=========================================================================== Set match_start to the longest match starting at the given string and return its length. Matches shorter or equal to prev_length are discarded, in which case the result is equal to prev_length and match_start is garbage. IN assertions: cur_match is the head of the hash chain for the current string (strstart) and its distance is = 1 OUT assertion: the match length is not greater than s>lookahead.
function longest_match(s, cur_match) { var chain_length = s.max_chain_length; /* max hash chain length */ var scan = s.strstart; /* current string */ var match; /* matched string */ var len; /* length of current match */ var best_len = s.prev_length; /* best match length so far */ var nice_match = s.nice_match; /* stop if match long enough */ var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; var _win = s.window; // shortcut var wmask = s.w_mask; var prev = s.prev; /* Stop when cur_match becomes <= limit. To simplify the code, * we prevent matches with the string of window index 0. */ var strend = s.strstart + MAX_MATCH; var scan_end1 = _win[scan + best_len - 1]; var scan_end = _win[scan + best_len]; /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. * It is easy to get rid of this optimization if necessary. */ // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); /* Do not waste too much time if we already have a good match: */ if (s.prev_length >= s.good_match) { chain_length >>= 2; } /* Do not look for matches beyond the end of the input. This is necessary * to make deflate deterministic. */ if (nice_match > s.lookahead) { nice_match = s.lookahead; } // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); do { // Assert(cur_match < s->strstart, "no future"); match = cur_match; /* Skip to next match if the match length cannot increase * or if the match length is less than 2. Note that the checks below * for insufficient lookahead only occur occasionally for performance * reasons. Therefore uninitialized memory will be accessed, and * conditional jumps will be made that depend on those values. * However the length of the match is limited to the lookahead, so * the output of deflate is not affected by the uninitialized values. */ if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { continue; } /* The check at best_len-1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that * the hash keys are equal and that HASH_BITS >= 8. */ scan += 2; match++; // Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; * the 256th check will be made at strstart+258. */ do { /*jshint noempty:false*/ } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); len = MAX_MATCH - (strend - scan); scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; best_len = len; if (len >= nice_match) { break; } scan_end1 = _win[scan + best_len - 1]; scan_end = _win[scan + best_len]; } } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); if (best_len <= s.lookahead) { return best_len; } return s.lookahead; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longest_match$1(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD$1)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD$1) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH$3;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH$3 - (strend - scan);\n\t scan = strend - MAX_MATCH$3;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n \n var _win = s.window; // shortcut\n \n var wmask = s.w_mask;\n var prev = s.prev;\n \n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n \n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n \n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n \n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n \n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n \n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n \n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n \n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n \n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n \n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n \n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n \n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n \n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n \n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n }", "function longest_match(s, cur_match) {\n var chain_length = s.max_chain_length;\n /* max hash chain length */\n\n var scan = s.strstart;\n /* current string */\n\n var match;\n /* matched string */\n\n var len;\n /* length of current match */\n\n var best_len = s.prev_length;\n /* best match length so far */\n\n var nice_match = s.nice_match;\n /* stop if match long enough */\n\n var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0\n /*NIL*/\n ;\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n\n\n if (nice_match > s.lookahead) {\n nice_match = s.lookahead;\n } // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) {\n continue;\n }\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n\n\n scan += 2;\n match++; // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n\n if (len >= nice_match) {\n break;\n }\n\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n\n return s.lookahead;\n}", "function longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0 /*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) {\n nice_match = s.lookahead;\n }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH - (strend - scan);\n\t scan = strend - MAX_MATCH;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH - (strend - scan);\n\t scan = strend - MAX_MATCH;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH - (strend - scan);\n\t scan = strend - MAX_MATCH;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH - (strend - scan);\n\t scan = strend - MAX_MATCH;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH - (strend - scan);\n\t scan = strend - MAX_MATCH;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH - (strend - scan);\n\t scan = strend - MAX_MATCH;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH - (strend - scan);\n\t scan = strend - MAX_MATCH;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0 /*NIL*/ ;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH$1;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) {\n\t nice_match = s.lookahead;\n\t }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH$1 - (strend - scan);\n\t scan = strend - MAX_MATCH$1;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n\t var chain_length = s.max_chain_length; /* max hash chain length */\n\t var scan = s.strstart; /* current string */\n\t var match; /* matched string */\n\t var len; /* length of current match */\n\t var best_len = s.prev_length; /* best match length so far */\n\t var nice_match = s.nice_match; /* stop if match long enough */\n\t var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n\t s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n\t var _win = s.window; // shortcut\n\n\t var wmask = s.w_mask;\n\t var prev = s.prev;\n\n\t /* Stop when cur_match becomes <= limit. To simplify the code,\n\t * we prevent matches with the string of window index 0.\n\t */\n\n\t var strend = s.strstart + MAX_MATCH$1;\n\t var scan_end1 = _win[scan + best_len - 1];\n\t var scan_end = _win[scan + best_len];\n\n\t /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n\t * It is easy to get rid of this optimization if necessary.\n\t */\n\t // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n\t /* Do not waste too much time if we already have a good match: */\n\t if (s.prev_length >= s.good_match) {\n\t chain_length >>= 2;\n\t }\n\t /* Do not look for matches beyond the end of the input. This is necessary\n\t * to make deflate deterministic.\n\t */\n\t if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n\t // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n\t do {\n\t // Assert(cur_match < s->strstart, \"no future\");\n\t match = cur_match;\n\n\t /* Skip to next match if the match length cannot increase\n\t * or if the match length is less than 2. Note that the checks below\n\t * for insufficient lookahead only occur occasionally for performance\n\t * reasons. Therefore uninitialized memory will be accessed, and\n\t * conditional jumps will be made that depend on those values.\n\t * However the length of the match is limited to the lookahead, so\n\t * the output of deflate is not affected by the uninitialized values.\n\t */\n\n\t if (_win[match + best_len] !== scan_end ||\n\t _win[match + best_len - 1] !== scan_end1 ||\n\t _win[match] !== _win[scan] ||\n\t _win[++match] !== _win[scan + 1]) {\n\t continue;\n\t }\n\n\t /* The check at best_len-1 can be removed because it will be made\n\t * again later. (This heuristic is not always a win.)\n\t * It is not necessary to compare scan[2] and match[2] since they\n\t * are always equal when the other bytes match, given that\n\t * the hash keys are equal and that HASH_BITS >= 8.\n\t */\n\t scan += 2;\n\t match++;\n\t // Assert(*scan == *match, \"match[2]?\");\n\n\t /* We check for insufficient lookahead only every 8th comparison;\n\t * the 256th check will be made at strstart+258.\n\t */\n\t do {\n\t /*jshint noempty:false*/\n\t } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n\t scan < strend);\n\n\t // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n\t len = MAX_MATCH$1 - (strend - scan);\n\t scan = strend - MAX_MATCH$1;\n\n\t if (len > best_len) {\n\t s.match_start = cur_match;\n\t best_len = len;\n\t if (len >= nice_match) {\n\t break;\n\t }\n\t scan_end1 = _win[scan + best_len - 1];\n\t scan_end = _win[scan + best_len];\n\t }\n\t } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n\t if (best_len <= s.lookahead) {\n\t return best_len;\n\t }\n\t return s.lookahead;\n\t}", "function longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH$1;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH$1 - (strend - scan);\n scan = strend - MAX_MATCH$1;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}" ]
[ "0.75376654", "0.7508505", "0.7501495", "0.75013494", "0.74998707", "0.74998707", "0.74998707", "0.74998707", "0.74998707", "0.74998707", "0.74998707", "0.7496742", "0.74936265", "0.748309", "0.74774504" ]
0.7495141
86
=========================================================================== Fill the window when the lookahead becomes insufficient. Updates strstart and lookahead. IN assertion: lookahead < MIN_LOOKAHEAD OUT assertions: strstart <= window_sizeMIN_LOOKAHEAD At least one byte has been read, or avail_in == 0; reads are performed for at least two bytes (required for the zip translate_eol option not supported here).
function fill_window(s) { var _w_size = s.w_size; var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); do { more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed /* Deal with !@#$% 64K limit: */ //if (sizeof(int) <= 2) { // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { // more = wsize; // // } else if (more == (unsigned)(-1)) { // /* Very unlikely, but possible on 16 bit machine if // * strstart == 0 && lookahead == 1 (input done a byte at time) // */ // more--; // } //} /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { utils.arraySet(s.window, s.window, _w_size, _w_size, 0); s.match_start -= _w_size; s.strstart -= _w_size; /* we now have strstart >= MAX_DIST */ s.block_start -= _w_size; /* Slide the hash table (could be avoided with 32 bit values at the expense of memory usage). We slide even when level == 0 to keep the hash table consistent if we switch back to level > 0 later. (Using level 0 permanently is not an optimal usage of zlib, so we don't care about this pathological case.) */ n = s.hash_size; p = n; do { m = s.head[--p]; s.head[p] = (m >= _w_size ? m - _w_size : 0); } while (--n); n = _w_size; p = n; do { m = s.prev[--p]; s.prev[p] = (m >= _w_size ? m - _w_size : 0); /* If n is not on any hash chain, prev[n] is garbage but * its value will never be used. */ } while (--n); more += _w_size; } if (s.strm.avail_in === 0) { break; } /* If there was no sliding: * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && * more == window_size - lookahead - strstart * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) * => more >= window_size - 2*WSIZE + 2 * In the BIG_MEM or MMAP case (not yet supported), * window_size == input_size + MIN_LOOKAHEAD && * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. * Otherwise, window_size == 2*WSIZE so more >= 2. * If there was sliding, more >= WSIZE. So in all cases, more >= 2. */ //Assert(more >= 2, "more < 2"); n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); s.lookahead += n; /* Initialize the hash value now that we have some input: */ if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3 // Call update_hash() MIN_MATCH-3 more times //#endif while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH-1]) & s.hash_mask; s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; if (s.lookahead + s.insert < MIN_MATCH) { break; } } } /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, * but this is not important since only literal bytes will be emitted. */ } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); /* If the WIN_INIT bytes after the end of the current data have never been * written, then zero those bytes in order to avoid memory check reports of * the use of uninitialized (or uninitialised as Julian writes) bytes by * the longest match routines. Update the high water mark for the next * time through here. WIN_INIT is set to MAX_MATCH since the longest match * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. */ // if (s.high_water < s.window_size) { // var curr = s.strstart + s.lookahead; // var init = 0; // // if (s.high_water < curr) { // /* Previous high water mark below current data -- zero WIN_INIT // * bytes or up to end of window, whichever is less. // */ // init = s.window_size - curr; // if (init > WIN_INIT) // init = WIN_INIT; // zmemzero(s->window + curr, (unsigned)init); // s->high_water = curr + init; // } // else if (s->high_water < (ulg)curr + WIN_INIT) { // /* High water mark at or above current data, but below current data // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up // * to end of window, whichever is less. // */ // init = (ulg)curr + WIN_INIT - s->high_water; // if (init > s->window_size - s->high_water) // init = s->window_size - s->high_water; // zmemzero(s->window + s->high_water, (unsigned)init); // s->high_water += init; // } // } // // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, // "not enough room for search"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fill_window() {\n\t\tvar n, m;\n\n\t // Amount of free space at the end of the window.\n\t\tvar more = window_size - lookahead - strstart;\n\n\t\t// If the window is almost full and there is insufficient lookahead,\n\t\t// move the upper half to the lower one to make room in the upper half.\n\t\tif (more === -1) {\n\t\t\t// Very unlikely, but possible on 16 bit machine if strstart == 0\n\t\t\t// and lookahead == 1 (input done one byte at time)\n\t\t\tmore--;\n\t\t} else if (strstart >= WSIZE + MAX_DIST) {\n\t\t\t// By the IN assertion, the window is not empty so we can't confuse\n\t\t\t// more == 0 with more == 64K on a 16 bit machine.\n\t\t\t// Assert(window_size == (ulg)2*WSIZE, \"no sliding with BIG_MEM\");\n\n\t\t\t// System.arraycopy(window, WSIZE, window, 0, WSIZE);\n\t\t\tfor (n = 0; n < WSIZE; n++) {\n\t\t\t\twindow[n] = window[n + WSIZE];\n\t\t\t}\n\n\t\t\tmatch_start -= WSIZE;\n\t\t\tstrstart -= WSIZE; /* we now have strstart >= MAX_DIST: */\n\t\t\tblock_start -= WSIZE;\n\n\t\t\tfor (n = 0; n < HASH_SIZE; n++) {\n\t\t\t\tm = head1(n);\n\t\t\t\thead2(n, m >= WSIZE ? m - WSIZE : NIL);\n\t\t\t}\n\t\t\tfor (n = 0; n < WSIZE; n++) {\n\t\t\t// If n is not on any hash chain, prev[n] is garbage but\n\t\t\t// its value will never be used.\n\t\t\t\tm = prev[n];\n\t\t\t\tprev[n] = (m >= WSIZE ? m - WSIZE : NIL);\n\t\t\t}\n\t\t\tmore += WSIZE;\n\t\t}\n\t\t// At this point, more >= 2\n\t\tif (!eofile) {\n\t\t\tn = read_buff(window, strstart + lookahead, more);\n\t\t\tif (n <= 0) {\n\t\t\t\teofile = true;\n\t\t\t} else {\n\t\t\t\tlookahead += n;\n\t\t\t}\n\t\t}\n\t}", "function fill_window() {\n\t\t var n, m;\n\t\t var p;\n\t\t var more; // Amount of free space at the end of the window.\n \n\t\t do {\n\t\t\tmore = window_size - lookahead - strstart; // Deal with !@#$% 64K limit:\n \n\t\t\tif (more === 0 && strstart === 0 && lookahead === 0) {\n\t\t\t more = w_size;\n\t\t\t} else if (more == -1) {\n\t\t\t // Very unlikely, but possible on 16 bit machine if strstart ==\n\t\t\t // 0\n\t\t\t // and lookahead == 1 (input done one byte at time)\n\t\t\t more--; // If the window is almost full and there is insufficient\n\t\t\t // lookahead,\n\t\t\t // move the upper half to the lower one to make room in the\n\t\t\t // upper half.\n\t\t\t} else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) {\n\t\t\t window.set(window.subarray(w_size, w_size + w_size), 0);\n\t\t\t match_start -= w_size;\n\t\t\t strstart -= w_size; // we now have strstart >= MAX_DIST\n \n\t\t\t block_start -= w_size; // Slide the hash table (could be avoided with 32 bit values\n\t\t\t // at the expense of memory usage). We slide even when level ==\n\t\t\t // 0\n\t\t\t // to keep the hash table consistent if we switch back to level\n\t\t\t // > 0\n\t\t\t // later. (Using level 0 permanently is not an optimal usage of\n\t\t\t // zlib, so we don't care about this pathological case.)\n \n\t\t\t n = hash_size;\n\t\t\t p = n;\n \n\t\t\t do {\n\t\t\t\tm = head[--p] & 0xffff;\n\t\t\t\thead[p] = m >= w_size ? m - w_size : 0;\n\t\t\t } while (--n !== 0);\n \n\t\t\t n = w_size;\n\t\t\t p = n;\n \n\t\t\t do {\n\t\t\t\tm = prev[--p] & 0xffff;\n\t\t\t\tprev[p] = m >= w_size ? m - w_size : 0; // If n is not on any hash chain, prev[n] is garbage but\n\t\t\t\t// its value will never be used.\n\t\t\t } while (--n !== 0);\n \n\t\t\t more += w_size;\n\t\t\t}\n \n\t\t\tif (strm.avail_in === 0) return; // If there was no sliding:\n\t\t\t// strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n\t\t\t// more == window_size - lookahead - strstart\n\t\t\t// => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n\t\t\t// => more >= window_size - 2*WSIZE + 2\n\t\t\t// In the BIG_MEM or MMAP case (not yet supported),\n\t\t\t// window_size == input_size + MIN_LOOKAHEAD &&\n\t\t\t// strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n\t\t\t// Otherwise, window_size == 2*WSIZE so more >= 2.\n\t\t\t// If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n \n\t\t\tn = strm.read_buf(window, strstart + lookahead, more);\n\t\t\tlookahead += n; // Initialize the hash value now that we have some input:\n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = window[strstart] & 0xff;\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + 1] & 0xff) & hash_mask;\n\t\t\t} // If the whole input has less than MIN_MATCH bytes, ins_h is\n\t\t\t// garbage,\n\t\t\t// but this is not important since only literal bytes will be\n\t\t\t// emitted.\n \n\t\t } while (lookahead < MIN_LOOKAHEAD && strm.avail_in !== 0);\n\t\t} // Copy without compression as much as possible from the input stream,", "function fill_window(s){var _w_size=s.w_size;var p,n,m,more,str;//Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n do{more=s.window_size-s.lookahead-s.strstart;// JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */ //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */if(s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0);s.match_start-=_w_size;s.strstart-=_w_size;/* we now have strstart >= MAX_DIST */s.block_start-=_w_size;/* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */n=s.hash_size;p=n;do{m=s.head[--p];s.head[p]=m>=_w_size?m-_w_size:0;}while(--n);n=_w_size;p=n;do{m=s.prev[--p];s.prev[p]=m>=_w_size?m-_w_size:0;/* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */}while(--n);more+=_w_size;}if(s.strm.avail_in===0){break;}/* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */ //Assert(more >= 2, \"more < 2\");\n n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more);s.lookahead+=n;/* Initialize the hash value now that we have some input: */if(s.lookahead+s.insert>=MIN_MATCH){str=s.strstart-s.insert;s.ins_h=s.window[str];/* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+1])&s.hash_mask;//#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n while(s.insert){/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+MIN_MATCH-1])&s.hash_mask;s.prev[str&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=str;str++;s.insert--;if(s.lookahead+s.insert<MIN_MATCH){break;}}}/* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */}while(s.lookahead<MIN_LOOKAHEAD&&s.strm.avail_in!==0);/* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */ // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n }", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed\n\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n\n s.block_start -= _w_size;\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n\n n = _w_size;\n p = n;\n\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n\n if (s.strm.avail_in === 0) {\n break;\n }\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n\n\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n /* Initialize the hash value now that we have some input: */\n\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n \n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n \n do {\n more = s.window_size - s.lookahead - s.strstart;\n \n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n \n \n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n \n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n \n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n \n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n \n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n \n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n \n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n \n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n \n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n \n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n \n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n \n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n }", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed\n\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n\n s.block_start -= _w_size;\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n\n n = _w_size;\n p = n;\n\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n\n if (s.strm.avail_in === 0) {\n break;\n }\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n\n\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n /* Initialize the hash value now that we have some input: */\n\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n\n }", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n }", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;\n //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n common.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n common.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH$1) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH$1 - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH$1) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed\n\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n\n s.block_start -= _w_size;\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n\n n = _w_size;\n p = n;\n\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n\n if (s.strm.avail_in === 0) {\n break;\n }\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n\n\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n /* Initialize the hash value now that we have some input: */\n\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n\n }", "function fill_window(s) {\n const _w_size = s.w_size;\n let p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH$1) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH$1 - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH$1) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n}", "function fill_window(s) {\n\t var _w_size = s.w_size;\n\t var p, n, m, more, str;\n\n\t //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n\t do {\n\t more = s.window_size - s.lookahead - s.strstart;\n\n\t // JS ints have 32 bit, block below not needed\n\t /* Deal with !@#$% 64K limit: */\n\t //if (sizeof(int) <= 2) {\n\t // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n\t // more = wsize;\n\t //\n\t // } else if (more == (unsigned)(-1)) {\n\t // /* Very unlikely, but possible on 16 bit machine if\n\t // * strstart == 0 && lookahead == 1 (input done a byte at time)\n\t // */\n\t // more--;\n\t // }\n\t //}\n\n\n\t /* If the window is almost full and there is insufficient lookahead,\n\t * move the upper half to the lower one to make room in the upper half.\n\t */\n\t if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n\t utils$h.arraySet(s.window, s.window, _w_size, _w_size, 0);\n\t s.match_start -= _w_size;\n\t s.strstart -= _w_size;\n\t /* we now have strstart >= MAX_DIST */\n\t s.block_start -= _w_size;\n\n\t /* Slide the hash table (could be avoided with 32 bit values\n\t at the expense of memory usage). We slide even when level == 0\n\t to keep the hash table consistent if we switch back to level > 0\n\t later. (Using level 0 permanently is not an optimal usage of\n\t zlib, so we don't care about this pathological case.)\n\t */\n\n\t n = s.hash_size;\n\t p = n;\n\t do {\n\t m = s.head[--p];\n\t s.head[p] = (m >= _w_size ? m - _w_size : 0);\n\t } while (--n);\n\n\t n = _w_size;\n\t p = n;\n\t do {\n\t m = s.prev[--p];\n\t s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n\t /* If n is not on any hash chain, prev[n] is garbage but\n\t * its value will never be used.\n\t */\n\t } while (--n);\n\n\t more += _w_size;\n\t }\n\t if (s.strm.avail_in === 0) {\n\t break;\n\t }\n\n\t /* If there was no sliding:\n\t * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n\t * more == window_size - lookahead - strstart\n\t * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n\t * => more >= window_size - 2*WSIZE + 2\n\t * In the BIG_MEM or MMAP case (not yet supported),\n\t * window_size == input_size + MIN_LOOKAHEAD &&\n\t * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n\t * Otherwise, window_size == 2*WSIZE so more >= 2.\n\t * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n\t */\n\t //Assert(more >= 2, \"more < 2\");\n\t n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n\t s.lookahead += n;\n\n\t /* Initialize the hash value now that we have some input: */\n\t if (s.lookahead + s.insert >= MIN_MATCH) {\n\t str = s.strstart - s.insert;\n\t s.ins_h = s.window[str];\n\n\t /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n\t//#if MIN_MATCH != 3\n\t// Call update_hash() MIN_MATCH-3 more times\n\t//#endif\n\t while (s.insert) {\n\t /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n\t s.prev[str & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = str;\n\t str++;\n\t s.insert--;\n\t if (s.lookahead + s.insert < MIN_MATCH) {\n\t break;\n\t }\n\t }\n\t }\n\t /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n\t * but this is not important since only literal bytes will be emitted.\n\t */\n\n\t } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n\t /* If the WIN_INIT bytes after the end of the current data have never been\n\t * written, then zero those bytes in order to avoid memory check reports of\n\t * the use of uninitialized (or uninitialised as Julian writes) bytes by\n\t * the longest match routines. Update the high water mark for the next\n\t * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n\t * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n\t */\n\t// if (s.high_water < s.window_size) {\n\t// var curr = s.strstart + s.lookahead;\n\t// var init = 0;\n\t//\n\t// if (s.high_water < curr) {\n\t// /* Previous high water mark below current data -- zero WIN_INIT\n\t// * bytes or up to end of window, whichever is less.\n\t// */\n\t// init = s.window_size - curr;\n\t// if (init > WIN_INIT)\n\t// init = WIN_INIT;\n\t// zmemzero(s->window + curr, (unsigned)init);\n\t// s->high_water = curr + init;\n\t// }\n\t// else if (s->high_water < (ulg)curr + WIN_INIT) {\n\t// /* High water mark at or above current data, but below current data\n\t// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n\t// * to end of window, whichever is less.\n\t// */\n\t// init = (ulg)curr + WIN_INIT - s->high_water;\n\t// if (init > s->window_size - s->high_water)\n\t// init = s->window_size - s->high_water;\n\t// zmemzero(s->window + s->high_water, (unsigned)init);\n\t// s->high_water += init;\n\t// }\n\t// }\n\t//\n\t// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n\t// \"not enough room for search\");\n\t}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n common$1.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH$1) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH$1 - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH$1) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}", "function fill_window(s) {\n\t var _w_size = s.w_size;\n\t var p, n, m, more, str;\n\n\t //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n\t do {\n\t more = s.window_size - s.lookahead - s.strstart;\n\n\t // JS ints have 32 bit, block below not needed\n\t /* Deal with !@#$% 64K limit: */\n\t //if (sizeof(int) <= 2) {\n\t // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n\t // more = wsize;\n\t //\n\t // } else if (more == (unsigned)(-1)) {\n\t // /* Very unlikely, but possible on 16 bit machine if\n\t // * strstart == 0 && lookahead == 1 (input done a byte at time)\n\t // */\n\t // more--;\n\t // }\n\t //}\n\n\n\t /* If the window is almost full and there is insufficient lookahead,\n\t * move the upper half to the lower one to make room in the upper half.\n\t */\n\t if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n\t utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n\t s.match_start -= _w_size;\n\t s.strstart -= _w_size;\n\t /* we now have strstart >= MAX_DIST */\n\t s.block_start -= _w_size;\n\n\t /* Slide the hash table (could be avoided with 32 bit values\n\t at the expense of memory usage). We slide even when level == 0\n\t to keep the hash table consistent if we switch back to level > 0\n\t later. (Using level 0 permanently is not an optimal usage of\n\t zlib, so we don't care about this pathological case.)\n\t */\n\n\t n = s.hash_size;\n\t p = n;\n\t do {\n\t m = s.head[--p];\n\t s.head[p] = (m >= _w_size ? m - _w_size : 0);\n\t } while (--n);\n\n\t n = _w_size;\n\t p = n;\n\t do {\n\t m = s.prev[--p];\n\t s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n\t /* If n is not on any hash chain, prev[n] is garbage but\n\t * its value will never be used.\n\t */\n\t } while (--n);\n\n\t more += _w_size;\n\t }\n\t if (s.strm.avail_in === 0) {\n\t break;\n\t }\n\n\t /* If there was no sliding:\n\t * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n\t * more == window_size - lookahead - strstart\n\t * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n\t * => more >= window_size - 2*WSIZE + 2\n\t * In the BIG_MEM or MMAP case (not yet supported),\n\t * window_size == input_size + MIN_LOOKAHEAD &&\n\t * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n\t * Otherwise, window_size == 2*WSIZE so more >= 2.\n\t * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n\t */\n\t //Assert(more >= 2, \"more < 2\");\n\t n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n\t s.lookahead += n;\n\n\t /* Initialize the hash value now that we have some input: */\n\t if (s.lookahead + s.insert >= MIN_MATCH) {\n\t str = s.strstart - s.insert;\n\t s.ins_h = s.window[str];\n\n\t /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n\t//#if MIN_MATCH != 3\n\t// Call update_hash() MIN_MATCH-3 more times\n\t//#endif\n\t while (s.insert) {\n\t /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH-1]) & s.hash_mask;\n\n\t s.prev[str & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = str;\n\t str++;\n\t s.insert--;\n\t if (s.lookahead + s.insert < MIN_MATCH) {\n\t break;\n\t }\n\t }\n\t }\n\t /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n\t * but this is not important since only literal bytes will be emitted.\n\t */\n\n\t } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n\t /* If the WIN_INIT bytes after the end of the current data have never been\n\t * written, then zero those bytes in order to avoid memory check reports of\n\t * the use of uninitialized (or uninitialised as Julian writes) bytes by\n\t * the longest match routines. Update the high water mark for the next\n\t * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n\t * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n\t */\n\t// if (s.high_water < s.window_size) {\n\t// var curr = s.strstart + s.lookahead;\n\t// var init = 0;\n\t//\n\t// if (s.high_water < curr) {\n\t// /* Previous high water mark below current data -- zero WIN_INIT\n\t// * bytes or up to end of window, whichever is less.\n\t// */\n\t// init = s.window_size - curr;\n\t// if (init > WIN_INIT)\n\t// init = WIN_INIT;\n\t// zmemzero(s->window + curr, (unsigned)init);\n\t// s->high_water = curr + init;\n\t// }\n\t// else if (s->high_water < (ulg)curr + WIN_INIT) {\n\t// /* High water mark at or above current data, but below current data\n\t// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n\t// * to end of window, whichever is less.\n\t// */\n\t// init = (ulg)curr + WIN_INIT - s->high_water;\n\t// if (init > s->window_size - s->high_water)\n\t// init = s->window_size - s->high_water;\n\t// zmemzero(s->window + s->high_water, (unsigned)init);\n\t// s->high_water += init;\n\t// }\n\t// }\n\t//\n\t// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n\t// \"not enough room for search\");\n\t}" ]
[ "0.73649114", "0.68951803", "0.6752545", "0.674314", "0.6729958", "0.67143106", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.6687618", "0.66866004", "0.66859555", "0.6678358", "0.6678358", "0.66764915", "0.6668091", "0.6661015", "0.66590536", "0.6657481" ]
0.6687618
86
=========================================================================== Copy without compression as much as possible from the input stream, return the current block state. This function does not insert new strings in the dictionary since uncompressible data is probably not useful. This function is used only for the level=0 compression option. NOTE: this function should be optimized to avoid extra copying from window to pending_buf.
function deflate_stored(s, flush) { /* Stored blocks are limited to 0xffff bytes, pending_buf is limited * to pending_buf_size, and each stored block has a 5 byte header: */ var max_block_size = 0xffff; if (max_block_size > s.pending_buf_size - 5) { max_block_size = s.pending_buf_size - 5; } /* Copy as much as possible from input to output: */ for (;;) { /* Fill the window as much as possible: */ if (s.lookahead <= 1) { //Assert(s->strstart < s->w_size+MAX_DIST(s) || // s->block_start >= (long)s->w_size, "slide too late"); // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || // s.block_start >= s.w_size)) { // throw new Error("slide too late"); // } fill_window(s); if (s.lookahead === 0 && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ } //Assert(s->block_start >= 0L, "block gone"); // if (s.block_start < 0) throw new Error("block gone"); s.strstart += s.lookahead; s.lookahead = 0; /* Emit a stored block if pending_buf will be full: */ var max_start = s.block_start + max_block_size; if (s.strstart === 0 || s.strstart >= max_start) { /* strstart == 0 is possible when wraparound on 16-bit machine */ s.lookahead = s.strstart - max_start; s.strstart = max_start; /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } /* Flush if we may have to slide, otherwise block_start may become * negative and the data will be gone: */ if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } s.insert = 0; if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.strstart > s.block_start) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_NEED_MORE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deflate_stored(s,flush){/* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */var max_block_size=0xffff;if(max_block_size>s.pending_buf_size-5){max_block_size=s.pending_buf_size-5;}/* Copy as much as possible from input to output: */for(;;){/* Fill the window as much as possible: */if(s.lookahead<=1){//Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n fill_window(s);if(s.lookahead===0&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;}/* flush the current block */}//Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n s.strstart+=s.lookahead;s.lookahead=0;/* Emit a stored block if pending_buf will be full: */var max_start=s.block_start+max_block_size;if(s.strstart===0||s.strstart>=max_start){/* strstart == 0 is possible when wraparound on 16-bit machine */s.lookahead=s.strstart-max_start;s.strstart=max_start;/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}/* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=0;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.strstart>s.block_start){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_NEED_MORE;}", "function $m2YO$var$deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n /* Copy as much as possible from input to output: */\n\n\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n $m2YO$var$fill_window(s);\n\n if (s.lookahead === 0 && flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n } //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n /* Emit a stored block if pending_buf will be full: */\n\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n\n\n if (s.strstart - s.block_start >= s.w_size - $m2YO$var$MIN_LOOKAHEAD) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_NEED_MORE;\n}", "function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n \n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n \n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n \n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n \n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n \n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n \n s.strstart += s.lookahead;\n s.lookahead = 0;\n \n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n \n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n \n \n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n \n s.insert = 0;\n \n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n \n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n \n return BS_NEED_MORE;\n }", "function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n /* Copy as much as possible from input to output: */\n\n\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n fill_window(s);\n\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n } //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n /* Emit a stored block if pending_buf will be full: */\n\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n\n\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_NEED_MORE;\n}", "function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH$1) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH$1) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}", "function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n let max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (; ;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n const max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}", "function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}", "function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n /* Copy as much as possible from input to output: */\n\n\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n fill_window(s);\n\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n } //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n /* Emit a stored block if pending_buf will be full: */\n\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n\n\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_NEED_MORE;\n }", "function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n }", "function copy_block(s, buf, len, header) //DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s);\n /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n } // while (len--) {\n // put_byte(s, *buf++);\n // }\n\n\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}", "function deflate_stored(s, flush) {\n\t /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t * to pending_buf_size, and each stored block has a 5 byte header:\n\t */\n\t var max_block_size = 0xffff;\n\t\n\t if (max_block_size > s.pending_buf_size - 5) {\n\t max_block_size = s.pending_buf_size - 5;\n\t }\n\t\n\t /* Copy as much as possible from input to output: */\n\t for (;;) {\n\t /* Fill the window as much as possible: */\n\t if (s.lookahead <= 1) {\n\t\n\t //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n\t // s->block_start >= (long)s->w_size, \"slide too late\");\n\t // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n\t // s.block_start >= s.w_size)) {\n\t // throw new Error(\"slide too late\");\n\t // }\n\t\n\t fill_window(s);\n\t if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t\n\t if (s.lookahead === 0) {\n\t break;\n\t }\n\t /* flush the current block */\n\t }\n\t //Assert(s->block_start >= 0L, \"block gone\");\n\t // if (s.block_start < 0) throw new Error(\"block gone\");\n\t\n\t s.strstart += s.lookahead;\n\t s.lookahead = 0;\n\t\n\t /* Emit a stored block if pending_buf will be full: */\n\t var max_start = s.block_start + max_block_size;\n\t\n\t if (s.strstart === 0 || s.strstart >= max_start) {\n\t /* strstart == 0 is possible when wraparound on 16-bit machine */\n\t s.lookahead = s.strstart - max_start;\n\t s.strstart = max_start;\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t\n\t\n\t }\n\t /* Flush if we may have to slide, otherwise block_start may become\n\t * negative and the data will be gone:\n\t */\n\t if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t\n\t s.insert = 0;\n\t\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t\n\t if (s.strstart > s.block_start) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t return BS_NEED_MORE;\n\t }", "function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n /* Copy as much as possible from input to output: */\n\n\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n fill_window(s);\n\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n } //Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n /* Emit a stored block if pending_buf will be full: */\n\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n\n\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_NEED_MORE;\n }", "function inflate_uncompressed_block(d) {\n var length, invlength;\n var i = 0, source = d.source, history = d.history, dest = d.dest, destIndex = d.destIndex;\n\n if (d.bitcount > 7) {\n var overflow = Math.floor(d.bitcount / 8);\n d.sourceIndex -= overflow;\n d.bitcount = 0;\n d.tag = 0;\n }\n\n /* get length */\n length = source[d.sourceIndex + 1];\n length = 256 * length + source[d.sourceIndex];\n\n /* get one's complement of length */\n invlength = source[d.sourceIndex + 3];\n invlength = 256 * invlength + source[d.sourceIndex + 2];\n\n /* check length */\n if (length != (~invlength & 0x0000ffff))\n return _tinf.DATA_ERROR;\n\n d.sourceIndex += 4;\n\n /* copy block */\n for (i = length; i; --i) {\n history.push(source[d.sourceIndex]);\n dest[destIndex++] = source[d.sourceIndex++];\n }\n\n /* make sure we start next block on a byte boundary */\n d.bitcount = 0;\n d.destIndex = destIndex;\n\n return _tinf.OK;\n }" ]
[ "0.59261113", "0.5765634", "0.57584363", "0.57032734", "0.56545705", "0.56424904", "0.5635157", "0.5626327", "0.56045735", "0.55976427", "0.55753577", "0.5563106", "0.55127627" ]
0.5665257
85
=========================================================================== Compress as much as possible from the input stream, return the current block state. This function does not perform lazy evaluation of matches and inserts new strings in the dictionary only for unmatched strings or for short matches. It is used only for the fast compression options.
function deflate_fast(s, flush) { var hash_head; /* head of the hash chain */ var bflush; /* set if current block must be flushed */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; /* flush the current block */ } } /* Insert the string window[strstart .. strstart+2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } /* Find the longest match, discarding those <= prev_length. * At this point we have always match_length < MIN_MATCH */ if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ } if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ do { s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ /* strstart never exceeds WSIZE-MAX_MATCH, so there are * always MIN_MATCH bytes ahead. */ } while (--s.match_length !== 0); s.strstart++; } else { s.strstart += s.match_length; s.match_length = 0; s.ins_h = s.window[s.strstart]; /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3 // Call UPDATE_HASH() MIN_MATCH-3 more times //#endif /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not * matter since it will be recomputed at next deflate call. */ } } else { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } if (bflush) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1); if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.last_lit) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_BLOCK_DONE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deflate_fast() {\n\t\twhile (lookahead !== 0 && qhead === null) {\n\t\t\tvar flush; // set if current block must be flushed\n\n\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\tINSERT_STRING();\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n\t\t\tif (hash_head !== NIL && strstart - hash_head <= MAX_DIST) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t// longest_match() sets match_start */\n\t\t\t\tif (match_length > lookahead) {\n\t\t\t\t\tmatch_length = lookahead;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\tflush = ct_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\tif (match_length <= max_lazy_match) {\n\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstrstart++;\n\t\t\t\t\t\tINSERT_STRING();\n\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t// always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n\t\t\t\t\t\t// these bytes are garbage, but it does not matter since\n\t\t\t\t\t\t// the next lookahead bytes will be emitted as literals.\n\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\tstrstart++;\n\t\t\t\t} else {\n\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\t\t// UPDATE_HASH(ins_h, window[strstart + 1]);\n\t\t\t\t\tins_h = ((ins_h << H_SHIFT) ^ (window[strstart + 1] & 0xff)) & HASH_MASK;\n\n\t\t\t\t//#if MIN_MATCH !== 3\n\t\t\t\t//\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n\t\t\t\t//#endif\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No match, output a literal byte */\n\t\t\t\tflush = ct_tally(0, window[strstart] & 0xff);\n\t\t\t\tlookahead--;\n\t\t\t\tstrstart++;\n\t\t\t}\n\t\t\tif (flush) {\n\t\t\t\tflush_block(0);\n\t\t\t\tblock_start = strstart;\n\t\t\t}\n\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\twhile (lookahead < MIN_LOOKAHEAD && !eofile) {\n\t\t\t\tfill_window();\n\t\t\t}\n\t\t}\n\t}", "function deflate_fast(s,flush){var hash_head;/* head of the hash chain */var bflush;/* set if current block must be flushed */for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;/* flush the current block */}}/* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0/*NIL*/;if(s.lookahead>=MIN_MATCH){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}/* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */if(hash_head!==0/*NIL*/&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD){/* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head);/* longest_match() sets match_start */}if(s.match_length>=MIN_MATCH){// check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;/* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */if(s.match_length<=s.max_lazy_match/*max_insert_length*/&&s.lookahead>=MIN_MATCH){s.match_length--;/* string at strstart already in table */do{s.strstart++;/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/ /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */}while(--s.match_length!==0);s.strstart++;}else {s.strstart+=s.match_length;s.match_length=0;s.ins_h=s.window[s.strstart];/* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+1])&s.hash_mask;//#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */}}else {/* No match, output a literal byte */ //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;}if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_slow(s,flush){var hash_head;/* head of hash chain */var bflush;/* set if current block must be flushed */var max_insert;/* Process the input block. */for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;}/* flush the current block */}/* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0/*NIL*/;if(s.lookahead>=MIN_MATCH){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}/* Find the longest match, discarding those <= prev_length.\n */s.prev_length=s.match_length;s.prev_match=s.match_start;s.match_length=MIN_MATCH-1;if(hash_head!==0/*NIL*/&&s.prev_length<s.max_lazy_match&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD/*MAX_DIST(s)*/){/* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head);/* longest_match() sets match_start */if(s.match_length<=5&&(s.strategy===Z_FILTERED||s.match_length===MIN_MATCH&&s.strstart-s.match_start>4096/*TOO_FAR*/)){/* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */s.match_length=MIN_MATCH-1;}}/* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH;/* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH);/* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */s.lookahead-=s.prev_length-1;s.prev_length-=2;do{if(++s.strstart<=max_insert){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}}while(--s.prev_length!==0);s.match_available=0;s.match_length=MIN_MATCH-1;s.strstart++;if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}else if(s.match_available){/* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */ //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);if(bflush){/*** FLUSH_BLOCK_ONLY(s, 0) ***/flush_block_only(s,false);/***/}s.strstart++;s.lookahead--;if(s.strm.avail_out===0){return BS_NEED_MORE;}}else {/* There is no previous match to compare with, wait for\n * the next step to decide.\n */s.match_available=1;s.strstart++;s.lookahead--;}}//Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if(s.match_available){//Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);s.match_available=0;}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n \n var max_insert;\n \n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n \n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n \n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n \n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n \n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n \n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n \n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n \n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n \n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n \n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n \n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n \n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n \n return BS_BLOCK_DONE;\n }", "function deflate_slow(s, flush) {\n\t var hash_head; /* head of hash chain */\n\t var bflush; /* set if current block must be flushed */\n\t\n\t var max_insert;\n\t\n\t /* Process the input block. */\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the next match, plus MIN_MATCH bytes to insert the\n\t * string following the next match.\n\t */\n\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t fill_window(s);\n\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\t\n\t /* Insert the string window[strstart .. strstart+2] in the\n\t * dictionary, and set hash_head to the head of the hash chain:\n\t */\n\t hash_head = 0/*NIL*/;\n\t if (s.lookahead >= MIN_MATCH$1) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t\n\t /* Find the longest match, discarding those <= prev_length.\n\t */\n\t s.prev_length = s.match_length;\n\t s.prev_match = s.match_start;\n\t s.match_length = MIN_MATCH$1 - 1;\n\t\n\t if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n\t s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n\t /* To simplify the code, we prevent matches with the string\n\t * of window index 0 (in particular we have to avoid a match\n\t * of the string with itself at the start of the input file).\n\t */\n\t s.match_length = longest_match(s, hash_head);\n\t /* longest_match() sets match_start */\n\t\n\t if (s.match_length <= 5 &&\n\t (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\t\n\t /* If prev_match is also MIN_MATCH, match_start is garbage\n\t * but we will ignore the current match anyway.\n\t */\n\t s.match_length = MIN_MATCH$1 - 1;\n\t }\n\t }\n\t /* If there was a match at the previous step and the current\n\t * match is not better, output the previous match:\n\t */\n\t if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) {\n\t max_insert = s.strstart + s.lookahead - MIN_MATCH$1;\n\t /* Do not insert strings in hash table beyond this. */\n\t\n\t //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\t\n\t /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n\t s.prev_length - MIN_MATCH, bflush);***/\n\t bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1);\n\t /* Insert in hash table all strings up to the end of the match.\n\t * strstart-1 and strstart are already inserted. If there is not\n\t * enough lookahead, the last two strings are not inserted in\n\t * the hash table.\n\t */\n\t s.lookahead -= s.prev_length - 1;\n\t s.prev_length -= 2;\n\t do {\n\t if (++s.strstart <= max_insert) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t } while (--s.prev_length !== 0);\n\t s.match_available = 0;\n\t s.match_length = MIN_MATCH$1 - 1;\n\t s.strstart++;\n\t\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t } else if (s.match_available) {\n\t /* If there was no match at the previous position, output a\n\t * single literal. If there was a match but the current match\n\t * is longer, truncate the previous match to a single literal.\n\t */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\t\n\t if (bflush) {\n\t /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n\t flush_block_only(s, false);\n\t /***/\n\t }\n\t s.strstart++;\n\t s.lookahead--;\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t } else {\n\t /* There is no previous match to compare with, wait for\n\t * the next step to decide.\n\t */\n\t s.match_available = 1;\n\t s.strstart++;\n\t s.lookahead--;\n\t }\n\t }\n\t //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\t if (s.match_available) {\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\t\n\t s.match_available = 0;\n\t }\n\t s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t return BS_BLOCK_DONE;\n\t }", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0 /*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0 /*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD /*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096 /*TOO_FAR*/)) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n var max_insert;\n /* Process the input block. */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n\n\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0\n /*NIL*/\n && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /*MAX_DIST(s)*/\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096\n /*TOO_FAR*/\n )) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n\n\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n\n s.strstart++;\n s.lookahead--;\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\n\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function $m2YO$var$deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < $m2YO$var$MIN_LOOKAHEAD) {\n $m2YO$var$fill_window(s);\n\n if (s.lookahead < $m2YO$var$MIN_LOOKAHEAD && flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= $m2YO$var$MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - $m2YO$var$MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = $m2YO$var$longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= $m2YO$var$MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, s.strstart - s.match_start, s.match_length - $m2YO$var$MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= $m2YO$var$MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < $m2YO$var$MIN_MATCH - 1 ? s.strstart : $m2YO$var$MIN_MATCH - 1;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n /***/\n\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_BLOCK_DONE;\n}", "function deflate_slow(flush) {\n\t\t // short hash_head = 0; // head of hash chain\n\t\t var hash_head = 0; // head of hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t var max_insert; // Process the input block.\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n \n \n\t\t\tprev_length = match_length;\n\t\t\tprev_match = match_start;\n\t\t\tmatch_length = MIN_MATCH - 1;\n \n\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n \n\t\t\t if (match_length <= 5 && (strategy == Z_FILTERED || match_length == MIN_MATCH && strstart - match_start > 4096)) {\n\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t }\n\t\t\t} // If there was a match at the previous step and the current\n\t\t\t// match is not better, output the previous match:\n \n \n\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t max_insert = strstart + lookahead - MIN_MATCH; // Do not insert strings in hash table beyond this.\n\t\t\t // check_match(strstart-1, prev_match, prev_length);\n \n\t\t\t bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); // Insert in hash table all strings up to the end of the match.\n\t\t\t // strstart-1 and strstart are already inserted. If there is not\n\t\t\t // enough lookahead, the last two strings are not inserted in\n\t\t\t // the hash table.\n \n\t\t\t lookahead -= prev_length - 1;\n\t\t\t prev_length -= 2;\n \n\t\t\t do {\n\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart;\n\t\t\t\t}\n\t\t\t } while (--prev_length !== 0);\n \n\t\t\t match_available = 0;\n\t\t\t match_length = MIN_MATCH - 1;\n\t\t\t strstart++;\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0) return NeedMore;\n\t\t\t }\n\t\t\t} else if (match_available !== 0) {\n\t\t\t // If there was no match at the previous position, output a\n\t\t\t // single literal. If there was a match but the current match\n\t\t\t // is longer, truncate the previous match to a single literal.\n\t\t\t bflush = _tr_tally(0, window[strstart - 1] & 0xff);\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t }\n \n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t} else {\n\t\t\t // There is no previous match to compare with, wait for\n\t\t\t // the next step to decide.\n\t\t\t match_available = 1;\n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t}\n\t\t }\n \n\t\t if (match_available !== 0) {\n\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\tmatch_available = 0;\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH-1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length-1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH-1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH$1) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH$1 - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH$1 - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH$1;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH$1 - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH$1) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH$1 - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH$1 - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH$1;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH$1 - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$1) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH$1) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (; ;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH$1) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH$1 - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH$1 - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH$1;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH$1 - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}", "function compress_block(s,ltree,dtree)// deflate_state *s;\n // const ct_data *ltree; /* literal tree */\n // const ct_data *dtree; /* distance tree */\n {var dist;/* distance of matched string */var lc;/* match length or unmatched char (if dist == 0) */var lx=0;/* running index in l_buf */var code;/* the code to send */var extra;/* number of extra bits to send */if(s.last_lit!==0){do{dist=s.pending_buf[s.d_buf+lx*2]<<8|s.pending_buf[s.d_buf+lx*2+1];lc=s.pending_buf[s.l_buf+lx];lx++;if(dist===0){send_code(s,lc,ltree);/* send a literal byte */ //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n }else {/* Here, lc is the match length - MIN_MATCH */code=_length_code[lc];send_code(s,code+LITERALS+1,ltree);/* send the length code */extra=extra_lbits[code];if(extra!==0){lc-=base_length[code];send_bits(s,lc,extra);/* send the extra length bits */}dist--;/* dist is now the match distance - 1 */code=d_code(dist);//Assert (code < D_CODES, \"bad d_code\");\n send_code(s,code,dtree);/* send the distance code */extra=extra_dbits[code];if(extra!==0){dist-=base_dist[code];send_bits(s,dist,extra);/* send the extra distance bits */}}/* literal or match pair ? */ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n }while(lx<s.last_lit);}send_code(s,END_BLOCK,ltree);}" ]
[ "0.66834676", "0.66489595", "0.6623362", "0.63921976", "0.639217", "0.6382699", "0.63680315", "0.63517934", "0.6348527", "0.6344936", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63384753", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.63381934", "0.6331601", "0.6331601", "0.6321188", "0.63165444", "0.63100123" ]
0.0
-1
=========================================================================== Same as above, but achieves better compression. We use a lazy evaluation for matches: a match is finally adopted only if there is no better match at the next window position.
function deflate_slow(s, flush) { var hash_head; /* head of hash chain */ var bflush; /* set if current block must be flushed */ var max_insert; /* Process the input block. */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ } /* Insert the string window[strstart .. strstart+2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } /* Find the longest match, discarding those <= prev_length. */ s.prev_length = s.match_length; s.prev_match = s.match_start; s.match_length = MIN_MATCH-1; if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ if (s.match_length <= 5 && (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ s.match_length = MIN_MATCH-1; } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ s.lookahead -= s.prev_length-1; s.prev_length -= 2; do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } } while (--s.prev_length !== 0); s.match_available = 0; s.match_length = MIN_MATCH-1; s.strstart++; if (bflush) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } else if (s.match_available) { /* If there was no match at the previous position, output a * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ flush_block_only(s, false); /***/ } s.strstart++; s.lookahead--; if (s.strm.avail_out === 0) { return BS_NEED_MORE; } } else { /* There is no previous match to compare with, wait for * the next step to decide. */ s.match_available = 1; s.strstart++; s.lookahead--; } } //Assert (flush != Z_NO_FLUSH, "no flush?"); if (s.match_available) { //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]); s.match_available = 0; } s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1; if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.last_lit) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_BLOCK_DONE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deflate_fast() {\n\t\twhile (lookahead !== 0 && qhead === null) {\n\t\t\tvar flush; // set if current block must be flushed\n\n\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\tINSERT_STRING();\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n\t\t\tif (hash_head !== NIL && strstart - hash_head <= MAX_DIST) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t// longest_match() sets match_start */\n\t\t\t\tif (match_length > lookahead) {\n\t\t\t\t\tmatch_length = lookahead;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\tflush = ct_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\tif (match_length <= max_lazy_match) {\n\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstrstart++;\n\t\t\t\t\t\tINSERT_STRING();\n\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t// always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n\t\t\t\t\t\t// these bytes are garbage, but it does not matter since\n\t\t\t\t\t\t// the next lookahead bytes will be emitted as literals.\n\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\tstrstart++;\n\t\t\t\t} else {\n\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\t\t// UPDATE_HASH(ins_h, window[strstart + 1]);\n\t\t\t\t\tins_h = ((ins_h << H_SHIFT) ^ (window[strstart + 1] & 0xff)) & HASH_MASK;\n\n\t\t\t\t//#if MIN_MATCH !== 3\n\t\t\t\t//\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n\t\t\t\t//#endif\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No match, output a literal byte */\n\t\t\t\tflush = ct_tally(0, window[strstart] & 0xff);\n\t\t\t\tlookahead--;\n\t\t\t\tstrstart++;\n\t\t\t}\n\t\t\tif (flush) {\n\t\t\t\tflush_block(0);\n\t\t\t\tblock_start = strstart;\n\t\t\t}\n\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\twhile (lookahead < MIN_LOOKAHEAD && !eofile) {\n\t\t\t\tfill_window();\n\t\t\t}\n\t\t}\n\t}", "function longest_match(s,cur_match){var chain_length=s.max_chain_length;/* max hash chain length */var scan=s.strstart;/* current string */var match;/* matched string */var len;/* length of current match */var best_len=s.prev_length;/* best match length so far */var nice_match=s.nice_match;/* stop if match long enough */var limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0/*NIL*/;var _win=s.window;// shortcut\n var wmask=s.w_mask;var prev=s.prev;/* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */var strend=s.strstart+MAX_MATCH;var scan_end1=_win[scan+best_len-1];var scan_end=_win[scan+best_len];/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */ // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n /* Do not waste too much time if we already have a good match: */if(s.prev_length>=s.good_match){chain_length>>=2;}/* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */if(nice_match>s.lookahead){nice_match=s.lookahead;}// Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n do{// Assert(cur_match < s->strstart, \"no future\");\n match=cur_match;/* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */if(_win[match+best_len]!==scan_end||_win[match+best_len-1]!==scan_end1||_win[match]!==_win[scan]||_win[++match]!==_win[scan+1]){continue;}/* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */scan+=2;match++;// Assert(*scan == *match, \"match[2]?\");\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */do{/*jshint noempty:false*/}while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scan<strend);// Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n len=MAX_MATCH-(strend-scan);scan=strend-MAX_MATCH;if(len>best_len){s.match_start=cur_match;best_len=len;if(len>=nice_match){break;}scan_end1=_win[scan+best_len-1];scan_end=_win[scan+best_len];}}while((cur_match=prev[cur_match&wmask])>limit&&--chain_length!==0);if(best_len<=s.lookahead){return best_len;}return s.lookahead;}", "function longest_match(cur_match) {\n\t\tvar chain_length = max_chain_length; // max hash chain length\n\t\tvar scanp = strstart; // current string\n\t\tvar matchp; // matched string\n\t\tvar len; // length of current match\n\t\tvar best_len = prev_length; // best match length so far\n\n\t\t// Stop when cur_match becomes <= limit. To simplify the code,\n\t\t// we prevent matches with the string of window index 0.\n\t\tvar limit = (strstart > MAX_DIST ? strstart - MAX_DIST : NIL);\n\n\t\tvar strendp = strstart + MAX_MATCH;\n\t\tvar scan_end1 = window[scanp + best_len - 1];\n\t\tvar scan_end = window[scanp + best_len];\n\n\t\tvar i, broke;\n\n\t\t// Do not waste too much time if we already have a good match: */\n\t\tif (prev_length >= good_match) {\n\t\t\tchain_length >>= 2;\n\t\t}\n\n\t\t// Assert(encoder->strstart <= window_size-MIN_LOOKAHEAD, \"insufficient lookahead\");\n\n\t\tdo {\n\t\t\t// Assert(cur_match < encoder->strstart, \"no future\");\n\t\t\tmatchp = cur_match;\n\n\t\t\t// Skip to next match if the match length cannot increase\n\t\t\t// or if the match length is less than 2:\n\t\t\tif (window[matchp + best_len] !== scan_end ||\n\t\t\t\t\twindow[matchp + best_len - 1] !== scan_end1 ||\n\t\t\t\t\twindow[matchp] !== window[scanp] ||\n\t\t\t\t\twindow[++matchp] !== window[scanp + 1]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// The check at best_len-1 can be removed because it will be made\n\t\t\t// again later. (This heuristic is not always a win.)\n\t\t\t// It is not necessary to compare scan[2] and match[2] since they\n\t\t\t// are always equal when the other bytes match, given that\n\t\t\t// the hash keys are equal and that HASH_BITS >= 8.\n\t\t\tscanp += 2;\n\t\t\tmatchp++;\n\n\t\t\t// We check for insufficient lookahead only every 8th comparison;\n\t\t\t// the 256th check will be made at strstart+258.\n\t\t\twhile (scanp < strendp) {\n\t\t\t\tbroke = false;\n\t\t\t\tfor (i = 0; i < 8; i += 1) {\n\t\t\t\t\tscanp += 1;\n\t\t\t\t\tmatchp += 1;\n\t\t\t\t\tif (window[scanp] !== window[matchp]) {\n\t\t\t\t\t\tbroke = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (broke) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlen = MAX_MATCH - (strendp - scanp);\n\t\t\tscanp = strendp - MAX_MATCH;\n\n\t\t\tif (len > best_len) {\n\t\t\t\tmatch_start = cur_match;\n\t\t\t\tbest_len = len;\n\t\t\t\tif (FULL_SEARCH) {\n\t\t\t\t\tif (len >= MAX_MATCH) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (len >= nice_match) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tscan_end1 = window[scanp + best_len - 1];\n\t\t\t\tscan_end = window[scanp + best_len];\n\t\t\t}\n\t\t} while ((cur_match = prev[cur_match & WMASK]) > limit && --chain_length !== 0);\n\n\t\treturn best_len;\n\t}", "function fill_window() {\n\t\t var n, m;\n\t\t var p;\n\t\t var more; // Amount of free space at the end of the window.\n \n\t\t do {\n\t\t\tmore = window_size - lookahead - strstart; // Deal with !@#$% 64K limit:\n \n\t\t\tif (more === 0 && strstart === 0 && lookahead === 0) {\n\t\t\t more = w_size;\n\t\t\t} else if (more == -1) {\n\t\t\t // Very unlikely, but possible on 16 bit machine if strstart ==\n\t\t\t // 0\n\t\t\t // and lookahead == 1 (input done one byte at time)\n\t\t\t more--; // If the window is almost full and there is insufficient\n\t\t\t // lookahead,\n\t\t\t // move the upper half to the lower one to make room in the\n\t\t\t // upper half.\n\t\t\t} else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) {\n\t\t\t window.set(window.subarray(w_size, w_size + w_size), 0);\n\t\t\t match_start -= w_size;\n\t\t\t strstart -= w_size; // we now have strstart >= MAX_DIST\n \n\t\t\t block_start -= w_size; // Slide the hash table (could be avoided with 32 bit values\n\t\t\t // at the expense of memory usage). We slide even when level ==\n\t\t\t // 0\n\t\t\t // to keep the hash table consistent if we switch back to level\n\t\t\t // > 0\n\t\t\t // later. (Using level 0 permanently is not an optimal usage of\n\t\t\t // zlib, so we don't care about this pathological case.)\n \n\t\t\t n = hash_size;\n\t\t\t p = n;\n \n\t\t\t do {\n\t\t\t\tm = head[--p] & 0xffff;\n\t\t\t\thead[p] = m >= w_size ? m - w_size : 0;\n\t\t\t } while (--n !== 0);\n \n\t\t\t n = w_size;\n\t\t\t p = n;\n \n\t\t\t do {\n\t\t\t\tm = prev[--p] & 0xffff;\n\t\t\t\tprev[p] = m >= w_size ? m - w_size : 0; // If n is not on any hash chain, prev[n] is garbage but\n\t\t\t\t// its value will never be used.\n\t\t\t } while (--n !== 0);\n \n\t\t\t more += w_size;\n\t\t\t}\n \n\t\t\tif (strm.avail_in === 0) return; // If there was no sliding:\n\t\t\t// strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n\t\t\t// more == window_size - lookahead - strstart\n\t\t\t// => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n\t\t\t// => more >= window_size - 2*WSIZE + 2\n\t\t\t// In the BIG_MEM or MMAP case (not yet supported),\n\t\t\t// window_size == input_size + MIN_LOOKAHEAD &&\n\t\t\t// strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n\t\t\t// Otherwise, window_size == 2*WSIZE so more >= 2.\n\t\t\t// If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n \n\t\t\tn = strm.read_buf(window, strstart + lookahead, more);\n\t\t\tlookahead += n; // Initialize the hash value now that we have some input:\n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = window[strstart] & 0xff;\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + 1] & 0xff) & hash_mask;\n\t\t\t} // If the whole input has less than MIN_MATCH bytes, ins_h is\n\t\t\t// garbage,\n\t\t\t// but this is not important since only literal bytes will be\n\t\t\t// emitted.\n \n\t\t } while (lookahead < MIN_LOOKAHEAD && strm.avail_in !== 0);\n\t\t} // Copy without compression as much as possible from the input stream,", "function $m2YO$var$deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= $m2YO$var$MAX_MATCH) {\n $m2YO$var$fill_window(s);\n\n if (s.lookahead <= $m2YO$var$MAX_MATCH && flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= $m2YO$var$MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + $m2YO$var$MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = $m2YO$var$MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= $m2YO$var$MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 1, s.match_length - $m2YO$var$MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n /***/\n\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_BLOCK_DONE;\n}", "function deflate_rle(s,flush){var bflush;/* set if current block must be flushed */var prev;/* byte at distance one to match */var scan,strend;/* scan goes up to strend for length of run */var _win=s.window;for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */if(s.lookahead<=MAX_MATCH){fill_window(s);if(s.lookahead<=MAX_MATCH&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;}/* flush the current block */}/* See how many times the previous byte repeats */s.match_length=0;if(s.lookahead>=MIN_MATCH&&s.strstart>0){scan=s.strstart-1;prev=_win[scan];if(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do{/*jshint noempty:false*/}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scan<strend);s.match_length=MAX_MATCH-(strend-scan);if(s.match_length>s.lookahead){s.match_length=s.lookahead;}}//Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }/* Emit match if have run of MIN_MATCH or longer, else emit literal */if(s.match_length>=MIN_MATCH){//check_match(s, s.strstart, s.strstart - 1, s.match_length);\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;s.strstart+=s.match_length;s.match_length=0;}else {/* No match, output a literal byte */ //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;}if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=0;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_fast(flush) {\n\t\t // short hash_head = 0; // head of the hash chain\n\t\t var hash_head = 0; // head of the hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n \n \n\t\t\tif (hash_head !== 0 && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n\t\t\t}\n \n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t // check_match(strstart, match_start, match_length);\n\t\t\t bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t lookahead -= match_length; // Insert new strings in the hash table only if the match length\n\t\t\t // is not too large. This saves time but degrades compression.\n \n\t\t\t if (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\tmatch_length--; // string at strstart already in hash table\n \n\t\t\t\tdo {\n\t\t\t\t strstart++;\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart; // strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t // always MIN_MATCH bytes ahead.\n\t\t\t\t} while (--match_length !== 0);\n \n\t\t\t\tstrstart++;\n\t\t\t } else {\n\t\t\t\tstrstart += match_length;\n\t\t\t\tmatch_length = 0;\n\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\tins_h = (ins_h << hash_shift ^ window[strstart + 1] & 0xff) & hash_mask; // If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t// not\n\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t }\n\t\t\t} else {\n\t\t\t // No match, output a literal byte\n\t\t\t bflush = _tr_tally(0, window[strstart] & 0xff);\n\t\t\t lookahead--;\n\t\t\t strstart++;\n\t\t\t}\n \n\t\t\tif (bflush) {\n\t\t\t flush_block_only(false);\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t}\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t} // Same as above, but achieves better compression. We use a lazy", "function fill_window(s){var _w_size=s.w_size;var p,n,m,more,str;//Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n do{more=s.window_size-s.lookahead-s.strstart;// JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */ //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */if(s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0);s.match_start-=_w_size;s.strstart-=_w_size;/* we now have strstart >= MAX_DIST */s.block_start-=_w_size;/* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */n=s.hash_size;p=n;do{m=s.head[--p];s.head[p]=m>=_w_size?m-_w_size:0;}while(--n);n=_w_size;p=n;do{m=s.prev[--p];s.prev[p]=m>=_w_size?m-_w_size:0;/* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */}while(--n);more+=_w_size;}if(s.strm.avail_in===0){break;}/* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */ //Assert(more >= 2, \"more < 2\");\n n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more);s.lookahead+=n;/* Initialize the hash value now that we have some input: */if(s.lookahead+s.insert>=MIN_MATCH){str=s.strstart-s.insert;s.ins_h=s.window[str];/* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+1])&s.hash_mask;//#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n while(s.insert){/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+MIN_MATCH-1])&s.hash_mask;s.prev[str&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=str;str++;s.insert--;if(s.lookahead+s.insert<MIN_MATCH){break;}}}/* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */}while(s.lookahead<MIN_LOOKAHEAD&&s.strm.avail_in!==0);/* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */ // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n }", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n \n var _win = s.window;\n \n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n \n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n \n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n \n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n \n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n \n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n }", "function deflate_slow(flush) {\n\t\t // short hash_head = 0; // head of hash chain\n\t\t var hash_head = 0; // head of hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t var max_insert; // Process the input block.\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n \n \n\t\t\tprev_length = match_length;\n\t\t\tprev_match = match_start;\n\t\t\tmatch_length = MIN_MATCH - 1;\n \n\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n \n\t\t\t if (match_length <= 5 && (strategy == Z_FILTERED || match_length == MIN_MATCH && strstart - match_start > 4096)) {\n\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t }\n\t\t\t} // If there was a match at the previous step and the current\n\t\t\t// match is not better, output the previous match:\n \n \n\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t max_insert = strstart + lookahead - MIN_MATCH; // Do not insert strings in hash table beyond this.\n\t\t\t // check_match(strstart-1, prev_match, prev_length);\n \n\t\t\t bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); // Insert in hash table all strings up to the end of the match.\n\t\t\t // strstart-1 and strstart are already inserted. If there is not\n\t\t\t // enough lookahead, the last two strings are not inserted in\n\t\t\t // the hash table.\n \n\t\t\t lookahead -= prev_length - 1;\n\t\t\t prev_length -= 2;\n \n\t\t\t do {\n\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart;\n\t\t\t\t}\n\t\t\t } while (--prev_length !== 0);\n \n\t\t\t match_available = 0;\n\t\t\t match_length = MIN_MATCH - 1;\n\t\t\t strstart++;\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0) return NeedMore;\n\t\t\t }\n\t\t\t} else if (match_available !== 0) {\n\t\t\t // If there was no match at the previous position, output a\n\t\t\t // single literal. If there was a match but the current match\n\t\t\t // is longer, truncate the previous match to a single literal.\n\t\t\t bflush = _tr_tally(0, window[strstart - 1] & 0xff);\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t }\n \n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t} else {\n\t\t\t // There is no previous match to compare with, wait for\n\t\t\t // the next step to decide.\n\t\t\t match_available = 1;\n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t}\n\t\t }\n \n\t\t if (match_available !== 0) {\n\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\tmatch_available = 0;\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "function deflate_rle(s, flush) {\n\t var bflush; /* set if current block must be flushed */\n\t var prev; /* byte at distance one to match */\n\t var scan, strend; /* scan goes up to strend for length of run */\n\t\n\t var _win = s.window;\n\t\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the longest run, plus one for the unrolled loop.\n\t */\n\t if (s.lookahead <= MAX_MATCH$1) {\n\t fill_window(s);\n\t if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\t\n\t /* See how many times the previous byte repeats */\n\t s.match_length = 0;\n\t if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n\t scan = s.strstart - 1;\n\t prev = _win[scan];\n\t if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n\t strend = s.strstart + MAX_MATCH$1;\n\t do {\n\t /*jshint noempty:false*/\n\t } while (prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t scan < strend);\n\t s.match_length = MAX_MATCH$1 - (strend - scan);\n\t if (s.match_length > s.lookahead) {\n\t s.match_length = s.lookahead;\n\t }\n\t }\n\t //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\t }\n\t\n\t /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\t if (s.match_length >= MIN_MATCH$1) {\n\t //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\t\n\t /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n\t bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH$1);\n\t\n\t s.lookahead -= s.match_length;\n\t s.strstart += s.match_length;\n\t s.match_length = 0;\n\t } else {\n\t /* No match, output a literal byte */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\t\n\t s.lookahead--;\n\t s.strstart++;\n\t }\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t s.insert = 0;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t return BS_BLOCK_DONE;\n\t }", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed\n\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n\n s.block_start -= _w_size;\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n\n n = _w_size;\n p = n;\n\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n\n if (s.strm.avail_in === 0) {\n break;\n }\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n\n\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n /* Initialize the hash value now that we have some input: */\n\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n\n }", "function $m2YO$var$fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed\n\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n\n if (s.strstart >= _w_size + (_w_size - $m2YO$var$MIN_LOOKAHEAD)) {\n $m2YO$var$utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n\n s.block_start -= _w_size;\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n\n n = _w_size;\n p = n;\n\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n\n if (s.strm.avail_in === 0) {\n break;\n }\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n\n\n n = $m2YO$var$read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n /* Initialize the hash value now that we have some input: */\n\n if (s.lookahead + s.insert >= $m2YO$var$MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n\n if (s.lookahead + s.insert < $m2YO$var$MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < $m2YO$var$MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n \n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n \n do {\n more = s.window_size - s.lookahead - s.strstart;\n \n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n \n \n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n \n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n \n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n \n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n \n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n \n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n \n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n \n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n \n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n \n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n \n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n \n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n }", "function findMaxMatch3() {\r\n\r\n // Initialise empty matching (reset flags)\r\n for (var i = 0; i < nodes.length; i++)\r\n match[i] = false;\r\n\r\n // Create frame and push to frames array (for animation)\r\n longTrace.push(\"<li>Algorithm started</li>\");\r\n shortTrace.push(\"<li>Algorithm started</li>\");\r\n frame = new Frame2(1, 1, longTraceNum++, shortTraceNum, graph.map(g => ([ ...g ])), [], [...blossom]);\r\n frames.push(frame);\r\n\r\n // Find augmenting path and augment matching along path until maximum matching is found\r\n while (findAugmentingPath());\r\n\r\n // Create frame and push to frames array (for animation)\r\n longTrace.push(\"<li>Maximum matching found</li>\");\r\n shortTrace.push(\"<li>Maximum matching found</li>\");\r\n frame = new Frame2(9, 5, longTraceNum++, ++shortTraceNum, graph.map(g => ([ ...g ])), [], []);\r\n frames.push(frame);\r\n\r\n}", "function fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str; //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed\n\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n\n s.block_start -= _w_size;\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n\n n = _w_size;\n p = n;\n\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n\n if (s.strm.avail_in === 0) {\n break;\n }\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n\n\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n /* Initialize the hash value now that we have some input: */\n\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n //#endif\n\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // var curr = s.strstart + s.lookahead;\n // var init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n\n}", "function $m2YO$var$deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < $m2YO$var$MIN_LOOKAHEAD) {\n $m2YO$var$fill_window(s);\n\n if (s.lookahead < $m2YO$var$MIN_LOOKAHEAD && flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= $m2YO$var$MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - $m2YO$var$MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = $m2YO$var$longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= $m2YO$var$MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, s.strstart - s.match_start, s.match_length - $m2YO$var$MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= $m2YO$var$MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < $m2YO$var$MIN_MATCH - 1 ? s.strstart : $m2YO$var$MIN_MATCH - 1;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n /***/\n\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_BLOCK_DONE;\n}", "function fill_window(s) {\n\t var _w_size = s.w_size;\n\t var p, n, m, more, str;\n\t\n\t //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\t\n\t do {\n\t more = s.window_size - s.lookahead - s.strstart;\n\t\n\t // JS ints have 32 bit, block below not needed\n\t /* Deal with !@#$% 64K limit: */\n\t //if (sizeof(int) <= 2) {\n\t // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n\t // more = wsize;\n\t //\n\t // } else if (more == (unsigned)(-1)) {\n\t // /* Very unlikely, but possible on 16 bit machine if\n\t // * strstart == 0 && lookahead == 1 (input done a byte at time)\n\t // */\n\t // more--;\n\t // }\n\t //}\n\t\n\t\n\t /* If the window is almost full and there is insufficient lookahead,\n\t * move the upper half to the lower one to make room in the upper half.\n\t */\n\t if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\t\n\t arraySet(s.window, s.window, _w_size, _w_size, 0);\n\t s.match_start -= _w_size;\n\t s.strstart -= _w_size;\n\t /* we now have strstart >= MAX_DIST */\n\t s.block_start -= _w_size;\n\t\n\t /* Slide the hash table (could be avoided with 32 bit values\n\t at the expense of memory usage). We slide even when level == 0\n\t to keep the hash table consistent if we switch back to level > 0\n\t later. (Using level 0 permanently is not an optimal usage of\n\t zlib, so we don't care about this pathological case.)\n\t */\n\t\n\t n = s.hash_size;\n\t p = n;\n\t do {\n\t m = s.head[--p];\n\t s.head[p] = (m >= _w_size ? m - _w_size : 0);\n\t } while (--n);\n\t\n\t n = _w_size;\n\t p = n;\n\t do {\n\t m = s.prev[--p];\n\t s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n\t /* If n is not on any hash chain, prev[n] is garbage but\n\t * its value will never be used.\n\t */\n\t } while (--n);\n\t\n\t more += _w_size;\n\t }\n\t if (s.strm.avail_in === 0) {\n\t break;\n\t }\n\t\n\t /* If there was no sliding:\n\t * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n\t * more == window_size - lookahead - strstart\n\t * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n\t * => more >= window_size - 2*WSIZE + 2\n\t * In the BIG_MEM or MMAP case (not yet supported),\n\t * window_size == input_size + MIN_LOOKAHEAD &&\n\t * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n\t * Otherwise, window_size == 2*WSIZE so more >= 2.\n\t * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n\t */\n\t //Assert(more >= 2, \"more < 2\");\n\t n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n\t s.lookahead += n;\n\t\n\t /* Initialize the hash value now that we have some input: */\n\t if (s.lookahead + s.insert >= MIN_MATCH$1) {\n\t str = s.strstart - s.insert;\n\t s.ins_h = s.window[str];\n\t\n\t /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n\t //#if MIN_MATCH != 3\n\t // Call update_hash() MIN_MATCH-3 more times\n\t //#endif\n\t while (s.insert) {\n\t /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t\n\t s.prev[str & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = str;\n\t str++;\n\t s.insert--;\n\t if (s.lookahead + s.insert < MIN_MATCH$1) {\n\t break;\n\t }\n\t }\n\t }\n\t /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n\t * but this is not important since only literal bytes will be emitted.\n\t */\n\t\n\t } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\t\n\t /* If the WIN_INIT bytes after the end of the current data have never been\n\t * written, then zero those bytes in order to avoid memory check reports of\n\t * the use of uninitialized (or uninitialised as Julian writes) bytes by\n\t * the longest match routines. Update the high water mark for the next\n\t * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n\t * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n\t */\n\t // if (s.high_water < s.window_size) {\n\t // var curr = s.strstart + s.lookahead;\n\t // var init = 0;\n\t //\n\t // if (s.high_water < curr) {\n\t // /* Previous high water mark below current data -- zero WIN_INIT\n\t // * bytes or up to end of window, whichever is less.\n\t // */\n\t // init = s.window_size - curr;\n\t // if (init > WIN_INIT)\n\t // init = WIN_INIT;\n\t // zmemzero(s->window + curr, (unsigned)init);\n\t // s->high_water = curr + init;\n\t // }\n\t // else if (s->high_water < (ulg)curr + WIN_INIT) {\n\t // /* High water mark at or above current data, but below current data\n\t // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n\t // * to end of window, whichever is less.\n\t // */\n\t // init = (ulg)curr + WIN_INIT - s->high_water;\n\t // if (init > s->window_size - s->high_water)\n\t // init = s->window_size - s->high_water;\n\t // zmemzero(s->window + s->high_water, (unsigned)init);\n\t // s->high_water += init;\n\t // }\n\t // }\n\t //\n\t // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n\t // \"not enough room for search\");\n\t }", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH$1) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH$1;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH$1 - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH$1) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH$1);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH$1) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH$1;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH$1 - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH$1) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH$1);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}" ]
[ "0.66324675", "0.60708964", "0.60278755", "0.58126444", "0.56749785", "0.56560904", "0.5632922", "0.5628258", "0.5612574", "0.55996627", "0.5562616", "0.5542642", "0.55422807", "0.55375457", "0.5528214", "0.5515559", "0.55129355", "0.550209", "0.5501354", "0.5501354", "0.54981655", "0.5487434", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235", "0.5484235" ]
0.0
-1
=========================================================================== For Z_RLE, simply look for runs of bytes, generate matches only of distance one. Do not maintain a hash table. (It will be regenerated if this run of deflate switches away from Z_RLE.)
function deflate_rle(s, flush) { var bflush; /* set if current block must be flushed */ var prev; /* byte at distance one to match */ var scan, strend; /* scan goes up to strend for length of run */ var _win = s.window; for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ if (s.lookahead <= MAX_MATCH) { fill_window(s); if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ } /* See how many times the previous byte repeats */ s.match_length = 0; if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; } } //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; s.match_length = 0; } else { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; } if (bflush) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } s.insert = 0; if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.last_lit) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_BLOCK_DONE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $m2YO$var$deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= $m2YO$var$MAX_MATCH) {\n $m2YO$var$fill_window(s);\n\n if (s.lookahead <= $m2YO$var$MAX_MATCH && flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= $m2YO$var$MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + $m2YO$var$MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = $m2YO$var$MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= $m2YO$var$MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 1, s.match_length - $m2YO$var$MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n /***/\n\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_BLOCK_DONE;\n}", "function deflate_rle(s,flush){var bflush;/* set if current block must be flushed */var prev;/* byte at distance one to match */var scan,strend;/* scan goes up to strend for length of run */var _win=s.window;for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */if(s.lookahead<=MAX_MATCH){fill_window(s);if(s.lookahead<=MAX_MATCH&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;}/* flush the current block */}/* See how many times the previous byte repeats */s.match_length=0;if(s.lookahead>=MIN_MATCH&&s.strstart>0){scan=s.strstart-1;prev=_win[scan];if(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do{/*jshint noempty:false*/}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scan<strend);s.match_length=MAX_MATCH-(strend-scan);if(s.match_length>s.lookahead){s.match_length=s.lookahead;}}//Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }/* Emit match if have run of MIN_MATCH or longer, else emit literal */if(s.match_length>=MIN_MATCH){//check_match(s, s.strstart, s.strstart - 1, s.match_length);\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;s.strstart+=s.match_length;s.match_length=0;}else {/* No match, output a literal byte */ //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;}if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=0;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n \n var _win = s.window;\n \n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n \n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n \n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n \n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n \n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n \n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$1) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH$1) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH$1) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH$1;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH$1 - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH$1) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH$1);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH$1) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH$1;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH$1 - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH$1) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH$1);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (; ;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH$1) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH$1;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH$1 - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH$1) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH$1);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n\t var bflush; /* set if current block must be flushed */\n\t var prev; /* byte at distance one to match */\n\t var scan, strend; /* scan goes up to strend for length of run */\n\t\n\t var _win = s.window;\n\t\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the longest run, plus one for the unrolled loop.\n\t */\n\t if (s.lookahead <= MAX_MATCH$1) {\n\t fill_window(s);\n\t if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\t\n\t /* See how many times the previous byte repeats */\n\t s.match_length = 0;\n\t if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n\t scan = s.strstart - 1;\n\t prev = _win[scan];\n\t if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n\t strend = s.strstart + MAX_MATCH$1;\n\t do {\n\t /*jshint noempty:false*/\n\t } while (prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t scan < strend);\n\t s.match_length = MAX_MATCH$1 - (strend - scan);\n\t if (s.match_length > s.lookahead) {\n\t s.match_length = s.lookahead;\n\t }\n\t }\n\t //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\t }\n\t\n\t /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\t if (s.match_length >= MIN_MATCH$1) {\n\t //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\t\n\t /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n\t bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH$1);\n\t\n\t s.lookahead -= s.match_length;\n\t s.strstart += s.match_length;\n\t s.match_length = 0;\n\t } else {\n\t /* No match, output a literal byte */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\t\n\t s.lookahead--;\n\t s.strstart++;\n\t }\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t s.insert = 0;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t return BS_BLOCK_DONE;\n\t }", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n\t var bflush; /* set if current block must be flushed */\n\t var prev; /* byte at distance one to match */\n\t var scan, strend; /* scan goes up to strend for length of run */\n\n\t var _win = s.window;\n\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the longest run, plus one for the unrolled loop.\n\t */\n\t if (s.lookahead <= MAX_MATCH) {\n\t fill_window(s);\n\t if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\n\t /* See how many times the previous byte repeats */\n\t s.match_length = 0;\n\t if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n\t scan = s.strstart - 1;\n\t prev = _win[scan];\n\t if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n\t strend = s.strstart + MAX_MATCH;\n\t do {\n\t /*jshint noempty:false*/\n\t } while (prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t scan < strend);\n\t s.match_length = MAX_MATCH - (strend - scan);\n\t if (s.match_length > s.lookahead) {\n\t s.match_length = s.lookahead;\n\t }\n\t }\n\t //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\t }\n\n\t /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\t if (s.match_length >= MIN_MATCH) {\n\t //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n\t /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n\t bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n\t s.lookahead -= s.match_length;\n\t s.strstart += s.match_length;\n\t s.match_length = 0;\n\t } else {\n\t /* No match, output a literal byte */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n\t s.lookahead--;\n\t s.strstart++;\n\t }\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t s.insert = 0;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t return BS_BLOCK_DONE;\n\t}", "function deflate_rle(s, flush) {\n\t var bflush; /* set if current block must be flushed */\n\t var prev; /* byte at distance one to match */\n\t var scan, strend; /* scan goes up to strend for length of run */\n\n\t var _win = s.window;\n\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the longest run, plus one for the unrolled loop.\n\t */\n\t if (s.lookahead <= MAX_MATCH) {\n\t fill_window(s);\n\t if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\n\t /* See how many times the previous byte repeats */\n\t s.match_length = 0;\n\t if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n\t scan = s.strstart - 1;\n\t prev = _win[scan];\n\t if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n\t strend = s.strstart + MAX_MATCH;\n\t do {\n\t /*jshint noempty:false*/\n\t } while (prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t scan < strend);\n\t s.match_length = MAX_MATCH - (strend - scan);\n\t if (s.match_length > s.lookahead) {\n\t s.match_length = s.lookahead;\n\t }\n\t }\n\t //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\t }\n\n\t /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\t if (s.match_length >= MIN_MATCH) {\n\t //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n\t /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n\t bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n\t s.lookahead -= s.match_length;\n\t s.strstart += s.match_length;\n\t s.match_length = 0;\n\t } else {\n\t /* No match, output a literal byte */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n\t s.lookahead--;\n\t s.strstart++;\n\t }\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t s.insert = 0;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t return BS_BLOCK_DONE;\n\t}" ]
[ "0.7337809", "0.72525966", "0.69772786", "0.6927416", "0.6923", "0.6902618", "0.690135", "0.68757206", "0.685161", "0.685161", "0.68312955", "0.68101317", "0.68007237", "0.67007655", "0.67007655" ]
0.6905223
85
=========================================================================== For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. (It will be regenerated if this run of deflate switches away from Huffman.)
function deflate_huff(s, flush) { var bflush; /* set if current block must be flushed */ for (;;) { /* Make sure that we have a literal to write. */ if (s.lookahead === 0) { fill_window(s); if (s.lookahead === 0) { if (flush === Z_NO_FLUSH) { return BS_NEED_MORE; } break; /* flush the current block */ } } /* Output a literal byte */ s.match_length = 0; //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; if (bflush) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } } s.insert = 0; if (flush === Z_FINISH) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { return BS_FINISH_STARTED; } /***/ return BS_FINISH_DONE; } if (s.last_lit) { /*** FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false); if (s.strm.avail_out === 0) { return BS_NEED_MORE; } /***/ } return BS_BLOCK_DONE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deflate_fast(flush) {\n\t\t // short hash_head = 0; // head of the hash chain\n\t\t var hash_head = 0; // head of the hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n \n \n\t\t\tif (hash_head !== 0 && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n\t\t\t}\n \n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t // check_match(strstart, match_start, match_length);\n\t\t\t bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t lookahead -= match_length; // Insert new strings in the hash table only if the match length\n\t\t\t // is not too large. This saves time but degrades compression.\n \n\t\t\t if (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\tmatch_length--; // string at strstart already in hash table\n \n\t\t\t\tdo {\n\t\t\t\t strstart++;\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart; // strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t // always MIN_MATCH bytes ahead.\n\t\t\t\t} while (--match_length !== 0);\n \n\t\t\t\tstrstart++;\n\t\t\t } else {\n\t\t\t\tstrstart += match_length;\n\t\t\t\tmatch_length = 0;\n\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\tins_h = (ins_h << hash_shift ^ window[strstart + 1] & 0xff) & hash_mask; // If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t// not\n\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t }\n\t\t\t} else {\n\t\t\t // No match, output a literal byte\n\t\t\t bflush = _tr_tally(0, window[strstart] & 0xff);\n\t\t\t lookahead--;\n\t\t\t strstart++;\n\t\t\t}\n \n\t\t\tif (bflush) {\n\t\t\t flush_block_only(false);\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t}\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t} // Same as above, but achieves better compression. We use a lazy", "function deflate_slow(flush) {\n\t\t // short hash_head = 0; // head of hash chain\n\t\t var hash_head = 0; // head of hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t var max_insert; // Process the input block.\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n \n \n\t\t\tprev_length = match_length;\n\t\t\tprev_match = match_start;\n\t\t\tmatch_length = MIN_MATCH - 1;\n \n\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n \n\t\t\t if (match_length <= 5 && (strategy == Z_FILTERED || match_length == MIN_MATCH && strstart - match_start > 4096)) {\n\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t }\n\t\t\t} // If there was a match at the previous step and the current\n\t\t\t// match is not better, output the previous match:\n \n \n\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t max_insert = strstart + lookahead - MIN_MATCH; // Do not insert strings in hash table beyond this.\n\t\t\t // check_match(strstart-1, prev_match, prev_length);\n \n\t\t\t bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); // Insert in hash table all strings up to the end of the match.\n\t\t\t // strstart-1 and strstart are already inserted. If there is not\n\t\t\t // enough lookahead, the last two strings are not inserted in\n\t\t\t // the hash table.\n \n\t\t\t lookahead -= prev_length - 1;\n\t\t\t prev_length -= 2;\n \n\t\t\t do {\n\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart;\n\t\t\t\t}\n\t\t\t } while (--prev_length !== 0);\n \n\t\t\t match_available = 0;\n\t\t\t match_length = MIN_MATCH - 1;\n\t\t\t strstart++;\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0) return NeedMore;\n\t\t\t }\n\t\t\t} else if (match_available !== 0) {\n\t\t\t // If there was no match at the previous position, output a\n\t\t\t // single literal. If there was a match but the current match\n\t\t\t // is longer, truncate the previous match to a single literal.\n\t\t\t bflush = _tr_tally(0, window[strstart - 1] & 0xff);\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t }\n \n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t} else {\n\t\t\t // There is no previous match to compare with, wait for\n\t\t\t // the next step to decide.\n\t\t\t match_available = 1;\n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t}\n\t\t }\n \n\t\t if (match_available !== 0) {\n\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\tmatch_available = 0;\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "function deflate_fast(s,flush){var hash_head;/* head of the hash chain */var bflush;/* set if current block must be flushed */for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;/* flush the current block */}}/* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0/*NIL*/;if(s.lookahead>=MIN_MATCH){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}/* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */if(hash_head!==0/*NIL*/&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD){/* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head);/* longest_match() sets match_start */}if(s.match_length>=MIN_MATCH){// check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;/* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */if(s.match_length<=s.max_lazy_match/*max_insert_length*/&&s.lookahead>=MIN_MATCH){s.match_length--;/* string at strstart already in table */do{s.strstart++;/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/ /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */}while(--s.match_length!==0);s.strstart++;}else {s.strstart+=s.match_length;s.match_length=0;s.ins_h=s.window[s.strstart];/* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+1])&s.hash_mask;//#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */}}else {/* No match, output a literal byte */ //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;}if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_slow(s,flush){var hash_head;/* head of hash chain */var bflush;/* set if current block must be flushed */var max_insert;/* Process the input block. */for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;}/* flush the current block */}/* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0/*NIL*/;if(s.lookahead>=MIN_MATCH){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}/* Find the longest match, discarding those <= prev_length.\n */s.prev_length=s.match_length;s.prev_match=s.match_start;s.match_length=MIN_MATCH-1;if(hash_head!==0/*NIL*/&&s.prev_length<s.max_lazy_match&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD/*MAX_DIST(s)*/){/* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head);/* longest_match() sets match_start */if(s.match_length<=5&&(s.strategy===Z_FILTERED||s.match_length===MIN_MATCH&&s.strstart-s.match_start>4096/*TOO_FAR*/)){/* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */s.match_length=MIN_MATCH-1;}}/* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH;/* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH);/* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */s.lookahead-=s.prev_length-1;s.prev_length-=2;do{if(++s.strstart<=max_insert){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}}while(--s.prev_length!==0);s.match_available=0;s.match_length=MIN_MATCH-1;s.strstart++;if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}else if(s.match_available){/* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */ //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);if(bflush){/*** FLUSH_BLOCK_ONLY(s, 0) ***/flush_block_only(s,false);/***/}s.strstart++;s.lookahead--;if(s.strm.avail_out===0){return BS_NEED_MORE;}}else {/* There is no previous match to compare with, wait for\n * the next step to decide.\n */s.match_available=1;s.strstart++;s.lookahead--;}}//Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if(s.match_available){//Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);s.match_available=0;}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_fast() {\n\t\twhile (lookahead !== 0 && qhead === null) {\n\t\t\tvar flush; // set if current block must be flushed\n\n\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\tINSERT_STRING();\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n\t\t\tif (hash_head !== NIL && strstart - hash_head <= MAX_DIST) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t// longest_match() sets match_start */\n\t\t\t\tif (match_length > lookahead) {\n\t\t\t\t\tmatch_length = lookahead;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\tflush = ct_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\tif (match_length <= max_lazy_match) {\n\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstrstart++;\n\t\t\t\t\t\tINSERT_STRING();\n\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t// always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n\t\t\t\t\t\t// these bytes are garbage, but it does not matter since\n\t\t\t\t\t\t// the next lookahead bytes will be emitted as literals.\n\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\tstrstart++;\n\t\t\t\t} else {\n\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\t\t// UPDATE_HASH(ins_h, window[strstart + 1]);\n\t\t\t\t\tins_h = ((ins_h << H_SHIFT) ^ (window[strstart + 1] & 0xff)) & HASH_MASK;\n\n\t\t\t\t//#if MIN_MATCH !== 3\n\t\t\t\t//\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n\t\t\t\t//#endif\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No match, output a literal byte */\n\t\t\t\tflush = ct_tally(0, window[strstart] & 0xff);\n\t\t\t\tlookahead--;\n\t\t\t\tstrstart++;\n\t\t\t}\n\t\t\tif (flush) {\n\t\t\t\tflush_block(0);\n\t\t\t\tblock_start = strstart;\n\t\t\t}\n\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\twhile (lookahead < MIN_LOOKAHEAD && !eofile) {\n\t\t\t\tfill_window();\n\t\t\t}\n\t\t}\n\t}", "function deflate_huff(s,flush){var bflush;/* set if current block must be flushed */for(;;){/* Make sure that we have a literal to write. */if(s.lookahead===0){fill_window(s);if(s.lookahead===0){if(flush===Z_NO_FLUSH){return BS_NEED_MORE;}break;/* flush the current block */}}/* Output a literal byte */s.match_length=0;//Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=0;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function $m2YO$var$deflate_huff(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n $m2YO$var$fill_window(s);\n\n if (s.lookahead === 0) {\n if (flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n break;\n /* flush the current block */\n }\n }\n /* Output a literal byte */\n\n\n s.match_length = 0; //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\n bflush = $m2YO$var$trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n /***/\n\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_BLOCK_DONE;\n}", "function $m2YO$var$deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < $m2YO$var$MIN_LOOKAHEAD) {\n $m2YO$var$fill_window(s);\n\n if (s.lookahead < $m2YO$var$MIN_LOOKAHEAD && flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= $m2YO$var$MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - $m2YO$var$MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = $m2YO$var$longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= $m2YO$var$MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, s.strstart - s.match_start, s.match_length - $m2YO$var$MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= $m2YO$var$MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < $m2YO$var$MIN_MATCH - 1 ? s.strstart : $m2YO$var$MIN_MATCH - 1;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n /***/\n\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n var max_insert;\n /* Process the input block. */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n\n\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0\n /*NIL*/\n && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /*MAX_DIST(s)*/\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096\n /*TOO_FAR*/\n )) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n\n\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n\n s.strstart++;\n s.lookahead--;\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\n\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function deflate_fast(s, flush) {\n\t var hash_head; /* head of the hash chain */\n\t var bflush; /* set if current block must be flushed */\n\t\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the next match, plus MIN_MATCH bytes to insert the\n\t * string following the next match.\n\t */\n\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t fill_window(s);\n\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) {\n\t break; /* flush the current block */\n\t }\n\t }\n\t\n\t /* Insert the string window[strstart .. strstart+2] in the\n\t * dictionary, and set hash_head to the head of the hash chain:\n\t */\n\t hash_head = 0/*NIL*/;\n\t if (s.lookahead >= MIN_MATCH$1) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t\n\t /* Find the longest match, discarding those <= prev_length.\n\t * At this point we have always match_length < MIN_MATCH\n\t */\n\t if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n\t /* To simplify the code, we prevent matches with the string\n\t * of window index 0 (in particular we have to avoid a match\n\t * of the string with itself at the start of the input file).\n\t */\n\t s.match_length = longest_match(s, hash_head);\n\t /* longest_match() sets match_start */\n\t }\n\t if (s.match_length >= MIN_MATCH$1) {\n\t // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\t\n\t /*** _tr_tally_dist(s, s.strstart - s.match_start,\n\t s.match_length - MIN_MATCH, bflush); ***/\n\t bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1);\n\t\n\t s.lookahead -= s.match_length;\n\t\n\t /* Insert new strings in the hash table only if the match length\n\t * is not too large. This saves time but degrades compression.\n\t */\n\t if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) {\n\t s.match_length--; /* string at strstart already in table */\n\t do {\n\t s.strstart++;\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t * always MIN_MATCH bytes ahead.\n\t */\n\t } while (--s.match_length !== 0);\n\t s.strstart++;\n\t } else\n\t {\n\t s.strstart += s.match_length;\n\t s.match_length = 0;\n\t s.ins_h = s.window[s.strstart];\n\t /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\t\n\t //#if MIN_MATCH != 3\n\t // Call UPDATE_HASH() MIN_MATCH-3 more times\n\t //#endif\n\t /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n\t * matter since it will be recomputed at next deflate call.\n\t */\n\t }\n\t } else {\n\t /* No match, output a literal byte */\n\t //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\t\n\t s.lookahead--;\n\t s.strstart++;\n\t }\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1);\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t return BS_BLOCK_DONE;\n\t }", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n var max_insert;\n /* Process the input block. */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n\n\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0\n /*NIL*/\n && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /*MAX_DIST(s)*/\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096\n /*TOO_FAR*/\n )) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n\n\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n\n s.strstart++;\n s.lookahead--;\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\n\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n {\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n }", "function deflate_huff(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n break;\n /* flush the current block */\n }\n }\n /* Output a literal byte */\n\n\n s.match_length = 0; //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n var max_insert;\n /* Process the input block. */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n\n\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0\n /*NIL*/\n && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /*MAX_DIST(s)*/\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096\n /*TOO_FAR*/\n )) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n\n\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n\n s.strstart++;\n s.lookahead--;\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\n\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}" ]
[ "0.67539406", "0.6724569", "0.637843", "0.63653594", "0.6295601", "0.6234702", "0.6223958", "0.6153701", "0.6106422", "0.6075691", "0.603571", "0.6007223", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.600191", "0.5995826", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5990683", "0.5982333", "0.5976037", "0.59624696", "0.59530234", "0.5951442", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552", "0.5945552" ]
0.0
-1
=========================================================================== Initialize the "longest match" routines for a new zlib stream
function lm_init(s) { s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ s.max_lazy_match = configuration_table[s.level].max_lazy; s.good_match = configuration_table[s.level].good_length; s.nice_match = configuration_table[s.level].nice_length; s.max_chain_length = configuration_table[s.level].max_chain; s.strstart = 0; s.block_start = 0; s.lookahead = 0; s.insert = 0; s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longest_match(s,cur_match){var chain_length=s.max_chain_length;/* max hash chain length */var scan=s.strstart;/* current string */var match;/* matched string */var len;/* length of current match */var best_len=s.prev_length;/* best match length so far */var nice_match=s.nice_match;/* stop if match long enough */var limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0/*NIL*/;var _win=s.window;// shortcut\n var wmask=s.w_mask;var prev=s.prev;/* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */var strend=s.strstart+MAX_MATCH;var scan_end1=_win[scan+best_len-1];var scan_end=_win[scan+best_len];/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */ // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n /* Do not waste too much time if we already have a good match: */if(s.prev_length>=s.good_match){chain_length>>=2;}/* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */if(nice_match>s.lookahead){nice_match=s.lookahead;}// Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n do{// Assert(cur_match < s->strstart, \"no future\");\n match=cur_match;/* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */if(_win[match+best_len]!==scan_end||_win[match+best_len-1]!==scan_end1||_win[match]!==_win[scan]||_win[++match]!==_win[scan+1]){continue;}/* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */scan+=2;match++;// Assert(*scan == *match, \"match[2]?\");\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */do{/*jshint noempty:false*/}while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scan<strend);// Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n len=MAX_MATCH-(strend-scan);scan=strend-MAX_MATCH;if(len>best_len){s.match_start=cur_match;best_len=len;if(len>=nice_match){break;}scan_end1=_win[scan+best_len-1];scan_end=_win[scan+best_len];}}while((cur_match=prev[cur_match&wmask])>limit&&--chain_length!==0);if(best_len<=s.lookahead){return best_len;}return s.lookahead;}", "function deflate_rle(s,flush){var bflush;/* set if current block must be flushed */var prev;/* byte at distance one to match */var scan,strend;/* scan goes up to strend for length of run */var _win=s.window;for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */if(s.lookahead<=MAX_MATCH){fill_window(s);if(s.lookahead<=MAX_MATCH&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;}/* flush the current block */}/* See how many times the previous byte repeats */s.match_length=0;if(s.lookahead>=MIN_MATCH&&s.strstart>0){scan=s.strstart-1;prev=_win[scan];if(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do{/*jshint noempty:false*/}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scan<strend);s.match_length=MAX_MATCH-(strend-scan);if(s.match_length>s.lookahead){s.match_length=s.lookahead;}}//Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }/* Emit match if have run of MIN_MATCH or longer, else emit literal */if(s.match_length>=MIN_MATCH){//check_match(s, s.strstart, s.strstart - 1, s.match_length);\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;s.strstart+=s.match_length;s.match_length=0;}else {/* No match, output a literal byte */ //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;}if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=0;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_slow(s,flush){var hash_head;/* head of hash chain */var bflush;/* set if current block must be flushed */var max_insert;/* Process the input block. */for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;}/* flush the current block */}/* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0/*NIL*/;if(s.lookahead>=MIN_MATCH){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}/* Find the longest match, discarding those <= prev_length.\n */s.prev_length=s.match_length;s.prev_match=s.match_start;s.match_length=MIN_MATCH-1;if(hash_head!==0/*NIL*/&&s.prev_length<s.max_lazy_match&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD/*MAX_DIST(s)*/){/* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head);/* longest_match() sets match_start */if(s.match_length<=5&&(s.strategy===Z_FILTERED||s.match_length===MIN_MATCH&&s.strstart-s.match_start>4096/*TOO_FAR*/)){/* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */s.match_length=MIN_MATCH-1;}}/* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH;/* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH);/* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */s.lookahead-=s.prev_length-1;s.prev_length-=2;do{if(++s.strstart<=max_insert){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}}while(--s.prev_length!==0);s.match_available=0;s.match_length=MIN_MATCH-1;s.strstart++;if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}else if(s.match_available){/* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */ //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);if(bflush){/*** FLUSH_BLOCK_ONLY(s, 0) ***/flush_block_only(s,false);/***/}s.strstart++;s.lookahead--;if(s.strm.avail_out===0){return BS_NEED_MORE;}}else {/* There is no previous match to compare with, wait for\n * the next step to decide.\n */s.match_available=1;s.strstart++;s.lookahead--;}}//Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if(s.match_available){//Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart-1]);s.match_available=0;}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_fast(s,flush){var hash_head;/* head of the hash chain */var bflush;/* set if current block must be flushed */for(;;){/* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */if(s.lookahead<MIN_LOOKAHEAD){fill_window(s);if(s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH){return BS_NEED_MORE;}if(s.lookahead===0){break;/* flush the current block */}}/* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */hash_head=0/*NIL*/;if(s.lookahead>=MIN_MATCH){/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/}/* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */if(hash_head!==0/*NIL*/&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD){/* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */s.match_length=longest_match(s,hash_head);/* longest_match() sets match_start */}if(s.match_length>=MIN_MATCH){// check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;/* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */if(s.match_length<=s.max_lazy_match/*max_insert_length*/&&s.lookahead>=MIN_MATCH){s.match_length--;/* string at strstart already in table */do{s.strstart++;/*** INSERT_STRING(s, s.strstart, hash_head); ***/s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask;hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h];s.head[s.ins_h]=s.strstart;/***/ /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */}while(--s.match_length!==0);s.strstart++;}else {s.strstart+=s.match_length;s.match_length=0;s.ins_h=s.window[s.strstart];/* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+1])&s.hash_mask;//#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */}}else {/* No match, output a literal byte */ //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;}if(bflush){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}}s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1;if(flush===Z_FINISH){/*** FLUSH_BLOCK(s, 1); ***/flush_block_only(s,true);if(s.strm.avail_out===0){return BS_FINISH_STARTED;}/***/return BS_FINISH_DONE;}if(s.last_lit){/*** FLUSH_BLOCK(s, 0); ***/flush_block_only(s,false);if(s.strm.avail_out===0){return BS_NEED_MORE;}/***/}return BS_BLOCK_DONE;}", "function deflate_fast(flush) {\n\t\t // short hash_head = 0; // head of the hash chain\n\t\t var hash_head = 0; // head of the hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n \n \n\t\t\tif (hash_head !== 0 && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n\t\t\t}\n \n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t // check_match(strstart, match_start, match_length);\n\t\t\t bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t lookahead -= match_length; // Insert new strings in the hash table only if the match length\n\t\t\t // is not too large. This saves time but degrades compression.\n \n\t\t\t if (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\tmatch_length--; // string at strstart already in hash table\n \n\t\t\t\tdo {\n\t\t\t\t strstart++;\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart; // strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t // always MIN_MATCH bytes ahead.\n\t\t\t\t} while (--match_length !== 0);\n \n\t\t\t\tstrstart++;\n\t\t\t } else {\n\t\t\t\tstrstart += match_length;\n\t\t\t\tmatch_length = 0;\n\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\tins_h = (ins_h << hash_shift ^ window[strstart + 1] & 0xff) & hash_mask; // If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t// not\n\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t }\n\t\t\t} else {\n\t\t\t // No match, output a literal byte\n\t\t\t bflush = _tr_tally(0, window[strstart] & 0xff);\n\t\t\t lookahead--;\n\t\t\t strstart++;\n\t\t\t}\n \n\t\t\tif (bflush) {\n\t\t\t flush_block_only(false);\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t}\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t} // Same as above, but achieves better compression. We use a lazy", "function deflate_slow(flush) {\n\t\t // short hash_head = 0; // head of hash chain\n\t\t var hash_head = 0; // head of hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t var max_insert; // Process the input block.\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n \n \n\t\t\tprev_length = match_length;\n\t\t\tprev_match = match_start;\n\t\t\tmatch_length = MIN_MATCH - 1;\n \n\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n \n\t\t\t if (match_length <= 5 && (strategy == Z_FILTERED || match_length == MIN_MATCH && strstart - match_start > 4096)) {\n\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t }\n\t\t\t} // If there was a match at the previous step and the current\n\t\t\t// match is not better, output the previous match:\n \n \n\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t max_insert = strstart + lookahead - MIN_MATCH; // Do not insert strings in hash table beyond this.\n\t\t\t // check_match(strstart-1, prev_match, prev_length);\n \n\t\t\t bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); // Insert in hash table all strings up to the end of the match.\n\t\t\t // strstart-1 and strstart are already inserted. If there is not\n\t\t\t // enough lookahead, the last two strings are not inserted in\n\t\t\t // the hash table.\n \n\t\t\t lookahead -= prev_length - 1;\n\t\t\t prev_length -= 2;\n \n\t\t\t do {\n\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart;\n\t\t\t\t}\n\t\t\t } while (--prev_length !== 0);\n \n\t\t\t match_available = 0;\n\t\t\t match_length = MIN_MATCH - 1;\n\t\t\t strstart++;\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0) return NeedMore;\n\t\t\t }\n\t\t\t} else if (match_available !== 0) {\n\t\t\t // If there was no match at the previous position, output a\n\t\t\t // single literal. If there was a match but the current match\n\t\t\t // is longer, truncate the previous match to a single literal.\n\t\t\t bflush = _tr_tally(0, window[strstart - 1] & 0xff);\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t }\n \n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t} else {\n\t\t\t // There is no previous match to compare with, wait for\n\t\t\t // the next step to decide.\n\t\t\t match_available = 1;\n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t}\n\t\t }\n \n\t\t if (match_available !== 0) {\n\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\tmatch_available = 0;\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "function deflate_fast(s, flush) {\n\t var hash_head; /* head of the hash chain */\n\t var bflush; /* set if current block must be flushed */\n\t\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the next match, plus MIN_MATCH bytes to insert the\n\t * string following the next match.\n\t */\n\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t fill_window(s);\n\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) {\n\t break; /* flush the current block */\n\t }\n\t }\n\t\n\t /* Insert the string window[strstart .. strstart+2] in the\n\t * dictionary, and set hash_head to the head of the hash chain:\n\t */\n\t hash_head = 0/*NIL*/;\n\t if (s.lookahead >= MIN_MATCH$1) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t\n\t /* Find the longest match, discarding those <= prev_length.\n\t * At this point we have always match_length < MIN_MATCH\n\t */\n\t if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n\t /* To simplify the code, we prevent matches with the string\n\t * of window index 0 (in particular we have to avoid a match\n\t * of the string with itself at the start of the input file).\n\t */\n\t s.match_length = longest_match(s, hash_head);\n\t /* longest_match() sets match_start */\n\t }\n\t if (s.match_length >= MIN_MATCH$1) {\n\t // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\t\n\t /*** _tr_tally_dist(s, s.strstart - s.match_start,\n\t s.match_length - MIN_MATCH, bflush); ***/\n\t bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1);\n\t\n\t s.lookahead -= s.match_length;\n\t\n\t /* Insert new strings in the hash table only if the match length\n\t * is not too large. This saves time but degrades compression.\n\t */\n\t if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) {\n\t s.match_length--; /* string at strstart already in table */\n\t do {\n\t s.strstart++;\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t * always MIN_MATCH bytes ahead.\n\t */\n\t } while (--s.match_length !== 0);\n\t s.strstart++;\n\t } else\n\t {\n\t s.strstart += s.match_length;\n\t s.match_length = 0;\n\t s.ins_h = s.window[s.strstart];\n\t /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\t\n\t //#if MIN_MATCH != 3\n\t // Call UPDATE_HASH() MIN_MATCH-3 more times\n\t //#endif\n\t /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n\t * matter since it will be recomputed at next deflate call.\n\t */\n\t }\n\t } else {\n\t /* No match, output a literal byte */\n\t //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\t\n\t s.lookahead--;\n\t s.strstart++;\n\t }\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1);\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t return BS_BLOCK_DONE;\n\t }", "function $m2YO$var$deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= $m2YO$var$MAX_MATCH) {\n $m2YO$var$fill_window(s);\n\n if (s.lookahead <= $m2YO$var$MAX_MATCH && flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= $m2YO$var$MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + $m2YO$var$MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = $m2YO$var$MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= $m2YO$var$MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 1, s.match_length - $m2YO$var$MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n /***/\n\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function $m2YO$var$deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < $m2YO$var$MIN_LOOKAHEAD) {\n $m2YO$var$fill_window(s);\n\n if (s.lookahead < $m2YO$var$MIN_LOOKAHEAD && flush === $m2YO$var$Z_NO_FLUSH) {\n return $m2YO$var$BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= $m2YO$var$MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - $m2YO$var$MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = $m2YO$var$longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= $m2YO$var$MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, s.strstart - s.match_start, s.match_length - $m2YO$var$MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= $m2YO$var$MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + $m2YO$var$MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = $m2YO$var$trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < $m2YO$var$MIN_MATCH - 1 ? s.strstart : $m2YO$var$MIN_MATCH - 1;\n\n if (flush === $m2YO$var$Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n $m2YO$var$flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_FINISH_STARTED;\n }\n /***/\n\n\n return $m2YO$var$BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n $m2YO$var$flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return $m2YO$var$BS_NEED_MORE;\n }\n /***/\n\n }\n\n return $m2YO$var$BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n\n\n if (hash_head !== 0\n /*NIL*/\n && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n\n if (s.match_length <= s.max_lazy_match\n /*max_insert_length*/\n && s.lookahead >= MIN_MATCH) {\n s.match_length--;\n /* string at strstart already in table */\n\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_rle(s, flush) {\n\t var bflush; /* set if current block must be flushed */\n\t var prev; /* byte at distance one to match */\n\t var scan, strend; /* scan goes up to strend for length of run */\n\t\n\t var _win = s.window;\n\t\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the longest run, plus one for the unrolled loop.\n\t */\n\t if (s.lookahead <= MAX_MATCH$1) {\n\t fill_window(s);\n\t if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\t\n\t /* See how many times the previous byte repeats */\n\t s.match_length = 0;\n\t if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n\t scan = s.strstart - 1;\n\t prev = _win[scan];\n\t if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n\t strend = s.strstart + MAX_MATCH$1;\n\t do {\n\t /*jshint noempty:false*/\n\t } while (prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t prev === _win[++scan] && prev === _win[++scan] &&\n\t scan < strend);\n\t s.match_length = MAX_MATCH$1 - (strend - scan);\n\t if (s.match_length > s.lookahead) {\n\t s.match_length = s.lookahead;\n\t }\n\t }\n\t //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\t }\n\t\n\t /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\t if (s.match_length >= MIN_MATCH$1) {\n\t //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\t\n\t /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n\t bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH$1);\n\t\n\t s.lookahead -= s.match_length;\n\t s.strstart += s.match_length;\n\t s.match_length = 0;\n\t } else {\n\t /* No match, output a literal byte */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\t\n\t s.lookahead--;\n\t s.strstart++;\n\t }\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t }\n\t s.insert = 0;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t return BS_BLOCK_DONE;\n\t }", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n \n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n \n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n \n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n \n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n \n s.lookahead -= s.match_length;\n \n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n \n //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n \n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n }", "function deflate_fast() {\n\t\twhile (lookahead !== 0 && qhead === null) {\n\t\t\tvar flush; // set if current block must be flushed\n\n\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\tINSERT_STRING();\n\n\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n\t\t\tif (hash_head !== NIL && strstart - hash_head <= MAX_DIST) {\n\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t// longest_match() sets match_start */\n\t\t\t\tif (match_length > lookahead) {\n\t\t\t\t\tmatch_length = lookahead;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\tflush = ct_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\tif (match_length <= max_lazy_match) {\n\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\tdo {\n\t\t\t\t\t\tstrstart++;\n\t\t\t\t\t\tINSERT_STRING();\n\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t// always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH\n\t\t\t\t\t\t// these bytes are garbage, but it does not matter since\n\t\t\t\t\t\t// the next lookahead bytes will be emitted as literals.\n\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\tstrstart++;\n\t\t\t\t} else {\n\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\t\t// UPDATE_HASH(ins_h, window[strstart + 1]);\n\t\t\t\t\tins_h = ((ins_h << H_SHIFT) ^ (window[strstart + 1] & 0xff)) & HASH_MASK;\n\n\t\t\t\t//#if MIN_MATCH !== 3\n\t\t\t\t//\t\tCall UPDATE_HASH() MIN_MATCH-3 more times\n\t\t\t\t//#endif\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No match, output a literal byte */\n\t\t\t\tflush = ct_tally(0, window[strstart] & 0xff);\n\t\t\t\tlookahead--;\n\t\t\t\tstrstart++;\n\t\t\t}\n\t\t\tif (flush) {\n\t\t\t\tflush_block(0);\n\t\t\t\tblock_start = strstart;\n\t\t\t}\n\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\twhile (lookahead < MIN_LOOKAHEAD && !eofile) {\n\t\t\t\tfill_window();\n\t\t\t}\n\t\t}\n\t}", "function deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n\n var prev;\n /* byte at distance one to match */\n\n var scan, strend;\n /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* See how many times the previous byte repeats */\n\n\n s.match_length = 0;\n\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);\n\n s.match_length = MAX_MATCH - (strend - scan);\n\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n\n\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n \n var _win = s.window;\n \n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n \n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n \n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n \n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n \n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n \n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n }", "function deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n var max_insert;\n /* Process the input block. */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n\n\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0\n /*NIL*/\n && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /*MAX_DIST(s)*/\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096\n /*TOO_FAR*/\n )) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n\n\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n\n s.strstart++;\n s.lookahead--;\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\n\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function lm_init() {\n\t\tvar j;\n\n\t\t// Initialize the hash table. */\n\t\tfor (j = 0; j < HASH_SIZE; j++) {\n\t\t\t// head2(j, NIL);\n\t\t\tprev[WSIZE + j] = 0;\n\t\t}\n\t\t// prev will be initialized on the fly */\n\n\t\t// Set the default configuration parameters:\n\t\tmax_lazy_match = configuration_table[compr_level].max_lazy;\n\t\tgood_match = configuration_table[compr_level].good_length;\n\t\tif (!FULL_SEARCH) {\n\t\t\tnice_match = configuration_table[compr_level].nice_length;\n\t\t}\n\t\tmax_chain_length = configuration_table[compr_level].max_chain;\n\n\t\tstrstart = 0;\n\t\tblock_start = 0;\n\n\t\tlookahead = read_buff(window, 0, 2 * WSIZE);\n\t\tif (lookahead <= 0) {\n\t\t\teofile = true;\n\t\t\tlookahead = 0;\n\t\t\treturn;\n\t\t}\n\t\teofile = false;\n\t\t// Make sure that we always have enough lookahead. This is important\n\t\t// if input comes from a device such as a tty.\n\t\twhile (lookahead < MIN_LOOKAHEAD && !eofile) {\n\t\t\tfill_window();\n\t\t}\n\n\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but this is\n\t\t// not important since only literal bytes will be emitted.\n\t\tins_h = 0;\n\t\tfor (j = 0; j < MIN_MATCH - 1; j++) {\n\t\t\t// UPDATE_HASH(ins_h, window[j]);\n\t\t\tins_h = ((ins_h << H_SHIFT) ^ (window[j] & 0xff)) & HASH_MASK;\n\t\t}\n\t}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0 /*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0 /*NIL*/ && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match /*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n //#if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n //#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n\t var hash_head; /* head of hash chain */\n\t var bflush; /* set if current block must be flushed */\n\t\n\t var max_insert;\n\t\n\t /* Process the input block. */\n\t for (;;) {\n\t /* Make sure that we always have enough lookahead, except\n\t * at the end of the input file. We need MAX_MATCH bytes\n\t * for the next match, plus MIN_MATCH bytes to insert the\n\t * string following the next match.\n\t */\n\t if (s.lookahead < MIN_LOOKAHEAD) {\n\t fill_window(s);\n\t if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n\t return BS_NEED_MORE;\n\t }\n\t if (s.lookahead === 0) { break; } /* flush the current block */\n\t }\n\t\n\t /* Insert the string window[strstart .. strstart+2] in the\n\t * dictionary, and set hash_head to the head of the hash chain:\n\t */\n\t hash_head = 0/*NIL*/;\n\t if (s.lookahead >= MIN_MATCH$1) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t\n\t /* Find the longest match, discarding those <= prev_length.\n\t */\n\t s.prev_length = s.match_length;\n\t s.prev_match = s.match_start;\n\t s.match_length = MIN_MATCH$1 - 1;\n\t\n\t if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n\t s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n\t /* To simplify the code, we prevent matches with the string\n\t * of window index 0 (in particular we have to avoid a match\n\t * of the string with itself at the start of the input file).\n\t */\n\t s.match_length = longest_match(s, hash_head);\n\t /* longest_match() sets match_start */\n\t\n\t if (s.match_length <= 5 &&\n\t (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\t\n\t /* If prev_match is also MIN_MATCH, match_start is garbage\n\t * but we will ignore the current match anyway.\n\t */\n\t s.match_length = MIN_MATCH$1 - 1;\n\t }\n\t }\n\t /* If there was a match at the previous step and the current\n\t * match is not better, output the previous match:\n\t */\n\t if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) {\n\t max_insert = s.strstart + s.lookahead - MIN_MATCH$1;\n\t /* Do not insert strings in hash table beyond this. */\n\t\n\t //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\t\n\t /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n\t s.prev_length - MIN_MATCH, bflush);***/\n\t bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1);\n\t /* Insert in hash table all strings up to the end of the match.\n\t * strstart-1 and strstart are already inserted. If there is not\n\t * enough lookahead, the last two strings are not inserted in\n\t * the hash table.\n\t */\n\t s.lookahead -= s.prev_length - 1;\n\t s.prev_length -= 2;\n\t do {\n\t if (++s.strstart <= max_insert) {\n\t /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n\t s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n\t hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n\t s.head[s.ins_h] = s.strstart;\n\t /***/\n\t }\n\t } while (--s.prev_length !== 0);\n\t s.match_available = 0;\n\t s.match_length = MIN_MATCH$1 - 1;\n\t s.strstart++;\n\t\n\t if (bflush) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t } else if (s.match_available) {\n\t /* If there was no match at the previous position, output a\n\t * single literal. If there was a match but the current match\n\t * is longer, truncate the previous match to a single literal.\n\t */\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\t\n\t if (bflush) {\n\t /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n\t flush_block_only(s, false);\n\t /***/\n\t }\n\t s.strstart++;\n\t s.lookahead--;\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t } else {\n\t /* There is no previous match to compare with, wait for\n\t * the next step to decide.\n\t */\n\t s.match_available = 1;\n\t s.strstart++;\n\t s.lookahead--;\n\t }\n\t }\n\t //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\t if (s.match_available) {\n\t //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\t /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n\t bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\t\n\t s.match_available = 0;\n\t }\n\t s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1;\n\t if (flush === Z_FINISH) {\n\t /*** FLUSH_BLOCK(s, 1); ***/\n\t flush_block_only(s, true);\n\t if (s.strm.avail_out === 0) {\n\t return BS_FINISH_STARTED;\n\t }\n\t /***/\n\t return BS_FINISH_DONE;\n\t }\n\t if (s.last_lit) {\n\t /*** FLUSH_BLOCK(s, 0); ***/\n\t flush_block_only(s, false);\n\t if (s.strm.avail_out === 0) {\n\t return BS_NEED_MORE;\n\t }\n\t /***/\n\t }\n\t\n\t return BS_BLOCK_DONE;\n\t }", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH$1) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH$1) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH$1) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH$1) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH$1 - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n var max_insert;\n /* Process the input block. */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n\n\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0\n /*NIL*/\n && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /*MAX_DIST(s)*/\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096\n /*TOO_FAR*/\n )) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n\n\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n\n s.strstart++;\n s.lookahead--;\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\n\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n }", "function deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n\n var bflush;\n /* set if current block must be flushed */\n\n var max_insert;\n /* Process the input block. */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n\n\n hash_head = 0\n /*NIL*/\n ;\n\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n\n\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0\n /*NIL*/\n && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /*MAX_DIST(s)*/\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096\n /*TOO_FAR*/\n )) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n\n\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n\n s.strstart++;\n s.lookahead--;\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n\n\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n\n\n return BS_FINISH_DONE;\n }\n\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n }\n\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}", "function deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}" ]
[ "0.6649219", "0.6516887", "0.64467674", "0.63978803", "0.6388808", "0.6328055", "0.62111276", "0.6198129", "0.6192374", "0.6181118", "0.61744523", "0.6143312", "0.6141138", "0.61273575", "0.6118701", "0.6109118", "0.60909086", "0.609031", "0.60864216", "0.60686386", "0.60589737", "0.6058665", "0.60525453", "0.6038785", "0.60250276", "0.60250276", "0.60226035", "0.6020066", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186", "0.6016186" ]
0.0
-1
We have no pointers in JS, so keep tables separate
function fixedtables(state) { /* build fixed huffman tables if first call (may not be thread safe) */ if (virgin) { var sym; lenfix = new utils.Buf32(512); distfix = new utils.Buf32(32); /* literal/length table */ sym = 0; while (sym < 144) { state.lens[sym++] = 8; } while (sym < 256) { state.lens[sym++] = 9; } while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {bits: 9}); /* distance table */ sym = 0; while (sym < 32) { state.lens[sym++] = 5; } inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {bits: 5}); /* do this just once */ virgin = false; } state.lencode = lenfix; state.lenbits = 9; state.distcode = distfix; state.distbits = 5; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildTable(){\n\n}", "function make_table_for_external_dispatcher(id_of_table , row_class_name , state){\n let table_witch_contains_id = document.getElementById(id_of_table);\n let table_rows_with_class_name = document.getElementsByClassName(row_class_name);\n\n while (table_rows_with_class_name.length){ // delete all row of certain table\n table_rows_with_class_name[0].remove();\n }\n // generator html pre dani table\n for (let calendar = 0 ; calendar < gates.array_of_calendars.length; calendar++){\n for (let real_time = 0 ;real_time < gates.array_of_calendars[calendar].time_slots.length;real_time++){\n for (let certain_time_slot = 0; certain_time_slot < gates.array_of_calendars[calendar].time_slots[real_time].start_times.length ; certain_time_slot++) {\n // pokial je row prepared negenegrovat s rovnakim casom ak sa uz cas nachada v\n let row = table_witch_contains_id.insertRow();\n row.className = row_class_name;\n let cell1 = row.insertCell(0);\n let cell2 = row.insertCell(1);\n let cell3 = row.insertCell(2);\n let cell4 = row.insertCell(3);\n let cell5 = row.insertCell(4);\n let cell6 = row.insertCell(5);\n let cell7 = row.insertCell(6);\n let cell8 = row.insertCell(7);\n\n if (gates.array_of_calendars[calendar].time_slots[real_time].kamionists_2[certain_time_slot] !== null) {\n cell5.innerHTML = gates.array_of_calendars[calendar].time_slots[real_time].kamionists_1[certain_time_slot]\n + \"<br>\" + gates.array_of_calendars[calendar].time_slots[real_time].kamionists_2[certain_time_slot];\n } else {\n cell5.innerHTML = gates.array_of_calendars[calendar].time_slots[real_time].kamionists_1[certain_time_slot];\n }\n\n cell4.innerHTML = gates.array_of_calendars[calendar].time_slots[real_time].evcs[certain_time_slot];\n\n cell1.innerHTML = gates.array_of_calendars[calendar].time_slots[real_time].start_times[certain_time_slot].split(' ')[1];\n cell2.innerHTML = gates.array_of_calendars[calendar].time_slots[real_time].destinations[certain_time_slot];\n cell3.innerHTML = gates.array_of_calendars[calendar].time_slots[real_time].external_dispatchers[certain_time_slot];\n\n\n if (gates.array_of_calendars[calendar].time_slots[real_time].commoditys[certain_time_slot].length > 40){\n create_html_linked_text(gates.array_of_calendars[calendar].time_slots[real_time].commoditys[certain_time_slot],cell6)\n\n }else{\n cell6.innerHTML = gates.array_of_calendars[calendar].time_slots[real_time].commoditys[certain_time_slot];\n }\n\n cell7.innerHTML = gates.ids[calendar];\n\n let apply_button = document.createElement(\"BUTTON\")\n apply_button.className = \"btn btn-default bg-success only_one\";\n apply_button.onclick = function (){\n let index = gates.array_of_calendars[calendar].time_slots[real_time].ids[certain_time_slot];\n ajax_post_confirm(row,index);\n }\n apply_button.innerHTML = \"Confirm arrival\";\n cell8.className = \"td_flex_buttons\";\n cell8.appendChild(apply_button);\n }\n }\n }\n}", "function TableMapper() {\r\n}", "function userTable() { }", "function gettable()\n{\n return table;\n}", "function transactionTable() { }", "function itemTable() { }", "function tableView(container,doc) \r\n{\r\n var numRows; // assigned in click, includes header\r\n var numCols; // assigned at bottom of click\r\n var activeSingleQuery = null;\r\n var autoCompArray = [];\r\n var entryArray = [];\r\n var qps; // assigned in onBinding\r\n var kb = tabulator.kb;\r\n\r\n thisTable = this; // fixes a problem with calling this.container\r\n this.document=null;\r\n if(doc)\r\n this.document=doc;\r\n else\r\n this.document=document;\r\n \r\n // The necessary vars for a View\r\n this.name=\"Table\"; //Display name of this view.\r\n this.queryStates=[]; //All Queries currently in this view.\r\n this.container=container; //HTML DOM parent node for this view.\r\n this.container.setAttribute('ondblclick','tableDoubleClick(event)');\r\n \r\n /*****************************************************\r\n drawQuery \r\n ******************************************************/\r\n this.drawQuery = function (q)\r\n {\r\n var i, td, th, j, v;\r\n var t = thisTable.document.createElement('table');\r\n var tr = thisTable.document.createElement('tr');\r\n var nv = q.vars.length;\r\n \r\n this.onBinding = function (bindings) {\r\n var i, tr, td;\r\n //tabulator.log.info('making a row w/ bindings ' + bindings);\r\n tr = thisTable.document.createElement('tr');\r\n t.appendChild(tr);\r\n numStats = q.pat.statements.length; // Added\r\n qps = q.pat.statements;\r\n for (i=0; i<nv; i++) {\r\n var v = q.vars[i];\r\n var val = bindings[v];\r\n tabulator.log.msg('Variable '+v+'->'+val)\r\n // generate the subj and pred for each tdNode \r\n for (j = 0; j<numStats; j++) {\r\n var stat = q.pat.statements[j];\r\n // statClone = <s> <p> ?* .\r\n var statClone = new tabulator.rdf.Statement(stat.subject, stat.predicate, stat.object);\r\n if (statClone.object == v) {\r\n statClone.object = bindings[v];\r\n var sSubj = statClone.subject.toString();\r\n if (sSubj[0] == '?') { \r\n // statClone = ?* <p> <o> .\r\n statClone.subject = bindings[statClone.subject];\r\n }\r\n break;\r\n }\r\n }\r\n tabulator.log.msg('looking for statement in store to attach to node ' + statClone);\r\n var st = kb.anyStatementMatching(statClone.subject, statClone.predicate, statClone.object);\r\n if (!st) {tabulator.log.warn(\"Tableview: no statement {\"+\r\n statClone.subject+statClone.predicate+statClone.object+\"} from bindings: \"+bindings);}\r\n else if (!st.why) {tabulator.log.warn(\"Unknown provenence for {\"+st.subject+st.predicate+st.object+\"}\");}\r\n tr.appendChild(matrixTD(val, st));\r\n } //for each query var, make a row\r\n } // onBinding\r\n\r\n t.appendChild(tr);\r\n t.setAttribute('class', 'results sortable'); //needed to make sortable\r\n t.setAttribute('id', 'tabulated_data'); \r\n \r\n tabulator.Util.emptyNode(thisTable.container).appendChild(t); // See results as we go\r\n\r\n for (i=0; i<nv; i++) { // create the header\r\n v = q.vars[i];\r\n tabulator.log.debug(\"table header cell for \" + v + ': '+v.label)\r\n text = document.createTextNode(v.label)\r\n th = thisTable.document.createElement('th');\r\n th.appendChild(text);\r\n tr.appendChild(th);\r\n }\r\n \r\n kb.query(q, this.onBinding); // pulling in the results of the query\r\n activeSingleQuery = q;\r\n this.queryStates[q.id]=1;\r\n \r\n drawExport();\r\n drawAddRow();\r\n sortables_init();\r\n \r\n // table edit\r\n t.addEventListener('click', click, false);\r\n numCols = nv;\r\n \r\n // auto completion array\r\n entryArray = tabulator.lb.entry;\r\n for (i = 0; i<tabulator.lb.entry.length; i++) {\r\n autoCompArray.push(entryArray[i][0].toString());\r\n entryArray = entryArray.slice(0);\r\n }\r\n } //drawQuery\r\n\r\n function drawExport () {\r\n var form= thisTable.document.createElement('form');\r\n var but = thisTable.document.createElement('input');\r\n form.setAttribute('textAlign','right');\r\n but.setAttribute('type','button');\r\n but.setAttribute('id','exportButton');\r\n but.addEventListener('click',exportTable,true);\r\n but.setAttribute('value','Export to HTML');\r\n form.appendChild(but);\r\n thisTable.container.appendChild(form);\r\n }\r\n\r\n this.undrawQuery = function(q) {\r\n if(q===activeSingleQuery) \r\n {\r\n this.queryStates[q.id]=0;\r\n activeSingleQuery=null;\r\n tabulator.Util.emptyNode(this.container);\r\n }\r\n }\r\n\r\n this.addQuery = function(q) {\r\n this.queryStates[q.id]=0;\r\n }\r\n\r\n this.removeQuery = function (q) {\r\n this.undrawQuery(q);\r\n delete this.queryStates[q.id];\r\n return;\r\n }\r\n\r\n this.clearView = function () {\r\n this.undrawQuery(activeSingleQuery);\r\n activeSingleQuery=null;\r\n tabulator.Util.emptyNode(this.container);\r\n }\r\n \r\n /*****************************************************\r\n Table Editing\r\n ******************************************************/\r\n var selTD;\r\n var inputObj;\r\n var sparqlUpdate;\r\n \r\n function clearSelected(node) {\r\n if (!node) {return;}\r\n var a = document.getElementById('focus');\r\n if (a != null) { a.parentNode.removeChild(a); };\r\n var t = document.getElementById('tabulated_data');\r\n t.removeEventListener('keypress', keyHandler, false);\r\n node.style.backgroundColor = 'white';\r\n }\r\n \r\n function clickSecond(e) {\r\n selTD.removeEventListener('click', clickSecond, false); \r\n if (e.target == selTD) {\r\n clearSelected(selTD);\r\n onEdit();\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }\r\n \r\n function setSelected(node) {\r\n if (!node) {return;}\r\n if (node.tagName != \"TD\") {return;}\r\n var a = document.createElement('a');\r\n a.setAttribute('id', 'focus');\r\n node.appendChild(a);\r\n a.focus();\r\n var t = document.getElementById('tabulated_data');\r\n t.addEventListener('keypress', keyHandler, false);\r\n node.style.backgroundColor = \"#8F3\";\r\n \r\n selTD = node;\r\n selTD.addEventListener('click', clickSecond, false);\r\n }\r\n \r\n function click(e) {\r\n if (selTD != null) clearSelected(selTD);\r\n var node = e.target;\r\n if (node.firstChild && node.firstChild.tagName == \"INPUT\") return;\r\n setSelected(node);\r\n var t = document.getElementById('tabulated_data');\r\n numRows = t.childNodes.length;\r\n }\r\n \r\n function getRowIndex(node) { \r\n var trNode = node.parentNode;\r\n var rowArray = trNode.parentNode.childNodes;\r\n var rowArrayLength = trNode.parentNode.childNodes.length;\r\n for (i = 1; i<rowArrayLength; i++) {\r\n if (rowArray[i].innerHTML == trNode.innerHTML) return i;\r\n }\r\n }\r\n \r\n function getTDNode(iRow, iCol) {\r\n var t = document.getElementById('tabulated_data');\r\n //return t.rows[iRow].cells[iCol]; // relies on tbody\r\n return t.childNodes[iRow].childNodes[iCol];\r\n }\r\n \r\n function keyHandler(e) {\r\n var oldRow = getRowIndex(selTD); //includes header\r\n var oldCol = selTD.cellIndex;\r\n var t = document.getElementById('tabulated_data');\r\n clearSelected(selTD);\r\n if (e.keyCode == 35) { //end\r\n addRow();\r\n }\r\n if (e.keyCode==13) { //enter\r\n onEdit();\r\n }\r\n if(e.keyCode==37) { //left\r\n newRow = oldRow;\r\n newCol = (oldCol>0)?(oldCol-1):oldCol;\r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n }\r\n if (e.keyCode==38) { //up\r\n newRow = (oldRow>1)?(oldRow-1):oldRow;\r\n newCol = oldCol;\r\n var newNode = getTDNode(newRow, newCol)\r\n setSelected(newNode);\r\n newNode.scrollIntoView(false); // ...\r\n }\r\n if (e.keyCode==39) { //right\r\n newRow = oldRow;\r\n newCol = (oldCol<numCols-1)?(oldCol+1):oldCol;\r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n }\r\n if (e.keyCode==40) { //down\r\n newRow = (oldRow<numRows-1)?(oldRow+1):oldRow;\r\n newCol = oldCol;\r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n newNode.scrollIntoView(false);\r\n }\r\n if (e.shiftKey && e.keyCode == 9) { //shift+tab\r\n newRow = oldRow;\r\n newCol = (oldCol>0)?(oldCol-1):oldCol;\r\n if (oldCol == 0) {\r\n newRow = oldRow-1;\r\n newCol = numCols-1;\r\n }\r\n if (oldRow==1) {newRow=1;}\r\n if (oldRow==1 && oldCol==0) {newRow=1; newCol = 0;}\r\n \r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n e.stopPropagation();\r\n e.preventDefault();\r\n return;\r\n }\r\n if (e.keyCode == 9) { // tab\r\n newRow = oldRow;\r\n newCol = (oldCol<numCols-1)?(oldCol+1):oldCol;\r\n if (oldCol == numCols-1) {\r\n newRow = oldRow+1;\r\n newCol = 0;\r\n }\r\n if (oldRow == numRows-1) {newRow = numRows-1;}\r\n if (oldRow == numRows-1 && oldCol == numCols-1) \r\n {newRow = numRows-1; newCol = numCols-1}\r\n \r\n var newNode = getTDNode(newRow, newCol);\r\n setSelected(newNode);\r\n }\r\n e.stopPropagation();\r\n e.preventDefault();\r\n } //keyHandler\r\n \r\n function onEdit() {\r\n if ((selTD.getAttribute('autocomp') == undefined) && \r\n (selTD.getAttribute('type') == 'sym')) {\r\n setSelected(selTD); return; \r\n }\r\n if (!selTD.editable && (selTD.getAttribute('type') == 'sym')) {return;}\r\n if (selTD.getAttribute('type') == 'bnode') {\r\n setSelected(selTD); return;\r\n }\r\n \r\n var t = document.getElementById('tabulated_data');\r\n var oldTxt = selTD.innerHTML;\r\n inputObj = document.createElement('input');\r\n inputObj.type = \"text\";\r\n inputObj.style.width = \"99%\";\r\n inputObj.value = oldTxt;\r\n \r\n // replace old text with input box\r\n if (!oldTxt)\r\n inputObj.value = ' '; // ????\r\n if (selTD.firstChild) { // selTD = <td> text </td>\r\n selTD.replaceChild(inputObj, selTD.firstChild);\r\n inputObj.select();\r\n } else { // selTD = <td />\r\n var parent = selTD.parentNode;\r\n var newTD = thisTable.document.createElement('TD');\r\n parent.replaceChild(newTD, selTD);\r\n newTD.appendChild(inputObj);\r\n }\r\n \r\n // make autocomplete input or just regular input\r\n if (selTD.getAttribute('autocomp') == 'true') {\r\n autoSuggest(inputObj, autoCompArray);\r\n }\r\n inputObj.addEventListener (\"blur\", inputObjBlur, false);\r\n inputObj.addEventListener (\"keypress\", inputObjKeyPress, false);\r\n } //onEdit\r\n \r\n function inputObjBlur(e) { \r\n // no re-editing of symbols for now\r\n document.getElementById(\"autosuggest\").style.display = 'none';\r\n newText = inputObj.value;\r\n selTD.setAttribute('about', newText);\r\n if (newText != '') {\r\n selTD.innerHTML = newText;\r\n }\r\n else {\r\n selTD.innerHTML = '---';\r\n }\r\n setSelected(selTD);\r\n e.stopPropagation();\r\n e.preventDefault();\r\n \r\n // sparql update\r\n if (!selTD.stat) {saveAddRowText(newText); return;};\r\n tabulator.log.msg('sparql update with stat: ' + selTD.stat);\r\n tabulator.log.msg('new object will be: ' + kb.literal(newText, ''));\r\n if (tabulator.isExtension) {sparqlUpdate = sparql.update_statement(selTD.stat);}\r\n else {sparqlUpdate = new sparql(kb).update_statement(selTD.stat);}\r\n // TODO: DEFINE ERROR CALLBACK\r\n //selTD.stat.object = kb.literal(newText, '');\r\n sparqlUpdate.set_object(kb.literal(newText, ''), function(uri,success,error_body) {\r\n if (success) {\r\n //kb.add(selTD.stat.subject, selTD.stat.predicate, selTD.stat.object, selTD.stat.why)\r\n tabulator.log.msg('sparql update success');\r\n var newStatement = kb.add(selTD.stat.subject, selTD.stat.predicate, kb.literal(newText, ''), selTD.stat.why);\r\n kb.remove(selTD.stat);\r\n selTD.stat = newStatement;\r\n }\r\n });\r\n }\r\n\r\n function inputObjKeyPress(e) {\r\n if (e.keyCode == 13) { //enter\r\n inputObjBlur(e);\r\n }\r\n } //***************** End Table Editing *****************//\r\n \r\n /******************************************************\r\n Add Row\r\n *******************************************************/\r\n // node type checking\r\n function literalRC (row, col) {\r\n var t = thisTable.document.getElementById('tabulated_data'); \r\n var tdNode = t.childNodes[row].childNodes[col];\r\n if (tdNode.getAttribute('type') =='lit') return true;\r\n } \r\n\r\n function bnodeRC (row, col) {\r\n var t = thisTable.document.getElementById('tabulated_data');\r\n var tdNode = t.childNodes[row].childNodes[col];\r\n if (tdNode.getAttribute('type') =='bnode') return true;\r\n }\r\n\r\n function symbolRC(row, col) {\r\n var t = thisTable.document.getElementById('tabulated_data');\r\n var tdNode = t.childNodes[row].childNodes[col];\r\n if (tdNode.getAttribute('type') == 'sym') return true;\r\n } // end note type checking\r\n \r\n // td creation for each type\r\n function createLiteralTD() {\r\n tabulator.log.msg('creating literalTD for addRow');\r\n var td = thisTable.document.createElement(\"TD\");\r\n td.setAttribute('type', 'lit');\r\n td.innerHTML = '---';\r\n return td;\r\n }\r\n \r\n function createSymbolTD() {\r\n tabulator.log.msg('creating symbolTD for addRow');\r\n var td = thisTable.document.createElement(\"TD\");\r\n td.editable=true;\r\n td.setAttribute('type', 'sym');\r\n td.setAttribute('style', 'color:#4444ff');\r\n td.innerHTML = \"---\";\r\n td.setAttribute('autocomp', 'true');\r\n return td;\r\n }\r\n\r\n function createBNodeTD() {\r\n var td = thisTable.document.createElement('TD');\r\n td.setAttribute('type', 'bnode');\r\n td.setAttribute('style', 'color:#4444ff');\r\n td.innerHTML = \"...\";\r\n bnode = kb.bnode();\r\n tabulator.log.msg('creating bnodeTD for addRow: ' + bnode.toNT());\r\n td.setAttribute('o', bnode.toNT());\r\n return td;\r\n } //end td creation\r\n \r\n function drawAddRow () {\r\n var form = thisTable.document.createElement('form');\r\n var but = thisTable.document.createElement('input');\r\n form.setAttribute('textAlign','right');\r\n but.setAttribute('type','button');\r\n but.setAttribute('id','addRowButton');\r\n but.addEventListener('click',addRow,true);\r\n but.setAttribute('value','+');\r\n form.appendChild(but);\r\n thisTable.container.appendChild(form);\r\n }\r\n \r\n // use kb.sym for symbols\r\n // use kb.bnode for blank nodes\r\n // use kb.literal for literal nodes \r\n function addRow () {\r\n var td; var tr = thisTable.document.createElement('tr');\r\n var t = thisTable.document.getElementById('tabulated_data');\r\n // create the td nodes for the new row\r\n // for each td node add the object variable like ?v0\r\n for (var i=0; i<numCols; i++) {\r\n if (symbolRC (1, i)) {\r\n td = createSymbolTD();\r\n td.v = qps[i].object;\r\n tabulator.log.msg('FOR COLUMN '+i+' v IS '+td.v);\r\n }\r\n else if (literalRC(1, i)) {\r\n td = createLiteralTD(); \r\n td.v = qps[i].object\r\n tabulator.log.msg('FOR COLUMN '+i+' v IS '+td.v);\r\n }\r\n else if (bnodeRC(1, i)) {\r\n td = createBNodeTD();\r\n td.v = qps[i].object\r\n tabulator.log.msg('FOR COLUMN '+i+' v IS '+td.v);\r\n }\r\n else {tabulator.log.warn('addRow problem')} \r\n tr.appendChild(td);\r\n }\r\n t.appendChild(tr);\r\n // highlight the td in the first column of the new row\r\n numRows = t.childNodes.length;\r\n clearSelected(selTD);\r\n newRow = numRows-1;\r\n newCol = 0;\r\n selTD = getTDNode(newRow, newCol); // first td of the row\r\n setSelected(selTD);\r\n // clone the qps array and attach a pointer to the clone on the first td of the row\r\n tabulator.log.msg('CREATING A CLONE OF QPS: ' + qps);\r\n var qpsClone = [];\r\n for (var i = 0; i<qps.length; i++) {\r\n var stat = qps[i];\r\n var newStat = new tabulator.rdf.Statement(stat.subject, stat.predicate, stat.object, stat.why);\r\n qpsClone[i] = newStat;\r\n }\r\n selTD.qpsClone = qpsClone; // remember that right now selTD is the first td of the row, qpsClone is not a 100% clone\r\n } //addRow\r\n \r\n function saveAddRowText(newText) {\r\n var td = selTD; // need to use this in case the user switches to a new TD in the middle of the autosuggest process\r\n td.editable=false;\r\n var type = td.getAttribute('type');\r\n // get the qps which is stored on the first cell of the row\r\n var qpsc = getTDNode(getRowIndex(td), 0).qpsClone;\r\n var row = getRowIndex(td);\r\n \r\n function validate() { // make sure the user has made a selection\r\n for (var i = 0; i<autoCompArray.length; i++) {\r\n if (newText == autoCompArray[i]) {\r\n return true;\r\n } \r\n }\r\n return false;\r\n }\r\n if (validate() == false && type == 'sym') {\r\n alert('Please make a selection');\r\n td.innerHTML = '---'; clearSelected(td); setSelected(selTD);\r\n return;\r\n }\r\n \r\n function getMatchingSym(text) {\r\n for (var i=0; i<autoCompArray.length; i++) {\r\n if (newText==autoCompArray[i]) {\r\n return entryArray[i][1];\r\n }\r\n }\r\n tabulator.log.warn('no matching sym');\r\n }\r\n \r\n var rowNum = getRowIndex(td);\r\n // fill in the query pattern based on the newText\r\n for (var i = 0; i<numCols; i++) {\r\n tabulator.log.msg('FILLING IN VARIABLE: ' + td.v);\r\n tabulator.log.msg('CURRENT STATEMENT IS: ' + qpsc[i]);\r\n if (qpsc[i].subject === td.v) { // subj is a variable\r\n if (type == 'sym') {qpsc[i].subject = getMatchingSym(newText);}\r\n if (type == 'lit') {qpsc[i].subject = kb.literal(newText, '');}\r\n if (type == 'bnode') {qpsc[i].subject = kb.bnode();}\r\n tabulator.log.msg('NEW QPSC IS: ' + qpsc);\r\n }\r\n if (qpsc[i].object === td.v) { // obj is a variable\r\n // TODO: DOUBLE QUERY PROBLEM IS PROBABLY HERE\r\n if (type == 'sym') {qpsc[i].object = getMatchingSym(newText);}\r\n if (type == 'lit') {qpsc[i].object = kb.literal(newText, '');}\r\n if (type == 'bnode') {qpsc[i].object = kb.bnode();}\r\n tabulator.log.msg('NEW QPSC IS: ' + qpsc);\r\n }\r\n }\r\n \r\n // check if all the variables in the query pattern have been filled out\r\n var qpscComplete = true; \r\n for (var i = 0; i<numCols; i++) {\r\n if (qpsc[i].subject.toString()[0]=='?') {qpscComplete = false;}\r\n if (qpsc[i].object.toString()[0]=='?') {qpscComplete = false;}\r\n }\r\n \r\n // if all the variables in the query pattern have been filled out, then attach stat pointers to each node, add the stat to the store, and perform the sparql update\r\n if (qpscComplete == true) {\r\n tabulator.log.msg('qpsc has been filled out: ' + qpsc);\r\n for (var i = 0; i<numCols; i++) {\r\n tabulator.log.msg('looking for statement in store: ' + qpsc[i]);\r\n var st = kb.anyStatementMatching(qpsc[i].subject, qpsc[i].predicate, qpsc[i].object); // existing statement for symbols\r\n if (!st) { // brand new statement for literals\r\n tabulator.log.msg('statement not found, making new statement');\r\n var why = qpsc[0].subject;\r\n st = new tabulator.rdf.Statement(qpsc[i].subject, qpsc[i].predicate, qpsc[i].object, why);\r\n //kb.add(st.subject, st.predicate, st.object, st.why);\r\n }\r\n var td = getTDNode(row, i);\r\n td.stat = st; \r\n \r\n // sparql update; for each cell in the completed row, send the value of the stat pointer\r\n tabulator.log.msg('sparql update with stat: ' + td.stat);\r\n if (tabulator.isExtension) {sparqlUpdate = sparql}\r\n else {sparqlUpdate = new sparql(kb)}\r\n // TODO: DEFINE ERROR CALLBACK\r\n sparqlUpdate.insert_statement(td.stat, function(uri,success,error_body) {\r\n if (success) {\r\n tabulator.log.msg('sparql update success');\r\n var newStatement = kb.add(td.stat.subject, td.stat.predicate, td.stat.object, td.stat.why);\r\n td.stat = newStatement;\r\n tabulator.log.msg('sparql update with '+newStatement);\r\n } \r\n });\r\n }\r\n }\r\n } // saveAddRowText\r\n\r\n /******************************************************\r\n Autosuggest box\r\n *******************************************************/\r\n // mostly copied from http://gadgetopia.com/post/3773\r\n function autoSuggest(elem, suggestions)\r\n {\r\n //Arrow to store a subset of eligible suggestions that match the user's input\r\n var eligible = new Array();\r\n //A pointer to the index of the highlighted eligible item. -1 means nothing highlighted.\r\n var highlighted = -1;\r\n //A div to use to create the dropdown.\r\n var div = document.getElementById(\"autosuggest\");\r\n //Do you want to remember what keycode means what? Me neither.\r\n var TAB = 9;\r\n var ESC = 27;\r\n var KEYUP = 38;\r\n var KEYDN = 40;\r\n var ENTER = 13;\r\n\r\n /********************************************************\r\n onkeyup event handler for the input elem.\r\n Enter key = use the highlighted suggestion, if there is one.\r\n Esc key = get rid of the autosuggest dropdown\r\n Up/down arrows = Move the highlight up and down in the suggestions.\r\n ********************************************************/\r\n elem.onkeyup = function(ev)\r\n {\r\n var key = getKeyCode(ev);\r\n\r\n switch(key)\r\n {\r\n case ENTER:\r\n useSuggestion();\r\n hideDiv();\r\n break;\r\n\r\n case ESC:\r\n hideDiv();\r\n break;\r\n\r\n case KEYUP:\r\n if (highlighted > 0)\r\n {\r\n highlighted--;\r\n }\r\n changeHighlight(key);\r\n break;\r\n\r\n case KEYDN:\r\n if (highlighted < (eligible.length - 1))\r\n {\r\n highlighted++;\r\n }\r\n changeHighlight(key);\r\n \r\n case 16: break;\r\n\r\n default:\r\n if (elem.value.length > 0) {\r\n getEligible();\r\n createDiv();\r\n positionDiv();\r\n showDiv();\r\n }\r\n else {\r\n hideDiv();\r\n }\r\n }\r\n };\r\n\r\n /********************************************************\r\n Insert the highlighted suggestion into the input box, and \r\n remove the suggestion dropdown.\r\n ********************************************************/\r\n useSuggestion = function() \r\n { // This is where I can move the onblur stuff\r\n if (highlighted > -1) {\r\n elem.value = eligible[highlighted];\r\n hideDiv();\r\n \r\n setTimeout(\"document.getElementById('\" + elem.id + \"').focus()\",0);\r\n }\r\n };\r\n\r\n /********************************************************\r\n Display the dropdown. Pretty straightforward.\r\n ********************************************************/\r\n showDiv = function()\r\n {\r\n div.style.display = 'block';\r\n };\r\n\r\n /********************************************************\r\n Hide the dropdown and clear any highlight.\r\n ********************************************************/\r\n hideDiv = function()\r\n {\r\n div.style.display = 'none';\r\n highlighted = -1;\r\n };\r\n\r\n /********************************************************\r\n Modify the HTML in the dropdown to move the highlight.\r\n ********************************************************/\r\n changeHighlight = function()\r\n {\r\n var lis = div.getElementsByTagName('LI');\r\n for (i in lis) {\r\n var li = lis[i];\r\n if (highlighted == i) {\r\n li.className = \"selected\";\r\n elem.value = li.firstChild.innerHTML;\r\n }\r\n else {\r\n if (!li) return; // fixes a bug involving \"li has no properties\"\r\n li.className = \"\";\r\n }\r\n }\r\n };\r\n\r\n /********************************************************\r\n Position the dropdown div below the input text field.\r\n ********************************************************/\r\n positionDiv = function()\r\n {\r\n var el = elem;\r\n var x = 0;\r\n var y = el.offsetHeight;\r\n\r\n //Walk up the DOM and add up all of the offset positions.\r\n while (el.offsetParent && el.tagName.toUpperCase() != 'BODY') {\r\n x += el.offsetLeft;\r\n y += el.offsetTop;\r\n el = el.offsetParent;\r\n }\r\n\r\n x += el.offsetLeft;\r\n y += el.offsetTop;\r\n\r\n div.style.left = x + 'px';\r\n div.style.top = y + 'px';\r\n };\r\n\r\n /********************************************************\r\n Build the HTML for the dropdown div\r\n ********************************************************/\r\n createDiv = function()\r\n {\r\n var ul = document.createElement('ul');\r\n\r\n //Create an array of LI's for the words.\r\n for (i in eligible) {\r\n var word = eligible[i];\r\n\r\n var li = document.createElement('li');\r\n var a = document.createElement('a');\r\n a.href=\"javascript:false\";\r\n a.innerHTML = word;\r\n li.appendChild(a);\r\n\r\n if (highlighted == i) {\r\n li.className = \"selected\";\r\n }\r\n\r\n ul.appendChild(li);\r\n }\r\n\r\n div.replaceChild(ul,div.childNodes[0]);\r\n\r\n /********************************************************\r\n mouseover handler for the dropdown ul\r\n move the highlighted suggestion with the mouse\r\n ********************************************************/\r\n ul.onmouseover = function(ev)\r\n {\r\n //Walk up from target until you find the LI.\r\n var target = getEventSource(ev);\r\n while (target.parentNode && target.tagName.toUpperCase() != 'LI')\r\n {\r\n target = target.parentNode;\r\n }\r\n \r\n var lis = div.getElementsByTagName('LI');\r\n \r\n\r\n for (i in lis)\r\n {\r\n var li = lis[i];\r\n if(li == target)\r\n {\r\n highlighted = i;\r\n break;\r\n }\r\n }\r\n changeHighlight();\r\n \r\n };\r\n\r\n /********************************************************\r\n click handler for the dropdown ul\r\n insert the clicked suggestion into the input\r\n ********************************************************/\r\n ul.onclick = function(ev)\r\n {\r\n \r\n useSuggestion();\r\n hideDiv();\r\n cancelEvent(ev);\r\n return false;\r\n };\r\n div.className=\"suggestion_list\";\r\n div.style.position = 'absolute';\r\n }; // createDiv\r\n\r\n /********************************************************\r\n determine which of the suggestions matches the input\r\n ********************************************************/\r\n getEligible = function()\r\n {\r\n eligible = new Array();\r\n for (i in suggestions) \r\n {\r\n var suggestion = suggestions[i];\r\n \r\n if(suggestion.toLowerCase().indexOf(elem.value.toLowerCase()) == \"0\")\r\n {\r\n eligible[eligible.length]=suggestion;\r\n }\r\n }\r\n };\r\n \r\n getKeyCode = function(ev) {\r\n if(ev) { return ev.keyCode;}\r\n };\r\n\r\n getEventSource = function(ev) {\r\n if(ev) { return ev.target; }\r\n };\r\n\r\n cancelEvent = function(ev) {\r\n if(ev) { ev.preventDefault(); ev.stopPropagation(); }\r\n }\r\n } // autosuggest\r\n \r\n //document.write('<div id=\"autosuggest\"><ul></ul></div>');\r\n var div = document.createElement('div');\r\n div.setAttribute('id','autosuggest');\r\n document.body.appendChild(div);\r\n div.appendChild(document.createElement('ul'));\r\n} // tableView", "function customTableFromArray(tbl, map) {\r\n var rows = map.length;\r\n var rowCount = 0\r\n var columns = map[0].length;\r\n var cell;\r\n\r\n\r\n for(var r=rows - 1;r>=0;r--) { \r\n var x=document.getElementById(tbl).insertRow(rowCount);\r\n for(var c=0;c<parseInt(columns,10);c++) {\r\n cell = map[r][c];\r\n \r\n var y= x.insertCell(c); \r\n $(y).attr(\"data-row\", (rows - rowCount - 1));\r\n $(y).attr(\"data-col\", c);\r\n $(y).attr(\"data-djsteps\", cell.djSteps);\r\n //$(y).text(cell.djSteps);\r\n\r\n if(cell.onPath) {$(y).attr(\"class\", \"onpath\");}\r\n\r\n //\r\n if(cell.borderTop) {y.style.borderTop = \"1px solid black\";};\r\n if(cell.borderRight) {y.style.borderRight = \"1px solid black\";};\r\n if(cell.borderBottom) {y.style.borderBottom = \"1px solid black\";};\r\n if(cell.borderLeft) {y.style.borderLeft = \"1px solid black\";};\r\n\r\n if(cell.entrance) {\r\n $(y).attr(\"id\", \"entrance\");\r\n }else if(cell.exit) {\r\n $(y).attr(\"id\", \"exit\");\r\n };\r\n \r\n //debugger;\r\n };\r\n rowCount += 1;\r\n };\r\n}", "function createTable() {\r\n $tbody.innerHTML = \"\";\r\n \r\n var sighting, sightingKeys;\r\n var dom;\r\n var columnValue;\r\n \r\n for (var i = 0; i < ufoData.length; i++) {\r\n sighting = ufoData[i];\r\n sightingKeys = Object.keys(sighting);\r\n\t\r\n $dom = $tbody.insertRow(i);\r\n\t/* insert the column values: 0=date, 1=city, 2=state, 3=country, 4=shape, 5=duration, 6=comments*/\t\r\n for (var j = 0; j < sightingKeys.length; j++) {\r\n columnValue = sightingKeys[j];\r\n $dom.insertCell(j).innerText = sighting[columnValue];\r\n }\r\n }\r\n}", "function genMapTable(){\r\n\t\tif (get('tabla_mapa')) removeElement(get('tabla_mapa'));\r\n\r\n\t\tvar table = document.createElement('TABLE');\r\n\r\n\t\ttable.setAttribute(\"id\", \"tabla_mapa\");\r\n\t\ttable.setAttribute(\"sortCol\", -1);\r\n\t\ttable.setAttribute(\"class\", \"tbg\");\r\n\t\ttable.setAttribute(\"align\", \"left\");\r\n\t\ttable.setAttribute(\"cellspacing\", \"1\");\r\n\t\ttable.setAttribute(\"cellpadding\", \"2\");\r\n\t\tvar thead = document.createElement(\"THEAD\");\r\n\t\tvar tbody = document.createElement(\"TBODY\");\r\n\t\tvar fila = document.createElement('TR');\r\n\t\tfila.setAttribute('class', \"rbg\");\r\n\t\tthead.appendChild(fila);\r\n\t\ttable.appendChild(thead);\r\n//\t\tvar etiquetas_tabla = [\"JUGADOR\", \"ALIANZA\", \"ALDEA\", \"HAB\", \"COORD\", \"ACCION\"];\r\n\t\tvar etiquetas_tabla = [\"JUGADOR\", \"ALIANZA\", \"ALDEA\", \"HAB\"];\r\n\t\tfor (var i = 0; i < etiquetas_tabla.length; i++){\r\n\t\t\tvar td = elem('TD', T(etiquetas_tabla[i]));\r\n\t\t\tif (i < 4){\r\n\t\t\t\tswitch(i){\r\n\t\t\t\t\tcase 3: td.addEventListener(\"click\", sortTable('tabla_mapa', i, 'int'), 0); break;\r\n\t\t\t\t\tdefault: td.addEventListener(\"click\", sortTable('tabla_mapa', i), 0);\r\n\t\t\t\t}\r\n\t\t\t\ttd.style.cursor = \"pointer\";\r\n\t\t\t}\r\n\t\t\tfila.appendChild(td);\r\n\t\t}\r\n\t\tvar datos = 0;\r\n\t\tvar area;\r\n\t\tfor(var i = 0; i < 7; i++)\r\n\t\t\tfor(var j = 0; j < 7; j++) {\r\n\t\t\t\tarea = document.getElementById('a_'+i+'_'+j).wrappedJSObject;//.getAttribute('details');//lmc.ad[i][j];\r\n\t\t\t\tvar cellinfo=area.details;\r\n//\t\t\t\tlog(1,'cellinfo i:'+i+' j:'+j+' x: '+cellinfo.x+' y: '+cellinfo.y);\r\n\t\t\t\tif (cellinfo && cellinfo.name !=null ) {\r\n\t\t\t\t\tdatos=1;\r\n\t\t\t\t\tvar inforow = document.createElement('TR');\r\n\t\t\t\t\tvar href=area.href;\r\n\r\n\t\t\t\t\tinforow.appendChild(elem('TD', cellinfo.name));\r\n\t\t\t\t\tinforow.appendChild(elem('TD', cellinfo.ally));\r\n\t\t\t\t\tinforow.appendChild(elem('TD', '<a href=\"' + href + '\">' + cellinfo.dname + '</a>'));\r\n\t\t\t\t\tinforow.appendChild(elem('TD', cellinfo.ew));\r\n\r\n//\t\t\t\t\tinforow.appendChild(elem('TD', '<a href=\"' + href + '\">' + cellinfo.x + \", \" + cellinfo.y + '</a>'));\r\n//\t\t\t\t\tinforow.appendChild(elem('TD', '<a href=\"' + href.replace(\"karte.php?d\", \"a2b.php?z\") + '\">' + T('ATACAR') + '</a> / <a href=\"' + href.replace(\"karte.php?d\", \"build.php?z\") + '&gid=17\">' + T('COMERCIAR') + '</a>'));\r\n\t\t\t\t\ttbody.appendChild(inforow);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\ttable.appendChild(tbody);\r\n\t\tif (datos == 1) {\r\n\r\n\t\t\tif (get('tabla_mapa_div')) {\r\n\t\t\t\tvar divt = get('tabla_mapa_div');\r\n\t\t\t} else {\r\n\t\t\t\tvar divt = document.createElement('DIV');\r\n\t\t\t\tdivt.style.display = 'block';\r\n\t\t\t\tdivt.style.position = 'absolute';\r\n\t\t\t\tdivt.id = 'tabla_mapa_div';\r\n\t\t\t\tdivt.style.top = 610 + longitudPantalla() + 'px';\r\n\t\t\t\tdocument.body.appendChild(divt);\r\n\t\t\t}\r\n\r\n\t\t\tdivt.appendChild(table);\r\n\r\n\t\t\tplayerLinks();\r\n\r\n//\t\t\tvar middleblock = get('lmidall');\r\n//\t\t\t//middleblock.appendChild(document.createElement('BR'));\r\n//\t\t\tmiddleblock.appendChild(table);\r\n\t\t}\r\n\t}", "function table(json) {\n var table = json.table,\n\trows = table.length,\n\tcols = table[0].length,\n\trowlabels = json.rowlabels,\n\tcollabels = json.collabels,\n\trowperm = reorder.permutation(rows),\n\tcolperm = reorder.permutation(cols);\n\n \n}", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n const rows = domTable.rows;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n const cells = rows[rowIndex].cells;\n for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function table(){\n return note;\n }", "_setTable() {\r\n\r\n\r\n }", "function convert_device_uplink_headers_database_to_table(device_uplink,view){cov_oh5eqgm35.f[4]++;let headers_database=(cov_oh5eqgm35.s[158]++,Object.keys(device_uplink));let headers_table=(cov_oh5eqgm35.s[159]++,[]);let place_holder=(cov_oh5eqgm35.s[160]++,{});//object which will store the text and value data\nlet x;//this is just a place holder for the value returned by device_uplink_headers_database_to_table_LUT\ncov_oh5eqgm35.s[161]++;for(let i=0;i<headers_database.length;i++){cov_oh5eqgm35.s[162]++;x=device_uplink_headers_database_to_table_LUT(headers_database[i],view);cov_oh5eqgm35.s[163]++;if(x!=null){cov_oh5eqgm35.b[37][0]++;cov_oh5eqgm35.s[164]++;place_holder[\"text\"]=x;cov_oh5eqgm35.s[165]++;place_holder[\"value\"]=headers_database[i];cov_oh5eqgm35.s[166]++;headers_table.push(place_holder);cov_oh5eqgm35.s[167]++;place_holder={};}else{cov_oh5eqgm35.b[37][1]++;}}cov_oh5eqgm35.s[168]++;return headers_table;}//Takes as the input an array of lenght 1 of the device uplink data and returns the headers in the form {text: \"Table form\", value: \"database form\"};", "function newTable (head) {\n // var table = new Table();\n var table = new Table({\n head: head || [],\n chars: {\n 'mid': '',\n 'left-mid': '',\n 'mid-mid': '',\n 'right-mid': ''\n }\n })\n return table\n}", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function createVirtualTable() {\n var rows = domTable.rows;\n for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n var cells = rows[rowIndex].cells;\n for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }", "function generateTable(tablename) {\r\n let table = document.getElementById(tablename);\r\n for (let i = 0; i < items.length; i++) {\r\n let row = table.insertRow();\r\n let element = items[i];\r\n for (key in element) {\r\n let cell = row.insertCell();\r\n let text = document.createTextNode(element[key]);\r\n cell.appendChild(text);\r\n }\r\n }\r\n}", "function generateTable(tablename) {\r\n let table = document.getElementById(tablename);\r\n for (let i = 0; i < items.length; i++) {\r\n let row = table.insertRow();\r\n let element = items[i];\r\n for (key in element) {\r\n let cell = row.insertCell();\r\n let text = document.createTextNode(element[key]);\r\n cell.appendChild(text);\r\n }\r\n }\r\n}", "function changeTable2() {\n \n }", "function v3_DOMGerarTabela(){\n let table = [];\n let rows = document.querySelectorAll('tbody tr');\n var keys = document.querySelectorAll('table thead tr th');\n keys = Array.prototype.map.call( keys, function( a ){\n return a.textContent;\n })\n rows.forEach( function(r){\n let linha = new Map();\n let vars = new Map();\n Array.prototype.forEach.call( r.cells, function( d, i ){ \n let value = d.querySelector('input').value\n if( i == 0 ){\n linha.set( keys[ d.cellIndex ], value )\n }else{\n vars.set( keys[ d.cellIndex ], Number(value) )\n }\n })\n linha.set( 'Variaveis', vars );\n table.push( linha )\n })\n return table;\n }", "function Table() {\r\n}", "function getTableDataFromHtml() {\n\n }", "function MapTable() {\r\n}", "function generateTableContent(table, id, stat, cols) {\n var attrs = getRelevantAttrs(stat);\n //console.log('generating placeholder data');\n var data = generateTablePlaceholderData(cols);\n var incrementer = 0;\n //console.log('stats[]'+incrementer);\n //console.log(json[id]);\n for (var pid in json[id]['stats']) { //run through every player node\n //console.log('pid='+pid);\n var name = findOfficialName(json[id]['stats'][pid]['names']);\n //console.log('found official name');\n //console.log(name);\n data['Pilot'][incrementer] = name; //add their name to the list always\n for (var attr in json[id]['stats'][pid]) { //for every name like 'times'\n //console.log('-> '+attr);\n //see if its in attrs\n for (var i in attrs) {\n //console.log('--> '+attrs[i]);\n if (attr == attrs[i]) { //see if we want something from here\n //console.log('we want everything from ' + attr);\n for (var realcol in json[id]['stats'][pid][attr]) { //push 'all' cols\n if (isNaN(realcol)) { //as long as its not a number\n \t\t\t\t if (stat == 'Hours') { //and if its for an hours table\n //console.log(realcol);\n \t\t\t\t\tif (inHelis(realcol)) { //only include whitelisted vehicles\n \t\t\t\t\t\t//console.log('-------> ' + realcol);\n \t\t\t\t\t\tdata[realcol][incrementer] = json[id]['stats'][pid][attr][realcol]; //make it so\n \t\t\t\t\t}\n \t\t\t\t } else {\n \t\t\t\t\t data[realcol][incrementer] = json[id]['stats'][pid][attr][realcol]; //not a number, not for hours, cool with me\n \t\t\t\t }\n }\n }\n }\n }\n }\n incrementer++;\n }\n //console.log(data);\n return tableFromData(table, data, cols, stat);\n }", "function povoateTable(){\n if (all_orders != []) {\n all_orders.forEach(_order => {\n appendOrder(_order);\n });\n }\n}", "function createTable() {\n $tableBody.empty();\n // By Columns\n // if (!shiftPressed) {\n let tableRow = '<tr>';\n tableRow += '<th id=\"border-maker\" class=\"by-cols\"><table class=\"inner-table\"><tr id=\"inner-border-maker\" class=\"inner-border-col\"><th>GrDgs</th></tr>';\n for (let i=0; i < leftBettisCopy.length; i++) {\n tableRow += '<tr id=\"inner-border-maker\" class=\"inner-border-col\"><th>' + leftBettisCopy[i] + '</th></tr>';\n }\n tableRow += '</table></th>';\n for (let col=0; col < matCopy[0].length; col++) {\n tableRow += '<td index='+ col +' id=\"border-maker\" class=\"by-cols\" onclick=\"multByNegOne(this)\"><table class=\"inner-table\">';\n tableRow += '<tr id=\"inner-border-maker\" class=\"inner-border-col\"><th>' + topBettisCopy[col] + '</th></tr>';\n for (let row=0; row < matCopy.length; row++) {\n tableRow += '<tr id=\"inner-border-maker\" class=\"inner-border-col\"><td>' + matCopy[row][col] + '</td></tr>';\n }\n tableRow += '</table></td>';\n }\n tableRow += '</tr>';\n $tableBody.append(tableRow);\n if (!ctrlPressed) {\n makeSortable('x', function(oldPos, newPos) {\n updateInteralMatrixByCol(oldPos, newPos); animateSwitchCol(oldPos, newPos);\n });\n } else {\n makeScalable('x', topBettisCopy, updateInteralMatrixByColAdder);\n }\n // By Rows\n // } else {\n // let tableRow;\n // tableRow += '<tr id=\"border-maker\" class=\"by-rows\"><th><table class=\"inner-table\"><tr><th id=\"inner-border-maker\" class=\"inner-border-row\">GrDgs</th>';\n // for (let i=0; i < topBettisCopy.length; i++) {\n // tableRow += '<th id=\"inner-border-maker\" class=\"inner-border-row\">' + topBettisCopy[i] + '</th>';\n // }\n // tableRow += '</tr></table></th></tr>'\n // for (let row=0; row < matCopy.length; row++) {\n // tableRow += '<tr id=\"border-maker\" class=\"by-rows movers\" onclick=\"multByNegOne(this, 0)\"><td index=' + row + '><table class=\"inner-table\"><tr>';\n // tableRow += '<th id=\"inner-border-maker\" class=\"inner-border-row\">' + leftBettisCopy[row] + '</th>';\n // for (let col=0; col < matCopy[0].length; col++) {\n // tableRow += '<td id=\"inner-border-maker\" class=\"inner-border-row\">' + matCopy[row][col] + '</td>';\n // }\n // tableRow += '</tr></table></td></tr>';\n // }\n // $tableBody.append(tableRow);\n // if (!ctrlPressed) {\n // makeSortable('y', function(oldPos, newPos) {\n // updateInteralMatrixByRow(oldPos, newPos);\n // animateSwitchRow(oldPos, newPos);\n // });\n // } else {\n // makeScalable('y', leftBettisCopy, updateInternalMatrixByRowAdder);\n // }\n // }\n}", "function objectify(table) {\n const info = table.querySelectorAll('tr:nth-child(n+4) td');\n const message = table.querySelector('th:first-child');\n const chunks = arrayChunk(Array.from(info), rowCount);\n const collection = [];\n chunks.forEach((chunk, chunkCount) => {\n collection[chunkCount] = {};\n collection[chunkCount].message = cleanupMessage(message.innerText.replace('( ! ) ', ''));\n collection[chunkCount].filename = getFilename(message.innerText);\n collection[chunkCount].linenumber = getLinenumber(message.innerText);\n chunk.forEach((el, index) => {\n collection[chunkCount][tableHeaderMap[index]] = (tableHeaderTypeMap[index] === 'number') ? parseFloat(el.innerText) : el.innerText;\n })\n });\n return collection;\n }", "function tableInfo() {\n let tableNumbers = []\n let rows\n let columns\n\n if(type.range % 10 === 0 && type.range !== 10){\n rows = type.range/10\n columns = 9\n }else if(type.range % 5 === 0){\n rows = type.range/5\n columns = 4\n }else if(type.range === 10){\n rows = 2\n columns = 4\n }\n\n for(let i =1;i<=type.range;i++){\n tableNumbers.push(i)\n }\n\n checkTable()\n checkCurrentSelectedNumbersArray()\n tableGenerator(tableNumbers, rows, columns)\n}", "function makeTable() {\n var queryfortable = \"Select * FROM products\";\n connection.query(queryfortable, function(error, results){\n if(error) throw error;\n var tableMaker = new Table ({\n head: [\"ID\", \"Product Name\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [10,25,20,10,20]\n });\n for(var i = 0; i < results.length; i++){\n tableMaker.push(\n [results[i].item_id,\n results[i].product_name,\n results[i].department_name, \n results[i].price,\n results[i].stock_quantity]\n );\n }\n console.log(tableMaker.toString());\n firstPrompt()\n })\n }", "function localRelTab() {\n var tableCache = {};\n\n /*\n * Terminology: \n * A *Column* is a sequence of scalar values of a particular type, along with metadata\n * describing the column and how it should be rendered (such as the type of scalar values and display\n * name to use in the column header).\n * A *Column Id* uniquely identifies a particular column. A column id is also used as\n * an index into the column metadata dictionary.\n * A *Table* is a sequence of columns.\n * A *Schema* is a sequence of Column Ids and a map from Column Id to Column Metadata info.\n * A *Column Index* is an ordinal index identifying the i-th column in a Table.\n */\n function Schema( schemaData ) {\n var s = schemaData;\n\n s.columnType = function( colId ) {\n var md = s.columnMetadata[ colId ];\n\n return md.type;\n }\n\n s.displayName = function( colId ) {\n var dn = s.columnMetadata[ colId ].displayName || colId;\n\n return dn;\n }\n\n var columnIndices = {};\n for ( var i = 0; i < schemaData.columns.length; i++ ) {\n var col = schemaData.columns[ i ];\n columnIndices[ col ] = i;\n }\n\n s.columnIndices = columnIndices;\n\n s.columnIndex = function( colId ) {\n return this.columnIndices[ colId ];\n }\n\n s.compatCheck = function( sb ) {\n if( this.columns.length != sb.columns.length ) {\n throw new SchemaError( \"incompatible schema: columns length mismatch\", this, sb );\n }\n for( var i = 0; i < this.columns.length; i++ ) {\n var colId = this.columns[ i ];\n var bColId = sb.columns[ i ];\n if( colId !== bColId ) {\n throw new SchemaError( \"incompatible schema: expected '\" + colId + \"', found '\" + bColId + \"'\", this, sb );\n }\n var colType = this.columnMetadata[ colId ].type;\n var bColType = sb.columnMetadata[ bColId ].type;\n if( colType !== bColType ) {\n throw new SchemaError( \"mismatched column types for col '\" + colId + \"': \" + colType + \", \" + bColType, this, sb );\n }\n }\n // success!\n }\n\n // Construct a row map with keys being column ids: \n s.rowMapFromRow = function( rowArray ) {\n var columnIds = this.columns;\n\n var rowMap = { };\n for( var col = 0; col < rowArray.length; col++ ) {\n rowMap[ columnIds[ col ] ] = rowArray[ col ];\n }\n\n return rowMap;\n }\n\n\n return s; // for now\n }\n\n function SchemaError( message, s1, s2 ) {\n this.message = message;\n this.s1 = s1;\n this.s2 = s2;\n }\n\n SchemaError.prototype = new Error();\n\n\n function TableRep( tableData ) {\n var schema = new Schema( tableData[ 0 ] );\n var rowData = tableData[ 1 ].rowData;\n\n function getRow( i ) {\n return rowData[ i ];\n }\n\n return {\n \"schema\": schema,\n \"getRow\": getRow,\n \"rowData\": rowData\n }\n }\n\n function ensureLoaded( tableName, cbfn ) {\n // tableCache will map tableName to a Promise whose value is a TableRep\n\n var tcp = tableCache[ tableName ];\n if( !tcp ) {\n var url = \"../json/\" + tableName + \".json\"; \n\n console.log( \"ensureLoaded: table '\", tableName, \"' not in cache, loading URL.\" );\n\n // We'll use .then to construct a Promise that gives us a TableRep (not just the raw JSON) and store this\n // in the tableCache:\n\n var rawJsonPromise = fetchURL( url );\n\n tcp = rawJsonPromise.then( function( jsonData ) {\n var trep = new TableRep( jsonData );\n return trep;\n })\n\n tableCache[ tableName ] = tcp;\n } else {\n console.log( \"ensureLoaded: table '\", tableName, \"': cache hit!\" );\n }\n return tcp;\n }\n\n function tableRefImpl( tableName ) {\n return ensureLoaded( tableName );\n }\n\n // Given an input Schema and an array of columns to project, calculate permutation\n // to apply to each row to obtain the projection\n function calcProjectionPermutation( inSchema, projectCols ) {\n var perm = [];\n // ensure all columns in projectCols in schema:\n for ( var i = 0 ; i < projectCols.length; i++ ) {\n var colId = projectCols[ i ];\n if( !( inSchema.columnMetadata[ colId ] ) ) {\n var err = new Error( \"project: unknown column Id '\" + colId + \"'\" );\n throw err;\n }\n perm.push( inSchema.columnIndex( colId ) );\n }\n return perm;\n }\n\n function projectImpl( projectCols ) {\n\n // Singleton promise to calculate permutation and schema\n var psp = null;\n\n /* Use the inImpl schema and projectCols to calculate the permutation to\n * apply to each input row to produce the result of the project.\n */\n function calcState( inSchema ) {\n var perm = calcProjectionPermutation( inSchema, projectCols );\n var ns = new Schema( { columns: projectCols, columnMetadata: inSchema.columnMetadata } );\n\n return { \"schema\": ns, \"permutation\": perm };\n }\n\n function pf( subTables ) {\n var tableData = subTables[ 0 ];\n\n var ps = calcState( tableData.schema );\n function permuteOneRow( row ) {\n return d3.permute( row, ps.permutation);\n }\n var outRowData = tableData.rowData.map( permuteOneRow );\n\n return { \"schema\": ps.schema, \"rowData\": outRowData };\n }\n\n return pf;\n };\n\n /*\n * compile the given filter expression with rest to the given schema\n */\n function compileFilterExp( schema, fexp ) {\n // base expression (token) types:\n var TOK_IDENT = 0; // identifier\n var TOK_STR = 1; // string literal\n var TOK_INT = 2;\n\n var identRE = /[a-zA-Z][a-zA-Z0-9]*/;\n var strRE = /'([^']*)'/; // TODO: deal with escaped quotes\n var intRE = /[0-9]+/;\n\n function exactMatch( re, target ) {\n var res = re.exec( target );\n if ( res && (res[0].length==target.length) && res.index==0 )\n return res;\n return null;\n }\n\n function tokenize( str ) {\n var ret = undefined;\n var match;\n if( match = exactMatch( identRE, str ) ) {\n ret = { tt: TOK_IDENT, val: str }\n } else if( match = exactMatch( strRE, str ) ) {\n ret = { tt: TOK_STR, val: match[1] }\n } else if( match = exactMatch( intRE, str ) ) {\n ret = { tt: TOK_INT, val: parseInt( str ) }\n } else {\n throw new Error( \"tokenize: unrecognized token [\" + str + \"]\" );\n }\n return ret;\n }\n\n function compileAccessor( tok ) {\n var af = undefined;\n if( tok.tt == TOK_IDENT ) {\n var idx = schema.columnIndex( tok.val );\n if( typeof idx == \"undefined\" ) {\n throw new Error( \"compiling filter expression: Unknown column identifier '\" + tok.val + \"'\" );\n }\n af = function( row ) {\n return row[ idx ];\n }\n } else {\n af = function( row ) {\n return tok.val;\n }\n }\n return af;\n }\n\n var relOpFnMap = {\n \"eq\": function( l, r ) { return l==r; },\n }\n\n function compileRelOp( relop ) {\n var tlhs = tokenize( relop.lhs );\n var trhs = tokenize( relop.rhs );\n var lhsef = compileAccessor( tlhs );\n var rhsef = compileAccessor( trhs );\n var cmpFn = relOpFnMap[ relop.relOp ];\n if( !cmpFn ) {\n throw new Error( \"compileRelOp: unknown relational operator '\" + relop.op + \"'\" );\n }\n\n function rf( row ) {\n var lval = lhsef( row );\n var rval = rhsef( row );\n return cmpFn( lval, rval );\n } \n return rf;\n }\n\n function compileSimpleExp( se ) {\n if( se.type==\"RelOp\" ) {\n return compileRelOp( se );\n } else if( se.type==\"subexp\" ) {\n return compileExp( se.exp );\n } else {\n throw new Error( \"error compile simple expression \" + JSON.stringify( se ) + \": unknown expr type\");\n }\n }\n\n function compileAndExp( argExps ) {\n var argCFs = argExps.map( compileSimpleExp );\n\n function cf( row ) {\n for ( var i = 0; i < argCFs.length; i++ ) {\n var acf = argCFs[ i ];\n var ret = acf( row );\n if( !ret )\n return false;\n }\n return true;\n } \n return cf;\n }\n \n function compileOrExp( argExps ) {\n // TODO\n }\n\n function compileExp( exp ) {\n var rep = exp._getRep();\n var boolOp = rep.boolOp; // top level\n var cfn = undefined;\n if( boolOp == \"and\" )\n cfn = compileAndExp\n else\n cfn = compileOrExp;\n\n return cfn( rep.args );\n } \n\n return {\n \"evalFilterExp\": compileExp( fexp )\n };\n\n }\n\n function filterImpl( fexp ) {\n function ff( subTables ) {\n var tableData = subTables[ 0 ];\n\n var ce = compileFilterExp( tableData.schema, fexp );\n\n var outRows = [];\n for( var i = 0; i < tableData.rowData.length; i++ ) {\n var row = tableData.rowData[ i ];\n if( ce.evalFilterExp( row ) )\n outRows.push( row );\n }\n\n return { schema: tableData.schema, rowData: outRows };\n }\n\n return ff;\n };\n\n function compileSortFunc( schema, keys ) {\n function strcmp( s1, s2 ) {\n return (s1 < s2 ? -1 : ( (s1 > s2) ? 1 : 0 ));\n }\n\n function intcmp( i1, i2 ) {\n return (i2 - i1);\n }\n\n var cmpFnMap = {\n \"text\": strcmp,\n \"integer\": intcmp\n };\n\n function mkRowCompFn( valCmpFn, idx, nextFunc ) {\n function rcf( rowa, rowb ) {\n var va = rowa[idx];\n var vb = rowb[idx];\n var ret = valCmpFn( va, vb );\n return ( ret==0 ? nextFunc( rowa, rowb ) : ret );\n }\n\n return rcf;\n }\n\n var rowCmpFn = function( rowa, rowb ) {\n return 0;\n }\n\n function reverseArgs( cfn ) {\n function rf( v1, v2 ) { return cfn( v2, v1 ); }\n\n return rf;\n }\n\n\n for( var i = keys.length - 1; i >=0; i-- ) {\n var colId = keys[i][0];\n var asc = keys[i][1];\n var idx = schema.columnIndex( colId );\n\n // look up comparison func for values of specific column type (taking asc in to account):\n var colType = schema.columnType( colId );\n var valCmpFn = cmpFnMap[ colType ];\n if( !asc ) {\n valCmpFn = reverseArgs( valCmpFn );\n }\n rowCmpFn = mkRowCompFn( valCmpFn, idx, rowCmpFn );\n }\n return rowCmpFn;\n }\n\n\n function sortImpl( sortKeys ) {\n\n function sf( subTables ) {\n var tableData = subTables[ 0 ];\n\n var rsf = compileSortFunc( tableData.schema, sortKeys );\n // force a copy:\n var outRows = tableData.rowData.slice();\n outRows.sort( rsf );\n\n return { schema: tableData.schema, rowData: outRows };\n }\n return sf;\n }\n\n // A simple op is a function from a full evaluated query result { schema, rowData } -> { schema, rowData }\n // This can easily be wrapped to make it async / promise-based / caching\n function groupByImpl( cols, aggs ) {\n var aggCols = aggs; // TODO: deal with explicitly specified (non-default) aggregations!\n\n function calcSchema( inSchema ) {\n var gbCols = cols.concat( aggCols );\n var gbs = new Schema( { columns: gbCols, columnMetadata: inSchema.columnMetadata } );\n\n return gbs;\n }\n\n function fillArray(value, len) {\n var arr = [];\n for (var i = 0; i < len; i++) {\n arr.push(value);\n };\n return arr;\n }\n\n function SumAgg() {\n this.sum = 0;\n }\n\n SumAgg.prototype.mplus = function( val ) {\n if ( typeof val !== \"undefined\" )\n this.sum += val;\n\n return this;\n }\n\n SumAgg.prototype.finalize = function() {\n return this.sum;\n }\n\n function UniqAgg() {\n this.initial = true; \n this.str = null;\n }\n\n UniqAgg.prototype.mplus = function( val ) {\n if ( this.initial && val != null ) {\n // this is our first non-null value:\n this.str = val;\n this.initial = false;\n } else {\n if( this.str != val )\n this.str = null; \n }\n }\n UniqAgg.prototype.finalize = function() {\n return this.str;\n }\n\n function AvgAgg() {\n this.count = 0;\n this.sum = 0;\n }\n\n AvgAgg.prototype.mplus = function( val ) {\n if ( typeof val !== \"undefined\" ) {\n this.count++;\n this.sum += val;\n }\n return this;\n }\n AvgAgg.prototype.finalize = function() {\n if ( this.count == 0 )\n return NaN;\n return this.sum / this.count;\n }\n\n // map of constructors for agg operators:\n var aggMap = {\n \"uniq\": UniqAgg,\n \"sum\": SumAgg,\n \"avg\": AvgAgg, \n }\n\n // map from column type to default agg functions:\n var defaultAggs = {\n \"integer\": SumAgg,\n \"text\": UniqAgg\n }\n\n function gb( subTables ) {\n var tableData = subTables[ 0 ];\n\n var inSchema = tableData.schema;\n var outSchema = calcSchema( inSchema );\n\n var aggCols = aggs; // TODO: deal with explicitly specified (non-default) aggregations!\n\n var groupMap = {};\n var keyPerm = calcProjectionPermutation( inSchema, cols );\n var aggColsPerm = calcProjectionPermutation( inSchema, aggCols );\n\n // construct and return an an array of aggregation objects appropriate\n // to each agg fn and agg column passed to groupBy\n\n function mkAggAccs() {\n var aggAccs = [];\n for ( var i = 0; i < aggCols.length; i++ ) {\n // TODO: check for typeof aggs[i] == array and use specified agg\n var aggColType = inSchema.columnMetadata[ aggCols[ i ] ].type;\n var aggCtor = defaultAggs[ aggColType ];\n var accObj = new aggCtor();\n aggAccs.push( accObj );\n }\n return aggAccs;\n }\n\n\n for ( var i = 0; i < tableData.rowData.length; i++ ) {\n var inRow = tableData.rowData[ i ];\n\n var keyData = d3.permute( inRow, keyPerm );\n var aggInData = d3.permute( inRow, aggColsPerm );\n var keyStr = JSON.stringify( keyData );\n\n var groupRow = groupMap[ keyStr ];\n var aggAccs = undefined;\n if ( !groupRow ) {\n aggAccs = mkAggAccs();\n // make an entry in our map:\n groupRow = keyData.concat( aggAccs );\n groupMap[ keyStr ] = groupRow; \n }\n for ( var j = keyData.length; j < groupRow.length; j++ ) {\n var acc = groupRow[ j ];\n acc.mplus( aggInData[ j - keyData.length ] );\n }\n } \n\n // finalize!\n var rowData = [];\n for ( keyStr in groupMap ) {\n if ( groupMap.hasOwnProperty( keyStr ) ) {\n groupRow = groupMap[ keyStr ];\n keyData = groupRow.slice( 0, cols.length );\n for ( var j = keyData.length; j < groupRow.length; j++ ) {\n groupRow[ j ] = groupRow[ j ].finalize(); \n }\n rowData.push( groupRow );\n }\n }\n return { schema: outSchema, rowData: rowData };\n }\n\n return gb;\n }\n\n /*\n * map the display name or type of columns.\n * TODO: perhaps split this into different functions since most operations are only schema transformations,\n * but type mapping will involve touching all input data.\n */\n function mapColumnsImpl( cmap ) {\n // TODO: check that all columns are columns of original schema,\n // and that applying cmap will not violate any invariants on Schema....but need to nail down\n // exactly what those invariants are first!\n\n function mc( subTables ) {\n var tableData = subTables[ 0 ];\n var inSchema = tableData.schema;\n\n var outColumns = [];\n var outMetadata = {};\n for ( var i = 0; i < inSchema.columns.length; i++ ) {\n var inColumnId = inSchema.columns[ i ];\n var inColumnInfo = inSchema.columnMetadata[ inColumnId ];\n var cmapColumnInfo = cmap[ inColumnId ];\n if( typeof cmapColumnInfo == \"undefined\" ) {\n outColumns.push( inColumnId );\n outMetadata[ inColumnId ] = inColumnInfo;\n } else {\n var outColumnId = cmapColumnInfo.id;\n if( typeof outColumnId == \"undefined\" ) {\n outColId = inColId;\n }\n\n // Form outColumnfInfo from inColumnInfo and all non-id keys in cmapColumnInfo:\n var outColumnInfo = JSON.parse( JSON.stringify( inColumnInfo ) );\n for( var key in cmapColumnInfo ) {\n if( key!='id' && cmapColumnInfo.hasOwnProperty( key ) )\n outColumnInfo[ key ] = cmapColumnInfo[ key ];\n }\n outMetadata[ outColumnId ] = outColumnInfo;\n outColumns.push( outColumnId );\n }\n }\n var outSchema = new Schema( { columns: outColumns, columnMetadata: outMetadata } );\n\n // TODO: remap types as needed!\n\n return { schema: outSchema, rowData: tableData.rowData };\n }\n\n return mc;\n }\n\n function mapColumnsByIndexImpl( cmap ) {\n // TODO: try to unify with mapColumns. Probably means mapColumns will construct an argument to\n // mapColumnsByIndex and use this impl\n function mc( subTables ) {\n var tableData = subTables[ 0 ];\n var inSchema = tableData.schema;\n\n var outColumns = [];\n var outMetadata = {};\n for ( var inIndex = 0; inIndex < inSchema.columns.length; inIndex++ ) {\n var inColumnId = inSchema.columns[ inIndex ];\n var inColumnInfo = inSchema.columnMetadata[ inColumnId ];\n var cmapColumnInfo = cmap[ inIndex ];\n if( typeof cmapColumnInfo == \"undefined\" ) {\n outColumns.push( inColumnId );\n outMetadata[ inColumnId ] = inColumnInfo;\n } else {\n var outColumnId = cmapColumnInfo.id;\n if( typeof outColumnId == \"undefined\" ) {\n outColumnId = inColumnId;\n }\n\n // Form outColumnfInfo from inColumnInfo and all non-id keys in cmapColumnInfo:\n var outColumnInfo = JSON.parse( JSON.stringify( inColumnInfo ) );\n for( var key in cmapColumnInfo ) {\n if( key!='id' && cmapColumnInfo.hasOwnProperty( key ) )\n outColumnInfo[ key ] = cmapColumnInfo[ key ];\n }\n outMetadata[ outColumnId ] = outColumnInfo;\n outColumns.push( outColumnId );\n }\n }\n var outSchema = new Schema( { columns: outColumns, columnMetadata: outMetadata } );\n\n // TODO: remap types as needed!\n\n return { schema: outSchema, rowData: tableData.rowData };\n }\n\n return mc;\n }\n\n /*\n * extend a RelTab by adding a column computed from existing columns.\n */\n function extendImpl( columns, columnMetadata, columnValMap ) {\n\n /*\n * TODO: What are the semantics of doing an extend on a column that already exists? Decide and spec. it!\n */\n function ef( subTables ) {\n var tableData = subTables[ 0 ];\n var inSchema = tableData.schema;\n\n var outCols = inSchema.columns.concat( columns );\n var outMetadata = $.extend( {}, inSchema.columnMetadata, columnMetadata );\n var outSchema = new Schema( { columns: outCols, columnMetadata: outMetadata } );\n\n var extValues = [];\n for( var i = 0; i < columns.length; i++ ) {\n var colId = columns[ i ];\n var val = columnValMap && columnValMap[ colId ];\n if ( typeof val == \"undefined\" )\n val = null;\n extValues.push( val );\n }\n\n /*\n * For now we only allow extensions to depend on columns of the original\n * table. We may want to relax this to allow columns to depend on earlier\n * entries in columns[] array.\n */\n var outRows = [];\n for( var i = 0; i < tableData.rowData.length; i++ ) {\n var inRow = tableData.rowData[ i ];\n var rowMap = null; // only build on-demand\n // TODO: For performance could cons up an object with getters that use schema to just do an array index\n // For now, let's just build the row object:\n\n var outRow = inRow.slice();\n for( var j = 0; j < extValues.length; j++ ) {\n var ev = extValues[ j ];\n if( typeof( ev ) === \"function\" ) {\n if( !rowMap ) {\n rowMap = tableData.schema.rowMapFromRow( inRow );\n }\n var outVal = ev( rowMap );\n } else {\n // extending with a constant value:\n var outVal = ev;\n }\n outRow.push( outVal );\n }\n outRows.push( outRow );\n }\n\n return { schema: outSchema, rowData: outRows };\n }\n\n return ef;\n }\n\n /*\n * concat tables\n */\n function concatImpl() {\n function cf( subTables ) {\n var tbl = subTables[ 0 ];\n var res = { schema: tbl.schema, rowData: tbl.rowData };\n for ( var i = 1; i < subTables.length; i++ ) {\n tbl = subTables[ i ];\n // check schema compatibility:\n res.schema.compatCheck( tbl.schema );\n\n res.rowData = res.rowData.concat( tbl.rowData );\n }\n\n return res;\n }\n\n return cf;\n } \n\n var simpleOpImplMap = {\n \"filter\": filterImpl,\n \"project\": projectImpl,\n \"groupBy\": groupByImpl,\n \"mapColumns\": mapColumnsImpl,\n \"mapColumnsByIndex\": mapColumnsByIndexImpl,\n \"extend\": extendImpl,\n \"concat\": concatImpl,\n \"sort\": sortImpl,\n }\n\n\n /*\n * Evaluate a non-base expression from its sub-tables\n */\n function evalExpr( opRep, subTables ) {\n var opImpl = simpleOpImplMap[ opRep.operator ];\n var valArgs = opRep.valArgs.slice();\n var impFn = opImpl.apply( null, valArgs );\n var tres = impFn( subTables );\n return tres; \n } \n\n\n\n // base expressions: Do not have any sub-table arguments, and produce a promise<TableData>\n var baseOpImplMap = {\n \"table\": tableRefImpl\n };\n\n function evalBaseExpr( exp ) {\n var opImpl = baseOpImplMap[ exp.operator ];\n if ( !opImpl ) {\n throw new Error( \"evalBaseExpr: unknown primitive table operator '\" + exp.operator + \"'\" );\n }\n var args = exp.valArgs.slice();\n var opRes = opImpl.apply( null, args );\n return opRes;\n }\n\n /* evaluate the specified table value in the CSE Map.\n * Returns: promise for the result value\n */\n function evalCSEMap( cseMap, tableId ) {\n var resp = cseMap.promises[ tableId ];\n if( typeof resp == \"undefined\" ) {\n // no entry yet, make one:\n var opRep = cseMap.valExps[ tableId ];\n\n var subTables = []; // array of promises:\n\n if( opRep.tableNums.length > 0 ) {\n // dfs eval of sub-tables:\n subTables = opRep.tableNums.map( function( tid ) { return evalCSEMap( cseMap, tid ); } );\n resp = Q.all( subTables ).then( function( tvals ) { return evalExpr( opRep, tvals ); } );\n } else {\n resp = evalBaseExpr( opRep );\n }\n cseMap.promises[ tableId ] = resp;\n }\n return resp;\n }\n\n /*\n * use simple depth-first traversal and value numbering in cseMap to\n * identify common table subexpressions.\n */\n function buildCSEMap( cseMap, opRep ) {\n if( typeof opRep == \"undefined\" ) debugger;\n var tableNums = opRep.tableArgs.map( function( e ) { return buildCSEMap( cseMap, e ); } );\n var expKey = opRep.operator + \"( [ \" + tableNums.toString() + \" ], \" + JSON.stringify( opRep.valArgs ) + \" )\";\n var valNum = cseMap.invMap[ expKey ];\n if( typeof valNum == \"undefined\" ) {\n // no entry, need to add it:\n // let's use opRep as prototype, and put tableNums in the new object:\n var expRep = Object.create( opRep );\n expRep.tableNums = tableNums;\n var valNum = cseMap.valExps.length;\n cseMap.valExps[ valNum ] = expRep;\n cseMap.invMap[ expKey ] = valNum;\n } // else: cache hit! nothing to do\n\n return valNum;\n }\n\n function evalQuery( queryExp ) {\n // use value numbering to build up a map of common subexpression and then evaluate that\n var cseMap = { invMap: {}, valExps: [], promises: [] };\n var queryIdent = buildCSEMap( cseMap, queryExp._rep ); \n\n console.log( \"evalQuery after buildCSEMap: queryIdent: \", queryIdent, \", map: \", cseMap );\n\n return evalCSEMap( cseMap, queryIdent );\n }\n\n return {\n \"Schema\": Schema,\n \"evalQuery\": evalQuery, \n };\n }", "function buildTable() {\n return {\n columns: [{\n value: 'mois'\n }, {\n value: 'trimestres'\n }, {\n value: 'année'\n },{\n value: '3 ans '\n },{\n value: '5 ans'\n }],\n rows: [ {\n cells: [{\n value: 'Je vous propose '\n }, {\n value: 'de rectrutter Mahdi '\n }, {\n value: 'car cest un bon '\n }, {\n value: 'developpeur qui '\n },{\n value: 'maitrise AngularJs'\n }]\n }, {\n cells: [{\n value: 'la cellule suivante'\n }, {\n value: 'a été définie null'\n }, {\n value: null\n }, {\n value: 'car ne contient'\n }, {\n value: 'pas de contenu'\n }]\n }]\n };\n }", "function myTable() {\n connection.query('SELECT * FROM orders', (err, res) => {\n const myTable = [];\n\n res.forEach(element => {\n let newRow = {};\n newRow.id = element.id;\n newRow.name = element.name;\n newRow.price = element.price;\n newRow.stock_quantity = element.stock_quantity;\n myTable.push(newRow);\n });\n console.table(myTable);\n });\n \n start(); //moves on to the store questions\n}", "constructor() {\n\n this.table = {};\n\n this.tableSize = 0;\n }", "getData(table) {\n return this.content.data[table];\n }", "function tableState(returnrows){\r\n\tfor (i=0; i<returnrows.length; i+=3){\r\n\t\tvar table = document.getElementById(\"mytablerows\");\r\n\t\tvar row = table.insertRow(1);\r\n\t\tvar cell1 = row.insertCell(0);\r\n\t\tvar cell2 = row.insertCell(1);\r\n\t\tvar cell3 = row.insertCell(2);\r\n\t\tcell1.innerHTML = returnrows[i];\r\n\t\tcell2.innerHTML = \"$ \" + returnrows[i+1];\r\n\t\tcell3.innerHTML = \"$ \" + returnrows[i+2]; \r\n\t\t}\r\n}", "function makeTableWork() {\n appendArrays();\n \n //REMOVE ALL ROWS IN TABLE\n $(\"#main-table tbody tr\").remove();\n //////////////////////////\n \n for (let itemNum in allSongsArray) {\n addRows(itemNum);\n } \n}", "function default_table(){\n tableData.forEach((sightings) => {\n var record = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var data_value = record.append(\"td\");\n data_value.text(value);\n });\n });\n}", "function tableView() {\n\tconnection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function(err, results) {\n if (err) throw err;\n\n// table \n\tvar table = new Table({\n \thead: ['ID#', 'Item Name', 'Department', 'Price($)', 'Quantity Available'],\n \t colWidths: [10, 20, 20, 20, 20],\n \t style: {\n\t\t\t head: ['cyan'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center'],\n\t\t }\n\t});\n//Loop through the data\n\tfor(var i = 0; i < results.length; i++){\n\t\ttable.push(\n\t\t\t[results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]\n\t\t);\n\t}\n\tconsole.log(table.toString());\n\n });\n}", "function builddomtable (domtable, table, fieldpaths) {\n var faccessors = $.map(fieldpaths, function (d, i) {\n return accessor(d);\n });\n\n var domrow = domtable.append(\"tr\");\n for (var i = 0; i < fieldpaths.length; i++)\n domrow.append(\"th\").text(fieldpaths[i]);\n for (var i = 0; i < table.length; i++) {\n domrow = domtable.append(\"tr\");\n for (var j = 0; j < faccessors.length; j++)\n domrow.append(\"td\").text(faccessors[j](table[i]));\n }\n }", "function createTableBody(table) {\n // reset body containings\n let tableBody = $('#table-body');\n tableBody.html('');\n\n // displaying results\n headers = Object.keys(table[0].input).slice(2);\n let rowCount = 0;\n\n table.forEach(function(data) {\n let tr = document.createElement('tr');\n\n let indexTd = document.createElement('td');\n indexTd.innerHTML = rowCount++ + '.';\n $(tr).append(indexTd);\n\n headers.forEach(function(key) {\n let td = document.createElement('td');\n td.innerHTML = data.input[key];\n $(tr).append(td);\n });\n\n let resultTd = document.createElement('td');\n resultTd.innerHTML = data.result;\n\n $(tr).append(resultTd);\n\n tableBody.append(tr);\n });\n }", "function finishTable( table ) {\n self.util.standardizeQuad(table);\n\n var r, c,\n id = table.parentElement.id,\n tab = table.points,\n rows = parseInt( $(table.parentElement).attr('rows') ),\n cols = parseInt( $(table.parentElement).attr('columns') ),\n after = $(table.parentElement);\n\n for ( c=1; c<=cols; c++ )\n for ( r=1; r<=rows; r++ ) {\n var\n elem = $(document.createElementNS(self.util.sns,'polygon'))\n .attr('points',$(table).attr('points'))\n .addClass('Coords'),\n\n top1 = c == 1 ? Point2f(tab[0]) : Point2f(tab[1]).subtract(tab[0]).hadamard((c-1)/cols).add(tab[0]),\n top2 = c == cols ? Point2f(tab[1]) : Point2f(tab[1]).subtract(tab[0]).hadamard(c/cols) .add(tab[0]),\n bottom1 = c == 1 ? Point2f(tab[3]) : Point2f(tab[2]).subtract(tab[3]).hadamard((c-1)/cols).add(tab[3]),\n bottom2 = c == cols ? Point2f(tab[2]) : Point2f(tab[2]).subtract(tab[3]).hadamard(c/cols) .add(tab[3]),\n left1 = r == 1 ? Point2f(tab[0]) : Point2f(tab[3]).subtract(tab[0]).hadamard((r-1)/rows).add(tab[0]),\n left2 = r == rows ? Point2f(tab[3]) : Point2f(tab[3]).subtract(tab[0]).hadamard(r/rows) .add(tab[0]),\n right1 = r == 1 ? Point2f(tab[1]) : Point2f(tab[2]).subtract(tab[1]).hadamard((r-1)/rows).add(tab[1]),\n right2 = r == rows ? Point2f(tab[2]) : Point2f(tab[2]).subtract(tab[1]).hadamard(r/rows) .add(tab[1]);\n intersection( top1, bottom1, left1, right1, elem[0].points[0] );\n intersection( top2, bottom2, left1, right1, elem[0].points[1] );\n intersection( top2, bottom2, left2, right2, elem[0].points[2] );\n intersection( top1, bottom1, left2, right2, elem[0].points[3] );\n\n after = $(document.createElementNS(self.util.sns,'g'))\n .addClass('TextRegion TableCell')\n .attr('tableid',id)\n .attr('id',id+'_'+r+'_'+c)\n .append(elem)\n .insertAfter(after);\n }\n\n $(self.util.svgRoot)\n .find('.TextRegion[id^='+id+']')\n .addClass('editable')\n .each( function () {\n this.setEditing = function ( ) {\n var event = { target: this };\n self.util.setEditing( event, 'select' );\n };\n } );\n window.setTimeout( function () {\n var elem = $(self.util.svgRoot).find('.TextRegion[id^='+id+']')[0];\n elem.setEditing();\n self.util.selectElem(elem,true);\n }, 50 );\n\n self.util.registerChange('added table '+id);\n\n for ( var n=0; n<self.cfg.onFinishTable.length; n++ )\n self.cfg.onFinishTable[n](table);\n }", "function tabelizer() {\n\n var row = tbody.append(\"tr\");\n all_dict.forEach((entry) => { \n var cell = row.append(\"td\");\n cell.text(entry);\n });\n\n all_dict = []\n}", "function TableBody() {\r\n let myElem_arr = [];\r\n for (let i = 0; i < window.user_list.length; i++) {\r\n let entries_arr = [];\r\n for (let j=0; j < window.user_list[i].length; j++){\r\n entries_arr.push(\r\n <td>{window.user_list[i][j]}</td>\r\n );\r\n }\r\n myElem_arr.push(<tr>{entries_arr}</tr>);\r\n }\r\n return myElem_arr\r\n}", "function displayTable() {\n var table = getTable('tablekrakens')\n var table2 = getTable('tableautres')\n //table.push('titi')\n var t = document.getElementById('table')\n t.innerHTML = \"<tr><th>EQUIPE KRAKEN</th><th>EQUIPE APERO</th></tr>\"\n //console.log(table)\n var taille\n if (table.length > table2.length) {\n taille = table.length\n } else {\n taille = table2.length\n }\n for (var index = 0; index < taille; index++) {\n r = t.insertRow(-1)\n c1 = r.insertCell(0)\n c2 = r.insertCell(1)\n if (table[index]) {\n c1.innerHTML = table[index]\n }\n if (table2[index]) {\n c2.innerHTML = table2[index]\n }\n }\n}", "function addtable() {\n tbody.html(\"\");\n console.log(`There are ${tableDatashape.length} records in this table.`);\n console.log(\"----------\");\n tableDatashape.forEach(function(sighting) {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "function renderTable() {\n clearTable();\n showTable();\n}", "function table() {\n this.table = null;\n this.opts = {};\n this.table_id = \"\";\n}", "function getTablesForATM(){\n try{\n \n theTables = originalWindow.document.getElementsByTagName(\"table\");\n for (var x = 0; x < theTables.length; x++) {\n var headers = theTables[x].querySelectorAll(\"tbody tr th\");\n for (var y = 0; y < headers.length; y++) {\n if (headers[y].innerText == \"Affiliate Table\") {\n theRightTable = theTables[x];\n } else if (headers[y].innerText == \"Organizations Table\") {\n theRightOrgsTable = theTables[x];\n } else if (headers[y].innerText == \"Topics Table\") {\n theRightTopicsTable = theTables[x];\n }\n }\n }\n affilRows_atm = theRightTable.querySelectorAll(\"tbody tr\");\n topicRows_atm = theRightTopicsTable.querySelectorAll(\"tbody tr\");\n orgRows_atm = theRightOrgsTable.querySelectorAll(\"tbody tr\");\n } catch (err) {\n atmWindow.alert(err);\n\t atmWindow.console.log(err);\n }\n }", "function displayTable() {\n var query = connection.query(\"SELECT * FROM products\", function(err, res) {\n \n var table = new Table([\n\n head=['id','product_name','department_name','price','stock_quantity']\n ,\n\n colWidths=[6,21,25,17]\n \n ]);\n table.push(['id','product name','department name','price','stock quantity']);\n for (var i = 0; i < res.length; i++) {\n table.push(\n \n [res[i].id ,res[i].product_name,res[i].department_name,res[i].price ,res[i].stock_quantity]\n \n );\n }\n console.log(colors.bgWhite(colors.red((table.toString())))); \n });\n}", "function drawTable(){\n for (employee of allEmployees){\n newRow(employee);\n }\n}", "function generateTable(table, data)\n{\n var i = 0;\n for (let element of data) {\n let row = table.insertRow();\n for (key in element)\n {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]);\n cell.innerHTML = text.textContent;\n // console.log(cell);\n }\n }\n}", "function getTable() {\n\n if (this.object) {\n var tbody = $('#gcodelist tbody');\n\n // clear table\n $(\"#gcodelist > tbody\").html(\"\");\n\n for (let i = 0; i < this.object.userData.lines.length; i++) {\n var line = this.object.userData.lines[i];\n\n if (line.args.origtext != '') {\n tbody.append('<tr><th scope=\"row\">' + (i + 1) + '</th><td>' + line.args.origtext + '</td></tr>');\n }\n }\n\n // set tableRows to the newly generated table rows\n tableRows = $('#gcodelist tbody tr');\n }\n}", "function getTables() {\n\n var tables = {\n\n 'Clients' : {\n query: 'SELECT ClientID, Title.Description as Title, Forename, Middlename, Surname, '\n + 'AddressLine1, AddressLine2, Town, Postcode, '\n + 'HomePhone, MobilePhone, EMail, isWheelchair, isActive, DateOfBirth '\n + 'FROM (Client LEFT OUTER JOIN Title ON Client.TitleID = Title.ID)',\n DateOnlyFields: {DateOfBirth: true},\n ChoiceOnlyFields: {Gender: ['M', 'F', 'X']}\n },\n 'Destinations' : {\n query: 'SELECT * FROM Destination'\n },\n 'DestinationType' : {},\n 'Drivers' : {\n query: 'SELECT * FROM Driver',\n DateOnlyFields: {DateOfBirth: true}\n },\n 'Jobs' : {}\n };\n \n for (var sTablename in tables) {\n\n if (tables[sTablename].query == undefined) {\n\n tables[sTablename].query = 'SELECT * from ' + sTablename;\n }\n }\n\n getTables = function() {\n return tables;\n };\n\n return tables;\n}", "function populateTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n // Get current sighting object and fields\n var sighting = tableData[i];\n console.log(sighting)\n var fields = Object.keys(sighting);\n // Create new row in tbody, set index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For each field in sighting object, create new cell and set inner text to be current value at current sighting field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}", "function departmentTable() { }", "function table(r){\n r.forEach(sighting => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key,value]) => {\n var entries = row.append(\"td\").text(value);\n });\n });\n}", "function renderTable(){\n $tbody.innerHTML =\"\";\n for(var i=0; i < tableData.length; i++){\n //Get current address object and its fields\n var address = tableData[i];\n console.log(address)\n var fields = Object.keys(address);\n //Create a new rown in the tbody, set the indect to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++){\n //for every field in the address object, create a new cell\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = address[field];\n }\n }\n}", "function createTable() {\r\n var matrix = getMatrix();\r\n cleanTable();\r\n\r\n var rowsH = '<th scope=\"col\">#</th>';\r\n var rowsB = '';\r\n idElements = [];\r\n matrix.forEach((row, i) => {\r\n var idRows = [];\r\n rowsH += `<th scope=\"col\">${i}</th>`;\r\n rowsB += `<tr>\\n\r\n <th scope=\"row\">${i}</th>\\n`;\r\n row.forEach((column, j) => {\r\n rowsB += `<td><input type=\"number\" class=\"form-control w-100\" id=\"element${i}-${j}\" value=\"${column}\"></td>\\n`;\r\n idRows.push(`element${i}-${j}`);\r\n });\r\n idElements.push(idRows);\r\n rowsB += `</tr>`;\r\n });\r\n mheader.innerHTML = rowsH;\r\n mbody.innerHTML = rowsB;\r\n}", "function renderTable() {\n tbody.innerHTML = \"\";\n for (var i = 0; i < filterData.length; i++) {\n // Get the current objects and its fields. Calling each dictionary object 'ovni'. This comes from the data.js database where\n //the object dataSet holds an array (list) of dictionaries. Each dictionary is an object and I'm calling it ovni. This will\n // loop through each dictionary/object from the variable dataSet and store their keys in the variable fields. \n\n var ovni = filterData[i];\n var fields = Object.keys(ovni);\n \n // Create a new row in the tbody, set the index to be i + startingIndex\n // fields are the columns\n var row = tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell and set its inner text to be the current value at the current address's field\n // the variable field will gather the columns names. It will loop through the fields(columns). Example, fields index 0 is datetime.\n var field = fields[j];\n var cell = row.insertCell(j);\n // now i will pass to the cell the ovni object, field values.\n cell.innerText = ovni[field];\n }\n }\n}", "function getTheTable() {\n return document.getElementById(\"myTable\");\n}", "function html_table(x, y, has_header_x, has_header_y) {\n this.x = x;\n this.y = y;\n this.has_header_x = has_header_x;\n this.has_header_y = has_header_y;\n // TODO: should be 'view' or 'html'\n this._table = null;\n this.header_x = null;\n this.header_y = null;\n // becomes 'origin'\n this.header_xy = null;\n this.cells = null;\n this.generate_tables();\n}", "function ProxiedObjectTable() {\n // Name for debugging.\n this.name = 'js-ref';\n\n // Table from IDs to JS objects.\n this.map = {};\n\n // Generator for new IDs.\n this._nextId = 0;\n\n // Ports for managing communication to proxies.\n this.port = new ReceivePortSync();\n this.sendPort = this.port.toSendPort();\n }", "generateMemTable(memoryArray, table) {\n\t\tlet currentHeaderRow = table.insertRow(-1);\n\t\tlet currentValueRow = table.insertRow(-1);\n\t\tmemoryArray.forEach((value, index) => {\n\t\t\tif (index != 0 && index % 10 == 0) {\n\t\t\t\tcurrentHeaderRow = table.insertRow(-1);\n\t\t\t\tcurrentValueRow = table.insertRow(-1);\n\t\t\t}\n\t\t\tconst headerCell = currentHeaderRow.insertCell(-1);\n\t\t\tconst valueCell = currentValueRow.insertCell(-1);\n\t\t\theaderCell.innerHTML = index;\n\t\t\tvalueCell.innerHTML = value;\n\t\t\tthis.memoryCells.push(valueCell);\n\t\t})\n\t}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < sightingData.length; i++) { // Loop through the data object items\n var sighting = sightingData[i]; // Get each data item object\n var fields = Object.keys(sighting); // Get the fields in each data item\n var $row = $tbody.insertRow(i); // Insert a row in the table object\n for (var j = 0; j < fields.length; j++) { // Add a cell for each field in the data item object and populate its content\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}", "copyTable() {\n var x = this.table;\n var copied = {};\n Object.keys(x).forEach(function(key) {\n copied[key] = [];\n copied[key][0] = x[key][0].slice(0);\n copied[key][1] = x[key][1];\n copied[key][2] = x[key][2];\n });\n return copied;\n }", "function HTMLTable()\n{\n var tblElem = new XMLElement('table', { border:1 });\n\n tblElem.addRow = function (row)\n {\n var rowElem = new XMLElement('tr');\n tblElem.addChild(rowElem);\n };\n\n tblElem.addCell = function (contents, attribs)\n {\n var cellElem = new XMLElement('td', attribs);\n tblElem.children[tblElem.children.length-1].addChild(cellElem);\n\n if (contents instanceof Array)\n {\n for (var i = 0; i < contents.length; ++i)\n cellElem.addChild(contents[i]);\n }\n else\n {\n if (typeof contents === 'string')\n contents = HTMLPar(contents);\n\n cellElem.addChild(contents);\n }\n };\n\n return tblElem;\n}", "function multiplication_table() {\n var table = elem('table').addClass('point');\n var tr = multiplication_header_row();\n table.append(tr);\n for (var a=1; a<=10; a++) {\n var row = elem('tr');\n var th = elem('th').html(a).attr('data-a', a).addClass('factor');\n row.append(th);\n for (var b=1; b<=10; b++) {\n var td = multiplication_cell(a, b);\n row.append(td);\n }\n table.append(row);\n }\n return table;\n}", "function generateTable() {\n\tvar request = new XMLHttpRequest();\n\n\trequest.open('GET', url + \"/gentable\", true);\n\trequest.addEventListener('load', function () {\n\t\tif (request.status >= 200 && request.status < 400) {\n\t\t\tvar dataReceived = JSON.parse(request.responseText);\n\t\t\tvar dataReceived2 = JSON.parse(dataReceived.tab);\n\t\t\tcreateTable(dataReceived2);\n\n\t\t} else {\n\t\t\tconsole.log(\"Network request error: \" + request.statusText);\n\t\t}\n\t});\n\trequest.send(null);\n}", "function get_table_info() {\n ;\n}", "function populateTable() {\n\n\n}", "function Percorrer_Tabela(table) {\n console.log(table);\n}", "function generateTableOne(tableOne, data) {\n for (let element of data) {\n let row = tableOne.insertRow();\n for (key in element) {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]);\n cell.appendChild(text);\n }\n }\n}", "function getTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n // printing current results object and fields\n var results = tableData[i];\n console.log(results)\n var fields = Object.keys(results);\n // Creating a new row in tbody\n var $newrow = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For each field in results object, creating a new cell and setting data to be the current results field\n var field = fields[j];\n var $cell = $newrow.insertCell(j);\n $cell.innerText = results[field];\n }\n }\n}", "function getTableCells(tblElm) {\r\n\t\t\tvar tHead = tblElm.tHead;\r\n\t\t\tvar tBody = tblElm.tBodies[0];\r\n\t\t\tvar tFoot = tblElm.tFoot;\r\n\t\t\t\r\n\t\t\t// This logic is reused 3 times, this is defined an internal function.\r\n\t\t\tvar extract = function(rowSet) {\r\n\t\t\t\t\tvar data = [];\r\n\t\t\t\t\tvar rows = [];\r\n\t\t\t\t\tfor(var rr in rowSet) {\r\n\t\t\t\t\t\tfor(var i = 0, r = rowSet[rr].length; i < r; i++) {\r\n\t\t\t\t\t\t\tif(rowSet[rr][i].style.display !== 'none') { // ignore invisible row\r\n\t\t\t\t\t\t\t\trows.push(rowSet[rr][i]);\r\n\t\t\t\t\t\t\t\tdata.push([]);// row's cell array\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Expand to a matrix considers rowspan and colspan\r\n\t\t\t\t\tfor(var r = 0; r < rows.length; r++) {\r\n\t\t\t\t\t\tvar cells = rows[r].cells;\r\n\t\t\t\t\t\tfor(var c = 0; c < cells.length; c++) {\r\n\t\t\t\t\t\t\tvar x = c;\r\n\t\t\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\t\t\twhile(data[r][x] !== undefined) x++; // Check the cell is setted because of rowspan or colspan.\r\n\t\t\t\t\t\t\tfor(var col = 0; col < cell.colSpan; col++) { // if it is marged cell, push the same value.\r\n\t\t\t\t\t\t\t\tfor(var row = 0; row < cell.rowSpan; row++) { // if it is marged cell, push the same value.\r\n\t\t\t\t\t\t\t\t\tdata[r+row][x+col] = cell;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t};\r\n\t\t\t\r\n\t\t\tvar headCells = extract([tHead ? tHead.rows : []]);\r\n\t\t\tvar bodyCells = extract([tBody ? tBody.rows : []]);\r\n\t\t\tvar footCells = extract([tFoot ? tFoot.rows : []]);\r\n\t\t\treturn {\r\n\t\t\t\theadCells : headCells,\r\n\t\t\t\tbodyCells : bodyCells,\r\n\t\t\t\tfootCells : footCells,\r\n\t\t\t\tallCells : headCells.concat(bodyCells).concat(footCells)\r\n\t\t\t};\r\n\t\t}", "function showTables()\n{\n var table = document.getElementById(\"roomTable\");\n for (var i = 0; i < rooms.length; i++) {\n console.log(\"room[\" + i + \"]: \" + rooms[i]);\n var tr = table.insertRow(i + 1);\n var td = tr.insertCell(0);\n td.innerHTML = rooms[i];\n }\n}", "function createTable(json){\n//Erasing previous data in case it had\n eraseTable();\n eraseReservations();\n eraseOptions();\n eraseHiddens();\n\n $('#dynamictable').append('<table></table>');\n var table = $('#dynamictable').children();\n table.append(\"<tr><td colspan='3'>Horarios</td></tr>\");\n table.append(\"<tr><td>Hora</td><td>30 min</td><td>30 min</td></tr>\");\n var root = \"h\";\n var val1,val2;\n for (h=0;h<24;h++){\n i=h*2;\n val1 = eval(\"json.\"+(root+i));//concat strings and values to access h vars\n val2 = eval(\"json.\"+(root+(i+1)));\n miArray[i] = val1;\n miArray[i+1] = val2;\n\n if (val1 != null || val2 != null){\n table.append(\"<tr><td>\"+formattedH(h)+\":00 </td> <td id=\"+i+\">\"+val1+\"</td><td id=\"+(i+1)+\">\"+val2+\"</td></tr>\");\n switch(val1) {\n case 0: $('#'+i).css({\"background-color\": \"#008000\"}); break; //free\n case 1: $('#'+i).css({\"background-color\": \"#6c1100\"}); break; //occupaid\n case 2: $('#'+i).css({\"background-color\": \"#ea821a\"}); break; //unavailable\n default: $('#'+i).css({\"background-color\": \"#8b8878\"}); //out of time\n }\n switch(val2) {\n case 0: $('#'+(i+1)).css({\"background-color\": \"#008000\"}); break; //free\n case 1: $('#'+(i+1)).css({\"background-color\": \"#6c1100\"}); break; //occupaid\n case 2: $('#'+(i+1)).css({\"background-color\": \"#ea821a\"}); break; //unavailable\n default: $('#'+(i+1)).css({\"background-color\": \"#8b8878\"}); //out of time\n }\n }\n }\n console.log(miArray);\n loadingValuesInHiddenTags();\n}", "function Table() \n{\n var divHTML = \"<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>\";\n divHTML += \"<tr><th></th>\";\n\n for (var j = 0; j < _columns; j++)\n divHTML += \"<th class='thclass'>\" + String.fromCharCode(j + 65) + \"</th>\";\n\n // closing row tag for the headers\n divHTML += \"</tr>\";\n\n // now do the main table area\n for (var i = 1; i <= _rows; i++) \n {\n divHTML += \"<tr>\";\n // ...first column of the current row (row label)\n divHTML += \"<td id='\" + i + \"_0' class='BaseColumn'>\" + i + \"</td>\";\n\n // ... the rest of the _columns\n for (var j = 1; j <= _columns; j++)\n divHTML += \"<td id='\" + i + \"_\" + j + \"' class='AlphaColumn' onclick='ClickCell(this)'></td>\";\n\n // ...end of row\n divHTML += \"</tr>\";\n }\n\n // finally add the end of table tag\n divHTML += \"</table>\";\n document.getElementById(\"table\").innerHTML = divHTML;\n // invokes two dim array func as we create the table in html page\n TwoDArray();\n document.getElementById(\"txtFilter\").value = \"\";\n document.getElementById(\"span\").innerHTML = \"Current Cell: \"\n}", "static fillRows(table, data, headers) {\n data.forEach(elem => {\n let row = table.insertRow(-1)\n let tds = []\n headers.forEach(el => {\n tds.push(row.insertCell(-1))\n tds[tds.length - 1].innerHTML = elem[el] ? elem[el] : ''\n tds[tds.length - 1].id = el\n })\n })\n }", "function init() {\n tableData.forEach((sightings) => {\n var row = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function table(c,r){\nvar tt=\"\";\nfor (var col=1; col<=c; col++){ tt +=\"<tr>\";\n\tfor (var row=1 ; row<=r ; row++){ tt += \"<td></td>\"; \n}tt += \"</tr>\";}return tt;}", "function drawtable()\n{\n // going to use a template for this!\n\n // example table data row { id: \"CDL\", rank: 1949, \"change\": 23, \"winp\" : 84.4, \"run\" : \"wwwwwwwwww\" },\n\n // need in the item s_players,\n // {{:rank}}\n // {{:change}}\n // {{:id}} - initials\n // {{:record}} - win percentage\n // {{:gamerun}} - last ten games results\n\n // the template then executes for each of the elements in this.\n\n // what player do we want? URL format is player.html/INITIALS\n playerid = window.location.href.substring(window.location.href.indexOf('?')+1);\n opponents = get_player_opponents(all_results, playerid);\n player_results = get_player_results(all_results, playerid, opponents)[0];\n\n recent_player_results = get_results_to_display(player_results, playerid, recent_results_to_display);\n var recent_res_template = $.templates(\"#resultTemplate\");\n var htmlOutput = recent_res_template.render(recent_player_results);\n $(\"#rec_res_tbl\").html(htmlOutput);\n\n var opponents_template = $.templates(\"#opponentsTemplate\");\n var opponent_template = create_opponents_template(opponents);\n var htmlOutput = opponents_template.render(opponent_template);\n $(\"#opponents_tbl\").html(htmlOutput);\n\n head_to_head = document.getElementById(\"opp_res_tbl\");\n head_to_head.setAttribute(\"style\", \"height:\" + 15 * player_results.length + \"px\");\n\n slider = document.getElementById(\"head_to_head_range\");\n label = document.getElementById(\"results_output\");\n\n for (var ii = 0; ii < opponents.length; ii++)\n {\n checkbox = document.getElementById(\"opp_check_box_\" + opponents[ii]);\n checkbox.onchange = function() {\n redraw_head_to_head(slider.value);\n };\n }\n change_opponenet_check_boxes(false);\n\n label.value = slider.value; // Display the default slider value\n // Update the current slider value (each time you drag the slider handle)\n slider.oninput = function() {\n label.value = this.value;\n redraw_head_to_head(this.value);\n }\n\n}", "function getTable(){\n init();\n tabelaGramatica = [];\n for(var i =1; i<table.rows.length; i++){\n table.rows[i].classList.remove('selecionado'); \n var naoTerminal = table.rows[i].cells[0].innerHTML;\n var derivacao = table.rows[i].cells[1].innerHTML;\n //Validação e reconhecimento das entradas \n var val = validarEntAF(naoTerminal, derivacao);\n \n if(val == \"Error\") return \"GRUD\"; //Não é GRUD\n\n if(addTabelaGramatica(naoTerminal, derivacao)){ //remove valores iguais\n table.deleteRow(i);\n }else{\n\n var naoT= decodificarLetra(naoTerminal);\n var ultLetra = derivacao.substring(derivacao.length-1, derivacao.length);\n var ultLetraD = decodificarLetra(ultLetra);\n var letra = derivacao.substring(0,derivacao.length-1);\n \n addState(naoT);\n \n if(val != \"Final\"){\n if(!possuiNaoTerminal(ultLetra)) return \"ERROR\";\n addlabel(letra, naoT, ultLetraD);\n addTransition(naoT, letra, ultLetraD);\n }else{\n tratarEstadoFinal(naoT, derivacao);\n }\n }\n \n }\n return \"TRUE\";\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < AlienData.length; i++) {\n // Get get the current address object and its fields\n var Sighting = AlienData[i];\n var fields = Object.keys(Sighting);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = Sighting[field];\n }\n }\n}", "function ufoTable(sighting) {\n\n // Create variable to set as the table body \n var tbody = d3.select(\"tbody\")\n\n tbody.html(\"\")\n\n // Loop through objects separating key field from value field to add table row and table data\n sighting.forEach((sighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function renderTableData(code, changeCurrent) {\r\n const pre = select(`.table-data[data-table-code=\"${code}\"]`)\r\n const tableArray = JSON.parse(pre.textContent)\r\n\r\n if(!changeCurrent) {\r\n currentTable = code\r\n }\r\n\r\n // remove old table content\r\n tableBody.textContent = ''\r\n\r\n tableArray.forEach(obj => {\r\n const specieRow = document.createElement('tr')\r\n // specie link column\r\n const specieLinkCol = document.createElement('td')\r\n const specieLink = document.createElement('a')\r\n specieLink.setAttribute('href', obj.link)\r\n specieLink.textContent = obj.specie\r\n\r\n specieLinkCol.appendChild(specieLink)\r\n\r\n // specie color box\r\n const colorCol = document.createElement('td')\r\n const colorBox = document.createElement('span')\r\n colorBox.classList.add('specie_color-box')\r\n colorBox.style = `background-color: ${obj.color}`\r\n\r\n colorCol.appendChild(colorBox)\r\n\r\n // species months\r\n const monthsCol = document.createElement('td')\r\n const monthsDiv = document.createElement('div')\r\n monthsDiv.classList.add('months')\r\n months.forEach(month => {\r\n const monthBox = document.createElement('span')\r\n monthBox.classList.add('month-box')\r\n\r\n monthsDiv.appendChild(monthBox)\r\n })\r\n\r\n const monthBoxes = selectAll('span.month-box', monthsDiv)\r\n\r\n obj.months.forEach(month => {\r\n monthBoxes[month - 1].classList.add('filled')\r\n })\r\n\r\n monthsCol.appendChild(monthsDiv)\r\n\r\n\r\n // append children to specie\r\n specieRow.appendChild(specieLinkCol)\r\n specieRow.appendChild(colorCol)\r\n specieRow.appendChild(monthsCol)\r\n\r\n tableBody.appendChild(specieRow)\r\n })\r\n }", "function read_table() {\n let table = [];\n\n for (let i=0; i < height_2048; i++) {\n let temp = [];\n\n for (let j=0; j < width_2048; j++) {\n temp.push(helper.get_cell(j,i).attr(\"data-2048-num\"));\n }\n table.push(temp);\n }\n return table;\n}", "function dataTable(data) {\n // keys variable holds ennumberable properties of the first object within data as an array \n var keys = Object.keys(data[0]);\n //headers = keys array is mapped with function that takes name arg\n var headers = keys.map(function(name) {\n // return underlined cell with argument textcell function with name arg\n return new UnderlinedCell(new TextCell(name));\n });\n var body = data.map(function(row) {\n return keys.map(function(name) {\n return new TextCell(String(row[name]));\n });\n });\n return [headers].concat(body);\n}", "function buildHtmlTable(arr) {\n table = document.createElement('graph-table');\n tr = document.createElement('tr');\n th = document.createElement('th');\n td = document.createElement('td');\n\n var _table = table.cloneNode(false);\n columns = addAllColumnHeaders(arr, _table);\n\n for (var i = 0, maxi = arr.length; i < maxi; ++i) {\n var _tr = tr.cloneNode(false);\n\n for (var j = 0, maxj = columns.length; j < maxj; ++j) {\n var _td = td.cloneNode(false);\n\n cellValue = arr[i][columns[j]];\n _td.appendChild(document.createTextNode(arr[i][columns[j]] || ''));\n _tr.appendChild(_td);\n }\n _table.appendChild(_tr);\n }\n table = _table;\n return _table;\n }", "async function myTensorTable(myDiv, myOutTensor, myCols, myTitle){ \n\n \n document.getElementById(myDiv).innerHTML += myTitle + '<br>'\n\n const myOutput = await myOutTensor.data()\n myTemp = '<table border=3><tr>'\n for (myCount = 0; myCount <= myOutTensor.size - 1; myCount++){ \n myTemp += '<td>'+ myOutput[myCount] + '</td>'\n if (myCount % myCols == myCols-1){\n myTemp += '</tr><tr>'\n }\n } \n myTemp += '</tr></table>'\n document.getElementById(myDiv).innerHTML += myTemp + '<br>'\n}" ]
[ "0.634005", "0.62782997", "0.6234986", "0.6232895", "0.61956674", "0.61253685", "0.61182165", "0.6103738", "0.60886884", "0.6075594", "0.6073368", "0.60690916", "0.60636455", "0.60636455", "0.60636455", "0.6060776", "0.6054898", "0.6052255", "0.6043594", "0.6034194", "0.6027806", "0.60194546", "0.60194546", "0.60194546", "0.60194546", "0.5999241", "0.5999241", "0.5999241", "0.598696", "0.598696", "0.59811765", "0.5965587", "0.59538245", "0.5935425", "0.5864711", "0.58507305", "0.584906", "0.5841767", "0.5830331", "0.58182216", "0.5816983", "0.5810893", "0.5780576", "0.57790196", "0.5767478", "0.5762801", "0.57548267", "0.57427996", "0.5735821", "0.5733669", "0.5726127", "0.57251316", "0.57193977", "0.5713334", "0.5713022", "0.57040083", "0.57016313", "0.56951857", "0.5685578", "0.56784487", "0.5678171", "0.56742287", "0.56687355", "0.5663965", "0.5660121", "0.5657689", "0.5656577", "0.5648987", "0.56478286", "0.5647232", "0.56443053", "0.56422937", "0.56367314", "0.56346214", "0.5630299", "0.5626461", "0.5626147", "0.56255186", "0.56243145", "0.5624135", "0.5620768", "0.5618832", "0.56186885", "0.5611853", "0.5607638", "0.56052214", "0.56050706", "0.5604406", "0.55935097", "0.559344", "0.5591707", "0.55892336", "0.5588736", "0.5587127", "0.5582379", "0.5578067", "0.55729514", "0.5566075", "0.5540526", "0.5536763", "0.55342305" ]
0.0
-1
Update the window with the last wsize (normally 32K) bytes written before returning. If window does not exist yet, create it. This is only called when a window is already in use, or when output has been written during this inflate call, but the end of the deflate stream has not been reached yet. It is also called to create a window for dictionary data when a dictionary is loaded. Providing output buffers larger than 32K to inflate() should provide a speed advantage, since only the last 32K of output is copied to the sliding window upon return from inflate(), and since all distances after the first 32K of output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches.
function updatewindow(strm, src, end, copy) { var dist; var state = strm.state; /* if it hasn't been done already, allocate space for the window */ if (state.window === null) { state.wsize = 1 << state.wbits; state.wnext = 0; state.whave = 0; state.window = new utils.Buf8(state.wsize); } /* copy state->wsize or less output bytes into the circular window */ if (copy >= state.wsize) { utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0); state.wnext = 0; state.whave = state.wsize; } else { dist = state.wsize - state.wnext; if (dist > copy) { dist = copy; } //zmemcpy(state->window + state->wnext, end - copy, dist); utils.arraySet(state.window,src, end - copy, dist, state.wnext); copy -= dist; if (copy) { //zmemcpy(state->window, end - copy, copy); utils.arraySet(state.window,src, end - copy, copy, 0); state.wnext = copy; state.whave = state.wsize; } else { state.wnext += dist; if (state.wnext === state.wsize) { state.wnext = 0; } if (state.whave < state.wsize) { state.whave += dist; } } } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\t\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\t\n\t state.window = Buf8(state.wsize);\n\t }\n\t\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t }", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new utils.Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t utils.arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new utils.Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t utils.arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new utils.Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t utils.arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new utils.Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t utils.arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new utils$d.Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t utils$d.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t utils$d.arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t utils$d.arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n \n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n \n state.window = new utils.Buf8(state.wsize);\n }\n \n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n }", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new common.Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t common.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t common.arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t common.arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n } else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n } else {\n state.wnext += dist;\n if (state.wnext === state.wsize) {\n state.wnext = 0;\n }\n if (state.whave < state.wsize) {\n state.whave += dist;\n }\n }\n }\n return 0;\n }", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t } else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t arraySet(state.window, src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t arraySet(state.window, src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t } else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) {\n\t state.wnext = 0;\n\t }\n\t if (state.whave < state.wsize) {\n\t state.whave += dist;\n\t }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new utils.Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t utils.arraySet(state.window,src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t utils.arraySet(state.window,src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n\t var dist;\n\t var state = strm.state;\n\n\t /* if it hasn't been done already, allocate space for the window */\n\t if (state.window === null) {\n\t state.wsize = 1 << state.wbits;\n\t state.wnext = 0;\n\t state.whave = 0;\n\n\t state.window = new utils.Buf8(state.wsize);\n\t }\n\n\t /* copy state->wsize or less output bytes into the circular window */\n\t if (copy >= state.wsize) {\n\t utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0);\n\t state.wnext = 0;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t dist = state.wsize - state.wnext;\n\t if (dist > copy) {\n\t dist = copy;\n\t }\n\t //zmemcpy(state->window + state->wnext, end - copy, dist);\n\t utils.arraySet(state.window,src, end - copy, dist, state.wnext);\n\t copy -= dist;\n\t if (copy) {\n\t //zmemcpy(state->window, end - copy, copy);\n\t utils.arraySet(state.window,src, end - copy, copy, 0);\n\t state.wnext = copy;\n\t state.whave = state.wsize;\n\t }\n\t else {\n\t state.wnext += dist;\n\t if (state.wnext === state.wsize) { state.wnext = 0; }\n\t if (state.whave < state.wsize) { state.whave += dist; }\n\t }\n\t }\n\t return 0;\n\t}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n }", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n } else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n } else {\n state.wnext += dist;\n if (state.wnext === state.wsize) {\n state.wnext = 0;\n }\n if (state.whave < state.wsize) {\n state.whave += dist;\n }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new common.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n common.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n common.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n common.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new common.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n common.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n common.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n common.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n /* if it hasn't been done already, allocate space for the window */\n\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n state.window = new utils.Buf8(state.wsize);\n }\n /* copy state->wsize or less output bytes into the circular window */\n\n\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n } else {\n dist = state.wsize - state.wnext;\n\n if (dist > copy) {\n dist = copy;\n } //zmemcpy(state->window + state->wnext, end - copy, dist);\n\n\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n } else {\n state.wnext += dist;\n\n if (state.wnext === state.wsize) {\n state.wnext = 0;\n }\n\n if (state.whave < state.wsize) {\n state.whave += dist;\n }\n }\n }\n\n return 0;\n }", "function updatewindow(strm,src,end,copy){var dist;var state=strm.state;/* if it hasn't been done already, allocate space for the window */if(state.window===null){state.wsize=1<<state.wbits;state.wnext=0;state.whave=0;state.window=new utils.Buf8(state.wsize);}/* copy state->wsize or less output bytes into the circular window */if(copy>=state.wsize){utils.arraySet(state.window,src,end-state.wsize,state.wsize,0);state.wnext=0;state.whave=state.wsize;}else {dist=state.wsize-state.wnext;if(dist>copy){dist=copy;}//zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window,src,end-copy,dist,state.wnext);copy-=dist;if(copy){//zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window,src,end-copy,copy,0);state.wnext=copy;state.whave=state.wsize;}else {state.wnext+=dist;if(state.wnext===state.wsize){state.wnext=0;}if(state.whave<state.wsize){state.whave+=dist;}}}return 0;}", "function $tTA8$var$updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n /* if it hasn't been done already, allocate space for the window */\n\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n state.window = new $tTA8$var$utils.Buf8(state.wsize);\n }\n /* copy state->wsize or less output bytes into the circular window */\n\n\n if (copy >= state.wsize) {\n $tTA8$var$utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n } else {\n dist = state.wsize - state.wnext;\n\n if (dist > copy) {\n dist = copy;\n }\n\n $tTA8$var$utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n $tTA8$var$utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n } else {\n state.wnext += dist;\n\n if (state.wnext === state.wsize) {\n state.wnext = 0;\n }\n\n if (state.whave < state.wsize) {\n state.whave += dist;\n }\n }\n }\n\n return 0;\n}", "function updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n /* if it hasn't been done already, allocate space for the window */\n\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n state.window = new utils.Buf8(state.wsize);\n }\n /* copy state->wsize or less output bytes into the circular window */\n\n\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n } else {\n dist = state.wsize - state.wnext;\n\n if (dist > copy) {\n dist = copy;\n } //zmemcpy(state->window + state->wnext, end - copy, dist);\n\n\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n } else {\n state.wnext += dist;\n\n if (state.wnext === state.wsize) {\n state.wnext = 0;\n }\n\n if (state.whave < state.wsize) {\n state.whave += dist;\n }\n }\n }\n\n return 0;\n}" ]
[ "0.6681966", "0.66441613", "0.66441613", "0.66441613", "0.66441613", "0.6637881", "0.6636711", "0.66295844", "0.66189325", "0.66103846", "0.66056824", "0.66056824", "0.6594528", "0.65899986", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6587221", "0.6586769", "0.6586769", "0.6575548", "0.6562821", "0.65625024", "0.65607774" ]
0.0
-1
=========================================================================== Output a short LSB first on the stream. IN assertion: there is enough room in pendingBuf.
function put_short (s, w) { // put_byte(s, (uch)((w) & 0xff)); // put_byte(s, (uch)((ush)(w) >> 8)); s.pending_buf[s.pending++] = (w) & 0xff; s.pending_buf[s.pending++] = (w >>> 8) & 0xff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function putShortMSB(s,b){// put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++]=b>>>8&0xff;s.pending_buf[s.pending++]=b&0xff;}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n }", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = b >>> 8 & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n }", "function putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = b >>> 8 & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n }", "function put_short(s,w){// put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++]=w&0xff;s.pending_buf[s.pending++]=w>>>8&0xff;}", "function putShortMSB(s, b) {\n\t // put_byte(s, (Byte)(b >> 8));\n\t // put_byte(s, (Byte)(b & 0xff));\n\t s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n\t s.pending_buf[s.pending++] = b & 0xff;\n\t}", "function putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = b >>> 8 & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = b >>> 8 & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}", "function putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n }", "function putShortMSB(s, b) {\n\t// put_byte(s, (Byte)(b >> 8));\n\t// put_byte(s, (Byte)(b & 0xff));\n\t s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n\t s.pending_buf[s.pending++] = b & 0xff;\n\t}" ]
[ "0.7274559", "0.7092112", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7075015", "0.7055127", "0.70478463", "0.70307606", "0.7011944", "0.699666", "0.6992513", "0.6992513", "0.6987222", "0.69794124" ]
0.0
-1
=========================================================================== Send a value on a given number of bits. IN assertion: length <= 16 and value fits in length bits.
function send_bits(s, value, length) { if (s.bi_valid > (Buf_size - length)) { s.bi_buf |= (value << s.bi_valid) & 0xffff; put_short(s, s.bi_buf); s.bi_buf = value >> (Buf_size - s.bi_valid); s.bi_valid += length - Buf_size; } else { s.bi_buf |= (value << s.bi_valid) & 0xffff; s.bi_valid += length; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t }", "function send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n }", "function send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n }", "function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length) {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> Buf_size - s.bi_valid;\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n s.bi_valid += length;\n }\n }", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n\t if (s.bi_valid > (Buf_size - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size - s.bi_valid);\n\t s.bi_valid += length - Buf_size;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length) {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> Buf_size - s.bi_valid;\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n s.bi_valid += length;\n }\n }", "function send_bits$1(s, value, length) {\n\t if (s.bi_valid > (Buf_size$1 - length)) {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t put_short$1(s, s.bi_buf);\n\t s.bi_buf = value >> (Buf_size$1 - s.bi_valid);\n\t s.bi_valid += length - Buf_size$1;\n\t } else {\n\t s.bi_buf |= (value << s.bi_valid) & 0xffff;\n\t s.bi_valid += length;\n\t }\n\t}", "function send_bits(s,value,length){if(s.bi_valid>Buf_size-length){s.bi_buf|=value<<s.bi_valid&0xffff;put_short(s,s.bi_buf);s.bi_buf=value>>Buf_size-s.bi_valid;s.bi_valid+=length-Buf_size;}else {s.bi_buf|=value<<s.bi_valid&0xffff;s.bi_valid+=length;}}" ]
[ "0.84644645", "0.8458237", "0.8422658", "0.84223914", "0.8398401", "0.8398401", "0.8398401", "0.8398401", "0.8398401", "0.8398401", "0.8398401", "0.8398401", "0.8398401", "0.83725744", "0.8353432", "0.83477384" ]
0.0
-1
=========================================================================== Reverse the first len bits of a code, using straightforward code (a faster method would use a table) IN assertion: 1 <= len <= 15
function bi_reverse(code, len) { var res = 0; do { res |= code & 1; code >>>= 1; res <<= 1; } while (--len > 0); return res >>> 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bi_reverse(code, len) {\n\t\tvar res = 0;\n\t\tdo {\n\t\t\tres |= code & 1;\n\t\t\tcode >>= 1;\n\t\t\tres <<= 1;\n\t\t} while (--len > 0);\n\t\treturn res >> 1;\n\t}", "function bi_reverse(code, len) {\n var res = 0;\n\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n\n return res >>> 1;\n }", "function bi_reverse(code, len) {\n var res = 0;\n\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n\n return res >>> 1;\n }", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t }", "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n }", "function bi_reverse$1(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code,len){var res=0;do{res|=code&1;code>>>=1;res<<=1;}while(--len>0);return res>>>1;}", "function bi_reverse(code, len) {\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}", "function bi_reverse(code, len) {\n\t var res = 0;\n\t do {\n\t res |= code & 1;\n\t code >>>= 1;\n\t res <<= 1;\n\t } while (--len > 0);\n\t return res >>> 1;\n\t}" ]
[ "0.7971538", "0.79377985", "0.7926397", "0.79039055", "0.79021436", "0.78989965", "0.7893038", "0.7874789", "0.7856889", "0.78369194", "0.78369194", "0.78369194", "0.78369194", "0.78369194", "0.78369194", "0.78369194", "0.78369194", "0.78369194" ]
0.0
-1
=========================================================================== Flush the bit buffer, keeping at most 7 bits in it.
function bi_flush(s) { if (s.bi_valid === 16) { put_short(s, s.bi_buf); s.bi_buf = 0; s.bi_valid = 0; } else if (s.bi_valid >= 8) { s.pending_buf[s.pending++] = s.bi_buf & 0xff; s.bi_buf >>= 8; s.bi_valid -= 8; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush(s){if(s.bi_valid===16){put_short(s,s.bi_buf);s.bi_buf=0;s.bi_valid=0;}else if(s.bi_valid>=8){s.pending_buf[s.pending++]=s.bi_buf&0xff;s.bi_buf>>=8;s.bi_valid-=8;}}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n \n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush$1(s) {\n\t if (s.bi_valid === 16) {\n\t put_short$1(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}" ]
[ "0.61976147", "0.6166657", "0.6141256", "0.6115985", "0.61072356", "0.6072232", "0.6072232", "0.6072232", "0.6072232", "0.6072232", "0.6072232", "0.6072232", "0.6072232", "0.6072232", "0.60623586", "0.60252243", "0.58954155" ]
0.0
-1
=========================================================================== Compute the optimal bit lengths for a tree and update the total bit length for the current block. IN assertion: the fields freq and dad are set, heap[heap_max] and above are the tree nodes sorted by increasing frequency. OUT assertions: the field len is set to the optimal bit length, the array bl_count contains the frequencies for each bit length. The length opt_len is updated; static_len is also updated if stree is not null.
function gen_bitlen(s, desc) // deflate_state *s; // tree_desc *desc; /* the tree descriptor */ { var tree = desc.dyn_tree; var max_code = desc.max_code; var stree = desc.stat_desc.static_tree; var has_stree = desc.stat_desc.has_stree; var extra = desc.stat_desc.extra_bits; var base = desc.stat_desc.extra_base; var max_length = desc.stat_desc.max_length; var h; /* heap index */ var n, m; /* iterate over the tree elements */ var bits; /* bit length */ var xbits; /* extra bits */ var f; /* frequency */ var overflow = 0; /* number of elements with bit length too large */ for (bits = 0; bits <= MAX_BITS; bits++) { s.bl_count[bits] = 0; } /* In a first pass, compute the optimal bit lengths (which may * overflow in the case of the bit length tree). */ tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */ for (h = s.heap_max+1; h < HEAP_SIZE; h++) { n = s.heap[h]; bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; if (bits > max_length) { bits = max_length; overflow++; } tree[n*2 + 1]/*.Len*/ = bits; /* We overwrite tree[n].Dad which is no longer needed */ if (n > max_code) { continue; } /* not a leaf node */ s.bl_count[bits]++; xbits = 0; if (n >= base) { xbits = extra[n-base]; } f = tree[n * 2]/*.Freq*/; s.opt_len += f * (bits + xbits); if (has_stree) { s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits); } } if (overflow === 0) { return; } // Trace((stderr,"\nbit length overflow\n")); /* This happens for example on obj2 and pic of the Calgary corpus */ /* Find the first bit length which could increase: */ do { bits = max_length-1; while (s.bl_count[bits] === 0) { bits--; } s.bl_count[bits]--; /* move one leaf down the tree */ s.bl_count[bits+1] += 2; /* move one overflow item as its brother */ s.bl_count[max_length]--; /* The brother of the overflow item also moves one step up, * but this does not affect bl_count[max_length] */ overflow -= 2; } while (overflow > 0); /* Now recompute all bit lengths, scanning in increasing frequency. * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all * lengths instead of fixing only the wrong ones. This idea is taken * from 'ar' written by Haruhiko Okumura.) */ for (bits = max_length; bits !== 0; bits--) { n = s.bl_count[bits]; while (n !== 0) { m = s.heap[--h]; if (m > max_code) { continue; } if (tree[m*2 + 1]/*.Len*/ !== bits) { // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/; tree[m*2 + 1]/*.Len*/ = bits; } n--; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_bitlen(s, desc) // deflate_state *s;\n // tree_desc *desc; /* the tree descriptor */\n {\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h;\n /* heap index */\n\n var n, m;\n /* iterate over the tree elements */\n\n var bits;\n /* bit length */\n\n var xbits;\n /* extra bits */\n\n var f;\n /* frequency */\n\n var overflow = 0;\n /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n\n\n tree[s.heap[s.heap_max] * 2 + 1]\n /*.Len*/\n = 0;\n /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]\n /*.Dad*/\n * 2 + 1]\n /*.Len*/\n + 1;\n\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n\n tree[n * 2 + 1]\n /*.Len*/\n = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) {\n continue;\n }\n /* not a leaf node */\n\n\n s.bl_count[bits]++;\n xbits = 0;\n\n if (n >= base) {\n xbits = extra[n - base];\n }\n\n f = tree[n * 2]\n /*.Freq*/\n ;\n s.opt_len += f * (bits + xbits);\n\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]\n /*.Len*/\n + xbits);\n }\n }\n\n if (overflow === 0) {\n return;\n } // Trace((stderr,\"\\nbit length overflow\\n\"));\n\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n\n\n do {\n bits = max_length - 1;\n\n while (s.bl_count[bits] === 0) {\n bits--;\n }\n\n s.bl_count[bits]--;\n /* move one leaf down the tree */\n\n s.bl_count[bits + 1] += 2;\n /* move one overflow item as its brother */\n\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n\n overflow -= 2;\n } while (overflow > 0);\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n\n\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n\n while (n !== 0) {\n m = s.heap[--h];\n\n if (m > max_code) {\n continue;\n }\n\n if (tree[m * 2 + 1]\n /*.Len*/\n !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]\n /*.Len*/\n ) * tree[m * 2]\n /*.Freq*/\n ;\n tree[m * 2 + 1]\n /*.Len*/\n = bits;\n }\n\n n--;\n }\n }\n }", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1] /*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1] /*.Dad*/ * 2 + 1] /*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1] /*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) {\n continue;\n } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2] /*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1] /*.Len*/ + xbits);\n }\n }\n if (overflow === 0) {\n return;\n }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) {\n bits--;\n }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) {\n continue;\n }\n if (tree[m * 2 + 1] /*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1] /*.Len*/) * tree[m * 2] /*.Freq*/;\n tree[m * 2 + 1] /*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc) // deflate_state *s;\n // tree_desc *desc; /* the tree descriptor */\n {\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h;\n /* heap index */\n\n var n, m;\n /* iterate over the tree elements */\n\n var bits;\n /* bit length */\n\n var xbits;\n /* extra bits */\n\n var f;\n /* frequency */\n\n var overflow = 0;\n /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n\n\n tree[s.heap[s.heap_max] * 2 + 1]\n /*.Len*/\n = 0;\n /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]\n /*.Dad*/\n * 2 + 1]\n /*.Len*/\n + 1;\n\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n\n tree[n * 2 + 1]\n /*.Len*/\n = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) {\n continue;\n }\n /* not a leaf node */\n\n\n s.bl_count[bits]++;\n xbits = 0;\n\n if (n >= base) {\n xbits = extra[n - base];\n }\n\n f = tree[n * 2]\n /*.Freq*/\n ;\n s.opt_len += f * (bits + xbits);\n\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]\n /*.Len*/\n + xbits);\n }\n }\n\n if (overflow === 0) {\n return;\n } // Trace((stderr,\"\\nbit length overflow\\n\"));\n\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n\n\n do {\n bits = max_length - 1;\n\n while (s.bl_count[bits] === 0) {\n bits--;\n }\n\n s.bl_count[bits]--;\n /* move one leaf down the tree */\n\n s.bl_count[bits + 1] += 2;\n /* move one overflow item as its brother */\n\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n\n overflow -= 2;\n } while (overflow > 0);\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n\n\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n\n while (n !== 0) {\n m = s.heap[--h];\n\n if (m > max_code) {\n continue;\n }\n\n if (tree[m * 2 + 1]\n /*.Len*/\n !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]\n /*.Len*/\n ) * tree[m * 2]\n /*.Freq*/\n ;\n tree[m * 2 + 1]\n /*.Len*/\n = bits;\n }\n\n n--;\n }\n }\n }", "function gen_bitlen(s, desc)\n\t // deflate_state *s;\n\t // tree_desc *desc; /* the tree descriptor */\n\t {\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bits;\n\t var base = desc.stat_desc.extra_base;\n\t var max_length = desc.stat_desc.max_length;\n\t var h; /* heap index */\n\t var n, m; /* iterate over the tree elements */\n\t var bits; /* bit length */\n\t var xbits; /* extra bits */\n\t var f; /* frequency */\n\t var overflow = 0; /* number of elements with bit length too large */\n\t\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t s.bl_count[bits] = 0;\n\t }\n\t\n\t /* In a first pass, compute the optimal bit lengths (which may\n\t * overflow in the case of the bit length tree).\n\t */\n\t tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\t\n\t for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t n = s.heap[h];\n\t bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n\t if (bits > max_length) {\n\t bits = max_length;\n\t overflow++;\n\t }\n\t tree[n * 2 + 1]/*.Len*/ = bits;\n\t /* We overwrite tree[n].Dad which is no longer needed */\n\t\n\t if (n > max_code) { continue; } /* not a leaf node */\n\t\n\t s.bl_count[bits]++;\n\t xbits = 0;\n\t if (n >= base) {\n\t xbits = extra[n - base];\n\t }\n\t f = tree[n * 2]/*.Freq*/;\n\t s.opt_len += f * (bits + xbits);\n\t if (has_stree) {\n\t s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n\t }\n\t }\n\t if (overflow === 0) { return; }\n\t\n\t // Trace((stderr,\"\\nbit length overflow\\n\"));\n\t /* This happens for example on obj2 and pic of the Calgary corpus */\n\t\n\t /* Find the first bit length which could increase: */\n\t do {\n\t bits = max_length - 1;\n\t while (s.bl_count[bits] === 0) { bits--; }\n\t s.bl_count[bits]--; /* move one leaf down the tree */\n\t s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n\t s.bl_count[max_length]--;\n\t /* The brother of the overflow item also moves one step up,\n\t * but this does not affect bl_count[max_length]\n\t */\n\t overflow -= 2;\n\t } while (overflow > 0);\n\t\n\t /* Now recompute all bit lengths, scanning in increasing frequency.\n\t * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t * lengths instead of fixing only the wrong ones. This idea is taken\n\t * from 'ar' written by Haruhiko Okumura.)\n\t */\n\t for (bits = max_length; bits !== 0; bits--) {\n\t n = s.bl_count[bits];\n\t while (n !== 0) {\n\t m = s.heap[--h];\n\t if (m > max_code) { continue; }\n\t if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n\t // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n\t s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n\t tree[m * 2 + 1]/*.Len*/ = bits;\n\t }\n\t n--;\n\t }\n\t }\n\t }", "function gen_bitlen(s, desc)\n // deflate_state *s;\n // tree_desc *desc; /* the tree descriptor */\n {\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n \n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n \n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n \n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n \n if (n > max_code) { continue; } /* not a leaf node */\n \n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n \n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n \n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n \n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n }", "function gen_bitlen(s, desc) // deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h;\n /* heap index */\n\n var n, m;\n /* iterate over the tree elements */\n\n var bits;\n /* bit length */\n\n var xbits;\n /* extra bits */\n\n var f;\n /* frequency */\n\n var overflow = 0;\n /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n\n\n tree[s.heap[s.heap_max] * 2 + 1]\n /*.Len*/\n = 0;\n /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]\n /*.Dad*/\n * 2 + 1]\n /*.Len*/\n + 1;\n\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n\n tree[n * 2 + 1]\n /*.Len*/\n = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) {\n continue;\n }\n /* not a leaf node */\n\n\n s.bl_count[bits]++;\n xbits = 0;\n\n if (n >= base) {\n xbits = extra[n - base];\n }\n\n f = tree[n * 2]\n /*.Freq*/\n ;\n s.opt_len += f * (bits + xbits);\n\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]\n /*.Len*/\n + xbits);\n }\n }\n\n if (overflow === 0) {\n return;\n } // Trace((stderr,\"\\nbit length overflow\\n\"));\n\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n\n\n do {\n bits = max_length - 1;\n\n while (s.bl_count[bits] === 0) {\n bits--;\n }\n\n s.bl_count[bits]--;\n /* move one leaf down the tree */\n\n s.bl_count[bits + 1] += 2;\n /* move one overflow item as its brother */\n\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n\n overflow -= 2;\n } while (overflow > 0);\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n\n\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n\n while (n !== 0) {\n m = s.heap[--h];\n\n if (m > max_code) {\n continue;\n }\n\n if (tree[m * 2 + 1]\n /*.Len*/\n !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]\n /*.Len*/\n ) * tree[m * 2]\n /*.Freq*/\n ;\n tree[m * 2 + 1]\n /*.Len*/\n = bits;\n }\n\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(desc) { // the tree descriptor\n\t\tvar tree = desc.dyn_tree;\n\t\tvar extra = desc.extra_bits;\n\t\tvar base = desc.extra_base;\n\t\tvar max_code = desc.max_code;\n\t\tvar max_length = desc.max_length;\n\t\tvar stree = desc.static_tree;\n\t\tvar h; // heap index\n\t\tvar n, m; // iterate over the tree elements\n\t\tvar bits; // bit length\n\t\tvar xbits; // extra bits\n\t\tvar f; // frequency\n\t\tvar overflow = 0; // number of elements with bit length too large\n\n\t\tfor (bits = 0; bits <= MAX_BITS; bits++) {\n\t\t\tbl_count[bits] = 0;\n\t\t}\n\n\t\t// In a first pass, compute the optimal bit lengths (which may\n\t\t// overflow in the case of the bit length tree).\n\t\ttree[heap[heap_max]].dl = 0; // root of the heap\n\n\t\tfor (h = heap_max + 1; h < HEAP_SIZE; h++) {\n\t\t\tn = heap[h];\n\t\t\tbits = tree[tree[n].dl].dl + 1;\n\t\t\tif (bits > max_length) {\n\t\t\t\tbits = max_length;\n\t\t\t\toverflow++;\n\t\t\t}\n\t\t\ttree[n].dl = bits;\n\t\t\t// We overwrite tree[n].dl which is no longer needed\n\n\t\t\tif (n > max_code) {\n\t\t\t\tcontinue; // not a leaf node\n\t\t\t}\n\n\t\t\tbl_count[bits]++;\n\t\t\txbits = 0;\n\t\t\tif (n >= base) {\n\t\t\t\txbits = extra[n - base];\n\t\t\t}\n\t\t\tf = tree[n].fc;\n\t\t\topt_len += f * (bits + xbits);\n\t\t\tif (stree !== null) {\n\t\t\t\tstatic_len += f * (stree[n].dl + xbits);\n\t\t\t}\n\t\t}\n\t\tif (overflow === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// This happens for example on obj2 and pic of the Calgary corpus\n\n\t\t// Find the first bit length which could increase:\n\t\tdo {\n\t\t\tbits = max_length - 1;\n\t\t\twhile (bl_count[bits] === 0) {\n\t\t\t\tbits--;\n\t\t\t}\n\t\t\tbl_count[bits]--; // move one leaf down the tree\n\t\t\tbl_count[bits + 1] += 2; // move one overflow item as its brother\n\t\t\tbl_count[max_length]--;\n\t\t\t// The brother of the overflow item also moves one step up,\n\t\t\t// but this does not affect bl_count[max_length]\n\t\t\toverflow -= 2;\n\t\t} while (overflow > 0);\n\n\t\t// Now recompute all bit lengths, scanning in increasing frequency.\n\t\t// h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t\t// lengths instead of fixing only the wrong ones. This idea is taken\n\t\t// from 'ar' written by Haruhiko Okumura.)\n\t\tfor (bits = max_length; bits !== 0; bits--) {\n\t\t\tn = bl_count[bits];\n\t\t\twhile (n !== 0) {\n\t\t\t\tm = heap[--h];\n\t\t\t\tif (m > max_code) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (tree[m].dl !== bits) {\n\t\t\t\t\topt_len += (bits - tree[m].dl) * tree[m].fc;\n\t\t\t\t\ttree[m].fc = bits;\n\t\t\t\t}\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t}", "function gen_bitlen(s, desc)\n\t// deflate_state *s;\n\t// tree_desc *desc; /* the tree descriptor */\n\t{\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bits;\n\t var base = desc.stat_desc.extra_base;\n\t var max_length = desc.stat_desc.max_length;\n\t var h; /* heap index */\n\t var n, m; /* iterate over the tree elements */\n\t var bits; /* bit length */\n\t var xbits; /* extra bits */\n\t var f; /* frequency */\n\t var overflow = 0; /* number of elements with bit length too large */\n\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t s.bl_count[bits] = 0;\n\t }\n\n\t /* In a first pass, compute the optimal bit lengths (which may\n\t * overflow in the case of the bit length tree).\n\t */\n\t tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n\t for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t n = s.heap[h];\n\t bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n\t if (bits > max_length) {\n\t bits = max_length;\n\t overflow++;\n\t }\n\t tree[n * 2 + 1]/*.Len*/ = bits;\n\t /* We overwrite tree[n].Dad which is no longer needed */\n\n\t if (n > max_code) { continue; } /* not a leaf node */\n\n\t s.bl_count[bits]++;\n\t xbits = 0;\n\t if (n >= base) {\n\t xbits = extra[n - base];\n\t }\n\t f = tree[n * 2]/*.Freq*/;\n\t s.opt_len += f * (bits + xbits);\n\t if (has_stree) {\n\t s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n\t }\n\t }\n\t if (overflow === 0) { return; }\n\n\t // Trace((stderr,\"\\nbit length overflow\\n\"));\n\t /* This happens for example on obj2 and pic of the Calgary corpus */\n\n\t /* Find the first bit length which could increase: */\n\t do {\n\t bits = max_length - 1;\n\t while (s.bl_count[bits] === 0) { bits--; }\n\t s.bl_count[bits]--; /* move one leaf down the tree */\n\t s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n\t s.bl_count[max_length]--;\n\t /* The brother of the overflow item also moves one step up,\n\t * but this does not affect bl_count[max_length]\n\t */\n\t overflow -= 2;\n\t } while (overflow > 0);\n\n\t /* Now recompute all bit lengths, scanning in increasing frequency.\n\t * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t * lengths instead of fixing only the wrong ones. This idea is taken\n\t * from 'ar' written by Haruhiko Okumura.)\n\t */\n\t for (bits = max_length; bits !== 0; bits--) {\n\t n = s.bl_count[bits];\n\t while (n !== 0) {\n\t m = s.heap[--h];\n\t if (m > max_code) { continue; }\n\t if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n\t // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n\t s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n\t tree[m * 2 + 1]/*.Len*/ = bits;\n\t }\n\t n--;\n\t }\n\t }\n\t}", "function gen_bitlen(s, desc)\n\t// deflate_state *s;\n\t// tree_desc *desc; /* the tree descriptor */\n\t{\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bits;\n\t var base = desc.stat_desc.extra_base;\n\t var max_length = desc.stat_desc.max_length;\n\t var h; /* heap index */\n\t var n, m; /* iterate over the tree elements */\n\t var bits; /* bit length */\n\t var xbits; /* extra bits */\n\t var f; /* frequency */\n\t var overflow = 0; /* number of elements with bit length too large */\n\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t s.bl_count[bits] = 0;\n\t }\n\n\t /* In a first pass, compute the optimal bit lengths (which may\n\t * overflow in the case of the bit length tree).\n\t */\n\t tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n\t for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t n = s.heap[h];\n\t bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n\t if (bits > max_length) {\n\t bits = max_length;\n\t overflow++;\n\t }\n\t tree[n * 2 + 1]/*.Len*/ = bits;\n\t /* We overwrite tree[n].Dad which is no longer needed */\n\n\t if (n > max_code) { continue; } /* not a leaf node */\n\n\t s.bl_count[bits]++;\n\t xbits = 0;\n\t if (n >= base) {\n\t xbits = extra[n - base];\n\t }\n\t f = tree[n * 2]/*.Freq*/;\n\t s.opt_len += f * (bits + xbits);\n\t if (has_stree) {\n\t s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n\t }\n\t }\n\t if (overflow === 0) { return; }\n\n\t // Trace((stderr,\"\\nbit length overflow\\n\"));\n\t /* This happens for example on obj2 and pic of the Calgary corpus */\n\n\t /* Find the first bit length which could increase: */\n\t do {\n\t bits = max_length - 1;\n\t while (s.bl_count[bits] === 0) { bits--; }\n\t s.bl_count[bits]--; /* move one leaf down the tree */\n\t s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n\t s.bl_count[max_length]--;\n\t /* The brother of the overflow item also moves one step up,\n\t * but this does not affect bl_count[max_length]\n\t */\n\t overflow -= 2;\n\t } while (overflow > 0);\n\n\t /* Now recompute all bit lengths, scanning in increasing frequency.\n\t * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t * lengths instead of fixing only the wrong ones. This idea is taken\n\t * from 'ar' written by Haruhiko Okumura.)\n\t */\n\t for (bits = max_length; bits !== 0; bits--) {\n\t n = s.bl_count[bits];\n\t while (n !== 0) {\n\t m = s.heap[--h];\n\t if (m > max_code) { continue; }\n\t if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n\t // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n\t s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n\t tree[m * 2 + 1]/*.Len*/ = bits;\n\t }\n\t n--;\n\t }\n\t }\n\t}", "function gen_bitlen(s, desc)\n\t// deflate_state *s;\n\t// tree_desc *desc; /* the tree descriptor */\n\t{\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bits;\n\t var base = desc.stat_desc.extra_base;\n\t var max_length = desc.stat_desc.max_length;\n\t var h; /* heap index */\n\t var n, m; /* iterate over the tree elements */\n\t var bits; /* bit length */\n\t var xbits; /* extra bits */\n\t var f; /* frequency */\n\t var overflow = 0; /* number of elements with bit length too large */\n\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t s.bl_count[bits] = 0;\n\t }\n\n\t /* In a first pass, compute the optimal bit lengths (which may\n\t * overflow in the case of the bit length tree).\n\t */\n\t tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n\t for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t n = s.heap[h];\n\t bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n\t if (bits > max_length) {\n\t bits = max_length;\n\t overflow++;\n\t }\n\t tree[n * 2 + 1]/*.Len*/ = bits;\n\t /* We overwrite tree[n].Dad which is no longer needed */\n\n\t if (n > max_code) { continue; } /* not a leaf node */\n\n\t s.bl_count[bits]++;\n\t xbits = 0;\n\t if (n >= base) {\n\t xbits = extra[n - base];\n\t }\n\t f = tree[n * 2]/*.Freq*/;\n\t s.opt_len += f * (bits + xbits);\n\t if (has_stree) {\n\t s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n\t }\n\t }\n\t if (overflow === 0) { return; }\n\n\t // Trace((stderr,\"\\nbit length overflow\\n\"));\n\t /* This happens for example on obj2 and pic of the Calgary corpus */\n\n\t /* Find the first bit length which could increase: */\n\t do {\n\t bits = max_length - 1;\n\t while (s.bl_count[bits] === 0) { bits--; }\n\t s.bl_count[bits]--; /* move one leaf down the tree */\n\t s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n\t s.bl_count[max_length]--;\n\t /* The brother of the overflow item also moves one step up,\n\t * but this does not affect bl_count[max_length]\n\t */\n\t overflow -= 2;\n\t } while (overflow > 0);\n\n\t /* Now recompute all bit lengths, scanning in increasing frequency.\n\t * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t * lengths instead of fixing only the wrong ones. This idea is taken\n\t * from 'ar' written by Haruhiko Okumura.)\n\t */\n\t for (bits = max_length; bits !== 0; bits--) {\n\t n = s.bl_count[bits];\n\t while (n !== 0) {\n\t m = s.heap[--h];\n\t if (m > max_code) { continue; }\n\t if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n\t // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n\t s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n\t tree[m * 2 + 1]/*.Len*/ = bits;\n\t }\n\t n--;\n\t }\n\t }\n\t}", "function gen_bitlen(s, desc)\n\t// deflate_state *s;\n\t// tree_desc *desc; /* the tree descriptor */\n\t{\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bits;\n\t var base = desc.stat_desc.extra_base;\n\t var max_length = desc.stat_desc.max_length;\n\t var h; /* heap index */\n\t var n, m; /* iterate over the tree elements */\n\t var bits; /* bit length */\n\t var xbits; /* extra bits */\n\t var f; /* frequency */\n\t var overflow = 0; /* number of elements with bit length too large */\n\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t s.bl_count[bits] = 0;\n\t }\n\n\t /* In a first pass, compute the optimal bit lengths (which may\n\t * overflow in the case of the bit length tree).\n\t */\n\t tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n\t for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t n = s.heap[h];\n\t bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n\t if (bits > max_length) {\n\t bits = max_length;\n\t overflow++;\n\t }\n\t tree[n * 2 + 1]/*.Len*/ = bits;\n\t /* We overwrite tree[n].Dad which is no longer needed */\n\n\t if (n > max_code) { continue; } /* not a leaf node */\n\n\t s.bl_count[bits]++;\n\t xbits = 0;\n\t if (n >= base) {\n\t xbits = extra[n - base];\n\t }\n\t f = tree[n * 2]/*.Freq*/;\n\t s.opt_len += f * (bits + xbits);\n\t if (has_stree) {\n\t s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n\t }\n\t }\n\t if (overflow === 0) { return; }\n\n\t // Trace((stderr,\"\\nbit length overflow\\n\"));\n\t /* This happens for example on obj2 and pic of the Calgary corpus */\n\n\t /* Find the first bit length which could increase: */\n\t do {\n\t bits = max_length - 1;\n\t while (s.bl_count[bits] === 0) { bits--; }\n\t s.bl_count[bits]--; /* move one leaf down the tree */\n\t s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n\t s.bl_count[max_length]--;\n\t /* The brother of the overflow item also moves one step up,\n\t * but this does not affect bl_count[max_length]\n\t */\n\t overflow -= 2;\n\t } while (overflow > 0);\n\n\t /* Now recompute all bit lengths, scanning in increasing frequency.\n\t * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t * lengths instead of fixing only the wrong ones. This idea is taken\n\t * from 'ar' written by Haruhiko Okumura.)\n\t */\n\t for (bits = max_length; bits !== 0; bits--) {\n\t n = s.bl_count[bits];\n\t while (n !== 0) {\n\t m = s.heap[--h];\n\t if (m > max_code) { continue; }\n\t if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n\t // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n\t s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n\t tree[m * 2 + 1]/*.Len*/ = bits;\n\t }\n\t n--;\n\t }\n\t }\n\t}", "function gen_bitlen(s, desc)\n\t// deflate_state *s;\n\t// tree_desc *desc; /* the tree descriptor */\n\t{\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bits;\n\t var base = desc.stat_desc.extra_base;\n\t var max_length = desc.stat_desc.max_length;\n\t var h; /* heap index */\n\t var n, m; /* iterate over the tree elements */\n\t var bits; /* bit length */\n\t var xbits; /* extra bits */\n\t var f; /* frequency */\n\t var overflow = 0; /* number of elements with bit length too large */\n\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t s.bl_count[bits] = 0;\n\t }\n\n\t /* In a first pass, compute the optimal bit lengths (which may\n\t * overflow in the case of the bit length tree).\n\t */\n\t tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n\t for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n\t n = s.heap[h];\n\t bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n\t if (bits > max_length) {\n\t bits = max_length;\n\t overflow++;\n\t }\n\t tree[n * 2 + 1]/*.Len*/ = bits;\n\t /* We overwrite tree[n].Dad which is no longer needed */\n\n\t if (n > max_code) { continue; } /* not a leaf node */\n\n\t s.bl_count[bits]++;\n\t xbits = 0;\n\t if (n >= base) {\n\t xbits = extra[n - base];\n\t }\n\t f = tree[n * 2]/*.Freq*/;\n\t s.opt_len += f * (bits + xbits);\n\t if (has_stree) {\n\t s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n\t }\n\t }\n\t if (overflow === 0) { return; }\n\n\t // Trace((stderr,\"\\nbit length overflow\\n\"));\n\t /* This happens for example on obj2 and pic of the Calgary corpus */\n\n\t /* Find the first bit length which could increase: */\n\t do {\n\t bits = max_length - 1;\n\t while (s.bl_count[bits] === 0) { bits--; }\n\t s.bl_count[bits]--; /* move one leaf down the tree */\n\t s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n\t s.bl_count[max_length]--;\n\t /* The brother of the overflow item also moves one step up,\n\t * but this does not affect bl_count[max_length]\n\t */\n\t overflow -= 2;\n\t } while (overflow > 0);\n\n\t /* Now recompute all bit lengths, scanning in increasing frequency.\n\t * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t * lengths instead of fixing only the wrong ones. This idea is taken\n\t * from 'ar' written by Haruhiko Okumura.)\n\t */\n\t for (bits = max_length; bits !== 0; bits--) {\n\t n = s.bl_count[bits];\n\t while (n !== 0) {\n\t m = s.heap[--h];\n\t if (m > max_code) { continue; }\n\t if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n\t // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n\t s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n\t tree[m * 2 + 1]/*.Len*/ = bits;\n\t }\n\t n--;\n\t }\n\t }\n\t}", "function gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) {\n continue; \n } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) {\n return; \n }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) {\n bits--; \n }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) {\n continue; \n }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}", "function gen_bitlen(s, desc)\n\t// deflate_state *s;\n\t// tree_desc *desc; /* the tree descriptor */\n\t{\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bits;\n\t var base = desc.stat_desc.extra_base;\n\t var max_length = desc.stat_desc.max_length;\n\t var h; /* heap index */\n\t var n, m; /* iterate over the tree elements */\n\t var bits; /* bit length */\n\t var xbits; /* extra bits */\n\t var f; /* frequency */\n\t var overflow = 0; /* number of elements with bit length too large */\n\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t s.bl_count[bits] = 0;\n\t }\n\n\t /* In a first pass, compute the optimal bit lengths (which may\n\t * overflow in the case of the bit length tree).\n\t */\n\t tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n\t for (h = s.heap_max+1; h < HEAP_SIZE; h++) {\n\t n = s.heap[h];\n\t bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n\t if (bits > max_length) {\n\t bits = max_length;\n\t overflow++;\n\t }\n\t tree[n*2 + 1]/*.Len*/ = bits;\n\t /* We overwrite tree[n].Dad which is no longer needed */\n\n\t if (n > max_code) { continue; } /* not a leaf node */\n\n\t s.bl_count[bits]++;\n\t xbits = 0;\n\t if (n >= base) {\n\t xbits = extra[n-base];\n\t }\n\t f = tree[n * 2]/*.Freq*/;\n\t s.opt_len += f * (bits + xbits);\n\t if (has_stree) {\n\t s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits);\n\t }\n\t }\n\t if (overflow === 0) { return; }\n\n\t // Trace((stderr,\"\\nbit length overflow\\n\"));\n\t /* This happens for example on obj2 and pic of the Calgary corpus */\n\n\t /* Find the first bit length which could increase: */\n\t do {\n\t bits = max_length-1;\n\t while (s.bl_count[bits] === 0) { bits--; }\n\t s.bl_count[bits]--; /* move one leaf down the tree */\n\t s.bl_count[bits+1] += 2; /* move one overflow item as its brother */\n\t s.bl_count[max_length]--;\n\t /* The brother of the overflow item also moves one step up,\n\t * but this does not affect bl_count[max_length]\n\t */\n\t overflow -= 2;\n\t } while (overflow > 0);\n\n\t /* Now recompute all bit lengths, scanning in increasing frequency.\n\t * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t * lengths instead of fixing only the wrong ones. This idea is taken\n\t * from 'ar' written by Haruhiko Okumura.)\n\t */\n\t for (bits = max_length; bits !== 0; bits--) {\n\t n = s.bl_count[bits];\n\t while (n !== 0) {\n\t m = s.heap[--h];\n\t if (m > max_code) { continue; }\n\t if (tree[m*2 + 1]/*.Len*/ !== bits) {\n\t // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n\t s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/;\n\t tree[m*2 + 1]/*.Len*/ = bits;\n\t }\n\t n--;\n\t }\n\t }\n\t}", "function gen_bitlen(s, desc)\n\t// deflate_state *s;\n\t// tree_desc *desc; /* the tree descriptor */\n\t{\n\t var tree = desc.dyn_tree;\n\t var max_code = desc.max_code;\n\t var stree = desc.stat_desc.static_tree;\n\t var has_stree = desc.stat_desc.has_stree;\n\t var extra = desc.stat_desc.extra_bits;\n\t var base = desc.stat_desc.extra_base;\n\t var max_length = desc.stat_desc.max_length;\n\t var h; /* heap index */\n\t var n, m; /* iterate over the tree elements */\n\t var bits; /* bit length */\n\t var xbits; /* extra bits */\n\t var f; /* frequency */\n\t var overflow = 0; /* number of elements with bit length too large */\n\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t s.bl_count[bits] = 0;\n\t }\n\n\t /* In a first pass, compute the optimal bit lengths (which may\n\t * overflow in the case of the bit length tree).\n\t */\n\t tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n\t for (h = s.heap_max+1; h < HEAP_SIZE; h++) {\n\t n = s.heap[h];\n\t bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n\t if (bits > max_length) {\n\t bits = max_length;\n\t overflow++;\n\t }\n\t tree[n*2 + 1]/*.Len*/ = bits;\n\t /* We overwrite tree[n].Dad which is no longer needed */\n\n\t if (n > max_code) { continue; } /* not a leaf node */\n\n\t s.bl_count[bits]++;\n\t xbits = 0;\n\t if (n >= base) {\n\t xbits = extra[n-base];\n\t }\n\t f = tree[n * 2]/*.Freq*/;\n\t s.opt_len += f * (bits + xbits);\n\t if (has_stree) {\n\t s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits);\n\t }\n\t }\n\t if (overflow === 0) { return; }\n\n\t // Trace((stderr,\"\\nbit length overflow\\n\"));\n\t /* This happens for example on obj2 and pic of the Calgary corpus */\n\n\t /* Find the first bit length which could increase: */\n\t do {\n\t bits = max_length-1;\n\t while (s.bl_count[bits] === 0) { bits--; }\n\t s.bl_count[bits]--; /* move one leaf down the tree */\n\t s.bl_count[bits+1] += 2; /* move one overflow item as its brother */\n\t s.bl_count[max_length]--;\n\t /* The brother of the overflow item also moves one step up,\n\t * but this does not affect bl_count[max_length]\n\t */\n\t overflow -= 2;\n\t } while (overflow > 0);\n\n\t /* Now recompute all bit lengths, scanning in increasing frequency.\n\t * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n\t * lengths instead of fixing only the wrong ones. This idea is taken\n\t * from 'ar' written by Haruhiko Okumura.)\n\t */\n\t for (bits = max_length; bits !== 0; bits--) {\n\t n = s.bl_count[bits];\n\t while (n !== 0) {\n\t m = s.heap[--h];\n\t if (m > max_code) { continue; }\n\t if (tree[m*2 + 1]/*.Len*/ !== bits) {\n\t // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n\t s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/;\n\t tree[m*2 + 1]/*.Len*/ = bits;\n\t }\n\t n--;\n\t }\n\t }\n\t}" ]
[ "0.7310192", "0.72961044", "0.7278004", "0.7245382", "0.7242131", "0.7229786", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72161794", "0.72139484", "0.7210448", "0.7210448", "0.7210448", "0.7210448", "0.7210448", "0.720622", "0.72054183", "0.72054183" ]
0.0
-1
=========================================================================== Generate the codes for a given tree and bit counts (which need not be optimal). IN assertion: the array bl_count contains the bit length statistics for the given tree and the field len is set for all tree elements. OUT assertion: the field code is set for all tree elements of non zero code length.
function gen_codes(tree, max_code, bl_count) // ct_data *tree; /* the tree to decorate */ // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */ var code = 0; /* running code value */ var bits; /* bit index */ var n; /* code index */ /* The distribution counts are first used to generate the code values * without bit reversal. */ for (bits = 1; bits <= MAX_BITS; bits++) { next_code[bits] = code = (code + bl_count[bits-1]) << 1; } /* Check that the bit counts in bl_count are consistent. The last code * must be all ones. */ //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1, // "inconsistent bit counts"); //Tracev((stderr,"\ngen_codes: max_code %d ", max_code)); for (n = 0; n <= max_code; n++) { var len = tree[n*2 + 1]/*.Len*/; if (len === 0) { continue; } /* Now reverse the bits */ tree[n*2]/*.Code*/ = bi_reverse(next_code[len]++, len); //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_codes(tree, max_code, bl_count) // ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1);\n /* next code value for each bit length */\n\n var code = 0;\n /* running code value */\n\n var bits;\n /* bit index */\n\n var n;\n /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]\n /*.Len*/\n ;\n\n if (len === 0) {\n continue;\n }\n /* Now reverse the bits */\n\n\n tree[n * 2]\n /*.Code*/\n = bi_reverse(next_code[len]++, len); //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n const len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) {\n continue; \n }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1] /*.Len*/;\n if (len === 0) {\n continue;\n }\n /* Now reverse the bits */\n tree[n * 2] /*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS$1; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1];\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count) // ct_data *tree; /* the tree to decorate */\n // int max_code; /* largest code with non zero frequency */\n // ushf *bl_count; /* number of codes at each bit length */\n {\n var next_code = new Array(MAX_BITS + 1);\n /* next code value for each bit length */\n\n var code = 0;\n /* running code value */\n\n var bits;\n /* bit index */\n\n var n;\n /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]\n /*.Len*/\n ;\n\n if (len === 0) {\n continue;\n }\n /* Now reverse the bits */\n\n\n tree[n * 2]\n /*.Code*/\n = bi_reverse(next_code[len]++, len); //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n }", "function gen_codes(tree, max_code, bl_count) // ct_data *tree; /* the tree to decorate */\n // int max_code; /* largest code with non zero frequency */\n // ushf *bl_count; /* number of codes at each bit length */\n {\n var next_code = new Array(MAX_BITS + 1);\n /* next code value for each bit length */\n\n var code = 0;\n /* running code value */\n\n var bits;\n /* bit index */\n\n var n;\n /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]\n /*.Len*/\n ;\n\n if (len === 0) {\n continue;\n }\n /* Now reverse the bits */\n\n\n tree[n * 2]\n /*.Code*/\n = bi_reverse(next_code[len]++, len); //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n }", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n {\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n }", "function gen_codes(tree, max_code, bl_count)\n // ct_data *tree; /* the tree to decorate */\n // int max_code; /* largest code with non zero frequency */\n // ushf *bl_count; /* number of codes at each bit length */\n {\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n \n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n \n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n \n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n }", "function gen_codes(tree, max_code, bl_count)\n\t// ct_data *tree; /* the tree to decorate */\n\t// int max_code; /* largest code with non zero frequency */\n\t// ushf *bl_count; /* number of codes at each bit length */\n\t{\n\t var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */\n\t var code = 0; /* running code value */\n\t var bits; /* bit index */\n\t var n; /* code index */\n\n\t /* The distribution counts are first used to generate the code values\n\t * without bit reversal.\n\t */\n\t for (bits = 1; bits <= MAX_BITS; bits++) {\n\t next_code[bits] = code = (code + bl_count[bits-1]) << 1;\n\t }\n\t /* Check that the bit counts in bl_count are consistent. The last code\n\t * must be all ones.\n\t */\n\t //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n\t // \"inconsistent bit counts\");\n\t //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\t for (n = 0; n <= max_code; n++) {\n\t var len = tree[n*2 + 1]/*.Len*/;\n\t if (len === 0) { continue; }\n\t /* Now reverse the bits */\n\t tree[n*2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n\t //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n\t // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n\t }\n\t}", "function gen_codes(tree, max_code, bl_count)\n\t// ct_data *tree; /* the tree to decorate */\n\t// int max_code; /* largest code with non zero frequency */\n\t// ushf *bl_count; /* number of codes at each bit length */\n\t{\n\t var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */\n\t var code = 0; /* running code value */\n\t var bits; /* bit index */\n\t var n; /* code index */\n\n\t /* The distribution counts are first used to generate the code values\n\t * without bit reversal.\n\t */\n\t for (bits = 1; bits <= MAX_BITS; bits++) {\n\t next_code[bits] = code = (code + bl_count[bits-1]) << 1;\n\t }\n\t /* Check that the bit counts in bl_count are consistent. The last code\n\t * must be all ones.\n\t */\n\t //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n\t // \"inconsistent bit counts\");\n\t //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\t for (n = 0; n <= max_code; n++) {\n\t var len = tree[n*2 + 1]/*.Len*/;\n\t if (len === 0) { continue; }\n\t /* Now reverse the bits */\n\t tree[n*2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n\t //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n\t // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n\t }\n\t}", "function gen_codes(tree, max_code, bl_count)\n\t// ct_data *tree; /* the tree to decorate */\n\t// int max_code; /* largest code with non zero frequency */\n\t// ushf *bl_count; /* number of codes at each bit length */\n\t{\n\t var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n\t var code = 0; /* running code value */\n\t var bits; /* bit index */\n\t var n; /* code index */\n\n\t /* The distribution counts are first used to generate the code values\n\t * without bit reversal.\n\t */\n\t for (bits = 1; bits <= MAX_BITS; bits++) {\n\t next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n\t }\n\t /* Check that the bit counts in bl_count are consistent. The last code\n\t * must be all ones.\n\t */\n\t //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n\t // \"inconsistent bit counts\");\n\t //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\t for (n = 0; n <= max_code; n++) {\n\t var len = tree[n * 2 + 1]/*.Len*/;\n\t if (len === 0) { continue; }\n\t /* Now reverse the bits */\n\t tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n\t //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n\t // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n\t }\n\t}", "function gen_codes(tree, max_code, bl_count)\n\t// ct_data *tree; /* the tree to decorate */\n\t// int max_code; /* largest code with non zero frequency */\n\t// ushf *bl_count; /* number of codes at each bit length */\n\t{\n\t var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n\t var code = 0; /* running code value */\n\t var bits; /* bit index */\n\t var n; /* code index */\n\n\t /* The distribution counts are first used to generate the code values\n\t * without bit reversal.\n\t */\n\t for (bits = 1; bits <= MAX_BITS; bits++) {\n\t next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n\t }\n\t /* Check that the bit counts in bl_count are consistent. The last code\n\t * must be all ones.\n\t */\n\t //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n\t // \"inconsistent bit counts\");\n\t //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\t for (n = 0; n <= max_code; n++) {\n\t var len = tree[n * 2 + 1]/*.Len*/;\n\t if (len === 0) { continue; }\n\t /* Now reverse the bits */\n\t tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n\t //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n\t // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n\t }\n\t}", "function gen_codes(tree, max_code, bl_count)\n\t// ct_data *tree; /* the tree to decorate */\n\t// int max_code; /* largest code with non zero frequency */\n\t// ushf *bl_count; /* number of codes at each bit length */\n\t{\n\t var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n\t var code = 0; /* running code value */\n\t var bits; /* bit index */\n\t var n; /* code index */\n\n\t /* The distribution counts are first used to generate the code values\n\t * without bit reversal.\n\t */\n\t for (bits = 1; bits <= MAX_BITS; bits++) {\n\t next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n\t }\n\t /* Check that the bit counts in bl_count are consistent. The last code\n\t * must be all ones.\n\t */\n\t //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n\t // \"inconsistent bit counts\");\n\t //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\t for (n = 0; n <= max_code; n++) {\n\t var len = tree[n * 2 + 1]/*.Len*/;\n\t if (len === 0) { continue; }\n\t /* Now reverse the bits */\n\t tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n\t //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n\t // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n\t }\n\t}" ]
[ "0.82030475", "0.817848", "0.81344014", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.8130681", "0.81300694", "0.8117773", "0.81091964", "0.809521", "0.80400854", "0.8039331", "0.8039331", "0.803465", "0.803465", "0.803465" ]
0.8137075
24
=========================================================================== Initialize the various 'constant' tables.
function tr_static_init() { var n; /* iterates over tree elements */ var bits; /* bit counter */ var length; /* length value */ var code; /* code value */ var dist; /* distance index */ var bl_count = new Array(MAX_BITS+1); /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() //if (static_init_done) return; /* For some embedded targets, global variables are not initialized: */ /*#ifdef NO_INIT_GLOBAL_POINTERS static_l_desc.static_tree = static_ltree; static_l_desc.extra_bits = extra_lbits; static_d_desc.static_tree = static_dtree; static_d_desc.extra_bits = extra_dbits; static_bl_desc.extra_bits = extra_blbits; #endif*/ /* Initialize the mapping length (0..255) -> length code (0..28) */ length = 0; for (code = 0; code < LENGTH_CODES-1; code++) { base_length[code] = length; for (n = 0; n < (1<<extra_lbits[code]); n++) { _length_code[length++] = code; } } //Assert (length == 256, "tr_static_init: length != 256"); /* Note that the length 255 (match length 258) can be represented * in two different ways: code 284 + 5 bits or code 285, so we * overwrite length_code[255] to use the best encoding: */ _length_code[length-1] = code; /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ dist = 0; for (code = 0 ; code < 16; code++) { base_dist[code] = dist; for (n = 0; n < (1<<extra_dbits[code]); n++) { _dist_code[dist++] = code; } } //Assert (dist == 256, "tr_static_init: dist != 256"); dist >>= 7; /* from now on, all distances are divided by 128 */ for ( ; code < D_CODES; code++) { base_dist[code] = dist << 7; for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { _dist_code[256 + dist++] = code; } } //Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ for (bits = 0; bits <= MAX_BITS; bits++) { bl_count[bits] = 0; } n = 0; while (n <= 143) { static_ltree[n*2 + 1]/*.Len*/ = 8; n++; bl_count[8]++; } while (n <= 255) { static_ltree[n*2 + 1]/*.Len*/ = 9; n++; bl_count[9]++; } while (n <= 279) { static_ltree[n*2 + 1]/*.Len*/ = 7; n++; bl_count[7]++; } while (n <= 287) { static_ltree[n*2 + 1]/*.Len*/ = 8; n++; bl_count[8]++; } /* Codes 286 and 287 do not exist, but we must include them in the * tree construction to get a canonical Huffman tree (longest code * all ones) */ gen_codes(static_ltree, L_CODES+1, bl_count); /* The static distance tree is trivial: */ for (n = 0; n < D_CODES; n++) { static_dtree[n*2 + 1]/*.Len*/ = 5; static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5); } // Now data ready and we can init static trees static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS); static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Constants() {}", "function Constants() {}", "function setConstants() {\n squareConfigs.constantValues = {\n x: squareConfigs.dimensions.x,\n y: squareConfigs.dimensions.y,\n w: squareConfigs.dimensions.w,\n h: squareConfigs.dimensions.h,\n\n actuallyConstantX: squareConfigs.dimensions.x,\n actuallyConstantY: squareConfigs.dimensions.y,\n actuallyConstantW: squareConfigs.dimensions.w,\n actuallyConstantH: squareConfigs.dimensions.h,\n colors: {r: squareConfigs.colors.r, g: squareConfigs.colors.g, b: squareConfigs.colors.b},\n transformationColor: {r: squareConfigs.transformationColor.r, g: squareConfigs.transformationColor.g, b: squareConfigs.transformationColor.b, special: squareConfigs.transformationColor.special}\n }\n}", "static initCrc32Table() {\n let i;\n for (let j = 0; j < 256; j++) {\n i = j;\n for (let k = 0; k < 8; k++) {\n i = ((i & 1) ? (0xEDB88320 ^ (i >>> 1)) : (i >>> 1));\n }\n CRC32TABLE[j] = i;\n }\n }", "_constants()\n {\n this.CREATED_AT = CREATED_AT;\n this.UPDATED_AT = UPDATED_AT;\n this.PRIMARY_KEY = PRIMARY_KEY;\n }", "function Constants() {\n if (currentToken() == \"constantes\") {\n nextToken();\n if (currentToken() == \"{\") {\n nextToken();\n ConstBody();\n if (currentToken() == \"}\") {\n nextToken();\n return;\n }\n }\n } else {\n let errorMessage = \"Bloco obrigatório de constantes não encontrado\";\n handleError(errorMessage);\n }\n }", "function InitStatics( x,y,z)\r\n\t\t{\r\n\t\t\tvar tables = SectorTables.find( (tab)=>{ return( tab.x==x && tab.y==y && tab.z == z ) });\r\n\t\t\tif( !tables )\r\n\t\t\t{\r\n\t\t\t\ttables = {\r\n\t\t\t\t\tx: x,\r\n\t\t\t\t\ty: y,\r\n\t\t\t\t\tz: z,\r\n\t\t\t\t\ttableX : new Array( x+2 ),\r\n\t\t\t\t\ttableY : new Array( y+2 ),\r\n\t\t\t\t\ttableZ : new Array( z+2 ),\r\n\t\t\t\t\tofTableX : new Array( x+2 ),\r\n\t\t\t\t\tofTableY : new Array( y+2 ),\r\n\t\t\t\t\tofTableZ : new Array( z+2 )\r\n\t\t\t\t}\r\n\t\t\t\t//tables.tableX.forEach( (elem)=>{elem=0})\r\n\t\t\t\t//console.log( \"tableX init is \", tables.tableX)\r\n\t\t\t\ttables.tableX[0] = 1;\r\n\t\t\t\ttables.tableX[x + 1] = 2;\r\n\t\t\t\ttables.tableZ[0] = 3;\r\n\t\t\t\ttables.tableZ[y + 1] = 6;\r\n\t\t\t\ttables.tableY[0] = 9;\r\n\t\t\t\ttables.tableY[z + 1] = 18;\r\n n = 0;\r\n tables.ofTableX[n] = ( ( ( n == 0 ) ? ( x - 1 ) : ( n == ( x + 1 ) ) ? 0 : ( n - 1 ) ) * y );\r\n tables.ofTableY[n] = ( ( ( n == 0 ) ? ( y - 1 ) : ( n == ( y + 1 ) ) ? 0 : ( n - 1 ) ) );\r\n tables.ofTableZ[n] = ( ( ( n == 0 ) ? ( z - 1 ) : ( n == ( z + 1 ) ) ? 0 : ( n - 1 ) ) * y * z );\r\n n = x+1;\r\n tables.ofTableX[n] = ( ( ( n == 0 ) ? ( x - 1 ) : ( n == ( x + 1 ) ) ? 0 : ( n - 1 ) ) * y );\r\n tables.ofTableY[n] = ( ( ( n == 0 ) ? ( y - 1 ) : ( n == ( y + 1 ) ) ? 0 : ( n - 1 ) ) );\r\n tables.ofTableZ[n] = ( ( ( n == 0 ) ? ( z - 1 ) : ( n == ( z + 1 ) ) ? 0 : ( n - 1 ) ) * y * z );\r\n for( n = 1; n < x + 1; n++ ) {\r\n\t\t\t\t\ttables.ofTableX[n] = ( ( ( n == 0 ) ? ( x - 1 ) : ( n == ( x + 1 ) ) ? 0 : ( n - 1 ) ) * y );\r\n tables.tableX[n] = 0;\r\n }\r\n\t\t\t\tfor( var n = 1; n < y + 1; n++ ){\r\n\t\t\t\t\ttables.ofTableY[n] = ( ( ( n == 0 ) ? ( y - 1 ) : ( n == ( y + 1 ) ) ? 0 : ( n - 1 ) ) );\r\n tables.tableY[n] = 0;\r\n }\r\n\t\t\t\tfor( n = 1; n < z + 1; n++ ) {\r\n\t\t\t\t\ttables.ofTableZ[n] = ( ( ( n == 0 ) ? ( z - 1 ) : ( n == ( z + 1 ) ) ? 0 : ( n - 1 ) ) * y * z );\r\n tables.tableZ[n] = 0;\r\n }\r\n\t\t\t\tSectorTables.push( tables );\r\n\t\t\t}\r\n Object.defineProperties( tables\r\n , { \"x\" : { writable:false}\r\n , \"y\" : { writable:false}\r\n , \"z\" : { writable:false}\r\n , \"tableX\" : { writable:false}\r\n , \"tableY\" : { writable:false}\r\n , \"tableZ\" : { writable:false}\r\n , \"ofTableX\" : { writable:false}\r\n , \"ofTableY\" : { writable:false}\r\n , \"ofTableZ\" : { writable:false}\r\n });\r\n Object.freeze( tables.tableX );\r\n Object.freeze( tables.tableY );\r\n Object.freeze( tables.tableZ );\r\n Object.freeze( tables.ofTableX );\r\n Object.freeze( tables.ofTableY );\r\n Object.freeze( tables.ofTableZ );\r\n\t\t\treturn tables;\r\n\t\t}", "initHapConstants() {\n Service = this.api.hap.Service;\n Characteristic = this.api.hap.Characteristic;\n Accessory = this.api.platformAccessory;\n HapStatusError = this.api.hap.HapStatusError;\n HAPStatus = this.api.hap.HAPStatus;\n }", "initHapConstants() {\n Service = this.api.hap.Service;\n Characteristic = this.api.hap.Characteristic;\n Accessory = this.api.platformAccessory;\n HapStatusError = this.api.hap.HapStatusError;\n HAPStatus = this.api.hap.HAPStatus;\n }", "initHapConstants() {\n Service = this.api.hap.Service;\n Characteristic = this.api.hap.Characteristic;\n Accessory = this.api.platformAccessory;\n HapStatusError = this.api.hap.HapStatusError;\n HAPStatus = this.api.hap.HAPStatus;\n }", "function _init_all_tables(db){\n try{ \n _init_my_updating_records_for_data_table(db);\n _init_my_updating_errors_for_data_table(db);\n _init_my_updating_records_table(db);\n _init_my_updating_errors_table(db);\n _init_my_gps_location_table(db);\n _init_my_summary_table(db);\n \n _init_my_client_type_code_table(db);\n _init_my_contact_type_code_table(db);\n _init_my_manager_user_agreement_table(db);\n _init_my_job_asset_type_code_table(db);\n _init_my_job_assigned_user_code_table(db);\n _init_my_job_note_type_code_table(db);\n _init_my_job_priority_code_table(db);\n _init_my_job_status_code_table(db);\n _init_my_job_operation_log_type_code_table(db);\n _init_my_job_library_item_type_code_table(db);\n _init_my_job_library_item_table(db);\n _init_my_locality_state_table(db);\n _init_my_locality_street_type_table(db);\n _init_my_locality_street_type_alias_table(db);\n _init_my_order_source_code(db);\n\n _init_my_salutation_code_table(db);\n _init_my_status_code_table(db);\n _init_my_frontend_config_setting_table(db);\n _init_my_quote_asset_type_code_table(db);\n _init_my_quote_note_type_code_table(db);\n _init_my_quote_status_code_table(db);\n _init_my_quote_operation_log_type_code_table(db);\n _init_my_manager_user_table(db);\n _init_my_client_table(db);\n _init_my_client_contact_table(db);\n _init_my_company_table(db);\n\n _init_my_job_table(db);\n _init_my_job_asset_table(db);\n _init_my_job_assigned_user_table(db);\n _init_my_job_client_contact_table(db);\n _init_my_job_site_contact_table(db);\n _init_my_job_contact_history_table(db);\n _init_my_job_contact_history_recipient_table(db);\n _init_my_job_note_table(db);\n _init_my_job_operation_log_table(db);\n _init_my_job_assigned_item_table(db);\n _init_my_job_status_log_table(db);\n\n _init_my_quote_table(db);\n _init_my_quote_asset_table(db);\n _init_my_quote_client_contact_table(db);\n _init_my_quote_site_contact_table(db);\n _init_my_quote_contact_history_table(db);\n _init_my_quote_contact_history_recipient_table(db);\n _init_my_quote_note_table(db);\n _init_my_quote_assigned_user_table(db);\n _init_my_quote_assigned_item_table(db);\n _init_my_quote_status_log_table(db);\n _init_my_quote_operation_log_table(db);\n \n //signature\n //_init_my_job_signature_table(db);\n //_init_my_quote_signature_table(db); \n //job invoice tables\n _init_my_job_invoice_table(db);\n _init_my_job_invoice_item_table(db);\n _init_my_job_invoice_operation_item_table(db);\n _init_my_job_invoice_receipt_table(db);\n _init_my_job_invoice_receipt_status_table(db);\n _init_my_job_invoice_status_code_table(db);\n _init_my_job_invoice_status_log_table(db);\n _init_my_job_invoice_template_table(db);\n //quote invoice tables\n _init_my_quote_invoice_table(db);\n _init_my_quote_invoice_status_code_table(db);\n _init_my_quote_invoice_template_table(db); \n //email signature\n _init_my_manager_user_email_signature_table(db);\n //item management tables\n _init_my_materials_locations_table(db);\n _init_my_materials_stocks_table(db); \n //manager mobile user code\n _init_my_manager_user_mobile_code_table(db);\n _init_my_manager_user_mobile_table(db); \n //invoice signature\n _init_my_job_invoice_signature_table(db);\n _init_my_quote_invoice_signature_table(db);\n //custom report\n _init_my_custom_report_table(db);\n _init_my_custom_report_field_table(db);\n _init_my_job_custom_report_data_table(db);\n _init_my_quote_custom_report_data_table(db);\n _init_my_job_custom_report_signature_table(db);\n _init_my_quote_custom_report_signature_table(db);\n //init labour manual item\n _init_my_job_operation_manual_table(db);\n _init_my_job_assigned_operation_manual_table(db);\n _init_my_quote_operation_manual_table(db);\n _init_my_quote_assigned_operation_manual_table(db);\n \n //init job count info table\n _init_my_job_and_quote_count_info_table(db);\n //init supplier tables\n _init_my_supplier_type_code_table(db);\n _init_my_suppliers_table(db);\n _init_my_suppliers_contact_table(db);\n //purchase order\n _init_my_purchase_order_status_code_table(db);\n _init_my_purchase_order_table(db);\n _init_my_purchase_order_item_table(db);\n //locksmith\n _init_my_job_invoice_locksmith_table(db);\n _init_my_job_invoice_locksmith_signature_table(db);\n }catch(err){\n self.process_simple_error_message(err);\n return;\n }\n }", "_initializing() {\n return {\n setupConstants() {\n // Make constants available in templates\n this.LIQUIBASE_DTD_VERSION = constants.LIQUIBASE_DTD_VERSION;\n },\n };\n }", "function CalcConstants(c){\n this.fort = c.fcon / (c.rcon * c.t)\t\t\n\t\tthis.vol = c.pi * (c.difna * c.difna) * c.difnl;\n\t\tthis.vi = (1. - c.vecs) * this.vol;\n\t\tthis.ve = c.vecs * this.vol;\n\t\tthis.vup = 0.05 * this.vi;\n\t\tthis.vrel = 0.02 * this.vi;\n\t\tthis.rtof = 1.0 / this.fort;\n\n\n\t\t// calculated constants\n \tthis.aup = (2. * c.fcon * this.vi) / (c.tup * c.cabarup);\n \tthis.atr = (2. * c.fcon * this.vrel) / c.trep;\n \tthis.arel = (2. * c.fcon * this.vrel) / c.trel;\n \tthis.nao3 = Math.pow(c.nao,3); //c.nao * c.nao * c.nao;\n \tthis.exp100fort = Math.exp(100. * this.fort);\n \tthis.exp50fort = Math.exp(50. * this.fort);\n\n }", "_initializeSearchFieldConstants() {\n this.constants = {};\n Object.assign(this.constants, {\n searchFieldNames: Object.keys(this._searchFields),\n stateSelectionFilter: this._stateSelectionFilter,\n });\n }", "function ct_init() {\n\t\tvar n; // iterates over tree elements\n\t\tvar bits; // bit counter\n\t\tvar length; // length value\n\t\tvar code; // code value\n\t\tvar dist; // distance index\n\n\t\tif (static_dtree[0].dl !== 0) {\n\t\t\treturn; // ct_init already called\n\t\t}\n\n\t\tl_desc.dyn_tree = dyn_ltree;\n\t\tl_desc.static_tree = static_ltree;\n\t\tl_desc.extra_bits = extra_lbits;\n\t\tl_desc.extra_base = LITERALS + 1;\n\t\tl_desc.elems = L_CODES;\n\t\tl_desc.max_length = MAX_BITS;\n\t\tl_desc.max_code = 0;\n\n\t\td_desc.dyn_tree = dyn_dtree;\n\t\td_desc.static_tree = static_dtree;\n\t\td_desc.extra_bits = extra_dbits;\n\t\td_desc.extra_base = 0;\n\t\td_desc.elems = D_CODES;\n\t\td_desc.max_length = MAX_BITS;\n\t\td_desc.max_code = 0;\n\n\t\tbl_desc.dyn_tree = bl_tree;\n\t\tbl_desc.static_tree = null;\n\t\tbl_desc.extra_bits = extra_blbits;\n\t\tbl_desc.extra_base = 0;\n\t\tbl_desc.elems = BL_CODES;\n\t\tbl_desc.max_length = MAX_BL_BITS;\n\t\tbl_desc.max_code = 0;\n\n\t // Initialize the mapping length (0..255) -> length code (0..28)\n\t\tlength = 0;\n\t\tfor (code = 0; code < LENGTH_CODES - 1; code++) {\n\t\t\tbase_length[code] = length;\n\t\t\tfor (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t\t\t\tlength_code[length++] = code;\n\t\t\t}\n\t\t}\n\t // Assert (length === 256, \"ct_init: length !== 256\");\n\n\t\t// Note that the length 255 (match length 258) can be represented\n\t\t// in two different ways: code 284 + 5 bits or code 285, so we\n\t\t// overwrite length_code[255] to use the best encoding:\n\t\tlength_code[length - 1] = code;\n\n\t\t// Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t\tdist = 0;\n\t\tfor (code = 0; code < 16; code++) {\n\t\t\tbase_dist[code] = dist;\n\t\t\tfor (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t\t\t\tdist_code[dist++] = code;\n\t\t\t}\n\t\t}\n\t\t// Assert (dist === 256, \"ct_init: dist !== 256\");\n\t\t// from now on, all distances are divided by 128\n\t\tfor (dist >>= 7; code < D_CODES; code++) {\n\t\t\tbase_dist[code] = dist << 7;\n\t\t\tfor (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t\t\t\tdist_code[256 + dist++] = code;\n\t\t\t}\n\t\t}\n\t\t// Assert (dist === 256, \"ct_init: 256+dist !== 512\");\n\n\t\t// Construct the codes of the static literal tree\n\t\tfor (bits = 0; bits <= MAX_BITS; bits++) {\n\t\t\tbl_count[bits] = 0;\n\t\t}\n\t\tn = 0;\n\t\twhile (n <= 143) {\n\t\t\tstatic_ltree[n++].dl = 8;\n\t\t\tbl_count[8]++;\n\t\t}\n\t\twhile (n <= 255) {\n\t\t\tstatic_ltree[n++].dl = 9;\n\t\t\tbl_count[9]++;\n\t\t}\n\t\twhile (n <= 279) {\n\t\t\tstatic_ltree[n++].dl = 7;\n\t\t\tbl_count[7]++;\n\t\t}\n\t\twhile (n <= 287) {\n\t\t\tstatic_ltree[n++].dl = 8;\n\t\t\tbl_count[8]++;\n\t\t}\n\t\t// Codes 286 and 287 do not exist, but we must include them in the\n\t\t// tree construction to get a canonical Huffman tree (longest code\n\t\t// all ones)\n\t\tgen_codes(static_ltree, L_CODES + 1);\n\n\t\t// The static distance tree is trivial: */\n\t\tfor (n = 0; n < D_CODES; n++) {\n\t\t\tstatic_dtree[n].dl = 5;\n\t\t\tstatic_dtree[n].fc = bi_reverse(n, 5);\n\t\t}\n\n\t\t// Initialize the first block of the first file:\n\t\tinit_block();\n\t}", "function initConstantsDev()\n{\n // THESE REPRESENT THE TWO POSSIBLE STATES FOR EACH CELL\n DEAD_CELL_DEV = '0';\n SPACESHIP_CELL_DEV = '1';\n FINISH_CELL_DEV = '2';\n BAD_CELL_DEV = '3';\n GOOD_CELL_DEV = '4';\n VOID_CELL_DEV = '5';\n BULLET_CELL_DEV = '6';\n TOKEN_CELL_DEV = '7';\n KEY_CELL_DEV = '8';\n // POWERUP CELLS\n RANDOM_POWERUP_CELL_DEV = '9';\n FUEL_CELL_DEV = 'a';\n HEALTH_CELL_DEV = 'b';\n SLOW_TIME_CELL_DEV = 'c';\n MORE_BULLETS_CELL_DEV = 'd';\n // ASTHETIC CELLS\n SPACESHIP_DAMAGED_CELL_DEV = 'e';\n FINISH_LOCKED_CELL_DEV = 'f';\n // ALL VALUES PAST THIS POINT ARE TELEPORTER VALUES\n TELEPORTER_BASE_VAL_DEV = 'g';\n\n // COLORS FOR RENDERING\n BAD_COLOR_DEV = \"#FF0000\";\n SPACESHIP_COLOR_DEV = \"#AFAFAF\";\n FINISH_COLOR_DEV = \"#B938FF\"\n FINISH_LOCKED_COLOR_DEV = \"#65156b\";\n SPACESHIP_DAMAGED_COLOR_DEV = \"#FFA411\";\n GRID_LINES_COLOR_DEV = \"#CCCCCC\";\n GRID_BACKGROUND_COLOR_DEV = \"#000000\"\n TEXT_COLOR_DEV = \"#FFFF00\";\n VOID_COLOR_DEV = \"#444444\";\n GOOD_COLOR_DEV = \"#54a04b\";\n POWERUP_COLOR_DEV = \"#fff956\";\n BULLET_COLOR_DEV = \"#FFFFFF\";\n KEY_COLOR_DEV = \"#ff00ae\";\n TOKEN_COLOR_DEV = \"#fff39e\";\n TELEPORTER_COLOR_DEV = \"#0affd6\";\n\n HEALTH_OUTLINE_DEV = \"#00e845\";\n FUEL_OUTLINE_DEV = \"#7a4f00\";\n SLOW_TIME_OUTLINE_DEV = \"#0053d8\";\n MORE_BULLETS_OUTLINE_DEV = \"#aaaaaa\";\n\n OVERLAY_COLOR = \"rgba(0, 0, 0, 0.57)\";\n OVERLAY_TEXT_COLOR = \"#FFFFFF\";\n OVERLAY_TITLE_X = 330;\n OVERLAY_TITLE_Y = 200;\n\n // THESE REPRESENT THE DIFFERENT TYPES OF CELL LOCATIONS IN THE GRID\n TOP_LEFT_DEV = 0;\n TOP_RIGHT_DEV = 1;\n BOTTOM_LEFT_DEV = 2;\n BOTTOM_RIGHT_DEV = 3;\n TOP_DEV = 4;\n BOTTOM_DEV = 5;\n LEFT_DEV = 6;\n RIGHT_DEV = 7;\n CENTER_DEV = 8;\n\n // FPS CONSTANTS\n MILLISECONDS_IN_ONE_SECOND_DEV = 1000;\n MAX_FPS_DEV = 33;\n MIN_FPS_DEV = 1;\n FPS_INC_DEV = 1;\n\n // CELL LENGTH CONSTANTS\n MAX_CELL_LENGTH_DEV = 32;\n MIN_CELL_LENGTH_DEV = 1;\n CELL_LENGTH_INC_DEV = 2;\n GRID_LINE_LENGTH_RENDERING_THRESHOLD_DEV = 8;\n\n // RENDERING LOCATIONS FOR TEXT ON THE CANVAS\n FPS_X_DEV = 20;\n FPS_Y_DEV = 450;\n CELL_LENGTH_X_DEV = 20;\n CELL_LENGTH_Y_DEV = 480;\n FUEL_X_DEV = 230;\n FUEL_Y_DEV = 30;\n HEALTH_X_DEV = 650;\n HEALTH_Y_DEV = 30;\n\n // To make sure that all images are loaded\n imagesLoadedDev = 0; // MAXIMUM = 4 (ship Up, Right, Down, Left)\n\n fpsDev = 20;\n\n // give the level default values\n if(toPlay === false){\n // DEFAULT VALUES\n xSpaceshipDev = 2;\n ySpaceshipDev = 30;\n dirSpaceshipDev = \"right\";\n velSpaceshipDev = 1;\n fuelDev = 100;\n healthDev = 100;\n cellLengthDev = 8;\n bulletLimitDev = 10;\n\n }\n moveShip = false;\n forceMove = false;\n\n bulletsConsumed = 0;\n\n keysPressed = new Array();\n\n playerShipDev = new spaceship(xSpaceshipDev, ySpaceshipDev, dirSpaceshipDev, velSpaceshipDev, healthDev, fuelDev);\n\n numKeysDev = 0;\n\n keysDev = {32: 1, 37: 1, 38: 1, 39: 1, 40: 1};\n\n teleporterListDev = new Array();\n toTeleport = false;\n}", "function init() {\n\t\tBB.TableModule.initTableVars();\n\t\t_addBalls();\n\t\t_renderBalls();\n\t\t_startGameLoop();\n\t}", "function Constants() {\n throw new Error('Constants should not be instantiated!');\n}", "function extensionTableInit() {\n const res = Object.create(null);\n for (const [_key, value] of Object.entries(exports.extensionTableInput)) {\n const key = _key;\n if (res[key]) {\n continue;\n }\n extensionTableBuilderInitKey(key, value, res);\n }\n exports.superTypeDictTable = res;\n}", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS + 1);\n\t /* number of codes at each bit length for an optimal tree */\n\t\n\t static_ltree = new Array((L_CODES + 2) * 2);\n\t zero(static_ltree);\n\t\n\t static_dtree = new Array(D_CODES * 2);\n\t zero(static_dtree);\n\t\n\t _dist_code = new Array(DIST_CODE_LEN);\n\t zero(_dist_code);\n\t\n\t _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n\t zero(_length_code);\n\t\n\t base_length = new Array(LENGTH_CODES);\n\t zero(base_length);\n\t\n\t base_dist = new Array(D_CODES);\n\t zero(base_dist);\n\t\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\t\n\t /* For some embedded targets, global variables are not initialized: */\n\t /*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t #endif*/\n\t\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES - 1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length - 1] = code;\n\t\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\t\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\t\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES + 1, bl_count);\n\t\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n * 2 + 1]/*.Len*/ = 5;\n\t static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\t\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\t\n\t //static_init_done = true;\n\t }", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n }", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n \n // do check in _tr_init()\n //if (static_init_done) return;\n \n /* For some embedded targets, global variables are not initialized: */\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n #endif*/\n \n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n \n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n \n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n \n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n \n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n \n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n \n //static_init_done = true;\n }", "function CalcConstants(c){\n \n this.pi = 4*Math.atan(1.);\n this.RTon2F = 8.3143*310.15/(2.0*c.Fc);\n this.RTonF = 2.0*this.RTon2F;\n this.eca = this.RTon2F*Math.log(c.Cae/c.Cai);\n this.fCa = c.KCa/(c.KCa + c.Cai);\n this.ekr = this.RTonF*Math.log(c.Ke/c.Ki);\n this.ek1 = this.RTonF*Math.log(c.Ke/c.Ki);\n this.ena = this.RTonF*Math.log(c.Nae/c.Nai);\n this.eto = this.RTonF*Math.log( (c.Ke+0.043*c.Nae) / (c.Ki+0.043*c.Nai));\n this.sigma = (Math.exp(c.Nae/67.3) - 1.0) / 7.0 ;\n this.d_o_dx2 = c.timestep*c.dlap/(c.dx*c.dx);\n }", "function CalcConstants(c){\n this.inverseVcF2 = 1/(2*c.Vc*c.FF);\n this.inverseVcF = 1.0/(c.Vc*c.FF);\n this.inversevssF2 = 1/(2*c.Vss*c.FF);\n this.rtof = (c.RR*c.TT)/c.FF;\n this.fort = 1.0/this.rtof;\n this.KmNai3 = Math.pow(c.KmNai,3); //c.KmNai*c.KmNai*c.KmNai\n this.Nao3 = Math.pow(c.Nao,3); //c.Nao*c.Nao*c.Nao;\n this.Gkrfactor = Math.sqrt(c.Ko/5.4);\n\n //asymptotic value for taufcass when cass>1\n this.exptaufcassinf = Math.exp(-cS.timestep/2.0) \n }", "function tr_static_init() {\n var n;\n /* iterates over tree elements */\n\n var bits;\n /* bit counter */\n\n var length;\n /* length value */\n\n var code;\n /* code value */\n\n var dist;\n /* distance index */\n\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n #endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n\n length = 0;\n\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n } //Assert (length == 256, \"tr_static_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n\n\n _length_code[length - 1] = code;\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\n dist = 0;\n\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\n\n dist >>= 7;\n /* from now on, all distances are divided by 128 */\n\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n\n while (n <= 143) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n\n while (n <= 255) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 9;\n n++;\n bl_count[9]++;\n }\n\n while (n <= 279) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 7;\n n++;\n bl_count[7]++;\n }\n\n while (n <= 287) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n\n\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n /* The static distance tree is trivial: */\n\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]\n /*.Len*/\n = 5;\n static_dtree[n * 2]\n /*.Code*/\n = bi_reverse(n, 5);\n } // Now data ready and we can init static trees\n\n\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true;\n }", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS + 1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES - 1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length - 1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n * 2 + 1]/*.Len*/ = 5;\n\t static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS + 1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES - 1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length - 1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n * 2 + 1]/*.Len*/ = 5;\n\t static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS + 1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES - 1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length - 1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n * 2 + 1]/*.Len*/ = 5;\n\t static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS + 1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES - 1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length - 1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n * 2 + 1]/*.Len*/ = 5;\n\t static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS + 1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES - 1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length - 1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n * 2 + 1]/*.Len*/ = 5;\n\t static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function tr_static_init() {\n var n;\n /* iterates over tree elements */\n\n var bits;\n /* bit counter */\n\n var length;\n /* length value */\n\n var code;\n /* code value */\n\n var dist;\n /* distance index */\n\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n #endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n\n length = 0;\n\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n } //Assert (length == 256, \"tr_static_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n\n\n _length_code[length - 1] = code;\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\n dist = 0;\n\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\n\n dist >>= 7;\n /* from now on, all distances are divided by 128 */\n\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n\n while (n <= 143) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n\n while (n <= 255) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 9;\n n++;\n bl_count[9]++;\n }\n\n while (n <= 279) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 7;\n n++;\n bl_count[7]++;\n }\n\n while (n <= 287) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n\n\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n /* The static distance tree is trivial: */\n\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]\n /*.Len*/\n = 5;\n static_dtree[n * 2]\n /*.Code*/\n = bi_reverse(n, 5);\n } // Now data ready and we can init static trees\n\n\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true;\n }", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS+1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES-1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1<<extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length-1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0 ; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1<<extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES+1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n*2 + 1]/*.Len*/ = 5;\n\t static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS+1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES-1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1<<extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length-1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0 ; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1<<extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n*2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES+1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n*2 + 1]/*.Len*/ = 5;\n\t static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS + 1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t /*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t #endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES - 1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length - 1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n * 2 + 1] /*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n * 2 + 1] /*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n * 2 + 1] /*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n * 2 + 1] /*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES; n++) {\n\t static_dtree[n * 2 + 1] /*.Len*/ = 5;\n\t static_dtree[n * 2] /*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n\t static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function tr_static_init() {\n\t var n; /* iterates over tree elements */\n\t var bits; /* bit counter */\n\t var length; /* length value */\n\t var code; /* code value */\n\t var dist; /* distance index */\n\t var bl_count = new Array(MAX_BITS$1 + 1);\n\t /* number of codes at each bit length for an optimal tree */\n\n\t // do check in _tr_init()\n\t //if (static_init_done) return;\n\n\t /* For some embedded targets, global variables are not initialized: */\n\t/*#ifdef NO_INIT_GLOBAL_POINTERS\n\t static_l_desc.static_tree = static_ltree;\n\t static_l_desc.extra_bits = extra_lbits;\n\t static_d_desc.static_tree = static_dtree;\n\t static_d_desc.extra_bits = extra_dbits;\n\t static_bl_desc.extra_bits = extra_blbits;\n\t#endif*/\n\n\t /* Initialize the mapping length (0..255) -> length code (0..28) */\n\t length = 0;\n\t for (code = 0; code < LENGTH_CODES$1 - 1; code++) {\n\t base_length[code] = length;\n\t for (n = 0; n < (1 << extra_lbits[code]); n++) {\n\t _length_code[length++] = code;\n\t }\n\t }\n\t //Assert (length == 256, \"tr_static_init: length != 256\");\n\t /* Note that the length 255 (match length 258) can be represented\n\t * in two different ways: code 284 + 5 bits or code 285, so we\n\t * overwrite length_code[255] to use the best encoding:\n\t */\n\t _length_code[length - 1] = code;\n\n\t /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\t dist = 0;\n\t for (code = 0; code < 16; code++) {\n\t base_dist[code] = dist;\n\t for (n = 0; n < (1 << extra_dbits[code]); n++) {\n\t _dist_code[dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\t dist >>= 7; /* from now on, all distances are divided by 128 */\n\t for (; code < D_CODES$1; code++) {\n\t base_dist[code] = dist << 7;\n\t for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n\t _dist_code[256 + dist++] = code;\n\t }\n\t }\n\t //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n\t /* Construct the codes of the static literal tree */\n\t for (bits = 0; bits <= MAX_BITS$1; bits++) {\n\t bl_count[bits] = 0;\n\t }\n\n\t n = 0;\n\t while (n <= 143) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t while (n <= 255) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 9;\n\t n++;\n\t bl_count[9]++;\n\t }\n\t while (n <= 279) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 7;\n\t n++;\n\t bl_count[7]++;\n\t }\n\t while (n <= 287) {\n\t static_ltree[n * 2 + 1]/*.Len*/ = 8;\n\t n++;\n\t bl_count[8]++;\n\t }\n\t /* Codes 286 and 287 do not exist, but we must include them in the\n\t * tree construction to get a canonical Huffman tree (longest code\n\t * all ones)\n\t */\n\t gen_codes(static_ltree, L_CODES$1 + 1, bl_count);\n\n\t /* The static distance tree is trivial: */\n\t for (n = 0; n < D_CODES$1; n++) {\n\t static_dtree[n * 2 + 1]/*.Len*/ = 5;\n\t static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n\t }\n\n\t // Now data ready and we can init static trees\n\t static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1);\n\t static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1);\n\t static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS);\n\n\t //static_init_done = true;\n\t}", "function initLUT() {\n sinLUT = new Float32Array(SINCOS_LENGTH);\n cosLUT = new Float32Array(SINCOS_LENGTH);\n for (let i = 0; i < SINCOS_LENGTH; i++) {\n sinLUT[i] = sin(i * DEG_TO_RAD * 0.5);\n cosLUT[i] = cos(i * DEG_TO_RAD * 0.5);\n }\n }", "function CalcConstants(c){\n\n this.sigma = (Math.exp(c.cnao/67.3)-1.)/7.0,\n this.rtof = c.r * c.xt/c.xxf,\n this.ena = this.rtof * Math.log(c.cnao/c.cnai),\n this.ek = this.rtof * Math.log(c.cko/c.cki),\n this.c_b1a = c.cm * 0.5/(c.xxf*c.vi),\n this.c_b1b = c.vup/c.vi,\n this.c_b1c = c.vrel/c.vi,\n this.c_b1d = this.c_b1a/ this.c_b1c,\n this.c_b1e = this.c_b1b/ this.c_b1c,\n this.cnao3 = c.cnao * c.cnao * c.cnao,\n this.istimdur = c.xstimdur/c.timestep,\n this.exptaufca = Math.exp(-c.timestep/c.taufca),\n this.exptauu = Math.exp(-c.timestep/c.tauu) \n }", "function tr_static_init() {\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n #endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1] /*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1] /*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1] /*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1] /*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1] /*.Len*/ = 5;\n static_dtree[n * 2] /*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function init() {\n if (window._env === 'development') console.debug('INIT');\n initFilters();\n initCountrySearch();\n initTableHeader();\n initTableDownload();\n }", "function abcons(n) {\r\n\t// declares number of absolute constants for the 20-GATE compiler.\t\r\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS$1 + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES$1 - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES$1; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS$1; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES$1 + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES$1; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n;\n /* iterates over tree elements */\n\n var bits;\n /* bit counter */\n\n var length;\n /* length value */\n\n var code;\n /* code value */\n\n var dist;\n /* distance index */\n\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n\n /*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n #endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n\n length = 0;\n\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n } //Assert (length == 256, \"tr_static_init: length != 256\");\n\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n\n\n _length_code[length - 1] = code;\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n\n dist = 0;\n\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: dist != 256\");\n\n\n dist >>= 7;\n /* from now on, all distances are divided by 128 */\n\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n\n for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {\n _dist_code[256 + dist++] = code;\n }\n } //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n\n while (n <= 143) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n\n while (n <= 255) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 9;\n n++;\n bl_count[9]++;\n }\n\n while (n <= 279) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 7;\n n++;\n bl_count[7]++;\n }\n\n while (n <= 287) {\n static_ltree[n * 2 + 1]\n /*.Len*/\n = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n\n\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n /* The static distance tree is trivial: */\n\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]\n /*.Len*/\n = 5;\n static_dtree[n * 2]\n /*.Code*/\n = bi_reverse(n, 5);\n } // Now data ready and we can init static trees\n\n\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); //static_init_done = true;\n}", "function ApplicationEditPageConstants() {\n }", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}", "function tr_static_init() {\n var n; /* iterates over tree elements */\n var bits; /* bit counter */\n var length; /* length value */\n var code; /* code value */\n var dist; /* distance index */\n var bl_count = new Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}" ]
[ "0.6477462", "0.6477462", "0.6084643", "0.5989747", "0.59109056", "0.579599", "0.5717196", "0.5694086", "0.5694086", "0.5694086", "0.5659585", "0.55818164", "0.558161", "0.5556769", "0.5543848", "0.5535738", "0.5528524", "0.5462032", "0.5461605", "0.54583144", "0.5440198", "0.5439564", "0.542618", "0.54258716", "0.5423207", "0.5419835", "0.5419835", "0.5419835", "0.5419835", "0.5419835", "0.54182994", "0.5417277", "0.5417277", "0.5416523", "0.54119015", "0.53814834", "0.5378678", "0.53303105", "0.5313056", "0.5304387", "0.52912164", "0.5282899", "0.5278939", "0.5263386", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166", "0.52567166" ]
0.0
-1
=========================================================================== Initialize a new block.
function init_block(s) { var n; /* iterates over tree elements */ /* Initialize the trees. */ for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; } for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; } for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; } s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1; s.opt_len = s.static_len = 0; s.last_lit = s.matches = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() { \n \n Block.initialize(this);\n }", "constructor(genesisBlock) {\n\n this.blocks = [];\n\n //2 [0, 2]\n this.addBlock(genesisBlock);\n }", "function init_block() {\n\t\tvar n; // iterates over tree elements\n\n\t\t// Initialize the trees.\n\t\tfor (n = 0; n < L_CODES; n++) {\n\t\t\tdyn_ltree[n].fc = 0;\n\t\t}\n\t\tfor (n = 0; n < D_CODES; n++) {\n\t\t\tdyn_dtree[n].fc = 0;\n\t\t}\n\t\tfor (n = 0; n < BL_CODES; n++) {\n\t\t\tbl_tree[n].fc = 0;\n\t\t}\n\n\t\tdyn_ltree[END_BLOCK].fc = 1;\n\t\topt_len = static_len = 0;\n\t\tlast_lit = last_dist = last_flags = 0;\n\t\tflags = 0;\n\t\tflag_bit = 1;\n\t}", "function initializeBlock (id, type) {\n const block =\n { id\n , type\n , html: ''\n , metadata: {}\n }\n this.ed._initializeContent([block])\n return this.ed.getBlock(id)\n}", "constructor (data) {\n // Block data model\n this.hash = \"\",\n this.height = 0,\n this.prev_block = \"\",\n this.time = 0,\n this.body = data\n }", "constructor(data){\n\t\tthis.hash = null; // Hash of the block\n\t\tthis.height = 0; // Block Height (consecutive number of each block)\n\t\tthis.body = Buffer.from(JSON.stringify(data)).toString('hex'); // Will contain the transactions stored in the block, by default it will encode the data\n\t\tthis.timeStamp = 0; // Timestamp for the Block creation\n\t\tthis.previousBlockHash = null; // Reference to the previous Block Hash\n }", "createGenesisBlock(){\n return new Block(Date.now(), [], '0');\n }", "createGenesisBlock(){\r\n\r\n return new Block(0, \"01/01/2019\",\"Genesis block\",\"0\");\r\n }", "function newBlock()\n\t{\n\t\tif(nextBlock == null)\n\t\t\tnextBlock = new Block();\n\n\t\tcurrentBlock = nextBlock;\n\t\tcurrentBlock.x = currentBlock.y = 0;\n\t\tcurrentBlock.moveHor(Math.floor(self.numColumns/2));\n\t\tcurrentBlock.moveVer(-1);\n\n\t\tbgGrid.addChild(currentBlock);\n\n\t\tnextBlock = new Block();\n\t\tnextBlock.x = bgGrid.x + bgGrid.width + GAP;\n\t\tnextBlock.y = celwid * 2;\n\t\tself.addChild(nextBlock);\n\t\t\n\t\tspeedPoints = 0;\n\t\tupdateSpeedPoints();\n\n\t\tvar canPlace = validateNewBlockPosition();\n\t\tif(!canPlace)\n\t\t\tgameOverSequence();\n\t}", "function initBlocks() {\n var grid = Resources.getGrid(), nRows = grid.nRows, nColumns = grid.nColumns;\n var row, col;\n\n for (row = 0; row < nRows; row++) {\n for (col = 0; col < nColumns; col++) {\n blocks.push(new Block(grid.rows[row], col, row));\n }\n }\n }", "function Block (data) {\n extend(this, data);\n}", "static initialize(obj, sequence, blockIdentifier, type) { \n obj['sequence'] = sequence;\n obj['block_identifier'] = blockIdentifier;\n obj['type'] = type;\n }", "createGenesisBlock(){\n return new Block(Date.parse(\"2018-03-18\"), [], \"0\");\n }", "createGenesisBlock(){\n return new Block(0, \"Genesis block\", \"0\");\n }", "async initialize() {\n let self = this;\n // check if genesis block (index=0) exists\n await self.getBlockHeight().catch(async function(err) {\n // create genesis block on init\n await self.addGenesisBlock().then(\n function(message) {\n console.log(message);\n },\n function(err) {});\n }\n ); \n }", "createGenesisBlock(){\n return new Block(\"18/05/2018\", {amount:\"Genesis Block\"}, \"0\");\n }", "createGenesisBlock(){\n return new Block(\"01/02/2000\",\"\",\"0\")\n }", "createGenesisBlock(){\n\n return new Block(0, \"18/08/2018\", \"Genesis block\", 0);\n }", "createGenesisBlock(){\r\n return new Block(0,'28/12/2017','this is genesis block','100');\r\n }", "constructor() {\n this.chain = [this.createGenesisBlock()]\n this.difficulty = 2 // number of zeros a block hash needs to have in the beginning\n this.pendingTransactions = [] // transactions that are pending (not on any block), and will be added to the next block when it is created/mined\n this.miningReward = 100 // reward that someone gets for mining a single block\n }", "constructor(){\r\n //an array of blocks\r\n this.chain = [this.createGenesisBlock()];\r\n \r\n }", "createGenesisBlock() {\n return new Block(0, moment(), \"Genesis block\", \"0\" );\n }", "createGenesisBlock(){\n\t\treturn new Block(\"01/01/2018\", [new Transaction('x','x',0)], \"0\");\n\t}", "function init_block(s) {\n var n; /* iterates over tree elements */\n \n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n \n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n }", "function init_block(s) {\n\t var n; /* iterates over tree elements */\n\t\n\t /* Initialize the trees. */\n\t for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n\t for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n\t for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\t\n\t s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n\t s.opt_len = s.static_len = 0;\n\t s.last_lit = s.matches = 0;\n\t }", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n }", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}", "function init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}" ]
[ "0.8056365", "0.7342965", "0.7319945", "0.7095824", "0.70780075", "0.7075087", "0.7068257", "0.70115083", "0.6973862", "0.6937791", "0.6902216", "0.6891296", "0.68896234", "0.6884551", "0.68490547", "0.6840111", "0.6802844", "0.68015593", "0.6768908", "0.6744197", "0.6713622", "0.6699797", "0.6698407", "0.6691312", "0.66823244", "0.6672454", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987", "0.6663987" ]
0.66690433
46
=========================================================================== Flush the bit buffer and align the output on a byte boundary
function bi_windup(s) { if (s.bi_valid > 8) { put_short(s, s.bi_buf); } else if (s.bi_valid > 0) { //put_byte(s, (Byte)s->bi_buf); s.pending_buf[s.pending++] = s.bi_buf; } s.bi_buf = 0; s.bi_valid = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bi_flush(s){if(s.bi_valid===16){put_short(s,s.bi_buf);s.bi_buf=0;s.bi_valid=0;}else if(s.bi_valid>=8){s.pending_buf[s.pending++]=s.bi_buf&0xff;s.bi_buf>>=8;s.bi_valid-=8;}}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n \n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "flush () {\n this._length = 0\n this._start = 0\n this._buffer.fill(undefined)\n }", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}" ]
[ "0.6588064", "0.6497159", "0.6488631", "0.6452589", "0.6426544", "0.63282317", "0.63277125", "0.6314214", "0.6314214", "0.6314214", "0.6314214", "0.6314214", "0.6314214", "0.6314214", "0.6314214", "0.6314214", "0.6227526", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828", "0.6213828" ]
0.0
-1
=========================================================================== Copy a stored block, storing first the length and its one's complement if requested.
function copy_block(s, buf, len, header) //DeflateState *s; //charf *buf; /* the input data */ //unsigned len; /* its length */ //int header; /* true if block header must be written */ { bi_windup(s); /* align on byte boundary */ if (header) { put_short(s, len); put_short(s, ~len); } // while (len--) { // put_byte(s, *buf++); // } utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); s.pending += len; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copy_block(s,buf,len,header)//DeflateState *s;\n //charf *buf; /* the input data */\n //unsigned len; /* its length */\n //int header; /* true if block header must be written */\n {bi_windup(s);/* align on byte boundary */if(header){put_short(s,len);put_short(s,~len);}// while (len--) {\n // put_byte(s, *buf++);\n // }\n utils.arraySet(s.pending_buf,s.window,buf,len,s.pending);s.pending+=len;}", "function copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n // while (len--) {\n // put_byte(s, *buf++);\n // }\n arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}", "function copy_block(buf, // the input data\n\t\tlen, // its length\n\t\theader // true if block header must be written\n\t\t) {\n\t\t bi_windup(); // align on byte boundary\n \n\t\t last_eob_len = 8; // enough lookahead for inflate\n \n\t\t if (header) {\n\t\t\tput_short(len);\n\t\t\tput_short(~len);\n\t\t }\n \n\t\t that.pending_buf.set(window.subarray(buf, buf + len), that.pending);\n\t\t that.pending += len;\n\t\t} // Send a stored block", "function copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n common$1.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}", "function copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n common.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}", "function copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n common.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}", "function copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n {\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n }", "function copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n // while (len--) {\n // put_byte(s, *buf++);\n // }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}", "function copy_block(s, buf, len, header) //DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s);\n /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n } // while (len--) {\n // put_byte(s, *buf++);\n // }\n\n\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}", "function copy_block(s, buf, len, header) //DeflateState *s;\n //charf *buf; /* the input data */\n //unsigned len; /* its length */\n //int header; /* true if block header must be written */\n {\n bi_windup(s);\n /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n } // while (len--) {\n // put_byte(s, *buf++);\n // }\n\n\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n }", "function $AvaN$var$copy_block(s, buf, len, header) //DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n $AvaN$var$bi_windup(s);\n /* align on byte boundary */\n\n if (header) {\n $AvaN$var$put_short(s, len);\n $AvaN$var$put_short(s, ~len);\n } // while (len--) {\n // put_byte(s, *buf++);\n // }\n\n\n $AvaN$var$utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}", "function copy_block(s, buf, len, header)\n //DeflateState *s;\n //charf *buf; /* the input data */\n //unsigned len; /* its length */\n //int header; /* true if block header must be written */\n {\n bi_windup(s); /* align on byte boundary */\n \n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n // while (len--) {\n // put_byte(s, *buf++);\n // }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n }", "function copy_block(s, buf, len, header) {\n\t//DeflateState *s;\n\t//charf *buf; /* the input data */\n\t//unsigned len; /* its length */\n\t//int header; /* true if block header must be written */\n\n\t bi_windup(s); /* align on byte boundary */\n\n\t if (header) {\n\t put_short(s, len);\n\t put_short(s, ~len);\n\t }\n\t // while (len--) {\n\t // put_byte(s, *buf++);\n\t // }\n\t arraySet(s.pending_buf, s.window, buf, len, s.pending);\n\t s.pending += len;\n\t}", "function copy_block(s, buf, len, header) //DeflateState *s;\n //charf *buf; /* the input data */\n //unsigned len; /* its length */\n //int header; /* true if block header must be written */\n {\n bi_windup(s);\n /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n } // while (len--) {\n // put_byte(s, *buf++);\n // }\n\n\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n }", "function copy_block(s, buf, len, header)\n\t //DeflateState *s;\n\t //charf *buf; /* the input data */\n\t //unsigned len; /* its length */\n\t //int header; /* true if block header must be written */\n\t {\n\t bi_windup(s); /* align on byte boundary */\n\t\n\t if (header) {\n\t put_short(s, len);\n\t put_short(s, ~len);\n\t }\n\t // while (len--) {\n\t // put_byte(s, *buf++);\n\t // }\n\t arraySet(s.pending_buf, s.window, buf, len, s.pending);\n\t s.pending += len;\n\t }" ]
[ "0.678666", "0.6686689", "0.6685482", "0.6682091", "0.66631144", "0.66631144", "0.6659264", "0.66396034", "0.66011596", "0.6587834", "0.6572326", "0.65491056", "0.653225", "0.6522475", "0.6462461" ]
0.66295946
85
=========================================================================== Compares to subtrees, using the tree depth as tie breaker when the subtrees have equal frequency. This minimizes the worst case length.
function smaller(tree, n, m, depth) { var _n2 = n*2; var _m2 = m*2; return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&depth[n]<=depth[m];}", "function smaller(tree, n, m, depth) {\n const _n2 = n * 2;\n const _m2 = m * 2;\n return tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m];\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n }", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return tree[_n2] /*.Freq*/ < tree[_m2] /*.Freq*/ || tree[_n2] /*.Freq*/ === tree[_m2] /*.Freq*/ && depth[n] <= depth[m];\n}", "apportion(node, level) {\n let firstChild = node.firstChild();\n let firstChildLeftNeighbor = firstChild.leftNeighbor();\n let compareDepth = 1;\n const depthToStop = this.cfg.maxDepth - level;\n\n while (firstChild && firstChildLeftNeighbor && compareDepth <= depthToStop) {\n // calculate the position of the firstChild, according to the position of firstChildLeftNeighbor\n\n let modifierSumRight = 0;\n let modifierSumLeft = 0;\n let leftAncestor = firstChildLeftNeighbor;\n let rightAncestor = firstChild;\n\n for (let i = 0; i < compareDepth; i += 1) {\n leftAncestor = leftAncestor.parent();\n rightAncestor = rightAncestor.parent();\n modifierSumLeft += leftAncestor.modifier;\n modifierSumRight += rightAncestor.modifier;\n\n // all the stacked children are oriented towards right so use right variables\n if (rightAncestor.stackParent !== undefined) {\n modifierSumRight += rightAncestor.size() / 2;\n }\n }\n\n // find the gap between two trees and apply it to subTrees\n // and matching smaller gaps to smaller subtrees\n\n let totalGap =\n firstChildLeftNeighbor.prelim +\n modifierSumLeft +\n firstChildLeftNeighbor.size() +\n this.cfg.subTeeSeparation -\n (firstChild.prelim + modifierSumRight);\n\n if (totalGap > 0) {\n let subtreeAux = node;\n let numSubtrees = 0;\n\n // count all the subtrees in the LeftSibling\n while (subtreeAux && subtreeAux.id !== leftAncestor.id) {\n subtreeAux = subtreeAux.leftSibling();\n numSubtrees += 1;\n }\n\n if (subtreeAux) {\n let subtreeMoveAux = node;\n const singleGap = totalGap / numSubtrees;\n\n while (subtreeMoveAux.id !== leftAncestor.id) {\n subtreeMoveAux.prelim += totalGap;\n subtreeMoveAux.modifier += totalGap;\n\n totalGap -= singleGap;\n subtreeMoveAux = subtreeMoveAux.leftSibling();\n }\n }\n }\n\n compareDepth += 1;\n\n firstChild =\n firstChild.childrenCount() === 0\n ? node.leftMost(0, compareDepth)\n : (firstChild = firstChild.firstChild());\n\n if (firstChild) {\n firstChildLeftNeighbor = firstChild.leftNeighbor();\n }\n }\n }", "function smaller(tree, n, m, depth) {\n\t var _n2 = n * 2;\n\t var _m2 = m * 2;\n\t return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n\t (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n\t }", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n }", "function smaller(tree, n, m, depth) {\n\t var _n2 = n*2;\n\t var _m2 = m*2;\n\t return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n\t (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n\t}", "function smaller(tree, n, m, depth) {\n\t var _n2 = n*2;\n\t var _m2 = m*2;\n\t return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n\t (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n\t}", "function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n\n var _m2 = m * 2;\n\n return tree[_n2]\n /*.Freq*/\n < tree[_m2]\n /*.Freq*/\n || tree[_n2]\n /*.Freq*/\n === tree[_m2]\n /*.Freq*/\n && depth[n] <= depth[m];\n }", "function smaller(tree, n, m, depth) {\n\t var _n2 = n * 2;\n\t var _m2 = m * 2;\n\t return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n\t (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n\t}", "function smaller(tree, n, m, depth) {\n\t var _n2 = n * 2;\n\t var _m2 = m * 2;\n\t return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n\t (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n\t}" ]
[ "0.64469874", "0.60803324", "0.5934289", "0.589644", "0.58895206", "0.58659226", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5861905", "0.5854367", "0.5786571", "0.5786571", "0.5782518", "0.57799107", "0.57799107" ]
0.58711904
25
=========================================================================== Restore the heap property by moving down the tree starting at node k, exchanging a node with the smallest of its two sons if necessary, stopping when the heap property is reestablished (each father smaller than its two sons).
function pqdownheap(s, tree, k) // deflate_state *s; // ct_data *tree; /* the tree to restore */ // int k; /* node to move down */ { var v = s.heap[k]; var j = k << 1; /* left son of k */ while (j <= s.heap_len) { /* Set j to the smallest of the two sons: */ if (j < s.heap_len && smaller(tree, s.heap[j+1], s.heap[j], s.depth)) { j++; } /* Exit if v is smaller than both sons */ if (smaller(tree, v, s.heap[j], s.depth)) { break; } /* Exchange v with the smallest son */ s.heap[k] = s.heap[j]; k = j; /* And continue down the tree, setting j to the left son of k */ j <<= 1; } s.heap[k] = v; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "swim(k) {\n while (k > 1 && this.heap[Math.floor(k/2)].priority > this.heap[k].priority) {\n /*\n * While not at root node, swap k (parent) with k/2 (child) if\n * parent > child. Continue swimming upwards until the invariant holds.\n */\n [this.heap[k], this.heap[Math.floor(k/2)]]\n = [this.heap[Math.floor(k/2)], this.heap[k]];\n k = Math.floor(k / 2);\n }\n }", "function pqdownheap(tree, k) {\n\t\tvar v = heap[k],\n\t\t\tj = k << 1; // left son of k\n\n\t\twhile (j <= heap_len) {\n\t\t\t// Set j to the smallest of the two sons:\n\t\t\tif (j < heap_len && SMALLER(tree, heap[j + 1], heap[j])) {\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t\t// Exit if v is smaller than both sons\n\t\t\tif (SMALLER(tree, v, heap[j])) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Exchange v with the smallest son\n\t\t\theap[k] = heap[j];\n\t\t\tk = j;\n\n\t\t\t// And continue down the tree, setting j to the left son of k\n\t\t\tj <<= 1;\n\t\t}\n\t\theap[k] = v;\n\t}", "function pqdownheap(s, tree, k) // deflate_state *s;\n // ct_data *tree; /* the tree to restore */\n // int k; /* node to move down */\n {\n var v = s.heap[k];\n var j = k << 1;\n /* left son of k */\n\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n\n\n if (smaller(tree, v, s.heap[j], s.depth)) {\n break;\n }\n /* Exchange v with the smallest son */\n\n\n s.heap[k] = s.heap[j];\n k = j;\n /* And continue down the tree, setting j to the left son of k */\n\n j <<= 1;\n }\n\n s.heap[k] = v;\n }", "function pqdownheap(s, tree, k) // deflate_state *s;\n // ct_data *tree; /* the tree to restore */\n // int k; /* node to move down */\n {\n var v = s.heap[k];\n var j = k << 1;\n /* left son of k */\n\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n\n\n if (smaller(tree, v, s.heap[j], s.depth)) {\n break;\n }\n /* Exchange v with the smallest son */\n\n\n s.heap[k] = s.heap[j];\n k = j;\n /* And continue down the tree, setting j to the left son of k */\n\n j <<= 1;\n }\n\n s.heap[k] = v;\n }", "function pqdownheap$1(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller$1(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller$1(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n // deflate_state *s;\n // ct_data *tree; /* the tree to restore */\n // int k; /* node to move down */\n {\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n \n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n \n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n }", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j+1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j+1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to restore */\n\t// int k; /* node to move down */\n\t{\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) {\n\t break;\n\t }\n\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t}", "function pqdownheap(s, tree, k) // deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1;\n /* left son of k */\n\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n\n\n if (smaller(tree, v, s.heap[j], s.depth)) {\n break;\n }\n /* Exchange v with the smallest son */\n\n\n s.heap[k] = s.heap[j];\n k = j;\n /* And continue down the tree, setting j to the left son of k */\n\n j <<= 1;\n }\n\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n\t // deflate_state *s;\n\t // ct_data *tree; /* the tree to restore */\n\t // int k; /* node to move down */\n\t {\n\t var v = s.heap[k];\n\t var j = k << 1; /* left son of k */\n\t while (j <= s.heap_len) {\n\t /* Set j to the smallest of the two sons: */\n\t if (j < s.heap_len &&\n\t smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n\t j++;\n\t }\n\t /* Exit if v is smaller than both sons */\n\t if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\t\n\t /* Exchange v with the smallest son */\n\t s.heap[k] = s.heap[j];\n\t k = j;\n\t\n\t /* And continue down the tree, setting j to the left son of k */\n\t j <<= 1;\n\t }\n\t s.heap[k] = v;\n\t }", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n {\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n }", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}", "function pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) {\n break;\n }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}" ]
[ "0.8100696", "0.7786214", "0.7684644", "0.7658836", "0.7649785", "0.7647308", "0.7631074", "0.7631074", "0.7631074", "0.7631074", "0.7631074", "0.7631074", "0.76270545", "0.76270545", "0.7623064", "0.76088023", "0.7603816", "0.75517195", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75347507", "0.75292104" ]
0.0
-1
inlined manually var SMALLEST = 1; / =========================================================================== Send the block data compressed using the given Huffman trees
function compress_block(s, ltree, dtree) // deflate_state *s; // const ct_data *ltree; /* literal tree */ // const ct_data *dtree; /* distance tree */ { var dist; /* distance of matched string */ var lc; /* match length or unmatched char (if dist == 0) */ var lx = 0; /* running index in l_buf */ var code; /* the code to send */ var extra; /* number of extra bits to send */ if (s.last_lit !== 0) { do { dist = (s.pending_buf[s.d_buf + lx*2] << 8) | (s.pending_buf[s.d_buf + lx*2 + 1]); lc = s.pending_buf[s.l_buf + lx]; lx++; if (dist === 0) { send_code(s, lc, ltree); /* send a literal byte */ //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; send_code(s, code+LITERALS+1, ltree); /* send the length code */ extra = extra_lbits[code]; if (extra !== 0) { lc -= base_length[code]; send_bits(s, lc, extra); /* send the extra length bits */ } dist--; /* dist is now the match distance - 1 */ code = d_code(dist); //Assert (code < D_CODES, "bad d_code"); send_code(s, code, dtree); /* send the distance code */ extra = extra_dbits[code]; if (extra !== 0) { dist -= base_dist[code]; send_bits(s, dist, extra); /* send the extra distance bits */ } } /* literal or match pair ? */ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, // "pendingBuf overflow"); } while (lx < s.last_lit); } send_code(s, END_BLOCK, ltree); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send_tree(s,tree,max_code)// deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {var n;/* iterates over all tree elements */var prevlen=-1;/* last emitted length */var curlen;/* length of current code */var nextlen=tree[0*2+1]/*.Len*/;/* length of next code */var count=0;/* repeat count of the current code */var max_count=7;/* max repeat count */var min_count=4;/* min repeat count */ /* tree[max_code+1].Len = -1; */ /* guard already set */if(nextlen===0){max_count=138;min_count=3;}for(n=0;n<=max_code;n++){curlen=nextlen;nextlen=tree[(n+1)*2+1]/*.Len*/;if(++count<max_count&&curlen===nextlen){continue;}else if(count<min_count){do{send_code(s,curlen,s.bl_tree);}while(--count!==0);}else if(curlen!==0){if(curlen!==prevlen){send_code(s,curlen,s.bl_tree);count--;}//Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s,REP_3_6,s.bl_tree);send_bits(s,count-3,2);}else if(count<=10){send_code(s,REPZ_3_10,s.bl_tree);send_bits(s,count-3,3);}else {send_code(s,REPZ_11_138,s.bl_tree);send_bits(s,count-11,7);}count=0;prevlen=curlen;if(nextlen===0){max_count=138;min_count=3;}else if(curlen===nextlen){max_count=6;min_count=3;}else {max_count=7;min_count=4;}}}", "function send_tree(s, tree, max_code) // deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */\n\n /* guard already set */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n } //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\n\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n {\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function send_tree(s, tree, max_code) // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */\n\n /* guard already set */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n } //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\n\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function $AvaN$var$send_tree(s, tree, max_code) // deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */\n\n /* guard already set */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n $AvaN$var$send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n $AvaN$var$send_code(s, curlen, s.bl_tree);\n count--;\n } //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\n\n $AvaN$var$send_code(s, $AvaN$var$REP_3_6, s.bl_tree);\n $AvaN$var$send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n $AvaN$var$send_code(s, $AvaN$var$REPZ_3_10, s.bl_tree);\n $AvaN$var$send_bits(s, count - 3, 3);\n } else {\n $AvaN$var$send_code(s, $AvaN$var$REPZ_11_138, s.bl_tree);\n $AvaN$var$send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code) // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */\n\n /* guard already set */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n } //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\n\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree); \n } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n\t // deflate_state *s;\n\t // ct_data *tree; /* the tree to be scanned */\n\t // int max_code; /* and its largest code of non zero frequency */\n\t {\n\t var n; /* iterates over all tree elements */\n\t var prevlen = -1; /* last emitted length */\n\t var curlen; /* length of current code */\n\t\n\t var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\t\n\t var count = 0; /* repeat count of the current code */\n\t var max_count = 7; /* max repeat count */\n\t var min_count = 4; /* min repeat count */\n\t\n\t /* tree[max_code+1].Len = -1; */ /* guard already set */\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\t }\n\t\n\t for (n = 0; n <= max_code; n++) {\n\t curlen = nextlen;\n\t nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\t\n\t if (++count < max_count && curlen === nextlen) {\n\t continue;\n\t\n\t } else if (count < min_count) {\n\t do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\t\n\t } else if (curlen !== 0) {\n\t if (curlen !== prevlen) {\n\t send_code(s, curlen, s.bl_tree);\n\t count--;\n\t }\n\t //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\t send_code(s, REP_3_6, s.bl_tree);\n\t send_bits(s, count - 3, 2);\n\t\n\t } else if (count <= 10) {\n\t send_code(s, REPZ_3_10, s.bl_tree);\n\t send_bits(s, count - 3, 3);\n\t\n\t } else {\n\t send_code(s, REPZ_11_138, s.bl_tree);\n\t send_bits(s, count - 11, 7);\n\t }\n\t\n\t count = 0;\n\t prevlen = curlen;\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\t\n\t } else if (curlen === nextlen) {\n\t max_count = 6;\n\t min_count = 3;\n\t\n\t } else {\n\t max_count = 7;\n\t min_count = 4;\n\t }\n\t }\n\t }", "function send_tree(s, tree, max_code)\n // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n \n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n \n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n \n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n \n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n \n if (++count < max_count && curlen === nextlen) {\n continue;\n \n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n \n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n \n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n \n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n \n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n \n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n \n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1] /*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1] /*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to be scanned */\n\t// int max_code; /* and its largest code of non zero frequency */\n\t{\n\t var n; /* iterates over all tree elements */\n\t var prevlen = -1; /* last emitted length */\n\t var curlen; /* length of current code */\n\n\t var nextlen = tree[0 * 2 + 1] /*.Len*/ ; /* length of next code */\n\n\t var count = 0; /* repeat count of the current code */\n\t var max_count = 7; /* max repeat count */\n\t var min_count = 4; /* min repeat count */\n\n\t /* tree[max_code+1].Len = -1; */\n\t /* guard already set */\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\t }\n\n\t for (n = 0; n <= max_code; n++) {\n\t curlen = nextlen;\n\t nextlen = tree[(n + 1) * 2 + 1] /*.Len*/ ;\n\n\t if (++count < max_count && curlen === nextlen) {\n\t continue;\n\n\t } else if (count < min_count) {\n\t do {\n\t send_code(s, curlen, s.bl_tree);\n\t } while (--count !== 0);\n\n\t } else if (curlen !== 0) {\n\t if (curlen !== prevlen) {\n\t send_code(s, curlen, s.bl_tree);\n\t count--;\n\t }\n\t //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\t send_code(s, REP_3_6, s.bl_tree);\n\t send_bits(s, count - 3, 2);\n\n\t } else if (count <= 10) {\n\t send_code(s, REPZ_3_10, s.bl_tree);\n\t send_bits(s, count - 3, 3);\n\n\t } else {\n\t send_code(s, REPZ_11_138, s.bl_tree);\n\t send_bits(s, count - 11, 7);\n\t }\n\n\t count = 0;\n\t prevlen = curlen;\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\n\t } else if (curlen === nextlen) {\n\t max_count = 6;\n\t min_count = 3;\n\n\t } else {\n\t max_count = 7;\n\t min_count = 4;\n\t }\n\t }\n\t}", "function send_tree(s, tree, max_code)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to be scanned */\n\t// int max_code; /* and its largest code of non zero frequency */\n\t{\n\t var n; /* iterates over all tree elements */\n\t var prevlen = -1; /* last emitted length */\n\t var curlen; /* length of current code */\n\n\t var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n\t var count = 0; /* repeat count of the current code */\n\t var max_count = 7; /* max repeat count */\n\t var min_count = 4; /* min repeat count */\n\n\t /* tree[max_code+1].Len = -1; */ /* guard already set */\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\t }\n\n\t for (n = 0; n <= max_code; n++) {\n\t curlen = nextlen;\n\t nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n\t if (++count < max_count && curlen === nextlen) {\n\t continue;\n\n\t } else if (count < min_count) {\n\t do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n\t } else if (curlen !== 0) {\n\t if (curlen !== prevlen) {\n\t send_code(s, curlen, s.bl_tree);\n\t count--;\n\t }\n\t //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\t send_code(s, REP_3_6, s.bl_tree);\n\t send_bits(s, count-3, 2);\n\n\t } else if (count <= 10) {\n\t send_code(s, REPZ_3_10, s.bl_tree);\n\t send_bits(s, count-3, 3);\n\n\t } else {\n\t send_code(s, REPZ_11_138, s.bl_tree);\n\t send_bits(s, count-11, 7);\n\t }\n\n\t count = 0;\n\t prevlen = curlen;\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\n\t } else if (curlen === nextlen) {\n\t max_count = 6;\n\t min_count = 3;\n\n\t } else {\n\t max_count = 7;\n\t min_count = 4;\n\t }\n\t }\n\t}" ]
[ "0.70694613", "0.6978705", "0.6972461", "0.6965995", "0.6906903", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.6906186", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.69021696", "0.68995845", "0.6890173", "0.68899167", "0.6851374", "0.6848537", "0.68478805", "0.6803277", "0.6796974" ]
0.0
-1
=========================================================================== Construct one Huffman tree and assigns the code bit strings and lengths. Update the total bit length for the current block. IN assertion: the field freq is set for all tree elements. OUT assertions: the fields len and code are set to the optimal bit length and corresponding code. The length opt_len is updated; static_len is also updated if stree is not null. The field max_code is set.
function build_tree(s, desc) // deflate_state *s; // tree_desc *desc; /* the tree descriptor */ { var tree = desc.dyn_tree; var stree = desc.stat_desc.static_tree; var has_stree = desc.stat_desc.has_stree; var elems = desc.stat_desc.elems; var n, m; /* iterate over heap elements */ var max_code = -1; /* largest code with non zero frequency */ var node; /* new node being created */ /* Construct the initial heap, with least frequent element in * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. * heap[0] is not used. */ s.heap_len = 0; s.heap_max = HEAP_SIZE; for (n = 0; n < elems; n++) { if (tree[n * 2]/*.Freq*/ !== 0) { s.heap[++s.heap_len] = max_code = n; s.depth[n] = 0; } else { tree[n*2 + 1]/*.Len*/ = 0; } } /* The pkzip format requires that at least one distance code exists, * and that at least one bit should be sent even if there is only one * possible code. So to avoid special checks later on we force at least * two codes of non zero frequency. */ while (s.heap_len < 2) { node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); tree[node * 2]/*.Freq*/ = 1; s.depth[node] = 0; s.opt_len--; if (has_stree) { s.static_len -= stree[node*2 + 1]/*.Len*/; } /* node is 0 or 1 so it does not have extra bits */ } desc.max_code = max_code; /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, * establish sub-heaps of increasing lengths: */ for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } /* Construct the Huffman tree by repeatedly combining the least two * frequent nodes. */ node = elems; /* next internal node of the tree */ do { //pqremove(s, tree, n); /* n = node of least frequency */ /*** pqremove ***/ n = s.heap[1/*SMALLEST*/]; s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; pqdownheap(s, tree, 1/*SMALLEST*/); /***/ m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ s.heap[--s.heap_max] = m; /* Create a new node father of n and m */ tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; tree[n*2 + 1]/*.Dad*/ = tree[m*2 + 1]/*.Dad*/ = node; /* and insert the new node in the heap */ s.heap[1/*SMALLEST*/] = node++; pqdownheap(s, tree, 1/*SMALLEST*/); } while (s.heap_len >= 2); s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; /* At this point, the fields freq and dad are set. We can now * generate the bit lengths. */ gen_bitlen(s, desc); /* The field len is now set, we can generate the bit codes */ gen_codes(tree, max_code, s.bl_count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function build_bl_tree() {\n\t\tvar max_blindex; // index of last bit length code of non zero freq\n\n\t\t// Determine the bit length frequencies for literal and distance trees\n\t\tscan_tree(dyn_ltree, l_desc.max_code);\n\t\tscan_tree(dyn_dtree, d_desc.max_code);\n\n\t\t// Build the bit length tree:\n\t\tbuild_tree(bl_desc);\n\t\t// opt_len now includes the length of the tree representations, except\n\t\t// the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\n\t\t// Determine the number of bit length codes to send. The pkzip format\n\t\t// requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t// 3 but the actual value used is 4.)\n\t\tfor (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[bl_order[max_blindex]].dl !== 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Update opt_len to include the bit length tree and counts */\n\t\topt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t\t// Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\n\t\treturn max_blindex;\n\t}", "function build_bl_tree() {\n\t\t var max_blindex; // index of last bit length code of non zero freq\n\t\t // Determine the bit length frequencies for literal and distance trees\n \n\t\t scan_tree(dyn_ltree, l_desc.max_code);\n\t\t scan_tree(dyn_dtree, d_desc.max_code); // Build the bit length tree:\n \n\t\t bl_desc.build_tree(that); // opt_len now includes the length of the tree representations, except\n\t\t // the lengths of the bit lengths codes and the 5+5+4 bits for the\n\t\t // counts.\n\t\t // Determine the number of bit length codes to send. The pkzip format\n\t\t // requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t // 3 but the actual value used is 4.)\n \n\t\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0) break;\n\t\t } // Update opt_len to include the bit length tree and counts\n \n \n\t\t that.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t\t return max_blindex;\n\t\t} // Output a byte on the stream.", "static initHuffmanTree() {\n let i = 0;\n while (i < 144) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x030 + i) << 8);\n ARR_LITERAL_LENGTHS[i++] = 8;\n }\n while (i < 256) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x190 - 144 + i) << 7);\n ARR_LITERAL_LENGTHS[i++] = 9;\n }\n while (i < 280) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x000 - 256 + i) << 9);\n ARR_LITERAL_LENGTHS[i++] = 7;\n }\n while (i < 286) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x0c0 - 280 + i) << 8);\n ARR_LITERAL_LENGTHS[i++] = 8;\n }\n for (i = 0; i < 30; i++) {\n ARR_DISTANCE_CODES[i] = CompressorHuffmanTree.bitReverse(i << 11);\n ARR_DISTANCE_LENGTHS[i] = 5;\n }\n }", "function BuildHuffmanTable(root_table,root_table_off,\n root_bits,\n code_lengths,code_lengths_off,\n code_lengths_size,\n count,count_off) {\n var code=new HuffmanCode(); /* current table entry */\n var table=new Array(new HuffmanCode());//* /* next available space in table */\n var table_off=0;\n var len; /* current code length */\n var symbol; /* symbol index in original or sorted table */\n var key; /* reversed prefix code */\n var step; /* step size to replicate values in current table */\n var low; /* low bits for current root entry */\n var mask; /* mask for low bits */\n var table_bits; /* key length of current table */\n var table_size; /* size of current table */\n var total_size; /* sum of root table size and 2nd level table sizes */\n /* symbols sorted by code length */\n var sorted=new mallocArr(code_lengths_size,0);\n /* offsets in sorted table for each length */\n var offset=new mallocArr(kHuffmanMaxLength + 1,0);\n var max_length = 1;\n\n /* generate offsets into sorted symbol table by code length */\n {\n var sum = 0;\n for (len = 1; len <= kHuffmanMaxLength; len++) {\n offset[len] = sum;\n if (count[len]) {\n sum = (sum + count[len]);\n max_length = len;\n }\n }\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (symbol = 0; symbol < code_lengths_size; symbol++) {\n if (code_lengths[symbol] != 0) {\n sorted[offset[code_lengths[symbol]]++] = symbol;\n }\n }\n\n table = root_table;\n table_off = root_table_off;\n table_bits = root_bits;\n table_size = 1 << table_bits;\n total_size = table_size;\n\n /* special case code with only one value */\n if (offset[kHuffmanMaxLength] == 1) {\n code.bits = 0;\n code.value = (sorted[0]);\n for (key = 0; key < total_size; ++key) {\n table[table_off+key] = code;\n }\n return total_size;\n }\n\n /* fill in root table */\n /* let's reduce the table size to a smaller size if possible, and */\n /* create the repetitions by memcpy if possible in the coming loop */\n if (table_bits > max_length) {\n table_bits = max_length;\n table_size = 1 << table_bits;\n }\n key = 0;\n symbol = 0;\n code.bits = 1;\n step = 2;\n do {\n for (; count[code.bits] != 0; --count[code.bits]) {\n code.value = (sorted[symbol++]);\n ReplicateValue(table,table_off+key, step, table_size, code);\n key = GetNextKey(key, code.bits);\n }\n step <<= 1;\n } while (++code.bits <= table_bits);\n\n /* if root_bits != table_bits we only created one fraction of the */\n /* table, and we need to replicate it now. */\n while (total_size != table_size) {\n //memcpy(&table[table_size], &table[0], table_size * sizeof(table[0]));\n\tfor(var i=0;i<table_size;++i) {\n\t\ttable[table_off+table_size+i].bits=table[table_off+0+i].bits;\n\t\ttable[table_off+table_size+i].value=table[table_off+0+i].value;\n\t}\n table_size <<= 1;\n }\n\n /* fill in 2nd level tables and add pointers to root table */\n mask = total_size - 1;\n low = -1;\n for (len = root_bits + 1, step = 2; len <= max_length; ++len, step <<= 1) {\n for (; count[len] != 0; --count[len]) {\n if ((key & mask) != low) {\n table_off += table_size;\n table_bits = NextTableBitSize(count, len, root_bits);\n table_size = 1 << table_bits;\n total_size += table_size;\n low = key & mask;\n root_table[root_table_off+low].bits = (table_bits + root_bits);\n root_table[root_table_off+low].value =\n ((table_off - root_table_off) - low);\n }\n code.bits = (len - root_bits);\n code.value = (sorted[symbol++]);\n ReplicateValue(table,table_off+(key >> root_bits), step, table_size, code);\n key = GetNextKey(key, len);\n }\n }\n\n return total_size;\n}", "function send_tree(s, tree, max_code) // deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */\n\n /* guard already set */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n } //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\n\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function build_bl_tree(s){var max_blindex;/* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */scan_tree(s,s.dyn_ltree,s.l_desc.max_code);scan_tree(s,s.dyn_dtree,s.d_desc.max_code);/* Build the bit length tree: */build_tree(s,s.bl_desc);/* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */ /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */for(max_blindex=BL_CODES-1;max_blindex>=3;max_blindex--){if(s.bl_tree[bl_order[max_blindex]*2+1]/*.Len*/!==0){break;}}/* Update opt_len to include the bit length tree and counts */s.opt_len+=3*(max_blindex+1)+5+5+4;//Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n return max_blindex;}", "function scan_tree(tree, // the tree to be scanned\n\t\tmax_code // and its largest code of non zero frequency\n\t\t) {\n\t\t var n; // iterates over all tree elements\n \n\t\t var prevlen = -1; // last emitted length\n \n\t\t var curlen; // length of current code\n \n\t\t var nextlen = tree[0 * 2 + 1]; // length of next code\n \n\t\t var count = 0; // repeat count of the current code\n \n\t\t var max_count = 7; // max repeat count\n \n\t\t var min_count = 4; // min repeat count\n \n\t\t if (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t }\n \n\t\t tree[(max_code + 1) * 2 + 1] = 0xffff; // guard\n \n\t\t for (n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n \n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t continue;\n\t\t\t} else if (count < min_count) {\n\t\t\t bl_tree[curlen * 2] += count;\n\t\t\t} else if (curlen !== 0) {\n\t\t\t if (curlen != prevlen) bl_tree[curlen * 2]++;\n\t\t\t bl_tree[REP_3_6 * 2]++;\n\t\t\t} else if (count <= 10) {\n\t\t\t bl_tree[REPZ_3_10 * 2]++;\n\t\t\t} else {\n\t\t\t bl_tree[REPZ_11_138 * 2]++;\n\t\t\t}\n \n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n \n\t\t\tif (nextlen === 0) {\n\t\t\t max_count = 138;\n\t\t\t min_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t max_count = 6;\n\t\t\t min_count = 3;\n\t\t\t} else {\n\t\t\t max_count = 7;\n\t\t\t min_count = 4;\n\t\t\t}\n\t\t }\n\t\t} // Construct the Huffman tree for the bit lengths and return the index in", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree); \n } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code) // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */\n\n /* guard already set */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n } //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\n\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n+1)*2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count-11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code) // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */\n\n /* guard already set */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n } //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\n\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree$1(s, tree, max_code)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to be scanned */\n\t// int max_code; /* and its largest code of non zero frequency */\n\t{\n\t var n; /* iterates over all tree elements */\n\t var prevlen = -1; /* last emitted length */\n\t var curlen; /* length of current code */\n\n\t var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n\t var count = 0; /* repeat count of the current code */\n\t var max_count = 7; /* max repeat count */\n\t var min_count = 4; /* min repeat count */\n\n\t /* tree[max_code+1].Len = -1; */ /* guard already set */\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\t }\n\n\t for (n = 0; n <= max_code; n++) {\n\t curlen = nextlen;\n\t nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n\t if (++count < max_count && curlen === nextlen) {\n\t continue;\n\n\t } else if (count < min_count) {\n\t do { send_code$1(s, curlen, s.bl_tree); } while (--count !== 0);\n\n\t } else if (curlen !== 0) {\n\t if (curlen !== prevlen) {\n\t send_code$1(s, curlen, s.bl_tree);\n\t count--;\n\t }\n\t //Assert(count >= 3 && count <= 6, \" 3_6?\");\n\t send_code$1(s, REP_3_6$1, s.bl_tree);\n\t send_bits$1(s, count - 3, 2);\n\n\t } else if (count <= 10) {\n\t send_code$1(s, REPZ_3_10$1, s.bl_tree);\n\t send_bits$1(s, count - 3, 3);\n\n\t } else {\n\t send_code$1(s, REPZ_11_138$1, s.bl_tree);\n\t send_bits$1(s, count - 11, 7);\n\t }\n\n\t count = 0;\n\t prevlen = curlen;\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\n\t } else if (curlen === nextlen) {\n\t max_count = 6;\n\t min_count = 3;\n\n\t } else {\n\t max_count = 7;\n\t min_count = 4;\n\t }\n\t }\n\t}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n {\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }" ]
[ "0.6371719", "0.63665086", "0.6333171", "0.6235446", "0.62348443", "0.6192163", "0.6171294", "0.61624026", "0.61611164", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.6161077", "0.61574686", "0.6153398", "0.61473584", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.6142711", "0.61398953" ]
0.0
-1
=========================================================================== Scan a literal or distance tree to determine the frequencies of the codes in the bit length tree.
function scan_tree(s, tree, max_code) // deflate_state *s; // ct_data *tree; /* the tree to be scanned */ // int max_code; /* and its largest code of non zero frequency */ { var n; /* iterates over all tree elements */ var prevlen = -1; /* last emitted length */ var curlen; /* length of current code */ var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */ var count = 0; /* repeat count of the current code */ var max_count = 7; /* max repeat count */ var min_count = 4; /* min repeat count */ if (nextlen === 0) { max_count = 138; min_count = 3; } tree[(max_code+1)*2 + 1]/*.Len*/ = 0xffff; /* guard */ for (n = 0; n <= max_code; n++) { curlen = nextlen; nextlen = tree[(n+1)*2 + 1]/*.Len*/; if (++count < max_count && curlen === nextlen) { continue; } else if (count < min_count) { s.bl_tree[curlen * 2]/*.Freq*/ += count; } else if (curlen !== 0) { if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } s.bl_tree[REP_3_6*2]/*.Freq*/++; } else if (count <= 10) { s.bl_tree[REPZ_3_10*2]/*.Freq*/++; } else { s.bl_tree[REPZ_11_138*2]/*.Freq*/++; } count = 0; prevlen = curlen; if (nextlen === 0) { max_count = 138; min_count = 3; } else if (curlen === nextlen) { max_count = 6; min_count = 3; } else { max_count = 7; min_count = 4; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scan_tree(tree, // the tree to be scanned\n\t\tmax_code // and its largest code of non zero frequency\n\t\t) {\n\t\t var n; // iterates over all tree elements\n \n\t\t var prevlen = -1; // last emitted length\n \n\t\t var curlen; // length of current code\n \n\t\t var nextlen = tree[0 * 2 + 1]; // length of next code\n \n\t\t var count = 0; // repeat count of the current code\n \n\t\t var max_count = 7; // max repeat count\n \n\t\t var min_count = 4; // min repeat count\n \n\t\t if (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t }\n \n\t\t tree[(max_code + 1) * 2 + 1] = 0xffff; // guard\n \n\t\t for (n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n \n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t continue;\n\t\t\t} else if (count < min_count) {\n\t\t\t bl_tree[curlen * 2] += count;\n\t\t\t} else if (curlen !== 0) {\n\t\t\t if (curlen != prevlen) bl_tree[curlen * 2]++;\n\t\t\t bl_tree[REP_3_6 * 2]++;\n\t\t\t} else if (count <= 10) {\n\t\t\t bl_tree[REPZ_3_10 * 2]++;\n\t\t\t} else {\n\t\t\t bl_tree[REPZ_11_138 * 2]++;\n\t\t\t}\n \n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n \n\t\t\tif (nextlen === 0) {\n\t\t\t max_count = 138;\n\t\t\t min_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t max_count = 6;\n\t\t\t min_count = 3;\n\t\t\t} else {\n\t\t\t max_count = 7;\n\t\t\t min_count = 4;\n\t\t\t}\n\t\t }\n\t\t} // Construct the Huffman tree for the bit lengths and return the index in", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1] /*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1] /*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1] /*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n s.bl_tree[curlen * 2] /*.Freq*/ += count;\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2] /*.Freq*/++;\n }\n s.bl_tree[REP_3_6 * 2] /*.Freq*/++;\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2] /*.Freq*/++;\n } else {\n s.bl_tree[REPZ_11_138 * 2] /*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code) // deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n tree[(max_code + 1) * 2 + 1]\n /*.Len*/\n = 0xffff;\n /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]\n /*.Freq*/\n += count;\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2] /*.Freq*/++;\n }\n\n s.bl_tree[REP_3_6 * 2] /*.Freq*/++;\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2] /*.Freq*/++;\n } else {\n s.bl_tree[REPZ_11_138 * 2] /*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2]/*.Freq*/++; \n }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code) // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n tree[(max_code + 1) * 2 + 1]\n /*.Len*/\n = 0xffff;\n /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]\n /*.Freq*/\n += count;\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2] /*.Freq*/++;\n }\n\n s.bl_tree[REP_3_6 * 2] /*.Freq*/++;\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2] /*.Freq*/++;\n } else {\n s.bl_tree[REPZ_11_138 * 2] /*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function scan_tree(s, tree, max_code) // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n tree[(max_code + 1) * 2 + 1]\n /*.Len*/\n = 0xffff;\n /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]\n /*.Freq*/\n += count;\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2] /*.Freq*/++;\n }\n\n s.bl_tree[REP_3_6 * 2] /*.Freq*/++;\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2] /*.Freq*/++;\n } else {\n s.bl_tree[REPZ_11_138 * 2] /*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function scan_tree(s,tree,max_code)// deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {var n;/* iterates over all tree elements */var prevlen=-1;/* last emitted length */var curlen;/* length of current code */var nextlen=tree[0*2+1]/*.Len*/;/* length of next code */var count=0;/* repeat count of the current code */var max_count=7;/* max repeat count */var min_count=4;/* min repeat count */if(nextlen===0){max_count=138;min_count=3;}tree[(max_code+1)*2+1]/*.Len*/=0xffff;/* guard */for(n=0;n<=max_code;n++){curlen=nextlen;nextlen=tree[(n+1)*2+1]/*.Len*/;if(++count<max_count&&curlen===nextlen){continue;}else if(count<min_count){s.bl_tree[curlen*2]/*.Freq*/+=count;}else if(curlen!==0){if(curlen!==prevlen){s.bl_tree[curlen*2]/*.Freq*/++;}s.bl_tree[REP_3_6*2]/*.Freq*/++;}else if(count<=10){s.bl_tree[REPZ_3_10*2]/*.Freq*/++;}else {s.bl_tree[REPZ_11_138*2]/*.Freq*/++;}count=0;prevlen=curlen;if(nextlen===0){max_count=138;min_count=3;}else if(curlen===nextlen){max_count=6;min_count=3;}else {max_count=7;min_count=4;}}}", "function scan_tree(s, tree, max_code)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to be scanned */\n\t// int max_code; /* and its largest code of non zero frequency */\n\t{\n\t var n; /* iterates over all tree elements */\n\t var prevlen = -1; /* last emitted length */\n\t var curlen; /* length of current code */\n\n\t var nextlen = tree[0 * 2 + 1] /*.Len*/ ; /* length of next code */\n\n\t var count = 0; /* repeat count of the current code */\n\t var max_count = 7; /* max repeat count */\n\t var min_count = 4; /* min repeat count */\n\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\t }\n\t tree[(max_code + 1) * 2 + 1] /*.Len*/ = 0xffff; /* guard */\n\n\t for (n = 0; n <= max_code; n++) {\n\t curlen = nextlen;\n\t nextlen = tree[(n + 1) * 2 + 1] /*.Len*/ ;\n\n\t if (++count < max_count && curlen === nextlen) {\n\t continue;\n\n\t } else if (count < min_count) {\n\t s.bl_tree[curlen * 2] /*.Freq*/ += count;\n\n\t } else if (curlen !== 0) {\n\n\t if (curlen !== prevlen) {\n\t s.bl_tree[curlen * 2] /*.Freq*/ ++;\n\t }\n\t s.bl_tree[REP_3_6 * 2] /*.Freq*/ ++;\n\n\t } else if (count <= 10) {\n\t s.bl_tree[REPZ_3_10 * 2] /*.Freq*/ ++;\n\n\t } else {\n\t s.bl_tree[REPZ_11_138 * 2] /*.Freq*/ ++;\n\t }\n\n\t count = 0;\n\t prevlen = curlen;\n\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\n\t } else if (curlen === nextlen) {\n\t max_count = 6;\n\t min_count = 3;\n\n\t } else {\n\t max_count = 7;\n\t min_count = 4;\n\t }\n\t }\n\t}", "function $AvaN$var$scan_tree(s, tree, max_code) // deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n;\n /* iterates over all tree elements */\n\n var prevlen = -1;\n /* last emitted length */\n\n var curlen;\n /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]\n /*.Len*/\n ;\n /* length of next code */\n\n var count = 0;\n /* repeat count of the current code */\n\n var max_count = 7;\n /* max repeat count */\n\n var min_count = 4;\n /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n tree[(max_code + 1) * 2 + 1]\n /*.Len*/\n = 0xffff;\n /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]\n /*.Len*/\n ;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]\n /*.Freq*/\n += count;\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2] /*.Freq*/++;\n }\n\n s.bl_tree[$AvaN$var$REP_3_6 * 2]++;\n } else if (count <= 10) {\n s.bl_tree[$AvaN$var$REPZ_3_10 * 2] /*.Freq*/++;\n } else {\n s.bl_tree[$AvaN$var$REPZ_11_138 * 2] /*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}", "function scan_tree(s, tree, max_code)\n // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n \n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n \n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n \n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n \n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n \n if (++count < max_count && curlen === nextlen) {\n continue;\n \n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n \n } else if (curlen !== 0) {\n \n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n \n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n \n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n \n count = 0;\n prevlen = curlen;\n \n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n \n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n \n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n {\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n }", "function scan_tree$1(s, tree, max_code)\n\t// deflate_state *s;\n\t// ct_data *tree; /* the tree to be scanned */\n\t// int max_code; /* and its largest code of non zero frequency */\n\t{\n\t var n; /* iterates over all tree elements */\n\t var prevlen = -1; /* last emitted length */\n\t var curlen; /* length of current code */\n\n\t var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n\t var count = 0; /* repeat count of the current code */\n\t var max_count = 7; /* max repeat count */\n\t var min_count = 4; /* min repeat count */\n\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\t }\n\t tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n\t for (n = 0; n <= max_code; n++) {\n\t curlen = nextlen;\n\t nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n\t if (++count < max_count && curlen === nextlen) {\n\t continue;\n\n\t } else if (count < min_count) {\n\t s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n\t } else if (curlen !== 0) {\n\n\t if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n\t s.bl_tree[REP_3_6$1 * 2]/*.Freq*/++;\n\n\t } else if (count <= 10) {\n\t s.bl_tree[REPZ_3_10$1 * 2]/*.Freq*/++;\n\n\t } else {\n\t s.bl_tree[REPZ_11_138$1 * 2]/*.Freq*/++;\n\t }\n\n\t count = 0;\n\t prevlen = curlen;\n\n\t if (nextlen === 0) {\n\t max_count = 138;\n\t min_count = 3;\n\n\t } else if (curlen === nextlen) {\n\t max_count = 6;\n\t min_count = 3;\n\n\t } else {\n\t max_count = 7;\n\t min_count = 4;\n\t }\n\t }\n\t}" ]
[ "0.7196888", "0.7099034", "0.7092436", "0.70759386", "0.706675", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.7054964", "0.70408994", "0.70359296", "0.6973957", "0.69738346", "0.6969734", "0.6963802", "0.69362766", "0.6872174" ]
0.70580226
27
=========================================================================== Send a literal or distance tree in compressed form, using the codes in bl_tree.
function send_tree(s, tree, max_code) // deflate_state *s; // ct_data *tree; /* the tree to be scanned */ // int max_code; /* and its largest code of non zero frequency */ { var n; /* iterates over all tree elements */ var prevlen = -1; /* last emitted length */ var curlen; /* length of current code */ var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */ var count = 0; /* repeat count of the current code */ var max_count = 7; /* max repeat count */ var min_count = 4; /* min repeat count */ /* tree[max_code+1].Len = -1; */ /* guard already set */ if (nextlen === 0) { max_count = 138; min_count = 3; } for (n = 0; n <= max_code; n++) { curlen = nextlen; nextlen = tree[(n+1)*2 + 1]/*.Len*/; if (++count < max_count && curlen === nextlen) { continue; } else if (count < min_count) { do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); } else if (curlen !== 0) { if (curlen !== prevlen) { send_code(s, curlen, s.bl_tree); count--; } //Assert(count >= 3 && count <= 6, " 3_6?"); send_code(s, REP_3_6, s.bl_tree); send_bits(s, count-3, 2); } else if (count <= 10) { send_code(s, REPZ_3_10, s.bl_tree); send_bits(s, count-3, 3); } else { send_code(s, REPZ_11_138, s.bl_tree); send_bits(s, count-11, 7); } count = 0; prevlen = curlen; if (nextlen === 0) { max_count = 138; min_count = 3; } else if (curlen === nextlen) { max_count = 6; min_count = 3; } else { max_count = 7; min_count = 4; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send_all_trees(lcodes, dcodes, blcodes) {\n\t\t var rank; // index in bl_order\n \n\t\t send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt\n \n\t\t send_bits(dcodes - 1, 5);\n\t\t send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt\n \n\t\t for (rank = 0; rank < blcodes; rank++) {\n\t\t\tsend_bits(bl_tree[Tree.bl_order[rank] * 2 + 1], 3);\n\t\t }\n \n\t\t send_tree(dyn_ltree, lcodes - 1); // literal tree\n \n\t\t send_tree(dyn_dtree, dcodes - 1); // distance tree\n\t\t} // Flush the bit buffer, keeping at most 7 bits in it.", "function send_all_trees(s, lcodes, dcodes, blcodes) // deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank;\n /* index in bl_order */\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n\n send_bits(s, lcodes - 257, 5);\n /* not +255 as stated in appnote.txt */\n\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4);\n /* not -3 as stated in appnote.txt */\n\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]\n /*.Len*/\n , 3);\n } //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n\n send_tree(s, s.dyn_ltree, lcodes - 1);\n /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1);\n /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function $AvaN$var$send_all_trees(s, lcodes, dcodes, blcodes) // deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank;\n /* index in bl_order */\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n\n $AvaN$var$send_bits(s, lcodes - 257, 5);\n /* not +255 as stated in appnote.txt */\n\n $AvaN$var$send_bits(s, dcodes - 1, 5);\n $AvaN$var$send_bits(s, blcodes - 4, 4);\n /* not -3 as stated in appnote.txt */\n\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n $AvaN$var$send_bits(s, s.bl_tree[$AvaN$var$bl_order[rank] * 2 + 1]\n /*.Len*/\n , 3);\n } //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n\n $AvaN$var$send_tree(s, s.dyn_ltree, lcodes - 1);\n /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n $AvaN$var$send_tree(s, s.dyn_dtree, dcodes - 1);\n /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s,lcodes,dcodes,blcodes)// deflate_state *s;\n // int lcodes, dcodes, blcodes; /* number of codes for each tree */\n {var rank;/* index in bl_order */ //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s,lcodes-257,5);/* not +255 as stated in appnote.txt */send_bits(s,dcodes-1,5);send_bits(s,blcodes-4,4);/* not -3 as stated in appnote.txt */for(rank=0;rank<blcodes;rank++){//Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s,s.bl_tree[bl_order[rank]*2+1]/*.Len*/,3);}//Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n send_tree(s,s.dyn_ltree,lcodes-1);/* literal tree */ //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n send_tree(s,s.dyn_dtree,dcodes-1);/* distance tree */ //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n }", "function send_tree(s,tree,max_code)// deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n {var n;/* iterates over all tree elements */var prevlen=-1;/* last emitted length */var curlen;/* length of current code */var nextlen=tree[0*2+1]/*.Len*/;/* length of next code */var count=0;/* repeat count of the current code */var max_count=7;/* max repeat count */var min_count=4;/* min repeat count */ /* tree[max_code+1].Len = -1; */ /* guard already set */if(nextlen===0){max_count=138;min_count=3;}for(n=0;n<=max_code;n++){curlen=nextlen;nextlen=tree[(n+1)*2+1]/*.Len*/;if(++count<max_count&&curlen===nextlen){continue;}else if(count<min_count){do{send_code(s,curlen,s.bl_tree);}while(--count!==0);}else if(curlen!==0){if(curlen!==prevlen){send_code(s,curlen,s.bl_tree);count--;}//Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s,REP_3_6,s.bl_tree);send_bits(s,count-3,2);}else if(count<=10){send_code(s,REPZ_3_10,s.bl_tree);send_bits(s,count-3,3);}else {send_code(s,REPZ_11_138,s.bl_tree);send_bits(s,count-11,7);}count=0;prevlen=curlen;if(nextlen===0){max_count=138;min_count=3;}else if(curlen===nextlen){max_count=6;min_count=3;}else {max_count=7;min_count=4;}}}", "function send_all_trees(s, lcodes, dcodes, blcodes) // deflate_state *s;\n // int lcodes, dcodes, blcodes; /* number of codes for each tree */\n {\n var rank;\n /* index in bl_order */\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n\n send_bits(s, lcodes - 257, 5);\n /* not +255 as stated in appnote.txt */\n\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4);\n /* not -3 as stated in appnote.txt */\n\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]\n /*.Len*/\n , 3);\n } //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n\n send_tree(s, s.dyn_ltree, lcodes - 1);\n /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1);\n /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n }", "function send_all_trees(s, lcodes, dcodes, blcodes) // deflate_state *s;\n // int lcodes, dcodes, blcodes; /* number of codes for each tree */\n {\n var rank;\n /* index in bl_order */\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n\n send_bits(s, lcodes - 257, 5);\n /* not +255 as stated in appnote.txt */\n\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4);\n /* not -3 as stated in appnote.txt */\n\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]\n /*.Len*/\n , 3);\n } //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n\n send_tree(s, s.dyn_ltree, lcodes - 1);\n /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1);\n /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n }", "function compress_block(ltree, dtree) {\n\t\tvar dist; // distance of matched string\n\t\tvar lc; // match length or unmatched char (if dist === 0)\n\t\tvar lx = 0; // running index in l_buf\n\t\tvar dx = 0; // running index in d_buf\n\t\tvar fx = 0; // running index in flag_buf\n\t\tvar flag = 0; // current flags\n\t\tvar code; // the code to send\n\t\tvar extra; // number of extra bits to send\n\n\t\tif (last_lit !== 0) {\n\t\t\tdo {\n\t\t\t\tif ((lx & 7) === 0) {\n\t\t\t\t\tflag = flag_buf[fx++];\n\t\t\t\t}\n\t\t\t\tlc = l_buf[lx++] & 0xff;\n\t\t\t\tif ((flag & 1) === 0) {\n\t\t\t\t\tSEND_CODE(lc, ltree); /* send a literal byte */\n\t\t\t\t\t//\tTracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n\t\t\t\t} else {\n\t\t\t\t\t// Here, lc is the match length - MIN_MATCH\n\t\t\t\t\tcode = length_code[lc];\n\t\t\t\t\tSEND_CODE(code + LITERALS + 1, ltree); // send the length code\n\t\t\t\t\textra = extra_lbits[code];\n\t\t\t\t\tif (extra !== 0) {\n\t\t\t\t\t\tlc -= base_length[code];\n\t\t\t\t\t\tsend_bits(lc, extra); // send the extra length bits\n\t\t\t\t\t}\n\t\t\t\t\tdist = d_buf[dx++];\n\t\t\t\t\t// Here, dist is the match distance - 1\n\t\t\t\t\tcode = D_CODE(dist);\n\t\t\t\t\t//\tAssert (code < D_CODES, \"bad d_code\");\n\n\t\t\t\t\tSEND_CODE(code, dtree); // send the distance code\n\t\t\t\t\textra = extra_dbits[code];\n\t\t\t\t\tif (extra !== 0) {\n\t\t\t\t\t\tdist -= base_dist[code];\n\t\t\t\t\t\tsend_bits(dist, extra); // send the extra distance bits\n\t\t\t\t\t}\n\t\t\t\t} // literal or match pair ?\n\t\t\t\tflag >>= 1;\n\t\t\t} while (lx < last_lit);\n\t\t}\n\n\t\tSEND_CODE(END_BLOCK, ltree);\n\t}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(lcodes, dcodes, blcodes) { // number of codes for each tree\n\t\tvar rank; // index in bl_order\n\n\t\t// Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n\t\t// Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, \"too many codes\");\n\t\t// Tracev((stderr, \"\\nbl counts: \"));\n\t\tsend_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt\n\t\tsend_bits(dcodes - 1, 5);\n\t\tsend_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt\n\t\tfor (rank = 0; rank < blcodes; rank++) {\n\t\t\t// Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n\t\t\tsend_bits(bl_tree[bl_order[rank]].dl, 3);\n\t\t}\n\n\t\t// send the literal tree\n\t\tsend_tree(dyn_ltree, lcodes - 1);\n\n\t\t// send the distance tree\n\t\tsend_tree(dyn_dtree, dcodes - 1);\n\t}", "function send_all_trees$1(s, lcodes, dcodes, blcodes)\n\t// deflate_state *s;\n\t// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n\t{\n\t var rank; /* index in bl_order */\n\n\t //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n\t //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n\t // \"too many codes\");\n\t //Tracev((stderr, \"\\nbl counts: \"));\n\t send_bits$1(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n\t send_bits$1(s, dcodes - 1, 5);\n\t send_bits$1(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n\t for (rank = 0; rank < blcodes; rank++) {\n\t //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n\t send_bits$1(s, s.bl_tree[bl_order$1[rank] * 2 + 1]/*.Len*/, 3);\n\t }\n\t //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n\t send_tree$1(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n\t //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n\t send_tree$1(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n\t //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n\t}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1] /*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}", "function send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}" ]
[ "0.721052", "0.6960736", "0.6942097", "0.6926114", "0.6910601", "0.6898549", "0.6897821", "0.6881878", "0.68465155", "0.6825804", "0.68159336", "0.6795697", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.6787552", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164", "0.67743164" ]
0.0
-1
=========================================================================== Construct the Huffman tree for the bit lengths and return the index in bl_order of the last bit length code to send.
function build_bl_tree(s) { var max_blindex; /* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */ scan_tree(s, s.dyn_ltree, s.l_desc.max_code); scan_tree(s, s.dyn_dtree, s.d_desc.max_code); /* Build the bit length tree: */ build_tree(s, s.bl_desc); /* opt_len now includes the length of the tree representations, except * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. */ /* Determine the number of bit length codes to send. The pkzip format * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) { break; } } /* Update opt_len to include the bit length tree and counts */ s.opt_len += 3*(max_blindex+1) + 5+5+4; //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", // s->opt_len, s->static_len)); return max_blindex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function build_bl_tree() {\n\t\tvar max_blindex; // index of last bit length code of non zero freq\n\n\t\t// Determine the bit length frequencies for literal and distance trees\n\t\tscan_tree(dyn_ltree, l_desc.max_code);\n\t\tscan_tree(dyn_dtree, d_desc.max_code);\n\n\t\t// Build the bit length tree:\n\t\tbuild_tree(bl_desc);\n\t\t// opt_len now includes the length of the tree representations, except\n\t\t// the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\n\t\t// Determine the number of bit length codes to send. The pkzip format\n\t\t// requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t// 3 but the actual value used is 4.)\n\t\tfor (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[bl_order[max_blindex]].dl !== 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Update opt_len to include the bit length tree and counts */\n\t\topt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t\t// Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\n\t\treturn max_blindex;\n\t}", "function build_bl_tree() {\n\t\t var max_blindex; // index of last bit length code of non zero freq\n\t\t // Determine the bit length frequencies for literal and distance trees\n \n\t\t scan_tree(dyn_ltree, l_desc.max_code);\n\t\t scan_tree(dyn_dtree, d_desc.max_code); // Build the bit length tree:\n \n\t\t bl_desc.build_tree(that); // opt_len now includes the length of the tree representations, except\n\t\t // the lengths of the bit lengths codes and the 5+5+4 bits for the\n\t\t // counts.\n\t\t // Determine the number of bit length codes to send. The pkzip format\n\t\t // requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t // 3 but the actual value used is 4.)\n \n\t\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0) break;\n\t\t } // Update opt_len to include the bit length tree and counts\n \n \n\t\t that.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t\t return max_blindex;\n\t\t} // Output a byte on the stream.", "function build_bl_tree(s){var max_blindex;/* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */scan_tree(s,s.dyn_ltree,s.l_desc.max_code);scan_tree(s,s.dyn_dtree,s.d_desc.max_code);/* Build the bit length tree: */build_tree(s,s.bl_desc);/* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */ /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */for(max_blindex=BL_CODES-1;max_blindex>=3;max_blindex--){if(s.bl_tree[bl_order[max_blindex]*2+1]/*.Len*/!==0){break;}}/* Update opt_len to include the bit length tree and counts */s.opt_len+=3*(max_blindex+1)+5+5+4;//Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n return max_blindex;}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\t\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\t\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\t\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\t\n\t return max_blindex;\n\t }", "function build_bl_tree(s) {\n var max_blindex;\n /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n /* Build the bit length tree: */\n\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]\n /*.Len*/\n !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n\n\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n }", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n \n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n \n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n \n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n \n return max_blindex;\n }", "function build_bl_tree(s) {\n var max_blindex;\n /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n /* Build the bit length tree: */\n\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]\n /*.Len*/\n !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n\n\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n var max_blindex;\n /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n /* Build the bit length tree: */\n\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]\n /*.Len*/\n !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n\n\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n }", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex] * 2 + 1] /*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3*(max_blindex+1) + 5+5+4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n\t var max_blindex; /* index of last bit length code of non zero freq */\n\n\t /* Determine the bit length frequencies for literal and distance trees */\n\t scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n\t scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n\t /* Build the bit length tree: */\n\t build_tree(s, s.bl_desc);\n\t /* opt_len now includes the length of the tree representations, except\n\t * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\t */\n\n\t /* Determine the number of bit length codes to send. The pkzip format\n\t * requires that at least 4 bit length codes be sent. (appnote.txt says\n\t * 3 but the actual value used is 4.)\n\t */\n\t for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {\n\t if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) {\n\t break;\n\t }\n\t }\n\t /* Update opt_len to include the bit length tree and counts */\n\t s.opt_len += 3*(max_blindex+1) + 5+5+4;\n\t //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t // s->opt_len, s->static_len));\n\n\t return max_blindex;\n\t}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}", "function build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}" ]
[ "0.7984391", "0.79464096", "0.73637545", "0.7298226", "0.7285736", "0.7285724", "0.724746", "0.7231646", "0.7228964", "0.7219668", "0.7219668", "0.7219668", "0.7219668", "0.7219668", "0.7218879", "0.7215603", "0.7215603", "0.7182199", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828", "0.7176828" ]
0.0
-1
=========================================================================== Send the header for a block using dynamic Huffman trees: the counts, the lengths of the bit length codes, the literal tree and the distance tree. IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
function send_all_trees(s, lcodes, dcodes, blcodes) // deflate_state *s; // int lcodes, dcodes, blcodes; /* number of codes for each tree */ { var rank; /* index in bl_order */ //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, // "too many codes"); //Tracev((stderr, "\nbl counts: ")); send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ send_bits(s, dcodes-1, 5); send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ for (rank = 0; rank < blcodes; rank++) { //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3); } //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */ //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */ //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function build_bl_tree() {\n\t\t var max_blindex; // index of last bit length code of non zero freq\n\t\t // Determine the bit length frequencies for literal and distance trees\n \n\t\t scan_tree(dyn_ltree, l_desc.max_code);\n\t\t scan_tree(dyn_dtree, d_desc.max_code); // Build the bit length tree:\n \n\t\t bl_desc.build_tree(that); // opt_len now includes the length of the tree representations, except\n\t\t // the lengths of the bit lengths codes and the 5+5+4 bits for the\n\t\t // counts.\n\t\t // Determine the number of bit length codes to send. The pkzip format\n\t\t // requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t // 3 but the actual value used is 4.)\n \n\t\t for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0) break;\n\t\t } // Update opt_len to include the bit length tree and counts\n \n \n\t\t that.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t\t return max_blindex;\n\t\t} // Output a byte on the stream.", "function build_bl_tree() {\n\t\tvar max_blindex; // index of last bit length code of non zero freq\n\n\t\t// Determine the bit length frequencies for literal and distance trees\n\t\tscan_tree(dyn_ltree, l_desc.max_code);\n\t\tscan_tree(dyn_dtree, d_desc.max_code);\n\n\t\t// Build the bit length tree:\n\t\tbuild_tree(bl_desc);\n\t\t// opt_len now includes the length of the tree representations, except\n\t\t// the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n\n\t\t// Determine the number of bit length codes to send. The pkzip format\n\t\t// requires that at least 4 bit length codes be sent. (appnote.txt says\n\t\t// 3 but the actual value used is 4.)\n\t\tfor (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n\t\t\tif (bl_tree[bl_order[max_blindex]].dl !== 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Update opt_len to include the bit length tree and counts */\n\t\topt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n\t\t// Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\n\t\treturn max_blindex;\n\t}", "static initHuffmanTree() {\n let i = 0;\n while (i < 144) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x030 + i) << 8);\n ARR_LITERAL_LENGTHS[i++] = 8;\n }\n while (i < 256) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x190 - 144 + i) << 7);\n ARR_LITERAL_LENGTHS[i++] = 9;\n }\n while (i < 280) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x000 - 256 + i) << 9);\n ARR_LITERAL_LENGTHS[i++] = 7;\n }\n while (i < 286) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x0c0 - 280 + i) << 8);\n ARR_LITERAL_LENGTHS[i++] = 8;\n }\n for (i = 0; i < 30; i++) {\n ARR_DISTANCE_CODES[i] = CompressorHuffmanTree.bitReverse(i << 11);\n ARR_DISTANCE_LENGTHS[i] = 5;\n }\n }", "function $AvaN$var$_tr_flush_block(s, buf, stored_len, last) //DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb;\n /* opt_len and static_len in bytes */\n\n var max_blindex = 0;\n /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === $AvaN$var$Z_UNKNOWN) {\n s.strm.data_type = $AvaN$var$detect_data_type(s);\n }\n /* Construct the literal and distance trees */\n\n\n $AvaN$var$build_tree(s, s.l_desc); // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n $AvaN$var$build_tree(s, s.d_desc); // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n\n max_blindex = $AvaN$var$build_bl_tree(s);\n /* Determine the best encoding. Compute the block lengths in bytes. */\n\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3; // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5;\n /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n $AvaN$var$_tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === $AvaN$var$Z_FIXED || static_lenb === opt_lenb) {\n $AvaN$var$send_bits(s, ($AvaN$var$STATIC_TREES << 1) + (last ? 1 : 0), 3);\n $AvaN$var$compress_block(s, $AvaN$var$static_ltree, $AvaN$var$static_dtree);\n } else {\n $AvaN$var$send_bits(s, ($AvaN$var$DYN_TREES << 1) + (last ? 1 : 0), 3);\n $AvaN$var$send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n $AvaN$var$compress_block(s, s.dyn_ltree, s.dyn_dtree);\n } // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n\n\n $AvaN$var$init_block(s);\n\n if (last) {\n $AvaN$var$bi_windup(s);\n } // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n\n}", "function HuffmanTreeGroup(alphabet_size, num_htrees) {\n this.alphabet_size = alphabet_size;\n this.num_htrees = num_htrees;\n this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]); \n this.htrees = new Uint32Array(num_htrees);\n}", "function HuffmanTreeGroup(alphabet_size, num_htrees) {\n this.alphabet_size = alphabet_size;\n this.num_htrees = num_htrees;\n this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]); \n this.htrees = new Uint32Array(num_htrees);\n}", "function HuffmanTreeGroup(alphabet_size, num_htrees) {\n this.alphabet_size = alphabet_size;\n this.num_htrees = num_htrees;\n this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]); \n this.htrees = new Uint32Array(num_htrees);\n}", "function HuffmanTreeGroup(alphabet_size, num_htrees) {\n this.alphabet_size = alphabet_size;\n this.num_htrees = num_htrees;\n this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]); \n this.htrees = new Uint32Array(num_htrees);\n}", "function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb;\n /* opt_len and static_len in bytes */\n\n var max_blindex = 0;\n /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n /* Construct the literal and distance trees */\n\n\n build_tree(s, s.l_desc); // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc); // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n\n max_blindex = build_bl_tree(s);\n /* Determine the best encoding. Compute the block lengths in bytes. */\n\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3; // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5;\n /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n } // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n\n\n init_block(s);\n\n if (last) {\n bi_windup(s);\n } // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n\n}", "function HuffmanTreeGroup(alphabet_size, num_htrees) {\n this.alphabet_size = alphabet_size;\n this.num_htrees = num_htrees;\n this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]);\n this.htrees = new Uint32Array(num_htrees);\n}", "function BuildHuffmanTable(root_table,root_table_off,\n root_bits,\n code_lengths,code_lengths_off,\n code_lengths_size,\n count,count_off) {\n var code=new HuffmanCode(); /* current table entry */\n var table=new Array(new HuffmanCode());//* /* next available space in table */\n var table_off=0;\n var len; /* current code length */\n var symbol; /* symbol index in original or sorted table */\n var key; /* reversed prefix code */\n var step; /* step size to replicate values in current table */\n var low; /* low bits for current root entry */\n var mask; /* mask for low bits */\n var table_bits; /* key length of current table */\n var table_size; /* size of current table */\n var total_size; /* sum of root table size and 2nd level table sizes */\n /* symbols sorted by code length */\n var sorted=new mallocArr(code_lengths_size,0);\n /* offsets in sorted table for each length */\n var offset=new mallocArr(kHuffmanMaxLength + 1,0);\n var max_length = 1;\n\n /* generate offsets into sorted symbol table by code length */\n {\n var sum = 0;\n for (len = 1; len <= kHuffmanMaxLength; len++) {\n offset[len] = sum;\n if (count[len]) {\n sum = (sum + count[len]);\n max_length = len;\n }\n }\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (symbol = 0; symbol < code_lengths_size; symbol++) {\n if (code_lengths[symbol] != 0) {\n sorted[offset[code_lengths[symbol]]++] = symbol;\n }\n }\n\n table = root_table;\n table_off = root_table_off;\n table_bits = root_bits;\n table_size = 1 << table_bits;\n total_size = table_size;\n\n /* special case code with only one value */\n if (offset[kHuffmanMaxLength] == 1) {\n code.bits = 0;\n code.value = (sorted[0]);\n for (key = 0; key < total_size; ++key) {\n table[table_off+key] = code;\n }\n return total_size;\n }\n\n /* fill in root table */\n /* let's reduce the table size to a smaller size if possible, and */\n /* create the repetitions by memcpy if possible in the coming loop */\n if (table_bits > max_length) {\n table_bits = max_length;\n table_size = 1 << table_bits;\n }\n key = 0;\n symbol = 0;\n code.bits = 1;\n step = 2;\n do {\n for (; count[code.bits] != 0; --count[code.bits]) {\n code.value = (sorted[symbol++]);\n ReplicateValue(table,table_off+key, step, table_size, code);\n key = GetNextKey(key, code.bits);\n }\n step <<= 1;\n } while (++code.bits <= table_bits);\n\n /* if root_bits != table_bits we only created one fraction of the */\n /* table, and we need to replicate it now. */\n while (total_size != table_size) {\n //memcpy(&table[table_size], &table[0], table_size * sizeof(table[0]));\n\tfor(var i=0;i<table_size;++i) {\n\t\ttable[table_off+table_size+i].bits=table[table_off+0+i].bits;\n\t\ttable[table_off+table_size+i].value=table[table_off+0+i].value;\n\t}\n table_size <<= 1;\n }\n\n /* fill in 2nd level tables and add pointers to root table */\n mask = total_size - 1;\n low = -1;\n for (len = root_bits + 1, step = 2; len <= max_length; ++len, step <<= 1) {\n for (; count[len] != 0; --count[len]) {\n if ((key & mask) != low) {\n table_off += table_size;\n table_bits = NextTableBitSize(count, len, root_bits);\n table_size = 1 << table_bits;\n total_size += table_size;\n low = key & mask;\n root_table[root_table_off+low].bits = (table_bits + root_bits);\n root_table[root_table_off+low].value =\n ((table_off - root_table_off) - low);\n }\n code.bits = (len - root_bits);\n code.value = (sorted[symbol++]);\n ReplicateValue(table,table_off+(key >> root_bits), step, table_size, code);\n key = GetNextKey(key, len);\n }\n }\n\n return total_size;\n}", "function build_bl_tree(s){var max_blindex;/* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */scan_tree(s,s.dyn_ltree,s.l_desc.max_code);scan_tree(s,s.dyn_dtree,s.d_desc.max_code);/* Build the bit length tree: */build_tree(s,s.bl_desc);/* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */ /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */for(max_blindex=BL_CODES-1;max_blindex>=3;max_blindex--){if(s.bl_tree[bl_order[max_blindex]*2+1]/*.Len*/!==0){break;}}/* Update opt_len to include the bit length tree and counts */s.opt_len+=3*(max_blindex+1)+5+5+4;//Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n return max_blindex;}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb; \n }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN$1) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len+3+7) >>> 3;\n static_lenb = (s.static_len+3+7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}" ]
[ "0.605133", "0.58291775", "0.5769802", "0.5747375", "0.56533957", "0.56533957", "0.56533957", "0.56533957", "0.5626713", "0.55912226", "0.55687624", "0.556751", "0.55406004", "0.55307066", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55298615", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923", "0.55249923" ]
0.0
-1
=========================================================================== Initialize the tree data structures for a new zlib stream.
function _tr_init(s) { if (!static_init_done) { tr_static_init(); static_init_done = true; } s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); s.bi_buf = 0; s.bi_valid = 0; /* Initialize the first block of the first file: */ init_block(s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_init() {\n this.__lookupTable = new qx.data.Array();\n this.__openNodes = [];\n this.__nestingLevel = [];\n this._initLayer();\n }", "function _tr_init(s){if(!static_init_done){tr_static_init();static_init_done=true;}s.l_desc=new TreeDesc(s.dyn_ltree,static_l_desc);s.d_desc=new TreeDesc(s.dyn_dtree,static_d_desc);s.bl_desc=new TreeDesc(s.bl_tree,static_bl_desc);s.bi_buf=0;s.bi_valid=0;/* Initialize the first block of the first file: */init_block(s);}", "constructor() {\n this._tree=new NaryTree();\n }", "buildTree() {\n\t\tthis.assignLevel(this.nodesList[0], 0);\n\t\tthis.positionMap = new Map();\n\t\tthis.assignPosition(this.nodesList[0], 0);\n\t}", "function treeInit() {\n tree = new YAHOO.widget.TreeView(\"en_tree\");\n // Caricamento dinamico dei dati \n tree.setDynamicLoad(loadDataForNode);\n\n var root = tree.getRoot();\n var baseLabel = baseRoot.replace(/.*\\//, \"\");\n var tmpNode = new YAHOO.widget.TextNode({ label: baseLabel, fqFileName: baseRoot, type: \"dir\" }, root, false);\n oTextNodeMap[tmpNode.labelElId] = tmpNode;\n tree.render();\n}", "static initHuffmanTree() {\n let i = 0;\n while (i < 144) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x030 + i) << 8);\n ARR_LITERAL_LENGTHS[i++] = 8;\n }\n while (i < 256) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x190 - 144 + i) << 7);\n ARR_LITERAL_LENGTHS[i++] = 9;\n }\n while (i < 280) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x000 - 256 + i) << 9);\n ARR_LITERAL_LENGTHS[i++] = 7;\n }\n while (i < 286) {\n ARR_LITERAL_CODES[i] = CompressorHuffmanTree.bitReverse((0x0c0 - 280 + i) << 8);\n ARR_LITERAL_LENGTHS[i++] = 8;\n }\n for (i = 0; i < 30; i++) {\n ARR_DISTANCE_CODES[i] = CompressorHuffmanTree.bitReverse(i << 11);\n ARR_DISTANCE_LENGTHS[i] = 5;\n }\n }", "function _tr_init(s) {\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}", "function _tr_init(s)\n {\n \n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n \n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n \n s.bi_buf = 0;\n s.bi_valid = 0;\n \n /* Initialize the first block of the first file: */\n init_block(s);\n }", "function _tr_init(s) {\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n s.bi_buf = 0;\n s.bi_valid = 0;\n /* Initialize the first block of the first file: */\n\n init_block(s);\n}", "function _tr_init(s) {\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}", "function _tr_init(s) {\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n s.bi_buf = 0;\n s.bi_valid = 0;\n /* Initialize the first block of the first file: */\n\n init_block(s);\n }", "function _tr_init(s) {\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n s.bi_buf = 0;\n s.bi_valid = 0;\n /* Initialize the first block of the first file: */\n\n init_block(s);\n }" ]
[ "0.6510822", "0.6424953", "0.6375535", "0.63501585", "0.6259595", "0.6178484", "0.6144798", "0.61362624", "0.6128932", "0.60982025", "0.6096389", "0.60900533" ]
0.61420107
90
=========================================================================== Send a stored block
function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ { send_bits(s, (STORED_BLOCK<<1)+(last ? 1 : 0), 3); /* send block type */ copy_block(s, buf, stored_len, true); /* with header */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "messageSent (peerId, block) {\n const ledger = this._findOrCreate(peerId)\n ledger.sentBytes(block ? block.data.length : 0)\n if (block && block.cid) {\n ledger.wantlist.remove(block.cid)\n }\n }", "messageSent (peerId, block) {\n const ledger = this._findOrCreate(peerId)\n ledger.sentBytes(block ? block.data.length : 0)\n if (block && block.cid) {\n ledger.wantlist.remove(block.cid)\n }\n }", "static mineBlock ( payload ){\n console.log(`Mining Block`)\n return new Promise((resolve, reject) => {\n let hash;\n let lastBlock = DB.transactionLastBlock();\n //payload.id = uuid();\n do {\n payload.created_at = Date.now()\n payload.nonce = CRPYTO.randomBytes(16).toString('base64');\n payload.difficulty = Block.adjustDifficulty(payload, lastBlock);\n //console.log('DIFFICULTY: ', payload.difficulty)\n payload.lastHash = lastBlock.hash\n hash = CryptUtil.hash(payload, payload.difficulty, payload.nonce);\n }while( HexToBin(hash).substr(0, payload.difficulty) !== '0'.repeat(payload.difficulty))\n let block = {\n payload : payload,\n hash\n }\n //Broadcast the new block\n global.node.broadcast.write(JSON.stringify({channel:'block', payload:block}))\n resolve(DB.transactionPutBlock(block));\n })\n \n \n }", "postNewBlock() {\n let self = this;\n this.app.post(\"/api/block\", (req, res) => {\n let blockData = req.body.data;\n let block = new Block.Block(blockData);\n self.myBlockChain.addBlock(block)\n .then((block) => {\n res.send(block)\n })\n .catch((err) => {\n res.send(\"Error creating block: \" + err);\n })\n });\n }", "postNewBlock() {\n this.server.route({\n method: 'POST',\n path: '/block',\n handler: (request, h) => {\n return new Promise ((resolve,reject)=>{\n var ctype = request.headers[\"content-type\"];\n if (!ctype || ctype.indexOf(\"application/json\") !== 0) {\n reject (Boom.badRequest(\"Wrong content-type. Required \\\"application/json\\\"\"));\n }\n const blockdata = request.payload.body;\n if (typeof blockdata === \"undefined\" || !blockdata || blockdata.trim().length === 0) { \n reject(Boom.badRequest(\"Bad Request expecting {\\\"data\\\":\\\"block body\\\"}\"));\n } else {\n this.blockChain.addBlock(new BlockClass.Block(blockdata)).then ((newblock)=>{\n resolve (JSON.stringify(newblock));\n });\n }\n });\n }\n });\n }", "async storageBlock(newBlock) {\n await this.m_chainDB.BeginTranscation();\n let newHeaders = newBlock.toHeaders();\n\n let headerHash = newHeaders.hash('hex');\n let blockHash = newBlock.hash('hex');\n \n if (newHeaders.height === this.m_headerChain.getNowHeight() + 1) {\n await this.m_headerChain.addHeader(newHeaders);\n }\n await this.m_chainDB.CommitTranscation();\n\n this.m_blockStorage.add(newBlock);\n }", "async function blxSendBinblock (data, fname, syncflag, mem_addr) {\n let txlen_total = data.length\n let tx_pos = 0\n const time0 = Date.now() - 1000\n let tw_old = time0\n let tw_new // Working Time fuer Fortschritt\n let sblk_len = (max_ble_blocklen - 2) & 0xFFFC // Initial MAX Size Block, but Multi of 4\n\n if (data.length > 1000) { // Mehr als 1k Daten UND File: -> FAST\n\n if(fname === undefined){\n // Might bee too fast for Download to CPU Memory, set to slow with .cf 15 or greater!!!\n if(con_memfast_speed < 15)\n terminalPrint(\"*** WARNING: Memory Connection Speed: \" + con_memfast_speed ) \n const os = con_fast_speed // temporaer mit MEMORY Speed\n con_fast_speed = con_memfast_speed\n await blxConnectionFast()\n con_fast_speed = os\n }else{\n await blxConnectionFast()\n } \n if (blxErrMsg) return\n // console.log(\"Fast OK\");\n }\n if(fname!== undefined) await blxDeviceCmd('P' + (syncflag ? '!' : '') + ':' + fname, 5000) // P wie PUT\n else {\n {\n let wadr = mem_addr\n let wsize = txlen_total\n const sector_size = 4096 // Fix fuer nrF52\n // Sektoren in einzeln Loeschen, da langsam\n while(wsize>0){\n await blxDeviceCmd('K:' + wadr + ' ' + 1 , 5000) \n if (blxErrMsg) return\n wadr+=sector_size\n wsize-=sector_size\n }\n }\n await blxDeviceCmd('I:' + mem_addr, 5000) // I wie Internal\n }\n if (blxErrMsg) return\n\n try {\n for (;;) {\n let blen = txlen_total // Blocklen\n if (blen > sblk_len ) blen = sblk_len\n const bdata = new Uint8Array(blen + 2)\n bdata[0] = blen\n bdata[1] = BB_BLE_BINBLK_IN // Binary Data\n // Aufgabe: data[tx_pos] an bdata[2] kopieren\n const datablock = data.subarray(tx_pos, tx_pos + blen)\n bdata.set(datablock, 2) // Copies datablock into bdata\n\n await NUS_data_chara_write.writeValue(bdata.buffer)\n\n // console.log(bdata);\n txlen_total -= blen\n tx_pos += blen\n if (!txlen_total) {\n const dtime = Date.now() - time0\n terminalPrint('Transfer OK (' + dtime / 1000 + ' sec, ' + ((data.length / dtime * 1000).toFixed(0)) + ' Bytes/sec)')\n break\n }\n tw_new = Date.now()\n if (tw_new - tw_old > 1000) { // Alle Sekunde Fortschritt\n tw_old = tw_new\n terminalPrint(((tx_pos * 100) / data.length).toFixed(0) + '% / ' + tx_pos + ' Bytes')\n }\n }\n } catch (error) {\n if (full_connected_flag === false) blxErrMsg = 'ERROR: Connection lost'\n else blxErrMsg = 'ERROR: Transfer ' + error\n return\n }\n\n await blxDeviceCmd('L', 5000) // Close\n\n if (blxErrMsg) return\n if (data.length > 1000) { // Mehr als 1k Daten: -> Wieder SLOW\n await blxConnectionSlow()\n }\n }", "function copy_block(buf, // the input data\n\t\tlen, // its length\n\t\theader // true if block header must be written\n\t\t) {\n\t\t bi_windup(); // align on byte boundary\n \n\t\t last_eob_len = 8; // enough lookahead for inflate\n \n\t\t if (header) {\n\t\t\tput_short(len);\n\t\t\tput_short(~len);\n\t\t }\n \n\t\t that.pending_buf.set(window.subarray(buf, buf + len), that.pending);\n\t\t that.pending += len;\n\t\t} // Send a stored block", "postNewBlock() {\n this.server.route({\n method: 'POST',\n path: '/api/block',\n handler: (request, h) => {\n return new Promise ((resolve,reject)=>{\n var ctype = request.headers[\"content-type\"];\n if (!ctype || ctype.indexOf(\"application/json\") !== 0) {\n reject (Boom.badRequest(\"Wrong content-type. Required \\\"application/json\\\"\"));\n }\n const blockdata = request.payload.body;\n if (typeof blockdata === \"undefined\" || !blockdata || blockdata.trim().length === 0) { \n reject(Boom.badRequest(\"Bad Request expecting {\\\"data\\\":\\\"block body\\\"}\"));\n } else {\n this.blockChain.addBlock(new BlockClass.Block(blockdata)).then ((newblock)=>{\n resolve (newblock);\n });\n }\n });\n }\n });\n }", "messageSent (peerId, msg) {\n const ledger = this._findOrCreate(peerId)\n for (let block of msg.blocks.values()) {\n ledger.sentBytes(block.data.length)\n ledger.wantlist.remove(block.key)\n this.peerRequestQueue.remove(block.key, peerId)\n }\n }", "processSend(privKey, previous, sendCallback) {\n let pubKey = nano_old.derivePublicKey(privKey)\n let address = nano.deriveAddress(pubKey, {useNanoPrefix: true})\n\n // make an extra check on valid destination\n if (this.state.validAddress && nano.checkAddress(this.state.address)) {\n this.inputToast = toast(\"Started transferring funds...\", helpers.getToast(helpers.toastType.SUCCESS_AUTO))\n this.appendLog(\"Transfer started: \" + address)\n this.generateWork(previous, this.defaultSendPow, function(work) {\n // create the block with the work found\n let block = nano.createBlock(privKey, {balance:'0', representative:this.representative,\n work:work, link:this.state.address, previous:previous})\n // replace xrb with nano (old library)\n block.block.account = block.block.account.replace('xrb', 'nano')\n block.block.link_as_account = block.block.link_as_account.replace('xrb', 'nano')\n\n // publish block for each iteration\n let jsonBlock = {action: \"process\", json_block: \"true\", subtype:\"send\", watch_work:\"false\", block: block.block}\n helpers.postDataTimeout(jsonBlock,helpers.constants.RPC_SWEEP_SERVER)\n .then(function(data) {\n if (data.hash) {\n this.inputToast = toast(\"Funds transferred!\", helpers.getToast(helpers.toastType.SUCCESS_AUTO))\n this.appendLog(\"Funds transferred: \"+data.hash)\n console.log(this.adjustedBalance + \" raw transferred to \" + this.state.address)\n }\n else {\n this.inputToast = toast(\"Failed processing block.\", helpers.getToast(helpers.toastType.ERROR_AUTO))\n this.appendLog(\"Failed processing block: \"+data.error)\n }\n sendCallback()\n }.bind(this))\n .catch(function(error) {\n this.handleRPCError(error)\n sendCallback()\n }.bind(this))}.bind(this)\n )\n }\n else {\n if (this.state.address !== '') {\n this.inputToast = toast(\"The destination address is not valid\", helpers.getToast(helpers.toastType.ERROR))\n }\n sendCallback()\n }\n }", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last) {\n\t //DeflateState *s;\n\t //charf *buf; /* input block */\n\t //ulg stored_len; /* length of input block */\n\t //int last; /* one if this is the last block for a file */\n\t send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n\t copy_block(s, buf, stored_len, true); /* with header */\n\t }", "submitStarData() {\n this.server.route({\n method: 'POST',\n path: '/block',\n handler: async (request, h) => {\n const result = await this.mempool.verifyAddressRequest(request.payload);\n if (result.address !== undefined) {\n //add block to blockchain\n let blockResult = await this.blockchain.addBlock(new BlockClass.Block(result));\n return await this.blockchain.addDecodedStoryToReturnObj(blockResult); \n }\n return result; \n }\n });\n }", "saveBlock(height, block) {\n\n const self = this;\n return new Promise((resolve, reject) => {\n\n const blockString = JSON.stringify(block);\n self.db.put(height, blockString, (err) => {\n\n if (err) {\n reject(err);\n }\n else {\n resolve(block);\n }\n });\n });\n }", "function _tr_stored_block(s,buf,stored_len,last)//DeflateState *s;\n //charf *buf; /* input block */\n //ulg stored_len; /* length of input block */\n //int last; /* one if this is the last block for a file */\n {send_bits(s,(STORED_BLOCK<<1)+(last?1:0),3);/* send block type */copy_block(s,buf,stored_len,true);/* with header */}", "postNewBlock() {\n let self = this.blockChain;\n this.server.route({\n method: 'POST',\n path: '/block',\n handler: async (request, h) => {\n //Fetching block data from request body\n \n try{\n let blockData = request.payload.body;\n //Check whether the data variable is empty \n if(blockData==null){\n return \"No block data added\";\n }\n if(blockData.length==0){\n return \"Data is empty\";\n }\n let promise = self.addBlock(new BlockClass.Block(blockData));\n let result = await promise;\n return result;\n }catch(err){\n console.log(err);\n return \"Block cannot be added\";\n }\n \n }\n });\n }", "function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s;\n //charf *buf; /* input block */\n //ulg stored_len; /* length of input block */\n //int last; /* one if this is the last block for a file */\n {\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);\n /* send block type */\n\n copy_block(s, buf, stored_len, true);\n /* with header */\n }", "requestLocalData() {\n if (this.sendBuffers.length > 0) {\n const sendData = this.sendBuffers.shift();\n this.sp.write(sendData.data, () => {\n if (this.sp) {\n this.sp.drain(() => {\n this.executeCheckList[sendData.index] = sendData.id;\n });\n }\n });\n }\n// console.count('write hardware');\n return;\n }", "postNewBlock() {\r\n this.server.route({\r\n method: 'POST',\r\n path: '/api/block',\r\n handler: async (request, h) => {\r\n if(request.payload==undefined || request.payload.length==0 || !request.payload.body){\r\n throw Boom.badRequest(\"You have to specify a valid json object with a body property.\");\r\n }\r\n let newBlock = new Block.Block(request.payload.body);\r\n let blockData = await this.blockChain.addBlock(newBlock);\r\n return h.response(blockData).code(201);\r\n }\r\n });\r\n }", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last) //DeflateState *s;\n //charf *buf; /* input block */\n //ulg stored_len; /* length of input block */\n //int last; /* one if this is the last block for a file */\n {\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);\n /* send block type */\n\n copy_block(s, buf, stored_len, true);\n /* with header */\n }", "function sendTemporaryBlock(recipientId) {\n var fraudTemplate = require('./messagetemplates/fraudMessage');\n var message = fraudTemplate.getTemporaryBlockMessage(recipientId);\n sendToMessenger.sendAPIForMessage(message);\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}", "function _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}" ]
[ "0.6636688", "0.6636688", "0.6435359", "0.62935793", "0.60487586", "0.60476345", "0.60344964", "0.6023343", "0.59361583", "0.58950603", "0.58587354", "0.5830017", "0.582569", "0.5822428", "0.5819708", "0.5804283", "0.57723826", "0.57716817", "0.5749839", "0.5746885", "0.5746508", "0.5741353", "0.57344884", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903", "0.57218903" ]
0.5756371
36
=========================================================================== Send one empty static block to give enough lookahead for inflate. This takes 10 bits, of which 7 may remain in the bit buffer.
function _tr_align(s) { send_bits(s, STATIC_TREES<<1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inflate(data, usz) {\n /* shortcircuit for empty buffer [0x03, 0x00] */\n if (data[0] == 3 && !(data[1] & 0x3)) {\n return [new_raw_buf(usz), 2];\n }\n /* bit offset */\n\n\n var boff = 0;\n /* header includes final bit and type bits */\n\n var header = 0;\n var outbuf = new_unsafe_buf(usz ? usz : 1 << 18);\n var woff = 0;\n var OL = outbuf.length >>> 0;\n var max_len_1 = 0,\n max_len_2 = 0;\n\n while ((header & 1) == 0) {\n header = read_bits_3(data, boff);\n boff += 3;\n\n if (header >>> 1 == 0) {\n /* Stored block */\n if (boff & 7) boff += 8 - (boff & 7);\n /* 2 bytes sz, 2 bytes bit inverse */\n\n var sz = data[boff >>> 3] | data[(boff >>> 3) + 1] << 8;\n boff += 32;\n /* push sz bytes */\n\n if (!usz && OL < woff + sz) {\n outbuf = realloc(outbuf, woff + sz);\n OL = outbuf.length;\n }\n\n if (typeof data.copy === 'function') {\n // $FlowIgnore\n data.copy(outbuf, woff, boff >>> 3, (boff >>> 3) + sz);\n woff += sz;\n boff += 8 * sz;\n } else while (sz-- > 0) {\n outbuf[woff++] = data[boff >>> 3];\n boff += 8;\n }\n\n continue;\n } else if (header >>> 1 == 1) {\n /* Fixed Huffman */\n max_len_1 = 9;\n max_len_2 = 5;\n } else {\n /* Dynamic Huffman */\n boff = dyn(data, boff);\n max_len_1 = dyn_len_1;\n max_len_2 = dyn_len_2;\n }\n\n if (!usz && OL < woff + 32767) {\n outbuf = realloc(outbuf, woff + 32767);\n OL = outbuf.length;\n }\n\n for (;;) {\n // while(true) is apparently out of vogue in modern JS circles\n\n /* ingest code and move read head */\n var bits = read_bits_n(data, boff, max_len_1);\n var code = header >>> 1 == 1 ? fix_lmap[bits] : dyn_lmap[bits];\n boff += code & 15;\n code >>>= 4;\n /* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */\n\n if ((code >>> 8 & 0xFF) === 0) outbuf[woff++] = code;else if (code == 256) break;else {\n code -= 257;\n var len_eb = code < 8 ? 0 : code - 4 >> 2;\n if (len_eb > 5) len_eb = 0;\n var tgt = woff + LEN_LN[code];\n /* length extra bits */\n\n if (len_eb > 0) {\n tgt += read_bits_n(data, boff, len_eb);\n boff += len_eb;\n }\n /* dist code */\n\n\n bits = read_bits_n(data, boff, max_len_2);\n code = header >>> 1 == 1 ? fix_dmap[bits] : dyn_dmap[bits];\n boff += code & 15;\n code >>>= 4;\n var dst_eb = code < 4 ? 0 : code - 2 >> 1;\n var dst = DST_LN[code];\n /* dist extra bits */\n\n if (dst_eb > 0) {\n dst += read_bits_n(data, boff, dst_eb);\n boff += dst_eb;\n }\n /* in the common case, manual byte copy is faster than TA set / Buffer copy */\n\n\n if (!usz && OL < tgt) {\n outbuf = realloc(outbuf, tgt);\n OL = outbuf.length;\n }\n\n while (woff < tgt) {\n outbuf[woff] = outbuf[woff - dst];\n ++woff;\n }\n }\n }\n }\n\n return [usz ? outbuf : outbuf.slice(0, woff), boff + 7 >>> 3];\n }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n \n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function send_bits(s,value,length){if(s.bi_valid>Buf_size-length){s.bi_buf|=value<<s.bi_valid&0xffff;put_short(s,s.bi_buf);s.bi_buf=value>>Buf_size-s.bi_valid;s.bi_valid+=length-Buf_size;}else {s.bi_buf|=value<<s.bi_valid&0xffff;s.bi_valid+=length;}}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function bi_flush(s){if(s.bi_valid===16){put_short(s,s.bi_buf);s.bi_buf=0;s.bi_valid=0;}else if(s.bi_valid>=8){s.pending_buf[s.pending++]=s.bi_buf&0xff;s.bi_buf>>=8;s.bi_valid-=8;}}", "function fixed(n) {\n return new FixedBuffer(ring(n), n);\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n }", "function inflate(data, usz) {\n\t/* shortcircuit for empty buffer [0x03, 0x00] */\n\tif(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }\n\n\t/* bit offset */\n\tvar boff = 0;\n\n\t/* header includes final bit and type bits */\n\tvar header = 0;\n\n\tvar outbuf = new_unsafe_buf(usz ? usz : (1<<18));\n\tvar woff = 0;\n\tvar OL = outbuf.length>>>0;\n\tvar max_len_1 = 0, max_len_2 = 0;\n\n\twhile((header&1) == 0) {\n\t\theader = read_bits_3(data, boff); boff += 3;\n\t\tif((header >>> 1) == 0) {\n\t\t\t/* Stored block */\n\t\t\tif(boff & 7) boff += 8 - (boff&7);\n\t\t\t/* 2 bytes sz, 2 bytes bit inverse */\n\t\t\tvar sz = data[boff>>>3] | data[(boff>>>3)+1]<<8;\n\t\t\tboff += 32;\n\t\t\t/* push sz bytes */\n\t\t\tif(!usz && OL < woff + sz) { outbuf = realloc(outbuf, woff + sz); OL = outbuf.length; }\n\t\t\tif(typeof data.copy === 'function') {\n\t\t\t\t// $FlowIgnore\n\t\t\t\tdata.copy(outbuf, woff, boff>>>3, (boff>>>3)+sz);\n\t\t\t\twoff += sz; boff += 8*sz;\n\t\t\t} else while(sz-- > 0) { outbuf[woff++] = data[boff>>>3]; boff += 8; }\n\t\t\tcontinue;\n\t\t} else if((header >>> 1) == 1) {\n\t\t\t/* Fixed Huffman */\n\t\t\tmax_len_1 = 9; max_len_2 = 5;\n\t\t} else {\n\t\t\t/* Dynamic Huffman */\n\t\t\tboff = dyn(data, boff);\n\t\t\tmax_len_1 = dyn_len_1; max_len_2 = dyn_len_2;\n\t\t}\n\t\tif(!usz && (OL < woff + 32767)) { outbuf = realloc(outbuf, woff + 32767); OL = outbuf.length; }\n\t\tfor(;;) { // while(true) is apparently out of vogue in modern JS circles\n\t\t\t/* ingest code and move read head */\n\t\t\tvar bits = read_bits_n(data, boff, max_len_1);\n\t\t\tvar code = (header>>>1) == 1 ? fix_lmap[bits] : dyn_lmap[bits];\n\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t/* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */\n\t\t\tif(((code>>>8)&0xFF) === 0) outbuf[woff++] = code;\n\t\t\telse if(code == 256) break;\n\t\t\telse {\n\t\t\t\tcode -= 257;\n\t\t\t\tvar len_eb = (code < 8) ? 0 : ((code-4)>>2); if(len_eb > 5) len_eb = 0;\n\t\t\t\tvar tgt = woff + LEN_LN[code];\n\t\t\t\t/* length extra bits */\n\t\t\t\tif(len_eb > 0) {\n\t\t\t\t\ttgt += read_bits_n(data, boff, len_eb);\n\t\t\t\t\tboff += len_eb;\n\t\t\t\t}\n\n\t\t\t\t/* dist code */\n\t\t\t\tbits = read_bits_n(data, boff, max_len_2);\n\t\t\t\tcode = (header>>>1) == 1 ? fix_dmap[bits] : dyn_dmap[bits];\n\t\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t\tvar dst_eb = (code < 4 ? 0 : (code-2)>>1);\n\t\t\t\tvar dst = DST_LN[code];\n\t\t\t\t/* dist extra bits */\n\t\t\t\tif(dst_eb > 0) {\n\t\t\t\t\tdst += read_bits_n(data, boff, dst_eb);\n\t\t\t\t\tboff += dst_eb;\n\t\t\t\t}\n\n\t\t\t\t/* in the common case, manual byte copy is faster than TA set / Buffer copy */\n\t\t\t\tif(!usz && OL < tgt) { outbuf = realloc(outbuf, tgt); OL = outbuf.length; }\n\t\t\t\twhile(woff < tgt) { outbuf[woff] = outbuf[woff - dst]; ++woff; }\n\t\t\t}\n\t\t}\n\t}\n\treturn [usz ? outbuf : outbuf.slice(0, woff), (boff+7)>>>3];\n}", "function inflate(data, usz) {\n\t/* shortcircuit for empty buffer [0x03, 0x00] */\n\tif(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }\n\n\t/* bit offset */\n\tvar boff = 0;\n\n\t/* header includes final bit and type bits */\n\tvar header = 0;\n\n\tvar outbuf = new_unsafe_buf(usz ? usz : (1<<18));\n\tvar woff = 0;\n\tvar OL = outbuf.length>>>0;\n\tvar max_len_1 = 0, max_len_2 = 0;\n\n\twhile((header&1) == 0) {\n\t\theader = read_bits_3(data, boff); boff += 3;\n\t\tif((header >>> 1) == 0) {\n\t\t\t/* Stored block */\n\t\t\tif(boff & 7) boff += 8 - (boff&7);\n\t\t\t/* 2 bytes sz, 2 bytes bit inverse */\n\t\t\tvar sz = data[boff>>>3] | data[(boff>>>3)+1]<<8;\n\t\t\tboff += 32;\n\t\t\t/* push sz bytes */\n\t\t\tif(!usz && OL < woff + sz) { outbuf = realloc(outbuf, woff + sz); OL = outbuf.length; }\n\t\t\tif(typeof data.copy === 'function') {\n\t\t\t\t// $FlowIgnore\n\t\t\t\tdata.copy(outbuf, woff, boff>>>3, (boff>>>3)+sz);\n\t\t\t\twoff += sz; boff += 8*sz;\n\t\t\t} else while(sz-- > 0) { outbuf[woff++] = data[boff>>>3]; boff += 8; }\n\t\t\tcontinue;\n\t\t} else if((header >>> 1) == 1) {\n\t\t\t/* Fixed Huffman */\n\t\t\tmax_len_1 = 9; max_len_2 = 5;\n\t\t} else {\n\t\t\t/* Dynamic Huffman */\n\t\t\tboff = dyn(data, boff);\n\t\t\tmax_len_1 = dyn_len_1; max_len_2 = dyn_len_2;\n\t\t}\n\t\tif(!usz && (OL < woff + 32767)) { outbuf = realloc(outbuf, woff + 32767); OL = outbuf.length; }\n\t\tfor(;;) { // while(true) is apparently out of vogue in modern JS circles\n\t\t\t/* ingest code and move read head */\n\t\t\tvar bits = read_bits_n(data, boff, max_len_1);\n\t\t\tvar code = (header>>>1) == 1 ? fix_lmap[bits] : dyn_lmap[bits];\n\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t/* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */\n\t\t\tif(((code>>>8)&0xFF) === 0) outbuf[woff++] = code;\n\t\t\telse if(code == 256) break;\n\t\t\telse {\n\t\t\t\tcode -= 257;\n\t\t\t\tvar len_eb = (code < 8) ? 0 : ((code-4)>>2); if(len_eb > 5) len_eb = 0;\n\t\t\t\tvar tgt = woff + LEN_LN[code];\n\t\t\t\t/* length extra bits */\n\t\t\t\tif(len_eb > 0) {\n\t\t\t\t\ttgt += read_bits_n(data, boff, len_eb);\n\t\t\t\t\tboff += len_eb;\n\t\t\t\t}\n\n\t\t\t\t/* dist code */\n\t\t\t\tbits = read_bits_n(data, boff, max_len_2);\n\t\t\t\tcode = (header>>>1) == 1 ? fix_dmap[bits] : dyn_dmap[bits];\n\t\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t\tvar dst_eb = (code < 4 ? 0 : (code-2)>>1);\n\t\t\t\tvar dst = DST_LN[code];\n\t\t\t\t/* dist extra bits */\n\t\t\t\tif(dst_eb > 0) {\n\t\t\t\t\tdst += read_bits_n(data, boff, dst_eb);\n\t\t\t\t\tboff += dst_eb;\n\t\t\t\t}\n\n\t\t\t\t/* in the common case, manual byte copy is faster than TA set / Buffer copy */\n\t\t\t\tif(!usz && OL < tgt) { outbuf = realloc(outbuf, tgt); OL = outbuf.length; }\n\t\t\t\twhile(woff < tgt) { outbuf[woff] = outbuf[woff - dst]; ++woff; }\n\t\t\t}\n\t\t}\n\t}\n\treturn [usz ? outbuf : outbuf.slice(0, woff), (boff+7)>>>3];\n}", "function inflate(data, usz) {\n\t/* shortcircuit for empty buffer [0x03, 0x00] */\n\tif(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }\n\n\t/* bit offset */\n\tvar boff = 0;\n\n\t/* header includes final bit and type bits */\n\tvar header = 0;\n\n\tvar outbuf = new_unsafe_buf(usz ? usz : (1<<18));\n\tvar woff = 0;\n\tvar OL = outbuf.length>>>0;\n\tvar max_len_1 = 0, max_len_2 = 0;\n\n\twhile((header&1) == 0) {\n\t\theader = read_bits_3(data, boff); boff += 3;\n\t\tif((header >>> 1) == 0) {\n\t\t\t/* Stored block */\n\t\t\tif(boff & 7) boff += 8 - (boff&7);\n\t\t\t/* 2 bytes sz, 2 bytes bit inverse */\n\t\t\tvar sz = data[boff>>>3] | data[(boff>>>3)+1]<<8;\n\t\t\tboff += 32;\n\t\t\t/* push sz bytes */\n\t\t\tif(!usz && OL < woff + sz) { outbuf = realloc(outbuf, woff + sz); OL = outbuf.length; }\n\t\t\tif(typeof data.copy === 'function') {\n\t\t\t\t// $FlowIgnore\n\t\t\t\tdata.copy(outbuf, woff, boff>>>3, (boff>>>3)+sz);\n\t\t\t\twoff += sz; boff += 8*sz;\n\t\t\t} else while(sz-- > 0) { outbuf[woff++] = data[boff>>>3]; boff += 8; }\n\t\t\tcontinue;\n\t\t} else if((header >>> 1) == 1) {\n\t\t\t/* Fixed Huffman */\n\t\t\tmax_len_1 = 9; max_len_2 = 5;\n\t\t} else {\n\t\t\t/* Dynamic Huffman */\n\t\t\tboff = dyn(data, boff);\n\t\t\tmax_len_1 = dyn_len_1; max_len_2 = dyn_len_2;\n\t\t}\n\t\tif(!usz && (OL < woff + 32767)) { outbuf = realloc(outbuf, woff + 32767); OL = outbuf.length; }\n\t\tfor(;;) { // while(true) is apparently out of vogue in modern JS circles\n\t\t\t/* ingest code and move read head */\n\t\t\tvar bits = read_bits_n(data, boff, max_len_1);\n\t\t\tvar code = (header>>>1) == 1 ? fix_lmap[bits] : dyn_lmap[bits];\n\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t/* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */\n\t\t\tif(((code>>>8)&0xFF) === 0) outbuf[woff++] = code;\n\t\t\telse if(code == 256) break;\n\t\t\telse {\n\t\t\t\tcode -= 257;\n\t\t\t\tvar len_eb = (code < 8) ? 0 : ((code-4)>>2); if(len_eb > 5) len_eb = 0;\n\t\t\t\tvar tgt = woff + LEN_LN[code];\n\t\t\t\t/* length extra bits */\n\t\t\t\tif(len_eb > 0) {\n\t\t\t\t\ttgt += read_bits_n(data, boff, len_eb);\n\t\t\t\t\tboff += len_eb;\n\t\t\t\t}\n\n\t\t\t\t/* dist code */\n\t\t\t\tbits = read_bits_n(data, boff, max_len_2);\n\t\t\t\tcode = (header>>>1) == 1 ? fix_dmap[bits] : dyn_dmap[bits];\n\t\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t\tvar dst_eb = (code < 4 ? 0 : (code-2)>>1);\n\t\t\t\tvar dst = DST_LN[code];\n\t\t\t\t/* dist extra bits */\n\t\t\t\tif(dst_eb > 0) {\n\t\t\t\t\tdst += read_bits_n(data, boff, dst_eb);\n\t\t\t\t\tboff += dst_eb;\n\t\t\t\t}\n\n\t\t\t\t/* in the common case, manual byte copy is faster than TA set / Buffer copy */\n\t\t\t\tif(!usz && OL < tgt) { outbuf = realloc(outbuf, tgt); OL = outbuf.length; }\n\t\t\t\twhile(woff < tgt) { outbuf[woff] = outbuf[woff - dst]; ++woff; }\n\t\t\t}\n\t\t}\n\t}\n\treturn [usz ? outbuf : outbuf.slice(0, woff), (boff+7)>>>3];\n}", "function inflate(data, usz) {\n\t/* shortcircuit for empty buffer [0x03, 0x00] */\n\tif(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }\n\n\t/* bit offset */\n\tvar boff = 0;\n\n\t/* header includes final bit and type bits */\n\tvar header = 0;\n\n\tvar outbuf = new_unsafe_buf(usz ? usz : (1<<18));\n\tvar woff = 0;\n\tvar OL = outbuf.length>>>0;\n\tvar max_len_1 = 0, max_len_2 = 0;\n\n\twhile((header&1) == 0) {\n\t\theader = read_bits_3(data, boff); boff += 3;\n\t\tif((header >>> 1) == 0) {\n\t\t\t/* Stored block */\n\t\t\tif(boff & 7) boff += 8 - (boff&7);\n\t\t\t/* 2 bytes sz, 2 bytes bit inverse */\n\t\t\tvar sz = data[boff>>>3] | data[(boff>>>3)+1]<<8;\n\t\t\tboff += 32;\n\t\t\t/* push sz bytes */\n\t\t\tif(!usz && OL < woff + sz) { outbuf = realloc(outbuf, woff + sz); OL = outbuf.length; }\n\t\t\tif(typeof data.copy === 'function') {\n\t\t\t\t// $FlowIgnore\n\t\t\t\tdata.copy(outbuf, woff, boff>>>3, (boff>>>3)+sz);\n\t\t\t\twoff += sz; boff += 8*sz;\n\t\t\t} else while(sz-- > 0) { outbuf[woff++] = data[boff>>>3]; boff += 8; }\n\t\t\tcontinue;\n\t\t} else if((header >>> 1) == 1) {\n\t\t\t/* Fixed Huffman */\n\t\t\tmax_len_1 = 9; max_len_2 = 5;\n\t\t} else {\n\t\t\t/* Dynamic Huffman */\n\t\t\tboff = dyn(data, boff);\n\t\t\tmax_len_1 = dyn_len_1; max_len_2 = dyn_len_2;\n\t\t}\n\t\tif(!usz && (OL < woff + 32767)) { outbuf = realloc(outbuf, woff + 32767); OL = outbuf.length; }\n\t\tfor(;;) { // while(true) is apparently out of vogue in modern JS circles\n\t\t\t/* ingest code and move read head */\n\t\t\tvar bits = read_bits_n(data, boff, max_len_1);\n\t\t\tvar code = (header>>>1) == 1 ? fix_lmap[bits] : dyn_lmap[bits];\n\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t/* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */\n\t\t\tif(((code>>>8)&0xFF) === 0) outbuf[woff++] = code;\n\t\t\telse if(code == 256) break;\n\t\t\telse {\n\t\t\t\tcode -= 257;\n\t\t\t\tvar len_eb = (code < 8) ? 0 : ((code-4)>>2); if(len_eb > 5) len_eb = 0;\n\t\t\t\tvar tgt = woff + LEN_LN[code];\n\t\t\t\t/* length extra bits */\n\t\t\t\tif(len_eb > 0) {\n\t\t\t\t\ttgt += read_bits_n(data, boff, len_eb);\n\t\t\t\t\tboff += len_eb;\n\t\t\t\t}\n\n\t\t\t\t/* dist code */\n\t\t\t\tbits = read_bits_n(data, boff, max_len_2);\n\t\t\t\tcode = (header>>>1) == 1 ? fix_dmap[bits] : dyn_dmap[bits];\n\t\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t\tvar dst_eb = (code < 4 ? 0 : (code-2)>>1);\n\t\t\t\tvar dst = DST_LN[code];\n\t\t\t\t/* dist extra bits */\n\t\t\t\tif(dst_eb > 0) {\n\t\t\t\t\tdst += read_bits_n(data, boff, dst_eb);\n\t\t\t\t\tboff += dst_eb;\n\t\t\t\t}\n\n\t\t\t\t/* in the common case, manual byte copy is faster than TA set / Buffer copy */\n\t\t\t\tif(!usz && OL < tgt) { outbuf = realloc(outbuf, tgt); OL = outbuf.length; }\n\t\t\t\twhile(woff < tgt) { outbuf[woff] = outbuf[woff - dst]; ++woff; }\n\t\t\t}\n\t\t}\n\t}\n\treturn [usz ? outbuf : outbuf.slice(0, woff), (boff+7)>>>3];\n}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\t\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t }", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function bi_flush(s) {\n\t if (s.bi_valid === 16) {\n\t put_short(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function copy_block(buf, // the input data\n\t\tlen, // its length\n\t\theader // true if block header must be written\n\t\t) {\n\t\t bi_windup(); // align on byte boundary\n \n\t\t last_eob_len = 8; // enough lookahead for inflate\n \n\t\t if (header) {\n\t\t\tput_short(len);\n\t\t\tput_short(~len);\n\t\t }\n \n\t\t that.pending_buf.set(window.subarray(buf, buf + len), that.pending);\n\t\t that.pending += len;\n\t\t} // Send a stored block", "function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length) {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> Buf_size - s.bi_valid;\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n s.bi_valid += length;\n }\n }", "function bi_windup(s) {\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n }", "function bi_flush$1(s) {\n\t if (s.bi_valid === 16) {\n\t put_short$1(s, s.bi_buf);\n\t s.bi_buf = 0;\n\t s.bi_valid = 0;\n\n\t } else if (s.bi_valid >= 8) {\n\t s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n\t s.bi_buf >>= 8;\n\t s.bi_valid -= 8;\n\t }\n\t}", "function _tr_align(s){send_bits(s,STATIC_TREES<<1,3);send_code(s,END_BLOCK,static_ltree);bi_flush(s);}", "function bi_windup(s){if(s.bi_valid>8){put_short(s,s.bi_buf);}else if(s.bi_valid>0){//put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++]=s.bi_buf;}s.bi_buf=0;s.bi_valid=0;}", "function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length) {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> Buf_size - s.bi_valid;\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= value << s.bi_valid & 0xffff;\n s.bi_valid += length;\n }\n }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function flush_block(eof) { // true if this is the last block for a file\n\t\tvar opt_lenb, static_lenb, // opt_len and static_len in bytes\n\t\t\tmax_blindex, // index of last bit length code of non zero freq\n\t\t\tstored_len, // length of input block\n\t\t\ti;\n\n\t\tstored_len = strstart - block_start;\n\t\tflag_buf[last_flags] = flags; // Save the flags for the last 8 items\n\n\t\t// Construct the literal and distance trees\n\t\tbuild_tree(l_desc);\n\t\t// Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\n\t\tbuild_tree(d_desc);\n\t\t// Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\t\t// At this point, opt_len and static_len are the total bit lengths of\n\t\t// the compressed block data, excluding the tree representations.\n\n\t\t// Build the bit length tree for the above two trees, and get the index\n\t\t// in bl_order of the last bit length code to send.\n\t\tmax_blindex = build_bl_tree();\n\n\t // Determine the best encoding. Compute first the block length in bytes\n\t\topt_lenb = (opt_len + 3 + 7) >> 3;\n\t\tstatic_lenb = (static_len + 3 + 7) >> 3;\n\n\t// Trace((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u \", opt_lenb, encoder->opt_len, static_lenb, encoder->static_len, stored_len, encoder->last_lit, encoder->last_dist));\n\n\t\tif (static_lenb <= opt_lenb) {\n\t\t\topt_lenb = static_lenb;\n\t\t}\n\t\tif (stored_len + 4 <= opt_lenb && block_start >= 0) { // 4: two words for the lengths\n\t\t\t// The test buf !== NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t\t\t// Otherwise we can't have processed more than WSIZE input bytes since\n\t\t\t// the last block flush, because compression would have been\n\t\t\t// successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t\t\t// transform a block into a stored block.\n\t\t\tsend_bits((STORED_BLOCK << 1) + eof, 3); /* send block type */\n\t\t\tbi_windup(); /* align on byte boundary */\n\t\t\tput_short(stored_len);\n\t\t\tput_short(~stored_len);\n\n\t\t\t// copy block\n\t\t\t/*\n\t\t\t\tp = &window[block_start];\n\t\t\t\tfor (i = 0; i < stored_len; i++) {\n\t\t\t\t\tput_byte(p[i]);\n\t\t\t\t}\n\t\t\t*/\n\t\t\tfor (i = 0; i < stored_len; i++) {\n\t\t\t\tput_byte(window[block_start + i]);\n\t\t\t}\n\t\t} else if (static_lenb === opt_lenb) {\n\t\t\tsend_bits((STATIC_TREES << 1) + eof, 3);\n\t\t\tcompress_block(static_ltree, static_dtree);\n\t\t} else {\n\t\t\tsend_bits((DYN_TREES << 1) + eof, 3);\n\t\t\tsend_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);\n\t\t\tcompress_block(dyn_ltree, dyn_dtree);\n\t\t}\n\n\t\tinit_block();\n\n\t\tif (eof !== 0) {\n\t\t\tbi_windup();\n\t\t}\n\t}", "function bi_windup(s) {\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n }", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}", "function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}" ]
[ "0.528871", "0.52563787", "0.52494574", "0.52383506", "0.51888853", "0.51388097", "0.5121298", "0.51076716", "0.51043904", "0.51043904", "0.51043904", "0.51043904", "0.51019776", "0.50877845", "0.50877845", "0.50877845", "0.50877845", "0.50877845", "0.50877845", "0.50877845", "0.50877845", "0.50877845", "0.5085012", "0.5068875", "0.5067823", "0.50653714", "0.506111", "0.50489306", "0.503946", "0.5036662", "0.50321656", "0.5026489", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727", "0.5020727" ]
0.0
-1
=========================================================================== Determine the best encoding for the current block: dynamic trees, static trees or store, and output the encoded block to the zip file.
function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ //int last; /* one if this is the last block for a file */ { var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ var max_blindex = 0; /* index of last bit length code of non zero freq */ /* Build the Huffman trees unless a stored block is forced */ if (s.level > 0) { /* Check if the file is binary or text */ if (s.strm.data_type === Z_UNKNOWN) { s.strm.data_type = detect_data_type(s); } /* Construct the literal and distance trees */ build_tree(s, s.l_desc); // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, // s->static_len)); build_tree(s, s.d_desc); // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, // s->static_len)); /* At this point, opt_len and static_len are the total bit lengths of * the compressed block data, excluding the tree representations. */ /* Build the bit length tree for the above two trees, and get the index * in bl_order of the last bit length code to send. */ max_blindex = build_bl_tree(s); /* Determine the best encoding. Compute the block lengths in bytes. */ opt_lenb = (s.opt_len+3+7) >>> 3; static_lenb = (s.static_len+3+7) >>> 3; // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, // s->last_lit)); if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } } else { // Assert(buf != (char*)0, "lost buf"); opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ } if ((stored_len+4 <= opt_lenb) && (buf !== -1)) { /* 4: two words for the lengths */ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. * Otherwise we can't have processed more than WSIZE input bytes since * the last block flush, because compression would have been * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ _tr_stored_block(s, buf, stored_len, last); } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); } else { send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3); send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1); compress_block(s, s.dyn_ltree, s.dyn_dtree); } // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); /* The above check is made mod 2^32, for files larger than 512 MB * and uLong implemented on 32 bits. */ init_block(s); if (last) { bi_windup(s); } // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, // s->compressed_len-7*last)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flush_block(eof) { // true if this is the last block for a file\n\t\tvar opt_lenb, static_lenb, // opt_len and static_len in bytes\n\t\t\tmax_blindex, // index of last bit length code of non zero freq\n\t\t\tstored_len, // length of input block\n\t\t\ti;\n\n\t\tstored_len = strstart - block_start;\n\t\tflag_buf[last_flags] = flags; // Save the flags for the last 8 items\n\n\t\t// Construct the literal and distance trees\n\t\tbuild_tree(l_desc);\n\t\t// Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\n\t\tbuild_tree(d_desc);\n\t\t// Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\t\t// At this point, opt_len and static_len are the total bit lengths of\n\t\t// the compressed block data, excluding the tree representations.\n\n\t\t// Build the bit length tree for the above two trees, and get the index\n\t\t// in bl_order of the last bit length code to send.\n\t\tmax_blindex = build_bl_tree();\n\n\t // Determine the best encoding. Compute first the block length in bytes\n\t\topt_lenb = (opt_len + 3 + 7) >> 3;\n\t\tstatic_lenb = (static_len + 3 + 7) >> 3;\n\n\t// Trace((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u \", opt_lenb, encoder->opt_len, static_lenb, encoder->static_len, stored_len, encoder->last_lit, encoder->last_dist));\n\n\t\tif (static_lenb <= opt_lenb) {\n\t\t\topt_lenb = static_lenb;\n\t\t}\n\t\tif (stored_len + 4 <= opt_lenb && block_start >= 0) { // 4: two words for the lengths\n\t\t\t// The test buf !== NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t\t\t// Otherwise we can't have processed more than WSIZE input bytes since\n\t\t\t// the last block flush, because compression would have been\n\t\t\t// successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t\t\t// transform a block into a stored block.\n\t\t\tsend_bits((STORED_BLOCK << 1) + eof, 3); /* send block type */\n\t\t\tbi_windup(); /* align on byte boundary */\n\t\t\tput_short(stored_len);\n\t\t\tput_short(~stored_len);\n\n\t\t\t// copy block\n\t\t\t/*\n\t\t\t\tp = &window[block_start];\n\t\t\t\tfor (i = 0; i < stored_len; i++) {\n\t\t\t\t\tput_byte(p[i]);\n\t\t\t\t}\n\t\t\t*/\n\t\t\tfor (i = 0; i < stored_len; i++) {\n\t\t\t\tput_byte(window[block_start + i]);\n\t\t\t}\n\t\t} else if (static_lenb === opt_lenb) {\n\t\t\tsend_bits((STATIC_TREES << 1) + eof, 3);\n\t\t\tcompress_block(static_ltree, static_dtree);\n\t\t} else {\n\t\t\tsend_bits((DYN_TREES << 1) + eof, 3);\n\t\t\tsend_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);\n\t\t\tcompress_block(dyn_ltree, dyn_dtree);\n\t\t}\n\n\t\tinit_block();\n\n\t\tif (eof !== 0) {\n\t\t\tbi_windup();\n\t\t}\n\t}", "function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb;\n /* opt_len and static_len in bytes */\n\n var max_blindex = 0;\n /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n /* Construct the literal and distance trees */\n\n\n build_tree(s, s.l_desc); // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc); // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n\n max_blindex = build_bl_tree(s);\n /* Determine the best encoding. Compute the block lengths in bytes. */\n\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3; // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5;\n /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n } // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n\n\n init_block(s);\n\n if (last) {\n bi_windup(s);\n } // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb; \n }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN$1) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}", "function _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n {\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n }", "function $AvaN$var$_tr_flush_block(s, buf, stored_len, last) //DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb;\n /* opt_len and static_len in bytes */\n\n var max_blindex = 0;\n /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === $AvaN$var$Z_UNKNOWN) {\n s.strm.data_type = $AvaN$var$detect_data_type(s);\n }\n /* Construct the literal and distance trees */\n\n\n $AvaN$var$build_tree(s, s.l_desc); // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n $AvaN$var$build_tree(s, s.d_desc); // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n\n max_blindex = $AvaN$var$build_bl_tree(s);\n /* Determine the best encoding. Compute the block lengths in bytes. */\n\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3; // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5;\n /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n $AvaN$var$_tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === $AvaN$var$Z_FIXED || static_lenb === opt_lenb) {\n $AvaN$var$send_bits(s, ($AvaN$var$STATIC_TREES << 1) + (last ? 1 : 0), 3);\n $AvaN$var$compress_block(s, $AvaN$var$static_ltree, $AvaN$var$static_dtree);\n } else {\n $AvaN$var$send_bits(s, ($AvaN$var$DYN_TREES << 1) + (last ? 1 : 0), 3);\n $AvaN$var$send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n $AvaN$var$compress_block(s, s.dyn_ltree, s.dyn_dtree);\n } // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n\n\n $AvaN$var$init_block(s);\n\n if (last) {\n $AvaN$var$bi_windup(s);\n } // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n\n}", "function _tr_flush_block(s, buf, stored_len, last)\n //DeflateState *s;\n //charf *buf; /* input block, or NULL if too old */\n //ulg stored_len; /* length of input block */\n //int last; /* one if this is the last block for a file */\n {\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n \n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n \n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n \n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n \n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n \n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n \n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n \n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n \n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n \n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n \n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n \n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n \n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n \n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n \n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n \n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n }", "function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s;\n //charf *buf; /* input block, or NULL if too old */\n //ulg stored_len; /* length of input block */\n //int last; /* one if this is the last block for a file */\n {\n var opt_lenb, static_lenb;\n /* opt_len and static_len in bytes */\n\n var max_blindex = 0;\n /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n /* Construct the literal and distance trees */\n\n\n build_tree(s, s.l_desc); // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc); // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n\n max_blindex = build_bl_tree(s);\n /* Determine the best encoding. Compute the block lengths in bytes. */\n\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3; // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5;\n /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n } // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n\n\n init_block(s);\n\n if (last) {\n bi_windup(s);\n } // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n\n }", "function _tr_flush_block(s, buf, stored_len, last) //DeflateState *s;\n //charf *buf; /* input block, or NULL if too old */\n //ulg stored_len; /* length of input block */\n //int last; /* one if this is the last block for a file */\n {\n var opt_lenb, static_lenb;\n /* opt_len and static_len in bytes */\n\n var max_blindex = 0;\n /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n /* Construct the literal and distance trees */\n\n\n build_tree(s, s.l_desc); // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc); // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n\n max_blindex = build_bl_tree(s);\n /* Determine the best encoding. Compute the block lengths in bytes. */\n\n opt_lenb = s.opt_len + 3 + 7 >>> 3;\n static_lenb = s.static_len + 3 + 7 >>> 3; // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5;\n /* force a stored block */\n }\n\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n } // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n\n\n init_block(s);\n\n if (last) {\n bi_windup(s);\n } // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n\n }", "function _tr_flush_block(s,buf,stored_len,last)//DeflateState *s;\n //charf *buf; /* input block, or NULL if too old */\n //ulg stored_len; /* length of input block */\n //int last; /* one if this is the last block for a file */\n {var opt_lenb,static_lenb;/* opt_len and static_len in bytes */var max_blindex=0;/* index of last bit length code of non zero freq */ /* Build the Huffman trees unless a stored block is forced */if(s.level>0){/* Check if the file is binary or text */if(s.strm.data_type===Z_UNKNOWN){s.strm.data_type=detect_data_type(s);}/* Construct the literal and distance trees */build_tree(s,s.l_desc);// Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n build_tree(s,s.d_desc);// Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */ /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */max_blindex=build_bl_tree(s);/* Determine the best encoding. Compute the block lengths in bytes. */opt_lenb=s.opt_len+3+7>>>3;static_lenb=s.static_len+3+7>>>3;// Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n if(static_lenb<=opt_lenb){opt_lenb=static_lenb;}}else {// Assert(buf != (char*)0, \"lost buf\");\n opt_lenb=static_lenb=stored_len+5;/* force a stored block */}if(stored_len+4<=opt_lenb&&buf!==-1){/* 4: two words for the lengths */ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */_tr_stored_block(s,buf,stored_len,last);}else if(s.strategy===Z_FIXED||static_lenb===opt_lenb){send_bits(s,(STATIC_TREES<<1)+(last?1:0),3);compress_block(s,static_ltree,static_dtree);}else {send_bits(s,(DYN_TREES<<1)+(last?1:0),3);send_all_trees(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1);compress_block(s,s.dyn_ltree,s.dyn_dtree);}// Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */init_block(s);if(last){bi_windup(s);}// Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n }", "function _tr_flush_block(s, buf, stored_len, last)\n\t//DeflateState *s;\n\t//charf *buf; /* input block, or NULL if too old */\n\t//ulg stored_len; /* length of input block */\n\t//int last; /* one if this is the last block for a file */\n\t{\n\t var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n\t var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n\t /* Build the Huffman trees unless a stored block is forced */\n\t if (s.level > 0) {\n\n\t /* Check if the file is binary or text */\n\t if (s.strm.data_type === Z_UNKNOWN) {\n\t s.strm.data_type = detect_data_type(s);\n\t }\n\n\t /* Construct the literal and distance trees */\n\t build_tree(s, s.l_desc);\n\t // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n\t // s->static_len));\n\n\t build_tree(s, s.d_desc);\n\t // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n\t // s->static_len));\n\t /* At this point, opt_len and static_len are the total bit lengths of\n\t * the compressed block data, excluding the tree representations.\n\t */\n\n\t /* Build the bit length tree for the above two trees, and get the index\n\t * in bl_order of the last bit length code to send.\n\t */\n\t max_blindex = build_bl_tree(s);\n\n\t /* Determine the best encoding. Compute the block lengths in bytes. */\n\t opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n\t static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n\t // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n\t // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n\t // s->last_lit));\n\n\t if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n\t } else {\n\t // Assert(buf != (char*)0, \"lost buf\");\n\t opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n\t }\n\n\t if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n\t /* 4: two words for the lengths */\n\n\t /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t * Otherwise we can't have processed more than WSIZE input bytes since\n\t * the last block flush, because compression would have been\n\t * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t * transform a block into a stored block.\n\t */\n\t _tr_stored_block(s, buf, stored_len, last);\n\n\t } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n\t send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n\t compress_block(s, static_ltree, static_dtree);\n\n\t } else {\n\t send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n\t send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n\t compress_block(s, s.dyn_ltree, s.dyn_dtree);\n\t }\n\t // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\t /* The above check is made mod 2^32, for files larger than 512 MB\n\t * and uLong implemented on 32 bits.\n\t */\n\t init_block(s);\n\n\t if (last) {\n\t bi_windup(s);\n\t }\n\t // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n\t // s->compressed_len-7*last));\n\t}", "function _tr_flush_block(s, buf, stored_len, last)\n\t//DeflateState *s;\n\t//charf *buf; /* input block, or NULL if too old */\n\t//ulg stored_len; /* length of input block */\n\t//int last; /* one if this is the last block for a file */\n\t{\n\t var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n\t var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n\t /* Build the Huffman trees unless a stored block is forced */\n\t if (s.level > 0) {\n\n\t /* Check if the file is binary or text */\n\t if (s.strm.data_type === Z_UNKNOWN) {\n\t s.strm.data_type = detect_data_type(s);\n\t }\n\n\t /* Construct the literal and distance trees */\n\t build_tree(s, s.l_desc);\n\t // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n\t // s->static_len));\n\n\t build_tree(s, s.d_desc);\n\t // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n\t // s->static_len));\n\t /* At this point, opt_len and static_len are the total bit lengths of\n\t * the compressed block data, excluding the tree representations.\n\t */\n\n\t /* Build the bit length tree for the above two trees, and get the index\n\t * in bl_order of the last bit length code to send.\n\t */\n\t max_blindex = build_bl_tree(s);\n\n\t /* Determine the best encoding. Compute the block lengths in bytes. */\n\t opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n\t static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n\t // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n\t // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n\t // s->last_lit));\n\n\t if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n\t } else {\n\t // Assert(buf != (char*)0, \"lost buf\");\n\t opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n\t }\n\n\t if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n\t /* 4: two words for the lengths */\n\n\t /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t * Otherwise we can't have processed more than WSIZE input bytes since\n\t * the last block flush, because compression would have been\n\t * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t * transform a block into a stored block.\n\t */\n\t _tr_stored_block(s, buf, stored_len, last);\n\n\t } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n\t send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n\t compress_block(s, static_ltree, static_dtree);\n\n\t } else {\n\t send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n\t send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n\t compress_block(s, s.dyn_ltree, s.dyn_dtree);\n\t }\n\t // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n\t /* The above check is made mod 2^32, for files larger than 512 MB\n\t * and uLong implemented on 32 bits.\n\t */\n\t init_block(s);\n\n\t if (last) {\n\t bi_windup(s);\n\t }\n\t // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n\t // s->compressed_len-7*last));\n\t}" ]
[ "0.60858995", "0.5848022", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.5814596", "0.58138496", "0.5806112", "0.58060175", "0.5751075", "0.5742372", "0.5683359", "0.56025267", "0.5537455", "0.55365497", "0.5500078", "0.5500078" ]
0.58105415
90
=========================================================================== Save the match info and tally the frequency counts. Return true if the current block must be flushed.
function _tr_tally(s, dist, lc) // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ { //var out_length, in_length, dcode; s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; s.last_lit++; if (dist === 0) { /* lc is the unmatched char */ s.dyn_ltree[lc*2]/*.Freq*/++; } else { s.matches++; /* Here, lc is the match length - MIN_MATCH */ dist--; /* dist = match distance - 1 */ //Assert((ush)dist < (ush)MAX_DIST(s) && // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++; s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; } // (!) This block is disabled in zlib defailts, // don't enable it for binary compatibility //#ifdef TRUNCATE_BLOCK // /* Try to guess if it is profitable to stop the current block here */ // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { // /* Compute an upper bound for the compressed length */ // out_length = s.last_lit*8; // in_length = s.strstart - s.block_start; // // for (dcode = 0; dcode < D_CODES; dcode++) { // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); // } // out_length >>>= 3; // //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", // // s->last_lit, in_length, out_length, // // 100L - out_length*100L/in_length)); // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { // return true; // } // } //#endif return (s.last_lit === s.lit_bufsize-1); /* We avoid equality with lit_bufsize because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function track(match) {\n return counters[match] = (counters[match] || 0) + 1;\n }", "function incrementMatchCount() {\n matchCount += 2;\n}", "function checkIfCompleted() {\n matchingCards++;\n\n if (matchingCards >= Math.floor(fieldSize / 2)) {\n gameCompleted = true;\n timerStop();\n gratulation();\n }\n }", "function checkWordsRecord() {\n console.log(\"Checking word scores\");\n // Check for new words answered records\n if ( window.wordsAnswered > window.highScores[window.gameMode]['words'] ) {\n console.log(\"New high word score for \" + window.gameMode);\n updateRecord(\"words\");\n return true;\n }\n else {\n return false;\n }\n}", "function match() {\n\n\tpairs++;\n\tcount = 0;\n\tdisableCards();\n\tresetCards();\n\tscoreKeeper();\n\n}", "writeMatches(pageClock) {\n var dict = {};\n dict[this.matchName] = pageClock.matches;\n chrome.storage.local.set(dict, () => {\n pageClock.debug.debug('Writing matches to storage...');\n if (typeof chrome.runtime.lastError !== 'undefined') {\n console.error(chrome.runtime.lastError);\n }\n });\n }", "function _tr_align() {\n\t\t send_bits(STATIC_TREES << 1, 3);\n\t\t send_code(END_BLOCK, StaticTree.static_ltree);\n\t\t bi_flush(); // Of the 10 bits for the empty block, we have already sent\n\t\t // (10 - bi_valid) bits. The lookahead for the last real code (before\n\t\t // the EOB of the previous block) was thus at least one plus the length\n\t\t // of the EOB plus what we have just sent of the empty static block.\n \n\t\t if (1 + last_eob_len + 10 - bi_valid < 9) {\n\t\t\tsend_bits(STATIC_TREES << 1, 3);\n\t\t\tsend_code(END_BLOCK, StaticTree.static_ltree);\n\t\t\tbi_flush();\n\t\t }\n \n\t\t last_eob_len = 7;\n\t\t} // Save the match info and tally the frequency counts. Return true if", "function afterMatchFound(result, ctx) {\n\n if(ctx.friendlies.indexOf(result.user.toLowerCase()) > -1) {\n result.relevance += ((1.0 - result.relevance) * 0.5); // up the relevance because it comes from a friendly\n }\n\n if(result.tags.length > 0) { // result.relevance\n console.debug(\"Found relevant match\" + (result.volatile ? \" [VOLATILE]\" : \"\") + \".\");\n console.debug(result.tweetid + \" [\"+result.relevance+\"]: \" + JSON.stringify(result.tags));\n // send through to InfluxDB\n saveTweetToInflux(result)\n } else {\n console.debug(\"Event not found to be relevant.\");\n }\n}", "function C007_LunchBreak_Natalie_EatGoodMatch() {\r\n C007_LunchBreak_Natalie_MatchCount++;\r\n C007_LunchBreak_Natalie_CalcParams();\r\n CurrentTime = CurrentTime + 300000;\r\n}", "checkMatch () {\n this.attempts++\n if (this.first === this.second) {\n this.hits++\n this.gameTimer.stopTimerOne()\n this.counter = 0\n this.firstIsflipped = false\n this.secondIsFlipped = false\n this.timerOneIsOn = false\n this.removeTwoPieces()\n this.flipped = 0\n this.first = ''\n this.second = '*'\n if (this.hits === this.max) {\n this.gameTimer.stopGameTimer()\n this.remove(this.max * 2)\n this.button.style.display = 'block'\n this.timeField.textContent = 'Congrats, you have made ' +\n this.attempts + ' attempts and won in ' + (++this.time) + this.seconds\n } else {\n this.focus(0, 100, true)\n }\n }\n }", "function updateMatchIds() {\n this.matchIds = [];\n\n var i, len;\n for (i = 0, len = this.blockCounts.length; i < len; i++) {\n if (this.blockCounts[i] === 0) {\n this.matchIds.push(i);\n }\n }\n }", "hasData() {\n const keys = this.keystrokeCount\n ? Object.keys(this.keystrokeCount.source)\n : null;\n if (!keys || keys.length === 0) {\n return false;\n }\n\n // delete files that don't have any kpm data\n let foundKpmData = false;\n if (this.keystrokeCount.keystrokes > 0) {\n foundKpmData = true;\n }\n\n // Now remove files that don't have any keystrokes that only\n // have an open or close associated with them. If they have\n // open AND close then it's ok, keep it.\n let keystrokesTally = 0;\n keys.forEach(key => {\n const data = this.keystrokeCount.source[key];\n\n const hasOpen = data.open > 0;\n const hasClose = data.close > 0;\n const hasKeystrokes = data.keystrokes > 0;\n keystrokesTally += data.keystrokes;\n if (\n (hasOpen && !hasClose && !hasKeystrokes) ||\n (hasClose && !hasOpen && !hasKeystrokes)\n ) {\n // delete it, no keystrokes and only an open\n delete this.keystrokeCount.source[key];\n } else if (!foundKpmData && hasOpen && hasClose) {\n foundKpmData = true;\n }\n });\n\n if (\n keystrokesTally > 0 &&\n keystrokesTally !== this.keystrokeCount.keystrokes\n ) {\n // use the keystrokes tally\n foundKpmData = true;\n this.keystrokeCount.keystrokes = keystrokesTally;\n }\n return foundKpmData;\n }", "function isAllMatched(){\n \n if(allMatchedCards==16){\n clearInterval(interval);\n var grade= starRating(movesCounter);\n showInfo(grade); \n }\n}", "function isLastMatchingPair() {\n return memoryGrid.querySelectorAll('.' + MATCH).length === 16;\n }", "function checkForMatch() {\n let isMatch = firstCardFlip.dataset.name === secondCardFlip.dataset.name;\n isMatch ? disableCards() : unflipCards();\n if (isMatch) {\n counter++;\n console.log(\"isMatch: \", counter);\n if (counter === levelMatches) {\n window.location = nextUrl;\n }\n disableCards();\n } else {\n console.log(\"notMatch: \", counter);\n }\n\n}", "function checkPointsRecord() {\n console.log(\"Checking point scores\");\n\n // Check new points records\n if ( window.currentScore > window.highScores[window.gameMode]['points'] ) {\n console.log(\"New high point score for \" + window.gameMode);\n updateRecord(\"points\");\n return true;\n }\n else {\n return false;\n }\n}", "function isSameCountCheck(mac,count){\n\t\n\tvar tag = count_map[mac];\n\n\tif(tag === undefined){\n\t\ttag = -1;\n\t}\n\n\tif (tag === count){\n\t\tconsole.log('count:' + count + '(mac:' +mac + '):tag='+tag+'is same #### drop');\n\t\treturn true;\n\t}else{\n\t\tcount_map[mac] = count;\n\t\tconsole.log('count:' + count + '(mac:' +mac + '):tag='+tag +' @@@@ save' );\n\t\treturn false;\n\t}\n}", "function matched() {\n deck.find('.open').addClass('match');\n setTimeout(function() {\n deck.find('.match').removeClass('open');\n }, 500);\n matchCards++;\n matchedCards = [];\n}", "function matchSuccess() {\n matchCard1.addClass(\"animated pulse matched\");\n matchCard2.addClass(\"animated pulse matched\");\n matches++;\n if (matches === pairs) {\n setTimeout(gameOver, 500);\n }\n }", "function quiescent() {\n return Object.keys(self.persistences).length ===\n self.lastObservedSize;\n }", "function saveDoneBlock() {\n\n let blockAlreadyInserted = false;\n for (let i = 0; i < playerLevelEnvironment.listOfBlocksInThePlayingArea.length; i++) {\n if (playerLevelEnvironment.listOfBlocksInThePlayingArea[i].blockCounter === playerLevelEnvironment.blockCounter) {\n blockAlreadyInserted = true;\n }\n }\n\n if (blockAlreadyInserted === false) {\n try {\n playerLevelEnvironment.listOfBlocksInThePlayingArea.push({\n blockMap: blockMap[playerLevelEnvironment.blockIndex][playerLevelEnvironment.rotationIndex][playerLevelEnvironment.rotationIndex],\n blockIndex: playerLevelEnvironment.blockIndex,\n blockX: Math.floor(playerLevelEnvironment.xPlayArea / gameLevelEnvironment.pixelSize),\n blockY: Math.floor(playerLevelEnvironment.yPlayArea / gameLevelEnvironment.pixelSize) - 1,\n blockCounter: playerLevelEnvironment.blockCounter,\n wasChecked: false\n });\n } catch(error) {\n }\n }\n }", "function flush_block(eof) { // true if this is the last block for a file\n\t\tvar opt_lenb, static_lenb, // opt_len and static_len in bytes\n\t\t\tmax_blindex, // index of last bit length code of non zero freq\n\t\t\tstored_len, // length of input block\n\t\t\ti;\n\n\t\tstored_len = strstart - block_start;\n\t\tflag_buf[last_flags] = flags; // Save the flags for the last 8 items\n\n\t\t// Construct the literal and distance trees\n\t\tbuild_tree(l_desc);\n\t\t// Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\n\t\tbuild_tree(d_desc);\n\t\t// Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\t\t// At this point, opt_len and static_len are the total bit lengths of\n\t\t// the compressed block data, excluding the tree representations.\n\n\t\t// Build the bit length tree for the above two trees, and get the index\n\t\t// in bl_order of the last bit length code to send.\n\t\tmax_blindex = build_bl_tree();\n\n\t // Determine the best encoding. Compute first the block length in bytes\n\t\topt_lenb = (opt_len + 3 + 7) >> 3;\n\t\tstatic_lenb = (static_len + 3 + 7) >> 3;\n\n\t// Trace((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u \", opt_lenb, encoder->opt_len, static_lenb, encoder->static_len, stored_len, encoder->last_lit, encoder->last_dist));\n\n\t\tif (static_lenb <= opt_lenb) {\n\t\t\topt_lenb = static_lenb;\n\t\t}\n\t\tif (stored_len + 4 <= opt_lenb && block_start >= 0) { // 4: two words for the lengths\n\t\t\t// The test buf !== NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t\t\t// Otherwise we can't have processed more than WSIZE input bytes since\n\t\t\t// the last block flush, because compression would have been\n\t\t\t// successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t\t\t// transform a block into a stored block.\n\t\t\tsend_bits((STORED_BLOCK << 1) + eof, 3); /* send block type */\n\t\t\tbi_windup(); /* align on byte boundary */\n\t\t\tput_short(stored_len);\n\t\t\tput_short(~stored_len);\n\n\t\t\t// copy block\n\t\t\t/*\n\t\t\t\tp = &window[block_start];\n\t\t\t\tfor (i = 0; i < stored_len; i++) {\n\t\t\t\t\tput_byte(p[i]);\n\t\t\t\t}\n\t\t\t*/\n\t\t\tfor (i = 0; i < stored_len; i++) {\n\t\t\t\tput_byte(window[block_start + i]);\n\t\t\t}\n\t\t} else if (static_lenb === opt_lenb) {\n\t\t\tsend_bits((STATIC_TREES << 1) + eof, 3);\n\t\t\tcompress_block(static_ltree, static_dtree);\n\t\t} else {\n\t\t\tsend_bits((DYN_TREES << 1) + eof, 3);\n\t\t\tsend_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);\n\t\t\tcompress_block(dyn_ltree, dyn_dtree);\n\t\t}\n\n\t\tinit_block();\n\n\t\tif (eof !== 0) {\n\t\t\tbi_windup();\n\t\t}\n\t}", "function checkIfCompleted() {\n if (_progress > 102) {\n _recording = false;\n $(\"#overLayMessage\").text(\"YOU CREATED A LEVEL\");\n $(\"#recordButt\").css(\"visibility\", \"hidden\");\n $(\"#restartButt2\").css(\"display\", \"block\");\n $(\"#saveButt\").css(\"display\", \"block\");\n console.log(_keyStrokes.length);\n }\n }", "function resetMatchCount() {\n matchCount = 0;\n}", "function isMatch () {\n\n\tif(cardsInPlay[0] === cardsInPlay[1])\n\t\t{\n\t\talert('You found a match');\n\t\tscore=score+1;\n\t\tnumberOfLives=numberOfLives-1;\n\t\tupdateLives();\n\t\tupdateScore(score);\n\t\tsetTimeout(clearCard(),10000);\n\t\t\n\t\t}\n\telse {\n\t\talert('Sorry Try Again');\n\t\tsetTimeout(clearCard(),10000);\n\t\tnumberOfLives=numberOfLives-1;\n\t\tupdateLives();\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "update() {\n this._updated = true;\n let now = new Date().getTime();\n if (now > this._lastDumpTime + this._interval) {\n try {\n this.dump();\n }\n catch (ex) {\n // Todo: decide what to do\n }\n }\n }", "function GotEverything() {\n return entryInfo.entries.length >= entryInfo.totalCount;\n }", "function saveMatchFile()\n{\n var fileData = header;\n \n for(var allianceIndex = 0; allianceIndex < $alliance.length; allianceIndex++)\n {\n for(var teamIndex = 0; teamIndex < $alliance[allianceIndex].length; teamIndex++)\n {\n // Team number\n fileData += $alliance[allianceIndex][teamIndex].value + \",\";\n \n // Auto data\n fileData += autoData[allianceIndex][teamIndex].high + \",\";\n fileData += autoData[allianceIndex][teamIndex].low + \",\";\n fileData += autoData[allianceIndex][teamIndex].hotHigh + \",\";\n fileData += autoData[allianceIndex][teamIndex].hotLow + \",\";\n fileData += autoData[allianceIndex][teamIndex].highAttempts + \",\";\n \n // Teleop data\n fileData += teleopData[allianceIndex][teamIndex].high + \",\";\n fileData += teleopData[allianceIndex][teamIndex].low + \",\";\n fileData += teleopData[allianceIndex][teamIndex].passes + \",\";\n fileData += teleopData[allianceIndex][teamIndex].truss + \",\";\n fileData += teleopData[allianceIndex][teamIndex].highAttempts + \",\";\n fileData += teleopData[allianceIndex][teamIndex].trussAttempts + \",\";\n \n // Tag data\n fileData += tags[allianceIndex][teamIndex].offensive + \",\";\n fileData += tags[allianceIndex][teamIndex].offensiveSuccess + \",\";\n fileData += tags[allianceIndex][teamIndex].defensive + \",\";\n fileData += tags[allianceIndex][teamIndex].defensiveSuccess + \",\";\n fileData += tags[allianceIndex][teamIndex].broken + \",\";\n fileData += tags[allianceIndex][teamIndex].canCatch + \",\";\n fileData += tags[allianceIndex][teamIndex].looseGrip + \",\";\n fileData += tags[allianceIndex][teamIndex].twoBallAuto + \",\";\n fileData += tags[allianceIndex][teamIndex].goodWithYou + \",\";\n \n // Comments\n fileData += comments[allianceIndex][teamIndex] + \"\\n\";\n }\n }\n \n writeToFile(fileData, \"Match \" + $matchNumber.value + \".csv\");\n reset();\n}", "function deflate_stored(flush) {\n\t\t // Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t\t // to pending_buf_size, and each stored block has a 5 byte header:\n\t\t var max_block_size = 0xffff;\n\t\t var max_start;\n \n\t\t if (max_block_size > pending_buf_size - 5) {\n\t\t\tmax_block_size = pending_buf_size - 5;\n\t\t } // Copy as much as possible from input to output:\n \n \n\t\t while (true) {\n\t\t\t// Fill the window as much as possible:\n\t\t\tif (lookahead <= 1) {\n\t\t\t fill_window();\n\t\t\t if (lookahead === 0 && flush == Z_NO_FLUSH) return NeedMore;\n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t}\n \n\t\t\tstrstart += lookahead;\n\t\t\tlookahead = 0; // Emit a stored block if pending_buf will be full:\n \n\t\t\tmax_start = block_start + max_block_size;\n \n\t\t\tif (strstart === 0 || strstart >= max_start) {\n\t\t\t // strstart === 0 is possible when wraparound on 16-bit machine\n\t\t\t lookahead = strstart - max_start;\n\t\t\t strstart = max_start;\n\t\t\t flush_block_only(false);\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t} // Flush if we may have to slide, otherwise block_start may become\n\t\t\t// negative and the data will be gone:\n \n \n\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n\t\t\t flush_block_only(false);\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t}\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n\t\t if (strm.avail_out === 0) return flush == Z_FINISH ? FinishStarted : NeedMore;\n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "match(order, priceLevel) {\n const matchingEventList = [];\n let volume = 0;\n\n while (true) {\n const tmpLLOE = this.orderMap.getFirstElementOfPriceLevel(priceLevel);\n if (!tmpLLOE) break; // all orders at this price level are matched\n\n const tradedQuantity = Math.min(order.remainingQuantity(), tmpLLOE.order.remainingQuantity());\n volume += tradedQuantity;\n logger.info(`orderbookside.js: match(): matches counter order id=${tmpLLOE.order._id} with trade quantity=${tradedQuantity}`);\n\n tmpLLOE.order.filledQuantity += tradedQuantity;\n order.filledQuantity += tradedQuantity;\n\n if (tmpLLOE.order.remainingQuantity() <= ZERO) tmpLLOE.order.filledQuantity = tmpLLOE.order.quantity;\n if (order.remainingQuantity() <= ZERO) order.filledQuantity = order.quantity;\n\n matchingEventList.push(OrderBookEvent.createNewMatchObject(tmpLLOE.order, tradedQuantity, tmpLLOE.order.remainingQuantity() <= ZERO));\n\n if (tmpLLOE.order.remainingQuantity() <= ZERO) this.orderMap.removeOrder(tmpLLOE.order);\n if (order.remainingQuantity() <= ZERO) break;\n }\n\n return {\n matchingEventList,\n volume,\n };\n }", "function matchCheck() {\n\tif (openedCard[0].lastElementChild.classList.item(1) === openedCard[1].lastElementChild.classList.item(1)){\n\t\topenedCard[0].classList.add('match');\n\t\topenedCard[1].classList.add('match');\n\t\tmatchedCount++;\n\t\topenedCard = []; //to clear the openedCard array...\n\t\tanimationFinished = true;\n\t\t\n\t\tif (matchedCount == 8) {\n\t\tsetTimeout(function(){gameWon()},400); //you won...\n\t\t}\n\t} else {\n\t\tfailedCount ++;\n\t\tstars();\n\t\tsetTimeout(function() {turnBack()},500); //to delay time to turn the card...\n\t}\n}", "count(value) {\n let currentState;\n if (this.currentTransactionIndex > -1) {\n currentState = this.applyTransactions();\n } else {\n currentState = this.db;\n }\n\n const keys = Object.keys(currentState);\n let count = 0;\n for (let i = 0; i < keys.length; i++) {\n if (currentState[keys[i]] === value) {\n count++;\n }\n }\n\n if (debug) {\n console.log('db: ', currentState, '\\n');\n }\n return count;\n }", "function ifMatching() {\n playAudio(doubleWhip);\n // add match class to both cards\n for (c of open) {\n c.card.classList.add('match', `level${currentLevel}`); // keep cards face up\n }\n matchedPairs += 1;\n // if all pairs are matched, end level with popup\n if (matchedPairs === iconCollections[currentLevel - 1].length) {\n window.clearInterval(interval); // stop timer\n setTimeout(congratsPopup, 700); // delay 0.7 seconds before popup\n }\n resetOpen();\n}", "function scoreKeeper() {\n for (i = 0; i < storeAnswers.length; i++) {\n if (storeAnswers[i] === questionsArray[i].answer) {\n correct++;\n console.log(correct);\n } else {\n incorrect++;\n }\n }\n }", "function checkStatus() {\n\n for (let card of cards) {\n if (card.classList.contains('match')) {\n counter++;\n console.log(\"counter = \" + counter);\n break;\n }\n }\n if (counter == 8) {\n saveScore();\n displayScore();\n }\n }", "function checkMatch(){\n\t\tplay = false;\n\t\tif (checking[0] == checking[1]){\n\t\t\tlet t1 = setTimeout(function(){\n\t\t\t\topenMatched();\n\t\t\t\tplay = true;\n\t\t\t}, 500);\n\t\t\tif (matches <= 7){\n\t\t\t\tmatches++;\t\t\t\t\n\t\t\t}\n\t\t\tif (matches == 8){\n\t\t\t\tlet t2 = setTimeout(function(){\n\t\t\t\t\talert(\"Well Done. Please Play Again!! \\nYou have won in \" + total_time + '\\nUsing ' + moves + ' Moves' + '\\nHaving ' + gstars + ' Stars');\n\t\t\t\t\tupdateCards();\n\t\t\t\t\tplay = true;\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tlet t3 = setTimeout(function(){\n\t\t\t\tparents[0].className = 'card';\n\t\t\t\tif (parents[1] != null || parents[1] == undefined){\n\t\t\t\t\tparents[1].className = 'card';\n\t\t\t\t}\n\t\t\t\tplay = true;\n\t\t\t}, 500);\n\t\t}\n}", "shouldFlush(sizes, buffer) {\r\n\t\tvar result = \r\n\t\t\t(sizes.vertices + (buffer != null ? buffer.positionsIndex : 0) > this.MAX_BUFFER_SIZE) || \r\n\t\t\t(sizes.indices + (buffer != null ? buffer.indicesIndex : 0) > this.MAX_BUFFER_SIZE * this.indicesVerticesFactor) ||\r\n\t\t\t(sizes.lineIndices + (buffer != null ? buffer.lineIndicesIndex : 0) > this.MAX_BUFFER_SIZE * this.indicesVerticesFactor) ||\r\n\t\t\t(sizes.pickColors + (buffer != null ? buffer.pickColorsIndex : 0) > this.MAX_BUFFER_SIZE * this.colorBufferFactor);\r\n\t\t\r\n\t\t// Not storing the results in a variable resulted in this always returning something that evaluates to false...\r\n\t\t\r\n\t\treturn result;\r\n\t}", "function decodeMatch(match, data) {\n rowProcessed = 0; // For debugging\n togglePlayer = 0; // To toggle players between the games.\n var score = [0, 0];\n while(data.length > 0) {\n var set = new Set();\n if (!decodeSet(set, data)) {\n return false;\n }\n // Store the set and the score before the win.\n match.sets.push([[score[0], score[1]], set]);\n score[set.winner]++;\n if (score[0] == 3) {\n match.winner = match.players[0];\n return true;\n } else if (score[1] == 3) {\n match.winner = match.players[1];\n return true;\n }\n }\n // When run out of data, the set winner is the winner of the last set.\n // In case this is a smaller 3 set match.\n match.winner = match.players[match.sets[match.sets.length - 1][1].winner];\n return true;\n}", "calculateTrack () {\n if (!this.prevTest.exists) {\n return false;\n }\n\n if (this.prevTest.data().shouldtrack) {\n if (this.testCase.successful) {\n // check how many subsequent passes there have been\n if (this.prevTest.data().subsequentpasses < RESET_SUCCESS_COUNT) {\n return true;\n } else {\n return false;\n }\n } else {\n // the test was previously being tracked and failed, so continue tracking\n return true;\n }\n } else {\n if (this.testCase.successful) {\n // the test is successful and previously untracked, so no need to track\n return false;\n } else if (this.prevTest.data().hasfailed && this.prevTest.data().passed) {\n // the test is currently failing and has failed in a prior run, so track it\n return true;\n } else {\n // this is the first time that the test is failing, so no need to track yet\n return false;\n }\n }\n }", "function checkMatch(){\n if(flipOne == flipTwo){\n points += 36;\n console.log('Match!');\n match++;\n }\n else{\n timer = setTimeout(function(){\n eventTarget1.style.transform = 'rotateY(0deg)';\n eventTarget2.style.transform = 'rotateY(0deg)';\n }, 750);\n totalFlips--;\n }\n document.getElementById('points').innerHTML = ' ' + points;\n document.getElementById('attempts').innerHTML = ' ' + totalFlips;\n if(match == totalMatches){\n document.getElementById('id02').style.display = 'block';\n }\n if(totalFlips == 0){\n document.getElementById('id03').style.display = 'block';\n }\n}", "function whenSantaFirstEntersBasement() { \n console.time('q = 2 santa-time');\n fs.readFile('./data.txt', (err, data) => {\n const directions = data.toString();\n const directionsArray = directions.split('');\n let accumalator = 0\n let counter = 0\n const answer = directionsArray.some((currentItem) => { \n if(currentItem === '(') { \n accumalator += 1\n } else if(currentItem === ')') { \n accumalator -=1\n }\n counter ++\n return accumalator < 0;\n })\n console.timeEnd('q = 2 santa-time');\n console.log('basement entered at: ',counter);\n })\n}", "function checkForPlayed() { // Function that resets the \"played\" counter\n let playedCount = 0; // if all movies are \"played\"\n\n for(i=0; i!=keys.length; i++) {\n if(db[keys[i]].played == true) {\n playedCount++;\n }\n }\n\n if(playedCount == keys.length) {\n for(i=0; i!=keys.length; i++) {\n db[keys[i]].played = false;\n }\n }\n}", "function matchCheck(){\n return (points == match);\n }", "function deflate_fast(flush) {\n\t\t // short hash_head = 0; // head of the hash chain\n\t\t var hash_head = 0; // head of the hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n\t\t\t// At this point we have always match_length < MIN_MATCH\n \n \n\t\t\tif (hash_head !== 0 && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n\t\t\t}\n \n\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t // check_match(strstart, match_start, match_length);\n\t\t\t bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\t\t\t lookahead -= match_length; // Insert new strings in the hash table only if the match length\n\t\t\t // is not too large. This saves time but degrades compression.\n \n\t\t\t if (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\tmatch_length--; // string at strstart already in hash table\n \n\t\t\t\tdo {\n\t\t\t\t strstart++;\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart; // strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t // always MIN_MATCH bytes ahead.\n\t\t\t\t} while (--match_length !== 0);\n \n\t\t\t\tstrstart++;\n\t\t\t } else {\n\t\t\t\tstrstart += match_length;\n\t\t\t\tmatch_length = 0;\n\t\t\t\tins_h = window[strstart] & 0xff;\n\t\t\t\tins_h = (ins_h << hash_shift ^ window[strstart + 1] & 0xff) & hash_mask; // If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t// not\n\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t }\n\t\t\t} else {\n\t\t\t // No match, output a literal byte\n\t\t\t bflush = _tr_tally(0, window[strstart] & 0xff);\n\t\t\t lookahead--;\n\t\t\t strstart++;\n\t\t\t}\n \n\t\t\tif (bflush) {\n\t\t\t flush_block_only(false);\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t}\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t} // Same as above, but achieves better compression. We use a lazy", "function is_matched(k, v) {\n $('.restart').attr(\"disabled\", false);\n counter += 1;\n if (counter == 1) {\n timer();\n }\n $('.moves').html(counter);\n if (matched_cards.length < 2) {\n // change front img with img to compare\n $('#' + k.id).children().attr('src', 'img/' + v + '.png');\n if (matched_cards.length == 0) {\n matched_cards.push(v);\n memory.push(k.id);\n }\n else if (matched_cards.length == 1) {\n matched_cards.push(v);\n memory.push(k.id);\n if (matched_cards[0] == matched_cards[1]) {\n no_of_matches += 2;\n matched_cards = [];\n memory = [];\n // if all cards are flipped\n if (no_of_matches == cards.length) {\n rating();\n $('.modal').fadeIn().show();\n $('.overlay').show();\n clearInterval(interval);\n }\n }\n //if 2 cards unmatched\n else {\n $('#' + k.id).children().attr('src', 'img/' + matched_cards[1] + '.png');\n setTimeout(rest_unmatched, 1000);\n }\n }\n \n }\n console.log(no_of_matches);\n console.log(counter);\n}", "async checkSaves(whisper = false) {\n\t\tthis.saves = new Set();\n\t\tthis.failedSaves = this.item?.hasAttack ? new Set(this.hitTargets) : new Set(this.targets);\n\t\tthis.advantageSaves = new Set();\n\t\tthis.disadvantageSaves = new Set();\n\t\tthis.saveDisplayData = [];\n\t\tif (debugEnabled > 1)\n\t\t\tdebug(`checkSaves: whisper ${whisper} hit targets ${this.hitTargets}`);\n\t\tif (this.hitTargets.size <= 0) {\n\t\t\tthis.saveDisplayFlavor = `<span>${i18n(\"midi-qol-relics.noSaveTargets\")}</span>`;\n\t\t\treturn;\n\t\t}\n\t\tlet rollDC = this.saveItem.data.data.save.DC;\n\t\tif (this.saveItem.getSaveDC) {\n\t\t\trollDC = this.saveItem.getSaveDC(); // TODO see if I need to do this for ammo as well\n\t\t}\n\t\tlet rollAbility = this.saveItem.data.data.save.ability;\n\t\tlet promises = [];\n\t\t//@ts-ignore actor.rollAbilitySave\n\t\tvar rollAction = CONFIG.Actor.documentClass.prototype.rollAbilitySave;\n\t\tvar rollType = \"save\";\n\t\tif (this.saveItem.data.data.actionType === \"abil\") {\n\t\t\trollType = \"abil\";\n\t\t\t//@ts-ignore actor.rollAbilityTest\n\t\t\trollAction = CONFIG.Actor.documentClass.prototype.rollAbilityTest;\n\t\t}\n\t\t// make sure saving throws are renabled.\n\t\tconst playerMonksTB = installedModules.get(\"monks-tokenbar\") && configSettings.playerRollSaves === \"mtb\";\n\t\tlet monkRequests = [];\n\t\tlet showRoll = configSettings.autoCheckSaves === \"allShow\";\n\t\ttry {\n\t\t\tfor (let target of this.hitTargets) {\n\t\t\t\tif (!target.actor)\n\t\t\t\t\tcontinue; // no actor means multi levels or bugged actor - but we won't roll a save\n\t\t\t\tlet advantage = undefined;\n\t\t\t\t// If spell, check for magic resistance\n\t\t\t\tif (this.item.data.type === \"spell\") {\n\t\t\t\t\t// check magic resistance in custom damage reduction traits\n\t\t\t\t\t//@ts-ignore traits\n\t\t\t\t\tadvantage = (target?.actor?.data.data.traits?.dr?.custom || \"\").includes(i18n(\"midi-qol-relics.MagicResistant\"));\n\t\t\t\t\t// check magic resistance as a feature (based on the SRD name as provided by the Relics system)\n\t\t\t\t\tadvantage = advantage || target?.actor?.data.items.find(a => a.type === \"feat\" && a.name === i18n(\"midi-qol-relics.MagicResistanceFeat\")) !== undefined;\n\t\t\t\t\tif (advantage)\n\t\t\t\t\t\tthis.advantageSaves.add(target);\n\t\t\t\t\telse\n\t\t\t\t\t\tadvantage = undefined;\n\t\t\t\t\tif (debugEnabled > 1)\n\t\t\t\t\t\tdebug(`${target.actor.name} resistant to magic : ${advantage}`);\n\t\t\t\t}\n\t\t\t\tif (this.saveItem.data.flags[\"midi-qol-relics\"]?.isConcentrationCheck) {\n\t\t\t\t\tif (getProperty(target.actor.data.flags, \"midi-qol-relics.advantage.concentration\")) {\n\t\t\t\t\t\tadvantage = true;\n\t\t\t\t\t\tthis.advantageSaves.add(target);\n\t\t\t\t\t}\n\t\t\t\t\tif (getProperty(target.actor.data.flags, \"midi-qol-relics.disadvantage.concentration\")) {\n\t\t\t\t\t\tadvantage = false;\n\t\t\t\t\t\tthis.disadvantageSaves.add(target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar player = playerFor(target);\n\t\t\t\tif (!player)\n\t\t\t\t\tplayer = ChatMessage.getWhisperRecipients(\"GM\").find(u => u.active);\n\t\t\t\tlet promptPlayer = (!player?.isGM && configSettings.playerRollSaves !== \"none\");\n\t\t\t\tlet GMprompt;\n\t\t\t\tlet gmMonksTB;\n\t\t\t\tif (player?.isGM) {\n\t\t\t\t\tconst monksTBSetting = target.document.isLinked ? configSettings.rollNPCLinkedSaves === \"mtb\" : configSettings.rollNPCSaves === \"mtb\";\n\t\t\t\t\tgmMonksTB = installedModules.get(\"monks-tokenbar\") && monksTBSetting;\n\t\t\t\t\tGMprompt = (target.document.isLinked ? configSettings.rollNPCLinkedSaves : configSettings.rollNPCSaves);\n\t\t\t\t\tpromptPlayer = GMprompt !== \"auto\";\n\t\t\t\t}\n\t\t\t\tif ((!player?.isGM && playerMonksTB) || (player?.isGM && gmMonksTB)) {\n\t\t\t\t\tpromises.push(new Promise((resolve) => {\n\t\t\t\t\t\tlet requestId = target.id;\n\t\t\t\t\t\tthis.saveRequests[requestId] = resolve;\n\t\t\t\t\t}));\n\t\t\t\t\t// record the targes to save.\n\t\t\t\t\tmonkRequests.push(target);\n\t\t\t\t}\n\t\t\t\telse if (promptPlayer && player?.active) {\n\t\t\t\t\t//@ts-ignore CONFIG.RELICS\n\t\t\t\t\tif (debugEnabled > 0)\n\t\t\t\t\t\twarn(`Player ${player?.name} controls actor ${target.actor.name} - requesting ${CONFIG.RELICS.abilities[this.saveItem.data.data.save.ability]} save`);\n\t\t\t\t\tpromises.push(new Promise((resolve) => {\n\t\t\t\t\t\tlet requestId = target.actor?.id ?? randomID();\n\t\t\t\t\t\tconst playerId = player?.id;\n\t\t\t\t\t\tif ([\"letme\", \"letmeQuery\"].includes(configSettings.playerRollSaves) && installedModules.get(\"lmrtfy\"))\n\t\t\t\t\t\t\trequestId = randomID();\n\t\t\t\t\t\tif ([\"letme\", \"letmeQuery\"].includes(GMprompt) && installedModules.get(\"lmrtfy\"))\n\t\t\t\t\t\t\trequestId = randomID();\n\t\t\t\t\t\tthis.saveRequests[requestId] = resolve;\n\t\t\t\t\t\trequestPCSave(this.saveItem.data.data.save.ability, rollType, player, target.actor, advantage, this.saveItem.name, rollDC, requestId, GMprompt);\n\t\t\t\t\t\t// set a timeout for taking over the roll\n\t\t\t\t\t\tif (configSettings.playerSaveTimeout > 0) {\n\t\t\t\t\t\t\tthis.saveTimeouts[requestId] = setTimeout(async () => {\n\t\t\t\t\t\t\t\tif (this.saveRequests[requestId]) {\n\t\t\t\t\t\t\t\t\tdelete this.saveRequests[requestId];\n\t\t\t\t\t\t\t\t\tdelete this.saveTimeouts[requestId];\n\t\t\t\t\t\t\t\t\tlet result;\n\t\t\t\t\t\t\t\t\tif (!game.user?.isGM && configSettings.autoCheckSaves === \"allShow\") {\n\t\t\t\t\t\t\t\t\t\t// non-gm users don't have permission to create chat cards impersonating the GM so hand the role to a GM client\n\t\t\t\t\t\t\t\t\t\tresult = await socketlibSocket.executeAsGM(\"rollAbility\", {\n\t\t\t\t\t\t\t\t\t\t\ttargetUuid: target.actor?.uuid ?? \"\",\n\t\t\t\t\t\t\t\t\t\t\trequest: rollType,\n\t\t\t\t\t\t\t\t\t\t\tability: this.saveItem.data.data.save.ability,\n\t\t\t\t\t\t\t\t\t\t\tshowRoll,\n\t\t\t\t\t\t\t\t\t\t\toptions: { messageData: { user: playerId }, chatMessage: showRoll, mapKeys: false, advantage: advantage === true, disadvantage: advantage === false, fastForward: true },\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tresult = await rollAction.bind(target.actor)(this.saveItem.data.data.save.ability, { messageData: { user: playerId }, chatMessage: showRoll, mapKeys: false, advantage: advantage === true, disadvantage: advantage === false, fastForward: true });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, (configSettings.playerSaveTimeout || 1) * 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\telse { // GM to roll save\n\t\t\t\t\t// Find a player owner for the roll if possible\n\t\t\t\t\tlet owner = playerFor(target);\n\t\t\t\t\tif (owner)\n\t\t\t\t\t\tshowRoll = true; // Always show player save rolls\n\t\t\t\t\t// If no player owns the token, find an active GM\n\t\t\t\t\tif (!owner)\n\t\t\t\t\t\towner = game.users?.find((u) => u.isGM && u.active);\n\t\t\t\t\t// Fall back to rolling as the current user\n\t\t\t\t\tif (!owner)\n\t\t\t\t\t\towner = game.user ?? undefined;\n\t\t\t\t\tpromises.push(socketlibSocket.executeAsUser(\"rollAbility\", owner?.id, {\n\t\t\t\t\t\ttargetUuid: target.actor.uuid,\n\t\t\t\t\t\trequest: rollType,\n\t\t\t\t\t\tability: this.saveItem.data.data.save.ability,\n\t\t\t\t\t\tshowRoll,\n\t\t\t\t\t\toptions: { messageData: { user: owner?.id }, chatMessage: showRoll, mapKeys: false, advantage: advantage === true, disadvantage: advantage === false, fastForward: true },\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.warn(err);\n\t\t}\n\t\tfinally {\n\t\t}\n\t\tif (monkRequests.length > 0) {\n\t\t\tsocketlibSocket.executeAsGM(\"monksTokenBarSaves\", {\n\t\t\t\ttokens: monkRequests.map(t => t.document.uuid),\n\t\t\t\trequest: `save:${this.saveItem.data.data.save.ability}`,\n\t\t\t\tsilent: true,\n\t\t\t\trollMode: \"gmroll\"\n\t\t\t});\n\t\t}\n\t\t;\n\t\tif (debugEnabled > 1)\n\t\t\tdebug(\"check saves: requests are \", this.saveRequests);\n\t\tvar results = await Promise.all(promises);\n\t\tthis.saveResults = results;\n\t\tlet i = 0;\n\t\tfor (let target of this.hitTargets) {\n\t\t\tif (!target.actor)\n\t\t\t\tcontinue; // these were skipped when doing the rolls so they can be skipped now\n\t\t\tif (!results[i])\n\t\t\t\terror(\"Token \", target, \"could not roll save/check assuming 0\");\n\t\t\tconst result = results[i];\n\t\t\tlet rollTotal = results[i]?.total || 0;\n\t\t\tlet rollDetail = results[i];\n\t\t\tif (result?.terms[0]?.options?.advantage)\n\t\t\t\tthis.advantageSaves.add(target);\n\t\t\tif (result?.terms[0]?.options?.disadvantage)\n\t\t\t\tthis.disadvantageSaves.add(target);\n\t\t\tlet isFumble = false;\n\t\t\tlet isCritical = false;\n\t\t\tif (rollDetail.terms && checkRule(\"criticalSaves\") && rollDetail.terms[0] instanceof DiceTerm) { // normal d20 roll/lmrtfy/monks roll\n\t\t\t\tconst dterm = rollDetail.terms[0];\n\t\t\t\t//@ts-ignore\n\t\t\t\tisFumble = dterm.total <= (dterm.options?.fumble ?? 1);\n\t\t\t\t//@ts-ignore\n\t\t\t\tisCritical = dterm.total >= (dterm.options?.critical ?? 20);\n\t\t\t}\n\t\t\telse if (result.isBR && checkRule(\"criticalSaves\"))\n\t\t\t\tisCritical = result.isCritical;\n\t\t\tlet saved = (isCritical || rollTotal >= rollDC) && !isFumble;\n\t\t\tif (this.checkSuperSaver(target.actor, this.saveItem.data.data.save.ability))\n\t\t\t\tthis.superSavers.add(target);\n\t\t\tif (this.item.data.flags[\"midi-qol-relics\"]?.isConcentrationCheck) {\n\t\t\t\tconst checkBonus = getProperty(target, \"actor.data.flags.midi-qol-relics.concentrationSaveBonus\");\n\t\t\t\tif (checkBonus) {\n\t\t\t\t\tconst rollBonus = (await new Roll(checkBonus, target.actor?.getRollData()).evaluate({ async: true })).total;\n\t\t\t\t\trollTotal += rollBonus;\n\t\t\t\t\trollDetail = (await new Roll(`${rollDetail.result} + ${rollBonus}`).evaluate({ async: true }));\n\t\t\t\t\tsaved = (isCritical || rollTotal >= rollDC) && !isFumble; //TODO see if bonus can change critical/fumble\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (saved) {\n\t\t\t\tthis.saves.add(target);\n\t\t\t\tthis.failedSaves.delete(target);\n\t\t\t}\n\t\t\tif (game.user?.isGM)\n\t\t\t\tlog(`Ability save/check: ${target.name} rolled ${rollTotal} vs ${rollAbility} DC ${rollDC}`);\n\t\t\tlet saveString = i18n(saved ? \"midi-qol-relics.save-success\" : \"midi-qol-relics.save-failure\");\n\t\t\tlet adv = this.advantageSaves.has(target) ? `(${i18n(\"RELICS.Advantage\")})` : \"\";\n\t\t\tif (this.disadvantageSaves.has(target))\n\t\t\t\tadv = `(${i18n(\"RELICS.Disadvantage\")})`;\n\t\t\tif (game.system.id === \"sw5e\") {\n\t\t\t\tadv = this.advantageSaves.has(target) ? `(${i18n(\"SW5E.Advantage\")})` : \"\";\n\t\t\t\tif (this.disadvantageSaves.has(target))\n\t\t\t\t\tadv = `(${i18n(\"SW5E.Disadvantage\")})`;\n\t\t\t}\n\t\t\tlet img = target.data.img ?? target.actor.img ?? \"\";\n\t\t\tif (configSettings.usePlayerPortrait && target.actor.data.type === \"character\")\n\t\t\t\timg = target.actor?.img ?? target.data.img ?? \"\";\n\t\t\tif (VideoHelper.hasVideoExtension(img)) {\n\t\t\t\timg = await game.video.createThumbnail(img, { width: 100, height: 100 });\n\t\t\t}\n\t\t\tlet isPlayerOwned = target.actor.hasPlayerOwner;\n\t\t\tthis.saveDisplayData.push({\n\t\t\t\tgmName: target.name,\n\t\t\t\tplayerName: getTokenPlayerName(target),\n\t\t\t\timg,\n\t\t\t\tisPC: isPlayerOwned,\n\t\t\t\ttarget,\n\t\t\t\tsaveString,\n\t\t\t\trollTotal,\n\t\t\t\trollDetail,\n\t\t\t\tid: target.id,\n\t\t\t\tadv\n\t\t\t});\n\t\t\ti++;\n\t\t}\n\t\tif (this.item.data.data.actionType !== \"abil\")\n\t\t\t//@ts-ignore CONFIG.RELICS\n\t\t\tthis.saveDisplayFlavor = `${this.item.name} <label class=\"midi-qol-relics-saveDC\">DC ${rollDC}</label> ${CONFIG.RELICS.abilities[rollAbility]} ${i18n(this.hitTargets.size > 1 ? \"midi-qol-relics.saving-throws\" : \"midi-qol-relics.saving-throw\")}:`;\n\t\telse\n\t\t\t//@ts-ignore CONFIG.RELICS\n\t\t\tthis.saveDisplayFlavor = `${this.item.name} <label class=\"midi-qol-relics-saveDC\">DC ${rollDC}</label> ${CONFIG.RELICS.abilities[rollAbility]} ${i18n(this.hitTargets.size > 1 ? \"midi-qol-relics.ability-checks\" : \"midi-qol-relics.ability-check\")}:`;\n\t}", "function testFlush(suitArray){\n let findSame1 = 0;\n for(let i = 0; i < suitArray.length - 1; i++){\n if(suitArray[i] === suitArray[i + 1]){\n findSame1 += 1;\n }\n }\n return findSame1 === 4;\n }", "finished() {\n const target = Game.getObjectById(this.params.targetId);\n if (target.hits <= 0) {\n return true;\n }\n }", "function addHitAndCheckWin() {\n numHits++;\n console.log(numHits);\n return numHits >= maxHits;\n}", "function countSave(count) {\n saveAll += count;\n countAllSavings();\n }", "function checkWin() {\n match_found += 1;\n if (match_found === 8) {\n showResults();\n }\n}", "function checkForMatch() {\n\tif (\n\t\ttoggledCards[0].firstElementChild.className === toggledCards[1].firstElementChild.className\n\t) {\n\t\t// if the cards do match, lock the cards in the open position (put this functionality in another function that you call from this one)\n\t\ttoggleMatchCard(toggledCards[0]);\n\t\ttoggleMatchCard(toggledCards[1]);\n\t\ttoggledCards = [];\n\t\tmatched++;\n\t\t// stop the game if TOTAL_PAIRS reached with a timeout of 1000\n\t\tsetTimeout(() => {\n\t\t\tif (matched === TOTAL_PAIRS) {\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}, 1000);\n\t}else{\n\t\t//setTimeOut is a callback function that runs after the designated time expires.\n\t\tsetTimeout(() => {\n\t\t\t// if the cards do not match, remove the cards from the list and hide the card's symbol (put this functionality in another function that you call from this one)\n\t\t\ttoggleCard(toggledCards[0]);\n\t\t\ttoggleCard(toggledCards[1]);\n\t\t\ttoggledCards = [];\n\t\t}, 1000);\n\n\t}\n}", "function checkAllAFK(match, teamId, row) {\n\n /*\n We define AFK to be having 35% or less XP than the average\n Where the average doesn't consider non-zero entities\n NOTE: We are testing 35% right now based on a a previous game to see if it breaks anything by being that high\n There was a game I got crushed in but I still had 52%, I expect as high as 40% is okay\n 47% definitely broke it\n 35% broke it and the value it broke on was 28%\n I'm leaving it at 35 but if I publish, 25% is a better value\n */\n var deltas = [];\n var deltaTimes = ['0-10', '10-20', '20-30', '30-end'];\n var myAFK = 0;\n var theirAFK = 0;\n var afk = false;\n for(var i = 0; i < 10; i++) {\n deltas.push(getXPPerMinuteDelta(match['participants'][i]));\n }\n var averageDeltas = getAverageDeltas(deltas, deltaTimes);\n for(var i = 0; i < deltas.length; i++) {\n for(var j = 0; j < deltaTimes.length; j++) {\n if(deltas[i][deltaTimes[j]] <= (averageDeltas[deltaTimes[j]] * 0.35)) {\n if(match['participants'][i]['teamId'] == teamId) {\n myAFK++;\n }\n else {\n theirAFK++;\n }\n break;\n }\n }\n }\n setCell('My AFK', row, myAFK);\n setCell('Their AFK', row, theirAFK);\n}", "function checkMatch() {\n const firstCardClass = openCards[0].firstElementChild.className;\n const secondCardClass = openCards[1].firstElementChild.className;\n if (firstCardClass === secondCardClass) {\n //locks cards in open position\n doMatch();\n } else {\n //flips cards over again\n setTimeout(removeCards, 1000);\n }\n //increases move and star counter\n moveCount();\n starCount();\n}", "async _saveLastSeqIfNeeded() {\n // Is it time to save the lastSeq again?\n if (new Date().getTime() - this._seqLastSaved.getTime() >= this._saveSeqAfterSeconds * 1000) {\n await this._saveLastSeq()\n }\n }", "function quest2() {\n fs.readFile('./santa.txt', (err, data) => {\n console.time('santaTime');\n const directions = data.toString();\n const directionsArray = directions.split('');\n let accumulator = 0\n let counter = 0\n const answer = directionsArray.some((currentItem) => {\n if (currentItem === '(') {\n accumulator += 1\n } else if (currentItem === ')') {\n accumulator -= 1\n }\n counter ++\n return accumulator <0; //ends the function when 0 is reached\n })\n console.timeEnd('santaTime');\n console.log('basement entry at: ', counter);\n })\n}", "record(count) {\n\t\tvar score = acc_helper(global.barCoords[this.state.target_index].rot, this.state.user_rotation);\n\t\tvar url = 'https://filtergraph.com/aiw/default/log_scores?';\n\t\turl += 'score=' + String(score) + '&';\n\t\turl += 'test_name=' + this.state.test_name + '&';\n\t\turl += 'user_ID=' + global.user_ID + '&';\n\t\turl += 'test_ID=' + global.test_ID + '&';\n\t\turl += 'key=' + global.key;\n\t\tfetch(url)\n\t\t\t.then((response) => response.text())\n\t\t\t.then((responseText) => {\n\t\t\t\tconsole.log(\"backend receipt: \" + this.state.test_name + \", screen \"\n\t\t\t\t+ String(count) + \", score \" + String(score) + ': ' + responseText);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t\tAlert(\"Something went wrong. Please check your connection.\");\n\t\t\t});\n\t\treturn score;\n\t}", "function checkForMatch(){\n\tif (toggledCards[0].firstElementChild.className === toggledCards[1].firstElementChild.className){\t\t\n\t\tconsole.log('Matched');\n\t\ttoggledCards[0].classList.toggle('match')\n\t\ttoggledCards[1].classList.toggle('match')\n\t\ttoggledCards = [];\n\t\tmatched++;\n\t\tconsole.log(matched);\n\t} else {\n\t setTimeout(() => {\n\t\tconsole.log('No Match');\n\t\ttoggleCard(toggledCards[0]);\n\t\ttoggleCard(toggledCards[1]);\n\t\ttoggledCards = [];\n\t }, 1000);\n }\n if (matched === 8) {\n gameOver();\n }\n}", "flush() {\n if (!this._replay || !this._replay.isEnabled()) {\n return;\n }\n\n return this._replay.flushImmediate();\n }", "function matcher (record) {\n this.depth = this.depth || 1 // depth tracking starts at level 1\n this.tracker = this.tracker || 0 // for basic sums, start counter at 0\n const subTotal = this.tracker + record\n // Found a match in the specified with desired qty of results, don't keep searching!\n if (subTotal === this.target && this.depth >= goal) {\n results.push(record)\n return true\n }\n // When subtotal exceeds target, return immediately and don't waste time\n // on more loops that won't get results\n if (subTotal > this.target) {\n return false\n }\n // If we're already at max depth, don't waste time on more loops\n if (this.depth >= this.maxDepth) {\n return false\n }\n // Check the next level down\n const res = records.find(matcher, {\n maxDepth: this.maxDepth,\n target: this.target,\n depth: this.depth + 1,\n tracker: this.tracker + record\n })\n // Propogate maches back up the recursion chain, capturing each\n if (res) {\n results.push(record)\n return true\n }\n // Nothing found with this combo, step to the next sibling\n return false\n }", "function registerFrequency(frequency){\n\n\t// need to store frequency in a data structure that allows O(1) look up on the phase and\n\t// the counts of repeats, there are two separate JS objects being used to achieve this.\n\t// There is an inherent need to ensure that these two data structures are kept in sync for\n\t// the relationships between them to remain true.\n\n\t// Does the passed frequency exist in the store yet?\n\tif (frequenciesSeen[frequency]) {\n\n\t\tlet countPassedFrequencySeen = frequenciesSeen[frequency];\n\n\t\t// Remove the frequency from the repeatsOfFrequencies Object for the current frequency count\n\t\t\n\t\t// If present in the repeatsOfFrequencies object already remove it\n\t\tif (repeatsOfFrequencies[countPassedFrequencySeen] && repeatsOfFrequencies[countPassedFrequencySeen][frequency]) {\n\t\t\tdelete repeatsOfFrequencies[countPassedFrequencySeen][frequency]\n\t\t}\n\n\t\t// Increment the value for passed frequency in the store\n\t\tfrequenciesSeen[frequency] = frequenciesSeen[frequency] + 1;\n\n\n // Create object for the current count if it does not exist\n if (!repeatsOfFrequencies[countPassedFrequencySeen]) {\n repeatsOfFrequencies[countPassedFrequencySeen] = {};\n }\n\n // Add to repeatsOfFrequencies object\n\t\trepeatsOfFrequencies[countPassedFrequencySeen][frequency] = {egg: true};\n\n console.log(`seen ${frequency} at least twice now...`)\n\n\t} else {\n\t\t// Add passed frequency to the store\n\t\tfrequenciesSeen[frequency] = 1;\n\n\t\t\n\n\t}\n\n}", "function checkMatches(drawData) {\n const { winningNumbers, drawedSets} = drawData;\n //const numAmount = winningNumbers.size;\n for (set of drawedSets) {\n set.match = 0;\n for (let num of set.numbers) {\n if (winningNumbers.includes(num)) {\n set.match++;\n }\n }\n }\n //console.log(winningNumbers, drawedSets);\n}", "function checkForWin() {\n matchesFound += 1;\n if (matchesFound == 8) {\n showResults();\n }\n}", "markOpenCardsAsMatch() {\n this.matchedCards.push(this.openCards[0], this.openCards[1]);\n this.openCards.forEach((card) => {\n setTimeout(this.markCardAsMatch.bind(this, card), 500);\n });\n if (this.matchedCards.length === 16) {\n setTimeout(() => {\n this.hideDeck();\n this.displaySuccessMessage();\n }, 2000);\n this.scoringHandler.stopTimer();\n }\n\n this.openCards = [];\n }", "_attemptToMatchHash() {\n attemptToMatchHash(this, this.savedHash, defaultSuccessHandler);\n }", "function countUpdate() {\n\n\tconsole.log('\\nnew call');\n\n \t// if we should block, count blocked time\n\tvar blocked = JSON.parse(localStorage[\"blockVar\"]);\n\tif (blocked) {\n\t\tcheckBlock();\n\t\treturn;\n\t}\n\n\tchrome.idle.queryState(30, function (state) {\n \tchrome.windows.getCurrent(function (current) {\n\n \t\t// count time is browser is in use\n\t\t\tif (state === \"active\" || current.state === \"fullscreen\") {\n \t\t\t\tchrome.tabs.query({active: true, currentWindow: true}, \n \t\t\t\t\tfunction (tabs) {\n\n\n\t\t\t\t\t// if we shouldn't block, count wasted time\n\t\t\t\t\tif (tabs.length === 0) return;\n\n\t\t\t\t\tvar tab = tabs[0];\n\t\t\t\t\t// get current Domain\n\t\t\t\t\tvar current = getDomain(tab.url);\t\n\n\t\t\t\t\t// a problem cause undefined\n\t\t\t\t\tconsole.log(localStorage[\"domHash\"]);\n \t\t\t\t\tvar dH = JSON.parse(localStorage[\"domHash\"]);\n \t\t\tif (dH !== undefined) {\n\t\t\t\t\t\tconsole.log('domHash got');\n\t\t\t\t\t\tconsole.log('current domain is ' + current);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get the hashed domain\n\t\t\t\t\t\tvar found = 'false';\n\t\t\t\t\t\tfor (var k in dH) {\n \t\t\t\t\t\tif (k === current) {\n \t\t\t\t\t\t\tconsole.log('match found!');\n \t\t\t\t\t\t\tdH[k] += UPDATE_SECONDS;\n \t\t\t\t\t\t\t\tconsole.log(dH);\n\t\t\t\t\t\t\t\tfound = 'true';\n\t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (found === 'true') {\n\t\t\t\t\t\t\tconsole.log(' updating...');\n\t\t\t\t\t\t\tlocalStorage[\"domHash\"] = JSON.stringify(dH);\n\t\t\t\t\t\t\tconsole.log(\"domHash updated!\");\n\t\t\t\t\t\t\tcountSum();\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse console.log('no change needed');\n\t\t\t\t\t}\n\t\t\t\t\telse console.log('PANIC: Hash table does not exist!');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t\telse console.log('state inactive; no update needed.');\n\t\t});\n\t});\n}", "countTracked() {\n return(Object.keys(tTracked).length)\n }", "function isCompleted() {\n return cards.length === matchedCards.length;\n}", "async function matchCollector() {\n // retrieve all active challenges\n console.log('**** Match Collector ****');\n let challengeCount = await codbets_reader.challengeCount();\n challengeCount = ethers.BigNumber.from(challengeCount).toNumber();\n console.log(`Current challenge count is ${challengeCount}`);\n\n if (challengeCount == 0) return;\n // Loop through all existing challenge Ids\n for (let challengeId = 1; challengeId <= challengeCount; challengeId++) {\n // - retrieve the challenge struct\n challenge = await codbets_reader.challenges(challengeId);\n\n if (challenge.settled) continue;\n if (!challenge.accepted) continue;\n\n // - call matchFinder()\n const matchId = await matchFinder(challenge.gamertag1, challenge.gamertag2);\n // - with return matchId, call fetchWinner(matchId, gamertag1, gamertag2, challengeId)\n if (matchId) {\n console.log(`Match Id ${matchId} found for Challenge id ${challengeId}`);\n await codbets_writer.fetchWinner(\n matchId,\n challenge.gamertag1,\n challenge.gamertag2,\n challengeId\n );\n } else {\n console.log(`No matches found for Challenge id ${challengeId}`);\n }\n }\n //\n}", "isFree() {\n return this.track === FREE;\n }", "function deflate_slow(flush) {\n\t\t // short hash_head = 0; // head of hash chain\n\t\t var hash_head = 0; // head of hash chain\n \n\t\t var bflush; // set if current block must be flushed\n \n\t\t var max_insert; // Process the input block.\n \n\t\t while (true) {\n\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t// string following the next match.\n\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t fill_window();\n \n\t\t\t if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\treturn NeedMore;\n\t\t\t }\n \n\t\t\t if (lookahead === 0) break; // flush the current block\n\t\t\t} // Insert the string window[strstart .. strstart+2] in the\n\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \n \n\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t head[ins_h] = strstart;\n\t\t\t} // Find the longest match, discarding those <= prev_length.\n \n \n\t\t\tprev_length = match_length;\n\t\t\tprev_match = match_start;\n\t\t\tmatch_length = MIN_MATCH - 1;\n \n\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && (strstart - hash_head & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t // To simplify the code, we prevent matches with the string\n\t\t\t // of window index 0 (in particular we have to avoid a match\n\t\t\t // of the string with itself at the start of the input file).\n\t\t\t if (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t } // longest_match() sets match_start\n \n \n\t\t\t if (match_length <= 5 && (strategy == Z_FILTERED || match_length == MIN_MATCH && strstart - match_start > 4096)) {\n\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t }\n\t\t\t} // If there was a match at the previous step and the current\n\t\t\t// match is not better, output the previous match:\n \n \n\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t max_insert = strstart + lookahead - MIN_MATCH; // Do not insert strings in hash table beyond this.\n\t\t\t // check_match(strstart-1, prev_match, prev_length);\n \n\t\t\t bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); // Insert in hash table all strings up to the end of the match.\n\t\t\t // strstart-1 and strstart are already inserted. If there is not\n\t\t\t // enough lookahead, the last two strings are not inserted in\n\t\t\t // the hash table.\n \n\t\t\t lookahead -= prev_length - 1;\n\t\t\t prev_length -= 2;\n \n\t\t\t do {\n\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t ins_h = (ins_h << hash_shift ^ window[strstart + (MIN_MATCH - 1)] & 0xff) & hash_mask; // prev[strstart&w_mask]=hash_head=head[ins_h];\n \n\t\t\t\t hash_head = head[ins_h] & 0xffff;\n\t\t\t\t prev[strstart & w_mask] = head[ins_h];\n\t\t\t\t head[ins_h] = strstart;\n\t\t\t\t}\n\t\t\t } while (--prev_length !== 0);\n \n\t\t\t match_available = 0;\n\t\t\t match_length = MIN_MATCH - 1;\n\t\t\t strstart++;\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t\tif (strm.avail_out === 0) return NeedMore;\n\t\t\t }\n\t\t\t} else if (match_available !== 0) {\n\t\t\t // If there was no match at the previous position, output a\n\t\t\t // single literal. If there was a match but the current match\n\t\t\t // is longer, truncate the previous match to a single literal.\n\t\t\t bflush = _tr_tally(0, window[strstart - 1] & 0xff);\n \n\t\t\t if (bflush) {\n\t\t\t\tflush_block_only(false);\n\t\t\t }\n \n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t if (strm.avail_out === 0) return NeedMore;\n\t\t\t} else {\n\t\t\t // There is no previous match to compare with, wait for\n\t\t\t // the next step to decide.\n\t\t\t match_available = 1;\n\t\t\t strstart++;\n\t\t\t lookahead--;\n\t\t\t}\n\t\t }\n \n\t\t if (match_available !== 0) {\n\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\tmatch_available = 0;\n\t\t }\n \n\t\t flush_block_only(flush == Z_FINISH);\n \n\t\t if (strm.avail_out === 0) {\n\t\t\tif (flush == Z_FINISH) return FinishStarted;else return NeedMore;\n\t\t }\n \n\t\t return flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "checkAutomaticMatch() {\n TweenMax.delayedCall(0.5, () => {\n let matches = this.checkGridForMatches();\n if (matches.length > 0) {\n this.gatherMatchingBlocks(matches);\n this.increaseCardsPointsAfterMatch(matches);\n } else {\n this.checkPossibleMove();\n }\n })\n }", "function setMatch() {\n open.forEach(function(card) {\n card.addClass('match');\n });\n open = [];\n matched += 2;\n if (Won()) {\n stopTimer();\n gameOver();\n }\n}", "function doTF(tf)\r\n{\r\n termfrequency = {};\r\n var word = tf.split(' '); // individual words\r\n var count=0;\r\n \r\n for(var i = 0;i<tf.length;i++)\r\n {\r\n if(termfrequency.hasOwnProperty(word[i]))\r\n {\r\n // the word is already in the database:\r\n termfrequency[word[i]]++;\r\n arrfrequency++;\r\n }\r\n else\r\n {\r\n // the word is new:\r\n termfrequency[word[i]]=1;\r\n arrfrequency++;\r\n \r\n }\r\n for (var j = 0; j < arr.length; j++) {\r\n if (arr[j] == word[i]) {\r\n count++;\r\n } }\r\n}\r\n \r\n \r\n \r\n console.log(termfrequency);\r\n console.log(arrfrequency);\r\n console.log(word);\r\n console.log(count); \r\n return count;\r\n }", "function flush() {\n sendEntries();\n events.length = 0;\n totalLogScore = 0;\n}", "function matching() {\n\tmatches++;\n\tclickedCards[0].classList.remove('open', 'show');\n\tclickedCards[0].classList.add('match', 'pulse');\n\tevent.target.classList.remove('open', 'show');\n\tevent.target.classList.add('match', 'pulse');\n\tclickedCards = [];\n}", "isFullMatch() {\n for (let i = 0; i < this.result.length; i++) {\n if (this.result[i].result !== 'MATCH') {\n return false;\n }\n }\n\n return true;\n }", "function countTime() {\n\tdocument.getElementById(\"time\").innerHTML = \"Vreme: \" + ++ value;\n\tif (value == list[0].vreme) {\n\t\tconsole.log(\"Kraj igre...\");\n\t\tlocalStorage.setItem('allAnswersLs', JSON.stringify(allAnswers));\n\t\tstop();\n\t\tfinishGame();\n\t}\n}", "function handleMatch(match, loopNdx, quantifierRecurse) {\n var currentPos = testPos;\n if (testPos == pos && match.matches == undefined) {\n matches.push({ \"match\": match, \"locator\": loopNdx.reverse() });\n return true;\n } else if (match.matches != undefined) {\n if (match.isGroup && quantifierRecurse !== true) { //when a group pass along to the quantifier\n match = handleMatch(maskToken.matches[tndx + 1], loopNdx);\n if (match) return true;\n } else if (match.isOptional) {\n var optionalToken = match;\n match = ResolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n if (match) {\n var latestMatch = matches[matches.length - 1][\"match\"];\n var isFirstMatch = (optionalToken.matches.indexOf(latestMatch) == 0);\n if (isFirstMatch) {\n insertStop = true; //insert a stop for non greedy\n }\n //search for next possible match\n testPos = currentPos;\n }\n } else if (match.isQuantifier && quantifierRecurse !== true) {\n var qt = match;\n for (var qndx = (ndxInitializer.length > 0 && quantifierRecurse !== true) ? ndxInitializer.shift() : 0; (qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max)) && testPos <= pos; qndx++) {\n var tokenGroup = maskToken.matches[maskToken.matches.indexOf(qt) - 1];\n match = handleMatch(tokenGroup, [qndx].concat(loopNdx), true);\n if (match) {\n //get latest match\n var latestMatch = matches[matches.length - 1][\"match\"];\n if (qndx > qt.quantifier.min - 1) { //mark optionality\n latestMatch.optionalQuantifier = true;\n }\n var isFirstMatch = (tokenGroup.matches.indexOf(latestMatch) == 0);\n if (isFirstMatch) { //search for next possible match\n if (qndx > qt.quantifier.min - 1) {\n insertStop = true;\n testPos = pos; //match the position after the group\n break; //stop quantifierloop\n } else return true;\n } else {\n return true;\n }\n }\n }\n } else {\n match = ResolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n if (match)\n return true;\n }\n } else testPos++;\n }", "postrender() {\n this.count++;\n if (this.mode === settings_1.settings.GC_MODES.MANUAL) {\n return;\n }\n this.checkCount++;\n if (this.checkCount > this.checkCountMax) {\n this.checkCount = 0;\n this.run();\n }\n }", "function isMatch() {\n if (cardOne.dataset.title === cardTwo.dataset.title) {\n keepShowing();\n pairs = pairs + 1;\n checkIfWon();\n return;\n }\n unflipCards();\n decreaseHealth();\n}", "function handleMatch(match, loopNdx, quantifierRecurse) {\n\t function isFirstMatch(latestMatch, tokenGroup) {\n\t var firstMatch = $.inArray(latestMatch, tokenGroup.matches) === 0;\n\t if (!firstMatch) {\n\t $.each(tokenGroup.matches, function (ndx, match) {\n\t if (match.isQuantifier === true) {\n\t firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]);\n\t if (firstMatch) return false;\n\t }\n\t });\n\t }\n\t return firstMatch;\n\t }\n\n\t function resolveNdxInitializer(pos, alternateNdx) {\n\t var bestMatch = selectBestMatch(pos, alternateNdx);\n\t return bestMatch ? bestMatch.locator.slice(bestMatch.alternation + 1) : [];\n\t }\n\t if (testPos > 10000) {\n\t throw \"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. \" + getMaskSet().mask;\n\t }\n\t if (testPos === pos && match.matches === undefined) {\n\t matches.push({\n\t \"match\": match,\n\t \"locator\": loopNdx.reverse(),\n\t \"cd\": cacheDependency\n\t });\n\t return true;\n\t } else if (match.matches !== undefined) {\n\t if (match.isGroup && quantifierRecurse !== match) { //when a group pass along to the quantifier\n\t match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx);\n\t if (match) return true;\n\t } else if (match.isOptional) {\n\t var optionalToken = match;\n\t match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n\t if (match) {\n\t latestMatch = matches[matches.length - 1].match;\n\t if (isFirstMatch(latestMatch, optionalToken)) {\n\t insertStop = true; //insert a stop\n\t testPos = pos; //match the position after the group\n\t } else return true;\n\t }\n\t } else if (match.isAlternator) {\n\t var alternateToken = match,\n\t\t\t\t\t\t\t\t\tmalternateMatches = [],\n\t\t\t\t\t\t\t\t\tmaltMatches,\n\t\t\t\t\t\t\t\t\tcurrentMatches = matches.slice(),\n\t\t\t\t\t\t\t\t\tloopNdxCnt = loopNdx.length;\n\t var altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;\n\t if (altIndex === -1 || typeof altIndex === \"string\") {\n\t var currentPos = testPos,\n\t\t\t\t\t\t\t\t\t\tndxInitializerClone = ndxInitializer.slice(),\n\t\t\t\t\t\t\t\t\t\taltIndexArr = [],\n\t\t\t\t\t\t\t\t\t\tamndx;\n\t if (typeof altIndex == \"string\") {\n\t altIndexArr = altIndex.split(\",\");\n\t } else {\n\t for (amndx = 0; amndx < alternateToken.matches.length; amndx++) {\n\t altIndexArr.push(amndx);\n\t }\n\t }\n\t for (var ndx = 0; ndx < altIndexArr.length; ndx++) {\n\t amndx = parseInt(altIndexArr[ndx]);\n\t matches = [];\n\t //set the correct ndxInitializer\n\t ndxInitializer = resolveNdxInitializer(testPos, amndx);\n\t match = handleMatch(alternateToken.matches[amndx] || maskToken.matches[amndx], [amndx].concat(loopNdx), quantifierRecurse) || match;\n\t if (match !== true && match !== undefined && (altIndexArr[altIndexArr.length - 1] < alternateToken.matches.length)) { //no match in the alternations (length mismatch) => look further\n\t var ntndx = maskToken.matches.indexOf(match) + 1;\n\t if (maskToken.matches.length > ntndx) {\n\t match = handleMatch(maskToken.matches[ntndx], [ntndx].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse);\n\t if (match) {\n\t altIndexArr.push(ntndx.toString());\n\t $.each(matches, function (ndx, lmnt) {\n\t lmnt.alternation = loopNdx.length - 1;\n\t });\n\t }\n\t }\n\t }\n\t maltMatches = matches.slice();\n\t testPos = currentPos;\n\t matches = [];\n\t //cloneback\n\t for (var i = 0; i < ndxInitializerClone.length; i++) {\n\t ndxInitializer[i] = ndxInitializerClone[i];\n\t }\n\t //fuzzy merge matches\n\t for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {\n\t var altMatch = maltMatches[ndx1];\n\t altMatch.alternation = altMatch.alternation || loopNdxCnt;\n\t for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {\n\t var altMatch2 = malternateMatches[ndx2];\n\t //verify equality\n\t if (altMatch.match.def === altMatch2.match.def && (typeof altIndex !== \"string\" || $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr) !== -1)) {\n\t if (altMatch.match.mask === altMatch2.match.mask) {\n\t maltMatches.splice(ndx1, 1);\n\t ndx1--;\n\t }\n\t if (altMatch2.locator[altMatch.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) === -1) {\n\t altMatch2.locator[altMatch.alternation] = altMatch2.locator[altMatch.alternation] + \",\" + altMatch.locator[altMatch.alternation];\n\t altMatch2.alternation = altMatch.alternation; //we pass the alternation index => used in determineLastRequiredPosition\n\t }\n\t break;\n\t }\n\t }\n\t }\n\t malternateMatches = malternateMatches.concat(maltMatches);\n\t }\n\n\t if (typeof altIndex == \"string\") { //filter matches\n\t malternateMatches = $.map(malternateMatches, function (lmnt, ndx) {\n\t if (isFinite(ndx)) {\n\t var mamatch,\n\t\t\t\t\t\t\t\t\t\t\t\t\talternation = lmnt.alternation,\n\t\t\t\t\t\t\t\t\t\t\t\t\taltLocArr = lmnt.locator[alternation].toString().split(\",\");\n\t lmnt.locator[alternation] = undefined;\n\t lmnt.alternation = undefined;\n\t for (var alndx = 0; alndx < altLocArr.length; alndx++) {\n\t mamatch = $.inArray(altLocArr[alndx], altIndexArr) !== -1;\n\t if (mamatch) { //rebuild the locator with valid entries\n\t if (lmnt.locator[alternation] !== undefined) {\n\t lmnt.locator[alternation] += \",\";\n\t lmnt.locator[alternation] += altLocArr[alndx];\n\t } else lmnt.locator[alternation] = parseInt(altLocArr[alndx]);\n\n\t lmnt.alternation = alternation;\n\t }\n\t }\n\t if (lmnt.locator[alternation] !== undefined) return lmnt;\n\t }\n\t });\n\t }\n\n\t matches = currentMatches.concat(malternateMatches);\n\t testPos = pos;\n\t insertStop = matches.length > 0; //insert a stopelemnt when there is an alternate - needed for non-greedy option\n\t } else {\n\t // if (alternateToken.matches[altIndex]) { //if not in the initial alternation => look further\n\t match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [altIndex].concat(loopNdx), quantifierRecurse);\n\t // } else match = false;\n\t }\n\t if (match) return true;\n\t } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) {\n\t var qt = match;\n\t for (var qndx = (ndxInitializer.length > 0) ? ndxInitializer.shift() : 0;\n\t\t\t\t\t\t\t\t\t(qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max)) && testPos <= pos; qndx++) {\n\t var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];\n\t match = handleMatch(tokenGroup, [qndx].concat(loopNdx), tokenGroup); //set the tokenGroup as quantifierRecurse marker\n\t if (match) {\n\t //get latest match\n\t latestMatch = matches[matches.length - 1].match;\n\t latestMatch.optionalQuantifier = qndx > (qt.quantifier.min - 1);\n\t if (isFirstMatch(latestMatch, tokenGroup)) { //search for next possible match\n\t if (qndx > (qt.quantifier.min - 1)) {\n\t insertStop = true;\n\t testPos = pos; //match the position after the group\n\t break; //stop quantifierloop\n\t } else return true;\n\t } else {\n\t return true;\n\t }\n\t }\n\t }\n\t } else {\n\t match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n\t if (match) return true;\n\t }\n\t } else testPos++;\n\t }", "function saveEntireAmtStateDone() {\r\n if (--IntelAmtEntireStateCalls != 0) return;\r\n var out = fs.openSync(settings.output, 'w');\r\n fs.writeSync(out, Buffer.from(JSON.stringify(IntelAmtEntireState)));\r\n fs.closeSync(out);\r\n console.log('Done, results written to ' + settings.output + '.');\r\n exit(1);\r\n}", "function checkBlock() {\n\t\n\t// get/update block time and duration in seconds\n\tvar count = JSON.parse(localStorage[\"blockCount\"]);\n\tcount += UPDATE_SECONDS;\n\t\n\tvar blockDur = localStorage[\"blockDuration\"];\n\tblockDur = blockDur * 3600;\n\tconsole.log(count + \" seconds of \" + blockDur + \" second sentence served\");\n\t// remove block if duration exceeded\n\tif (count >= blockDur) {\n \tlocalStorage[\"blockVar\"] = \"false\";\n \tlocalStorage[\"target\"] = 0;\n \tlocalStorage[\"blockCount\"] = 0;\n \t\tconsole.log(\"you did great. the block is coming down\");\n\t}\n\telse {\n\t\tlocalStorage[\"blockCount\"] = count;\n\t}\n}", "function checkMatch() {\n if (facedCards[0].firstElementChild.className == facedCards[1].firstElementChild.className) {\n for (let card of facedCards) {\n card.classList.add(\"match\");\n }\n /*Once match is made facedCards array is emptied. */\n facedCards = [];\n /*Match is added to match total*/\n matches++;\n /*Updates the wait variable to false so that users can click cards for the next try*/\n wait = false;\n } else {\n /*Flips cards that are not a match back over after a short delay. */\n setTimeout(clearFacedCards, 1000);\n }\n}", "function checkIfcurrentFilterMatchSave() {\r\n\r\n\tfor (var i=0; i<9; i++) {\r\n\t\r\n\t\tif (assistsFilter[i] != assistsFilterBackup[i]) {\r\n\t\t\tsaveFilterButton.disabled = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\t\r\n\tfor (var i=0; i<7; i++) {\r\n\t\r\n\t\tif (gameSettingsFilter[i] != gameSettingsFilterBackup[i]) {\r\n\t\t\tsaveFilterButton.disabled = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsaveFilterButton.disabled = true;\r\n}", "function match() {\n\t\tfor(card of chosenCards) {\n\t\t\t\tcard.classList.add('match');\n\t\t\t\tgotRight(card);\n\t\t};\n\t\tpairsRemain--;\n\t\tcheckWin();\n\t\tempty();\n}", "function checkWinCondition(){\n// When all pairs are selected (pairCounter === maxPair, based on mode)\n if (pairCounter === maxPair){\n endTime = new Date();\n console.log('End Time:', endTime);\n }\n // Once the end time is captured, a 'score' is deduced by extracting and comparing time codes and converting from milliseconds to seconds. That value in seconds is added to the userData object\n if (endTime) {\n var numStartTime = startTime.getTime();\n var numEndTime = endTime.getTime();\n var elapsedTime = numEndTime-numStartTime;\n var timeInSec = elapsedTime/1000;\n console.log('Elapsed Time:', timeInSec);\n userData.finalTimes.push(timeInSec);\n // At this point, we have updated all necessary userData information and are ready to re-stringify it and send it back to local storage\n stringyUser = JSON.stringify(userData);\n localStorage.setItem('userData', stringyUser);\n // And now we send the user on to the About Me page to view their results\n window.location.href = 'about.html';\n }\n}", "function checkForMatch() {\n if (firstCard.dataset.framework === secondCard.dataset.framework) {\n countMatch ++;\n // In case all of the matches are found ==> Congratulation you win the game\n if( countMatch === 8){\n //if the matches are 8 then popUp the messagge of win!\n congratulation();\n\n }\n disableCards();\n return;\n }\n\n unflipCards();\n }", "isComplete() {\n if (!this.endTime) return false;\n if (this.now() > this.endTime) {\n return true;\n }\n else {\n return false;\n }\n \n }", "allPlayersDone() {\n var showHostOffset = 0;\n var doneCount = 0;\n\n this.playerMap.doAll((player) => {\n if (player.isShowHost) {\n showHostOffset++;\n } else if (!player.hasFastestFingerChoicesLeft()) {\n doneCount++;\n }\n });\n\n return doneCount >= this.playerMap.getPlayerCount() - showHostOffset;\n }", "async _checkRecords(index, record) {\n\t\tlet write = false;\n\n\t\tfor (const [index, record] of this.cache.records.entries()) {\n\t\t\tif (this.cache.currentIPv4 === record.recordContent || \n\t\t\t\tthis.cache.currentIPv6 === record.recordContent)\n\t\t\t\tcontinue;\n\t\n\t\t\tconsole.log(`Updating DNS record ${index} from ${record.recordContent} to ` +\n\t\t\t\t(record.ipv6 ? this.cache.currentIPv6 : this.cache.currentIPv4));\n\t\n\t\t\ttry {\n\t\t\t\tawait this._updateRecord(index);\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error('Error updating DNS record:\\n' + err);\n\t\t\t\tprocess.exit();\n\t\t\t}\n\t\n\t\t\tconsole.log('DNS record is up to date.');\n\t\t\twrite = true;\n\t\t}\n\n\t\treturn write;\n\t}", "if (didScheduleUpdateDuringPassiveEffects) {\n if (root === rootWithPassiveNestedUpdates) {\n nestedPassiveUpdateCount++;\n } else {\n nestedPassiveUpdateCount = 0;\n rootWithPassiveNestedUpdates = root;\n }\n }", "function checkMatch() {\n if (app.firstCard.dataset.avenger === app.secondCard.dataset.avenger) {\n disableCards();\n cardMatchSound();\n app.matchedCards.push(app.firstCard.dataset.avenger);\n gameComplete();\n return;\n }\n unflipCards();\n}", "async function storeCount () {\n console.log(\"storeCount starts\")\n var date = new Date();\n var obj = { \n date:date,\n cashtagCount:cashtagCount,\n errorCount:errorCount\n };\n counterStore.push(obj);\n cashtagCount = 0;\n errorCount = 0;\n runCount = runCount + 1;\n setTimeout(storeCount, 120000);\n }", "function isMatch() {\n const openCard = document.getElementsByClassName(\"open show\");\n\n clickCounter++;\n\n //accesses the first and second cards as they're clicked\n const firstCard = openCard[0];\n const secondCard = openCard[1];\n\n /* compares everything about the cards to each other (comparing the node would\n * probably not be the best solution in the wild, but because the whole card * will be identical here, I think it's fine) */\n const matchedCards = firstCard.isEqualNode(secondCard);\n\n /* if the cards match, open & show classes are removed, match class is added\n * if the cards don't match, open & show classes are removed and the cards\n * can be accessed again */\n if (matchedCards) {\n firstCard.classList.remove(\"open\", \"show\");\n secondCard.classList.remove(\"open\", \"show\");\n firstCard.classList.add(\"match\");\n secondCard.classList.add(\"match\");\n\n clickCounter = 0;\n moves++;\n\n } else if (clickCounter === 2) {\n // closes both cards after a delay if they're not a match\n window.setTimeout(function() {\n firstCard.classList.remove(\"open\", \"show\");\n secondCard.classList.remove(\"open\", \"show\");\n }, 500);\n\n clickCounter = 0;\n moves++;\n\n } else {\n //// do nothing\n }\n\n /* victory condition which stops the timer and pops open a modal that\n * displays the player's stats */\n const allCardsMatched = document.querySelectorAll(\".match\");\n if (allCardsMatched.length === 16) {\n clearInterval(Interval);\n victoryModal();\n }\n}", "function cardMatch() {\n if(cardSelections[0].firstElementChild.className === cardSelections[1].firstElementChild.className) {\n // If a match adds the match class to each card in array\n cardSelections.forEach(function(card){\n card.classList.add('match');\n });\n matchCount++;\n cardSelections = [];\n } else {\n // If no match sets timeout on card flipping via toggle.\n setTimeout(function() {\n displayCard(cardSelections[0]);\n displayCard(cardSelections[1]);\n cardSelections = [];\n }, 400 );\n }\n }", "updateProtocolMatches() {\n log.trace('ProtocolEngine::updateProtocolMatches');\n\n // Clear all data currently in matchedProtocols\n this._clearMatchedProtocols();\n\n // For each study, find the matching protocols\n this.studies.forEach(study => {\n const matched = this.findMatchByStudy(study);\n\n // For each matched protocol, check if it is already in MatchedProtocols\n matched.forEach(matchedDetail => {\n const protocol = matchedDetail.protocol;\n if (!protocol) {\n return;\n }\n\n // If it is not already in the MatchedProtocols Collection, insert it with its score\n if (!this.matchedProtocols.has(protocol.id)) {\n log.trace(\n 'ProtocolEngine::updateProtocolMatches inserting protocol match',\n matchedDetail\n );\n this.matchedProtocols.set(protocol.id, protocol);\n this.matchedProtocolScores[protocol.id] = matchedDetail.score;\n }\n });\n });\n }", "function checkMatch() {\n if (openedCards[0][0].firstChild.className == openedCards[1][0].firstChild.className) {\n console.log('This is a match!');\n openedCards[0].addClass('match');\n openedCards[1].addClass('match');\n clickOff();\n clearOpenCards();\n setTimeout(checkForWin, 900);\n } else {\n openedCards[0].toggleClass('open show').animateCss('flipInY');\n setTimeout(flipDelay, 600); //2nd card closes after the first\n clickOn();\n }\n}", "getFrequencyMapping() {\n var mapping = [];\n for (const [name, midiFile] of Object.entries(this.midiFiles)) {\n var track = midiFile.track;\n track.forEach(function(midiEvent) {\n midiEvent.event.forEach(function(d) {\n if (d.type == 9 && d.data[1] > 0) {\n var find = Constants.NOTE_MAPPING[d.data[0]];\n var found = false;\n for (var i = 0; i < mapping.length && !found; i++) {\n if (mapping[i][\"name\"] == name && mapping[i][\"note\"] == find) {\n mapping[i][\"count\"] += 1;\n found = true;\n }\n }\n if (!found) {\n mapping.push({\n name: name,\n color: midiFile.color,\n note: find,\n count: 1\n });\n }\n }\n });\n });\n }\n\n // Identify mismatches and add match parameter\n const master = mapping.filter(item => item.name == mapping[0].name);\n const files = [...new Set(mapping.map(item => item.name))];\n master.forEach(function(d) {\n const notes = mapping.filter(item => item.note == d.note);\n const match = notes.every(item => item.count == notes[0].count);\n notes.forEach(item => (item.match = match));\n notes.forEach(item => (item.fileCount = files.length));\n });\n\n return mapping;\n }", "async onMatchEnd(winner, duration) {\n this.stats.match += 1;\n this.stats.wins[winner] += 1;\n this.stats.lastDurations.push(duration);\n this.stats.matchTime = duration;\n\n await this.updateUi();\n this.stats.matchTime = 0;\n this.stats.matchFrame = 0;\n }" ]
[ "0.57499295", "0.5212014", "0.51859707", "0.5111995", "0.5039224", "0.50121415", "0.49712586", "0.49325344", "0.48576874", "0.4847375", "0.48212865", "0.48212302", "0.48096582", "0.4798437", "0.47001162", "0.46869558", "0.46755353", "0.46664038", "0.4647019", "0.46444625", "0.46365", "0.46253917", "0.46242842", "0.46181378", "0.46150774", "0.4613607", "0.45957497", "0.45921835", "0.45465726", "0.4546422", "0.45179403", "0.45174104", "0.45035866", "0.44984153", "0.44980368", "0.4491529", "0.44791394", "0.44776556", "0.44771263", "0.44669446", "0.44636995", "0.44633877", "0.4463346", "0.44618818", "0.44612062", "0.44603238", "0.4458306", "0.4444376", "0.44433415", "0.44403234", "0.44239703", "0.4423836", "0.44230318", "0.44196144", "0.4412893", "0.44076797", "0.44059494", "0.43961883", "0.4391127", "0.4386834", "0.4377882", "0.43648812", "0.43636805", "0.43591544", "0.4358113", "0.43566236", "0.43538693", "0.4352099", "0.43443397", "0.43409598", "0.43371508", "0.43331012", "0.43302158", "0.43270805", "0.43248296", "0.43227223", "0.43210244", "0.43181536", "0.43157497", "0.43096292", "0.43075186", "0.43044826", "0.4298589", "0.42930126", "0.42872915", "0.42854756", "0.42811003", "0.42804268", "0.42784595", "0.42767316", "0.42690095", "0.4268347", "0.42659178", "0.42627847", "0.42593667", "0.42590615", "0.42567807", "0.42549613", "0.42481592", "0.42431068", "0.42430156" ]
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.defineProperty(t,a,r),r\n/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */}", "function n(r){return!!r.constructor&&typeof r.constructor.isBuffer==\"function\"&&r.constructor.isBuffer(r)}", "function Generator() {} // 80", "function r() {}", "function r() {}", "function r() {}", "function i(e){var t=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(e),n=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(e),r=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),i=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),a=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),s=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),c=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),d=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),f=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),m=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),v=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),y=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),g=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),_=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),b=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),w=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),T=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),E=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),S=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(n),x=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(e),k=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(x),C=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(x),A=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(x),N=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(x),I=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),t}(x);(0,o.default)(e,{0:t,NetworkOrCORSError:t,400:n,BadRequest:n,401:r,Unauthorized:r,402:i,PaymentRequired:i,403:a,Forbidden:a,404:s,NotFound:s,405:c,MethodNotAllowed:c,406:d,NotAcceptable:d,407:f,ProxyAuthenticationRequired:f,408:m,RequestTimeout:m,409:v,Conflict:v,410:y,Gone:y,411:g,LengthRequired:g,412:_,PreconditionFailed:_,413:b,RequestEntityTooLarge:b,414:w,RequestUriTooLong:w,415:T,UnsupportedMediaType:T,416:E,RequestRangeNotSatisfiable:E,417:S,ExpectationFailed:S,500:x,InternalServerError:x,501:k,NotImplemented:k,502:C,BadGateway:C,503:A,ServiceUnavailable:A,504:N,GatewayTimeout:N,505:I,HttpVersionNotSupported:I,select:function(t){if(void 0===t||null===t)return e;t=t.statusCode||t;var n=e[t];return n||(t=t.toString().split(\"\").shift()+\"00\",t=parseInt(t,10),e[t]||e)}})}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.constructor.isBuffer(n)}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.constructor.isBuffer(n)}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.constructor.isBuffer(n)}", "function y(e){let t=R,n=D,r=j,s=v,i=M,o=B,a=_,u=new Uint8Array(x.slice(0,R)),d=E,c=E.slice(0,E.length),g=F,l=Y,p=e();return R=t,D=n,j=r,v=s,M=i,B=o,_=a,x=u,Y=l,E=d,E.splice(0,E.length,...c),F=g,P=new DataView(x.buffer,x.byteOffset,x.byteLength),p}", "function Generator() {} // 84", "function require() { return {}; }", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function Util() {}", "function n(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function lt(t,i){return t(i={exports:{}},i.exports),i.exports}", "function c(e,t,n){Array.isArray(e)?(n=t,t=e,e=void 0):\"string\"!=typeof e&&(n=e,e=t=void 0),t&&!Array.isArray(t)&&(n=t,t=void 0),t||(t=[\"require\",\"exports\",\"module\"]),\n//Set up properties for this module. If an ID, then use\n//internal cache. If no ID, then use the external variables\n//for this node module.\ne?\n//Put the module in deep freeze until there is a\n//require call for it.\nd[e]=[e,t,n]:l(e,t,n)}", "private public function m246() {}", "function t(e){return!!e.constructor&&'function'==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function universalModule() {\n\t\t var $Object = Object;\n\n\t\tfunction createClass(ctor, methods, staticMethods, superClass) {\n\t\t var proto;\n\t\t if (superClass) {\n\t\t var superProto = superClass.prototype;\n\t\t proto = $Object.create(superProto);\n\t\t } else {\n\t\t proto = ctor.prototype;\n\t\t }\n\t\t $Object.keys(methods).forEach(function (key) {\n\t\t proto[key] = methods[key];\n\t\t });\n\t\t $Object.keys(staticMethods).forEach(function (key) {\n\t\t ctor[key] = staticMethods[key];\n\t\t });\n\t\t proto.constructor = ctor;\n\t\t ctor.prototype = proto;\n\t\t return ctor;\n\t\t}\n\n\t\tfunction superCall(self, proto, name, args) {\n\t\t return $Object.getPrototypeOf(proto)[name].apply(self, args);\n\t\t}\n\n\t\tfunction defaultSuperCall(self, proto, args) {\n\t\t superCall(self, proto, 'constructor', args);\n\t\t}\n\n\t\tvar $traceurRuntime = {};\n\t\t$traceurRuntime.createClass = createClass;\n\t\t$traceurRuntime.superCall = superCall;\n\t\t$traceurRuntime.defaultSuperCall = defaultSuperCall;\n\t\t\"use strict\";\n\t\tfunction is(valueA, valueB) {\n\t\t if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {\n\t\t return true;\n\t\t }\n\t\t if (!valueA || !valueB) {\n\t\t return false;\n\t\t }\n\t\t if (typeof valueA.valueOf === 'function' && typeof valueB.valueOf === 'function') {\n\t\t valueA = valueA.valueOf();\n\t\t valueB = valueB.valueOf();\n\t\t }\n\t\t return typeof valueA.equals === 'function' && typeof valueB.equals === 'function' ? valueA.equals(valueB) : valueA === valueB || (valueA !== valueA && valueB !== valueB);\n\t\t}\n\t\tfunction invariant(condition, error) {\n\t\t if (!condition)\n\t\t throw new Error(error);\n\t\t}\n\t\tvar DELETE = 'delete';\n\t\tvar SHIFT = 5;\n\t\tvar SIZE = 1 << SHIFT;\n\t\tvar MASK = SIZE - 1;\n\t\tvar NOT_SET = {};\n\t\tvar CHANGE_LENGTH = {value: false};\n\t\tvar DID_ALTER = {value: false};\n\t\tfunction MakeRef(ref) {\n\t\t ref.value = false;\n\t\t return ref;\n\t\t}\n\t\tfunction SetRef(ref) {\n\t\t ref && (ref.value = true);\n\t\t}\n\t\tfunction OwnerID() {}\n\t\tfunction arrCopy(arr, offset) {\n\t\t offset = offset || 0;\n\t\t var len = Math.max(0, arr.length - offset);\n\t\t var newArr = new Array(len);\n\t\t for (var ii = 0; ii < len; ii++) {\n\t\t newArr[ii] = arr[ii + offset];\n\t\t }\n\t\t return newArr;\n\t\t}\n\t\tfunction assertNotInfinite(size) {\n\t\t invariant(size !== Infinity, 'Cannot perform this action with an infinite size.');\n\t\t}\n\t\tfunction ensureSize(iter) {\n\t\t if (iter.size === undefined) {\n\t\t iter.size = iter.__iterate(returnTrue);\n\t\t }\n\t\t return iter.size;\n\t\t}\n\t\tfunction wrapIndex(iter, index) {\n\t\t return index >= 0 ? (+index) : ensureSize(iter) + (+index);\n\t\t}\n\t\tfunction returnTrue() {\n\t\t return true;\n\t\t}\n\t\tfunction wholeSlice(begin, end, size) {\n\t\t return (begin === 0 || (size !== undefined && begin <= -size)) && (end === undefined || (size !== undefined && end >= size));\n\t\t}\n\t\tfunction resolveBegin(begin, size) {\n\t\t return resolveIndex(begin, size, 0);\n\t\t}\n\t\tfunction resolveEnd(end, size) {\n\t\t return resolveIndex(end, size, size);\n\t\t}\n\t\tfunction resolveIndex(index, size, defaultIndex) {\n\t\t return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index);\n\t\t}\n\t\tvar imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) {\n\t\t a = a | 0;\n\t\t b = b | 0;\n\t\t var c = a & 0xffff;\n\t\t var d = b & 0xffff;\n\t\t return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0;\n\t\t};\n\t\tfunction smi(i32) {\n\t\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t\t}\n\t\tfunction hash(o) {\n\t\t if (o === false || o === null || o === undefined) {\n\t\t return 0;\n\t\t }\n\t\t if (typeof o.valueOf === 'function') {\n\t\t o = o.valueOf();\n\t\t if (o === false || o === null || o === undefined) {\n\t\t return 0;\n\t\t }\n\t\t }\n\t\t if (o === true) {\n\t\t return 1;\n\t\t }\n\t\t var type = typeof o;\n\t\t if (type === 'number') {\n\t\t var h = o | 0;\n\t\t while (o > 0xFFFFFFFF) {\n\t\t o /= 0xFFFFFFFF;\n\t\t h ^= o;\n\t\t }\n\t\t return smi(h);\n\t\t }\n\t\t if (type === 'string') {\n\t\t return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n\t\t }\n\t\t if (typeof o.hashCode === 'function') {\n\t\t return o.hashCode();\n\t\t }\n\t\t return hashJSObj(o);\n\t\t}\n\t\tfunction cachedHashString(string) {\n\t\t var hash = stringHashCache[string];\n\t\t if (hash === undefined) {\n\t\t hash = hashString(string);\n\t\t if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n\t\t STRING_HASH_CACHE_SIZE = 0;\n\t\t stringHashCache = {};\n\t\t }\n\t\t STRING_HASH_CACHE_SIZE++;\n\t\t stringHashCache[string] = hash;\n\t\t }\n\t\t return hash;\n\t\t}\n\t\tfunction hashString(string) {\n\t\t var hash = 0;\n\t\t for (var ii = 0; ii < string.length; ii++) {\n\t\t hash = 31 * hash + string.charCodeAt(ii) | 0;\n\t\t }\n\t\t return smi(hash);\n\t\t}\n\t\tfunction hashJSObj(obj) {\n\t\t var hash = weakMap && weakMap.get(obj);\n\t\t if (hash)\n\t\t return hash;\n\t\t hash = obj[UID_HASH_KEY];\n\t\t if (hash)\n\t\t return hash;\n\t\t if (!canDefineProperty) {\n\t\t hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n\t\t if (hash)\n\t\t return hash;\n\t\t hash = getIENodeHash(obj);\n\t\t if (hash)\n\t\t return hash;\n\t\t }\n\t\t if (Object.isExtensible && !Object.isExtensible(obj)) {\n\t\t throw new Error('Non-extensible objects are not allowed as keys.');\n\t\t }\n\t\t hash = ++objHashUID;\n\t\t if (objHashUID & 0x40000000) {\n\t\t objHashUID = 0;\n\t\t }\n\t\t if (weakMap) {\n\t\t weakMap.set(obj, hash);\n\t\t } else if (canDefineProperty) {\n\t\t Object.defineProperty(obj, UID_HASH_KEY, {\n\t\t 'enumerable': false,\n\t\t 'configurable': false,\n\t\t 'writable': false,\n\t\t 'value': hash\n\t\t });\n\t\t } else if (obj.propertyIsEnumerable && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n\t\t obj.propertyIsEnumerable = function() {\n\t\t return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n\t\t };\n\t\t obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n\t\t } else if (obj.nodeType) {\n\t\t obj[UID_HASH_KEY] = hash;\n\t\t } else {\n\t\t throw new Error('Unable to set a non-enumerable property on object.');\n\t\t }\n\t\t return hash;\n\t\t}\n\t\tvar canDefineProperty = (function() {\n\t\t try {\n\t\t Object.defineProperty({}, 'x', {});\n\t\t return true;\n\t\t } catch (e) {\n\t\t return false;\n\t\t }\n\t\t}());\n\t\tfunction getIENodeHash(node) {\n\t\t if (node && node.nodeType > 0) {\n\t\t switch (node.nodeType) {\n\t\t case 1:\n\t\t return node.uniqueID;\n\t\t case 9:\n\t\t return node.documentElement && node.documentElement.uniqueID;\n\t\t }\n\t\t }\n\t\t}\n\t\tvar weakMap = typeof WeakMap === 'function' && new WeakMap();\n\t\tvar objHashUID = 0;\n\t\tvar UID_HASH_KEY = '__immutablehash__';\n\t\tif (typeof Symbol === 'function') {\n\t\t UID_HASH_KEY = Symbol(UID_HASH_KEY);\n\t\t}\n\t\tvar STRING_HASH_CACHE_MIN_STRLEN = 16;\n\t\tvar STRING_HASH_CACHE_MAX_SIZE = 255;\n\t\tvar STRING_HASH_CACHE_SIZE = 0;\n\t\tvar stringHashCache = {};\n\t\tvar ITERATE_KEYS = 0;\n\t\tvar ITERATE_VALUES = 1;\n\t\tvar ITERATE_ENTRIES = 2;\n\t\tvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\t\tvar REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n\t\tvar ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\t\tvar Iterator = function Iterator(next) {\n\t\t this.next = next;\n\t\t};\n\t\t($traceurRuntime.createClass)(Iterator, {toString: function() {\n\t\t return '[Iterator]';\n\t\t }}, {});\n\t\tIterator.KEYS = ITERATE_KEYS;\n\t\tIterator.VALUES = ITERATE_VALUES;\n\t\tIterator.ENTRIES = ITERATE_ENTRIES;\n\t\tvar IteratorPrototype = Iterator.prototype;\n\t\tIteratorPrototype.inspect = IteratorPrototype.toSource = function() {\n\t\t return this.toString();\n\t\t};\n\t\tIteratorPrototype[ITERATOR_SYMBOL] = function() {\n\t\t return this;\n\t\t};\n\t\tfunction iteratorValue(type, k, v, iteratorResult) {\n\t\t var value = type === 0 ? k : type === 1 ? v : [k, v];\n\t\t iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {\n\t\t value: value,\n\t\t done: false\n\t\t });\n\t\t return iteratorResult;\n\t\t}\n\t\tfunction iteratorDone() {\n\t\t return {\n\t\t value: undefined,\n\t\t done: true\n\t\t };\n\t\t}\n\t\tfunction hasIterator(maybeIterable) {\n\t\t return !!_iteratorFn(maybeIterable);\n\t\t}\n\t\tfunction isIterator(maybeIterator) {\n\t\t return maybeIterator && typeof maybeIterator.next === 'function';\n\t\t}\n\t\tfunction getIterator(iterable) {\n\t\t var iteratorFn = _iteratorFn(iterable);\n\t\t return iteratorFn && iteratorFn.call(iterable);\n\t\t}\n\t\tfunction _iteratorFn(iterable) {\n\t\t var iteratorFn = iterable && ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL]);\n\t\t if (typeof iteratorFn === 'function') {\n\t\t return iteratorFn;\n\t\t }\n\t\t}\n\t\tvar Iterable = function Iterable(value) {\n\t\t return isIterable(value) ? value : Seq(value);\n\t\t};\n\t\tvar $Iterable = Iterable;\n\t\t($traceurRuntime.createClass)(Iterable, {\n\t\t toArray: function() {\n\t\t assertNotInfinite(this.size);\n\t\t var array = new Array(this.size || 0);\n\t\t this.valueSeq().__iterate((function(v, i) {\n\t\t array[i] = v;\n\t\t }));\n\t\t return array;\n\t\t },\n\t\t toIndexedSeq: function() {\n\t\t return new ToIndexedSequence(this);\n\t\t },\n\t\t toJS: function() {\n\t\t return this.toSeq().map((function(value) {\n\t\t return value && typeof value.toJS === 'function' ? value.toJS() : value;\n\t\t })).__toJS();\n\t\t },\n\t\t toKeyedSeq: function() {\n\t\t return new ToKeyedSequence(this, true);\n\t\t },\n\t\t toMap: function() {\n\t\t return Map(this.toKeyedSeq());\n\t\t },\n\t\t toObject: function() {\n\t\t assertNotInfinite(this.size);\n\t\t var object = {};\n\t\t this.__iterate((function(v, k) {\n\t\t object[k] = v;\n\t\t }));\n\t\t return object;\n\t\t },\n\t\t toOrderedMap: function() {\n\t\t return OrderedMap(this.toKeyedSeq());\n\t\t },\n\t\t toOrderedSet: function() {\n\t\t return OrderedSet(isKeyed(this) ? this.valueSeq() : this);\n\t\t },\n\t\t toSet: function() {\n\t\t return Set(isKeyed(this) ? this.valueSeq() : this);\n\t\t },\n\t\t toSetSeq: function() {\n\t\t return new ToSetSequence(this);\n\t\t },\n\t\t toSeq: function() {\n\t\t return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();\n\t\t },\n\t\t toStack: function() {\n\t\t return Stack(isKeyed(this) ? this.valueSeq() : this);\n\t\t },\n\t\t toList: function() {\n\t\t return List(isKeyed(this) ? this.valueSeq() : this);\n\t\t },\n\t\t toString: function() {\n\t\t return '[Iterable]';\n\t\t },\n\t\t __toString: function(head, tail) {\n\t\t if (this.size === 0) {\n\t\t return head + tail;\n\t\t }\n\t\t return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n\t\t },\n\t\t concat: function() {\n\t\t for (var values = [],\n\t\t $__2 = 0; $__2 < arguments.length; $__2++)\n\t\t values[$__2] = arguments[$__2];\n\t\t return reify(this, concatFactory(this, values));\n\t\t },\n\t\t contains: function(searchValue) {\n\t\t return this.some((function(value) {\n\t\t return is(value, searchValue);\n\t\t }));\n\t\t },\n\t\t entries: function() {\n\t\t return this.__iterator(ITERATE_ENTRIES);\n\t\t },\n\t\t every: function(predicate, context) {\n\t\t assertNotInfinite(this.size);\n\t\t var returnValue = true;\n\t\t this.__iterate((function(v, k, c) {\n\t\t if (!predicate.call(context, v, k, c)) {\n\t\t returnValue = false;\n\t\t return false;\n\t\t }\n\t\t }));\n\t\t return returnValue;\n\t\t },\n\t\t filter: function(predicate, context) {\n\t\t return reify(this, filterFactory(this, predicate, context, true));\n\t\t },\n\t\t find: function(predicate, context, notSetValue) {\n\t\t var foundValue = notSetValue;\n\t\t this.__iterate((function(v, k, c) {\n\t\t if (predicate.call(context, v, k, c)) {\n\t\t foundValue = v;\n\t\t return false;\n\t\t }\n\t\t }));\n\t\t return foundValue;\n\t\t },\n\t\t forEach: function(sideEffect, context) {\n\t\t assertNotInfinite(this.size);\n\t\t return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n\t\t },\n\t\t join: function(separator) {\n\t\t assertNotInfinite(this.size);\n\t\t separator = separator !== undefined ? '' + separator : ',';\n\t\t var joined = '';\n\t\t var isFirst = true;\n\t\t this.__iterate((function(v) {\n\t\t isFirst ? (isFirst = false) : (joined += separator);\n\t\t joined += v !== null && v !== undefined ? v : '';\n\t\t }));\n\t\t return joined;\n\t\t },\n\t\t keys: function() {\n\t\t return this.__iterator(ITERATE_KEYS);\n\t\t },\n\t\t map: function(mapper, context) {\n\t\t return reify(this, mapFactory(this, mapper, context));\n\t\t },\n\t\t reduce: function(reducer, initialReduction, context) {\n\t\t assertNotInfinite(this.size);\n\t\t var reduction;\n\t\t var useFirst;\n\t\t if (arguments.length < 2) {\n\t\t useFirst = true;\n\t\t } else {\n\t\t reduction = initialReduction;\n\t\t }\n\t\t this.__iterate((function(v, k, c) {\n\t\t if (useFirst) {\n\t\t useFirst = false;\n\t\t reduction = v;\n\t\t } else {\n\t\t reduction = reducer.call(context, reduction, v, k, c);\n\t\t }\n\t\t }));\n\t\t return reduction;\n\t\t },\n\t\t reduceRight: function(reducer, initialReduction, context) {\n\t\t var reversed = this.toKeyedSeq().reverse();\n\t\t return reversed.reduce.apply(reversed, arguments);\n\t\t },\n\t\t reverse: function() {\n\t\t return reify(this, reverseFactory(this, true));\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t if (wholeSlice(begin, end, this.size)) {\n\t\t return this;\n\t\t }\n\t\t var resolvedBegin = resolveBegin(begin, this.size);\n\t\t var resolvedEnd = resolveEnd(end, this.size);\n\t\t if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n\t\t return this.toSeq().cacheResult().slice(begin, end);\n\t\t }\n\t\t var skipped = resolvedBegin === 0 ? this : this.skip(resolvedBegin);\n\t\t return reify(this, resolvedEnd === undefined || resolvedEnd === this.size ? skipped : skipped.take(resolvedEnd - resolvedBegin));\n\t\t },\n\t\t some: function(predicate, context) {\n\t\t return !this.every(not(predicate), context);\n\t\t },\n\t\t sort: function(comparator) {\n\t\t return reify(this, sortFactory(this, comparator));\n\t\t },\n\t\t values: function() {\n\t\t return this.__iterator(ITERATE_VALUES);\n\t\t },\n\t\t butLast: function() {\n\t\t return this.slice(0, -1);\n\t\t },\n\t\t count: function(predicate, context) {\n\t\t return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);\n\t\t },\n\t\t countBy: function(grouper, context) {\n\t\t return countByFactory(this, grouper, context);\n\t\t },\n\t\t equals: function(other) {\n\t\t return deepEqual(this, other);\n\t\t },\n\t\t entrySeq: function() {\n\t\t var iterable = this;\n\t\t if (iterable._cache) {\n\t\t return new ArraySeq(iterable._cache);\n\t\t }\n\t\t var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();\n\t\t entriesSequence.fromEntrySeq = (function() {\n\t\t return iterable.toSeq();\n\t\t });\n\t\t return entriesSequence;\n\t\t },\n\t\t filterNot: function(predicate, context) {\n\t\t return this.filter(not(predicate), context);\n\t\t },\n\t\t findLast: function(predicate, context, notSetValue) {\n\t\t return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n\t\t },\n\t\t first: function() {\n\t\t return this.find(returnTrue);\n\t\t },\n\t\t flatMap: function(mapper, context) {\n\t\t return reify(this, flatMapFactory(this, mapper, context));\n\t\t },\n\t\t flatten: function(depth) {\n\t\t return reify(this, flattenFactory(this, depth, true));\n\t\t },\n\t\t fromEntrySeq: function() {\n\t\t return new FromEntriesSequence(this);\n\t\t },\n\t\t get: function(searchKey, notSetValue) {\n\t\t return this.find((function(_, key) {\n\t\t return is(key, searchKey);\n\t\t }), undefined, notSetValue);\n\t\t },\n\t\t getIn: function(searchKeyPath, notSetValue) {\n\t\t var nested = this;\n\t\t if (searchKeyPath) {\n\t\t var iter = getIterator(searchKeyPath) || getIterator($Iterable(searchKeyPath));\n\t\t var step;\n\t\t while (!(step = iter.next()).done) {\n\t\t var key = step.value;\n\t\t nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;\n\t\t if (nested === NOT_SET) {\n\t\t return notSetValue;\n\t\t }\n\t\t }\n\t\t }\n\t\t return nested;\n\t\t },\n\t\t groupBy: function(grouper, context) {\n\t\t return groupByFactory(this, grouper, context);\n\t\t },\n\t\t has: function(searchKey) {\n\t\t return this.get(searchKey, NOT_SET) !== NOT_SET;\n\t\t },\n\t\t hasIn: function(searchKeyPath) {\n\t\t return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;\n\t\t },\n\t\t isSubset: function(iter) {\n\t\t iter = typeof iter.contains === 'function' ? iter : $Iterable(iter);\n\t\t return this.every((function(value) {\n\t\t return iter.contains(value);\n\t\t }));\n\t\t },\n\t\t isSuperset: function(iter) {\n\t\t return iter.isSubset(this);\n\t\t },\n\t\t keySeq: function() {\n\t\t return this.toSeq().map(keyMapper).toIndexedSeq();\n\t\t },\n\t\t last: function() {\n\t\t return this.toSeq().reverse().first();\n\t\t },\n\t\t max: function(comparator) {\n\t\t return maxFactory(this, comparator);\n\t\t },\n\t\t maxBy: function(mapper, comparator) {\n\t\t return maxFactory(this, comparator, mapper);\n\t\t },\n\t\t min: function(comparator) {\n\t\t return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);\n\t\t },\n\t\t minBy: function(mapper, comparator) {\n\t\t return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);\n\t\t },\n\t\t rest: function() {\n\t\t return this.slice(1);\n\t\t },\n\t\t skip: function(amount) {\n\t\t return reify(this, skipFactory(this, amount, true));\n\t\t },\n\t\t skipLast: function(amount) {\n\t\t return reify(this, this.toSeq().reverse().skip(amount).reverse());\n\t\t },\n\t\t skipWhile: function(predicate, context) {\n\t\t return reify(this, skipWhileFactory(this, predicate, context, true));\n\t\t },\n\t\t skipUntil: function(predicate, context) {\n\t\t return this.skipWhile(not(predicate), context);\n\t\t },\n\t\t sortBy: function(mapper, comparator) {\n\t\t return reify(this, sortFactory(this, comparator, mapper));\n\t\t },\n\t\t take: function(amount) {\n\t\t return reify(this, takeFactory(this, amount));\n\t\t },\n\t\t takeLast: function(amount) {\n\t\t return reify(this, this.toSeq().reverse().take(amount).reverse());\n\t\t },\n\t\t takeWhile: function(predicate, context) {\n\t\t return reify(this, takeWhileFactory(this, predicate, context));\n\t\t },\n\t\t takeUntil: function(predicate, context) {\n\t\t return this.takeWhile(not(predicate), context);\n\t\t },\n\t\t valueSeq: function() {\n\t\t return this.toIndexedSeq();\n\t\t },\n\t\t hashCode: function() {\n\t\t return this.__hash || (this.__hash = hashIterable(this));\n\t\t }\n\t\t}, {});\n\t\tvar IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n\t\tvar IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n\t\tvar IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n\t\tvar IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\n\t\tvar IterablePrototype = Iterable.prototype;\n\t\tIterablePrototype[IS_ITERABLE_SENTINEL] = true;\n\t\tIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;\n\t\tIterablePrototype.toJSON = IterablePrototype.toJS;\n\t\tIterablePrototype.__toJS = IterablePrototype.toArray;\n\t\tIterablePrototype.__toStringMapper = quoteString;\n\t\tIterablePrototype.inspect = IterablePrototype.toSource = function() {\n\t\t return this.toString();\n\t\t};\n\t\tIterablePrototype.chain = IterablePrototype.flatMap;\n\t\t(function() {\n\t\t try {\n\t\t Object.defineProperty(IterablePrototype, 'length', {get: function() {\n\t\t if (!Iterable.noLengthWarning) {\n\t\t var stack;\n\t\t try {\n\t\t throw new Error();\n\t\t } catch (error) {\n\t\t stack = error.stack;\n\t\t }\n\t\t if (stack.indexOf('_wrapObject') === -1) {\n\t\t console && console.warn && console.warn('iterable.length has been deprecated, ' + 'use iterable.size or iterable.count(). ' + 'This warning will become a silent error in a future version. ' + stack);\n\t\t return this.size;\n\t\t }\n\t\t }\n\t\t }});\n\t\t } catch (e) {}\n\t\t})();\n\t\tvar KeyedIterable = function KeyedIterable(value) {\n\t\t return isKeyed(value) ? value : KeyedSeq(value);\n\t\t};\n\t\t($traceurRuntime.createClass)(KeyedIterable, {\n\t\t flip: function() {\n\t\t return reify(this, flipFactory(this));\n\t\t },\n\t\t findKey: function(predicate, context) {\n\t\t var foundKey;\n\t\t this.__iterate((function(v, k, c) {\n\t\t if (predicate.call(context, v, k, c)) {\n\t\t foundKey = k;\n\t\t return false;\n\t\t }\n\t\t }));\n\t\t return foundKey;\n\t\t },\n\t\t findLastKey: function(predicate, context) {\n\t\t return this.toSeq().reverse().findKey(predicate, context);\n\t\t },\n\t\t keyOf: function(searchValue) {\n\t\t return this.findKey((function(value) {\n\t\t return is(value, searchValue);\n\t\t }));\n\t\t },\n\t\t lastKeyOf: function(searchValue) {\n\t\t return this.toSeq().reverse().keyOf(searchValue);\n\t\t },\n\t\t mapEntries: function(mapper, context) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t return reify(this, this.toSeq().map((function(v, k) {\n\t\t return mapper.call(context, [k, v], iterations++, $__0);\n\t\t })).fromEntrySeq());\n\t\t },\n\t\t mapKeys: function(mapper, context) {\n\t\t var $__0 = this;\n\t\t return reify(this, this.toSeq().flip().map((function(k, v) {\n\t\t return mapper.call(context, k, v, $__0);\n\t\t })).flip());\n\t\t }\n\t\t}, {}, Iterable);\n\t\tvar KeyedIterablePrototype = KeyedIterable.prototype;\n\t\tKeyedIterablePrototype[IS_KEYED_SENTINEL] = true;\n\t\tKeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;\n\t\tKeyedIterablePrototype.__toJS = IterablePrototype.toObject;\n\t\tKeyedIterablePrototype.__toStringMapper = (function(v, k) {\n\t\t return k + ': ' + quoteString(v);\n\t\t});\n\t\tvar IndexedIterable = function IndexedIterable(value) {\n\t\t return isIndexed(value) ? value : IndexedSeq(value);\n\t\t};\n\t\t($traceurRuntime.createClass)(IndexedIterable, {\n\t\t toKeyedSeq: function() {\n\t\t return new ToKeyedSequence(this, false);\n\t\t },\n\t\t filter: function(predicate, context) {\n\t\t return reify(this, filterFactory(this, predicate, context, false));\n\t\t },\n\t\t findIndex: function(predicate, context) {\n\t\t var key = this.toKeyedSeq().findKey(predicate, context);\n\t\t return key === undefined ? -1 : key;\n\t\t },\n\t\t indexOf: function(searchValue) {\n\t\t var key = this.toKeyedSeq().keyOf(searchValue);\n\t\t return key === undefined ? -1 : key;\n\t\t },\n\t\t lastIndexOf: function(searchValue) {\n\t\t var key = this.toKeyedSeq().lastKeyOf(searchValue);\n\t\t return key === undefined ? -1 : key;\n\t\t },\n\t\t reverse: function() {\n\t\t return reify(this, reverseFactory(this, false));\n\t\t },\n\t\t splice: function(index, removeNum) {\n\t\t var numArgs = arguments.length;\n\t\t removeNum = Math.max(removeNum | 0, 0);\n\t\t if (numArgs === 0 || (numArgs === 2 && !removeNum)) {\n\t\t return this;\n\t\t }\n\t\t index = resolveBegin(index, this.size);\n\t\t var spliced = this.slice(0, index);\n\t\t return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));\n\t\t },\n\t\t findLastIndex: function(predicate, context) {\n\t\t var key = this.toKeyedSeq().findLastKey(predicate, context);\n\t\t return key === undefined ? -1 : key;\n\t\t },\n\t\t first: function() {\n\t\t return this.get(0);\n\t\t },\n\t\t flatten: function(depth) {\n\t\t return reify(this, flattenFactory(this, depth, false));\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t index = wrapIndex(this, index);\n\t\t return (index < 0 || (this.size === Infinity || (this.size !== undefined && index > this.size))) ? notSetValue : this.find((function(_, key) {\n\t\t return key === index;\n\t\t }), undefined, notSetValue);\n\t\t },\n\t\t has: function(index) {\n\t\t index = wrapIndex(this, index);\n\t\t return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1);\n\t\t },\n\t\t interpose: function(separator) {\n\t\t return reify(this, interposeFactory(this, separator));\n\t\t },\n\t\t last: function() {\n\t\t return this.get(-1);\n\t\t },\n\t\t skip: function(amount) {\n\t\t var iter = this;\n\t\t var skipSeq = skipFactory(iter, amount, false);\n\t\t if (isSeq(iter) && skipSeq !== iter) {\n\t\t skipSeq.get = function(index, notSetValue) {\n\t\t index = wrapIndex(this, index);\n\t\t return index >= 0 ? iter.get(index + amount, notSetValue) : notSetValue;\n\t\t };\n\t\t }\n\t\t return reify(this, skipSeq);\n\t\t },\n\t\t skipWhile: function(predicate, context) {\n\t\t return reify(this, skipWhileFactory(this, predicate, context, false));\n\t\t },\n\t\t take: function(amount) {\n\t\t var iter = this;\n\t\t var takeSeq = takeFactory(iter, amount);\n\t\t if (isSeq(iter) && takeSeq !== iter) {\n\t\t takeSeq.get = function(index, notSetValue) {\n\t\t index = wrapIndex(this, index);\n\t\t return index >= 0 && index < amount ? iter.get(index, notSetValue) : notSetValue;\n\t\t };\n\t\t }\n\t\t return reify(this, takeSeq);\n\t\t }\n\t\t}, {}, Iterable);\n\t\tIndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;\n\t\tIndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;\n\t\tvar SetIterable = function SetIterable(value) {\n\t\t return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);\n\t\t};\n\t\t($traceurRuntime.createClass)(SetIterable, {\n\t\t get: function(value, notSetValue) {\n\t\t return this.has(value) ? value : notSetValue;\n\t\t },\n\t\t contains: function(value) {\n\t\t return this.has(value);\n\t\t },\n\t\t keySeq: function() {\n\t\t return this.valueSeq();\n\t\t }\n\t\t}, {}, Iterable);\n\t\tSetIterable.prototype.has = IterablePrototype.contains;\n\t\tfunction isIterable(maybeIterable) {\n\t\t return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);\n\t\t}\n\t\tfunction isKeyed(maybeKeyed) {\n\t\t return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);\n\t\t}\n\t\tfunction isIndexed(maybeIndexed) {\n\t\t return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);\n\t\t}\n\t\tfunction isAssociative(maybeAssociative) {\n\t\t return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n\t\t}\n\t\tfunction isOrdered(maybeOrdered) {\n\t\t return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);\n\t\t}\n\t\tIterable.isIterable = isIterable;\n\t\tIterable.isKeyed = isKeyed;\n\t\tIterable.isIndexed = isIndexed;\n\t\tIterable.isAssociative = isAssociative;\n\t\tIterable.isOrdered = isOrdered;\n\t\tIterable.Keyed = KeyedIterable;\n\t\tIterable.Indexed = IndexedIterable;\n\t\tIterable.Set = SetIterable;\n\t\tIterable.Iterator = Iterator;\n\t\tfunction keyMapper(v, k) {\n\t\t return k;\n\t\t}\n\t\tfunction entryMapper(v, k) {\n\t\t return [k, v];\n\t\t}\n\t\tfunction not(predicate) {\n\t\t return function() {\n\t\t return !predicate.apply(this, arguments);\n\t\t };\n\t\t}\n\t\tfunction neg(predicate) {\n\t\t return function() {\n\t\t return -predicate.apply(this, arguments);\n\t\t };\n\t\t}\n\t\tfunction quoteString(value) {\n\t\t return typeof value === 'string' ? JSON.stringify(value) : value;\n\t\t}\n\t\tfunction defaultNegComparator(a, b) {\n\t\t return a < b ? 1 : a > b ? -1 : 0;\n\t\t}\n\t\tfunction deepEqual(a, b) {\n\t\t if (a === b) {\n\t\t return true;\n\t\t }\n\t\t if (!isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) {\n\t\t return false;\n\t\t }\n\t\t if (a.size === 0 && b.size === 0) {\n\t\t return true;\n\t\t }\n\t\t var notAssociative = !isAssociative(a);\n\t\t if (isOrdered(a)) {\n\t\t var entries = a.entries();\n\t\t return b.every((function(v, k) {\n\t\t var entry = entries.next().value;\n\t\t return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));\n\t\t })) && entries.next().done;\n\t\t }\n\t\t var flipped = false;\n\t\t if (a.size === undefined) {\n\t\t if (b.size === undefined) {\n\t\t a.cacheResult();\n\t\t } else {\n\t\t flipped = true;\n\t\t var _ = a;\n\t\t a = b;\n\t\t b = _;\n\t\t }\n\t\t }\n\t\t var allEqual = true;\n\t\t var bSize = b.__iterate((function(v, k) {\n\t\t if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {\n\t\t allEqual = false;\n\t\t return false;\n\t\t }\n\t\t }));\n\t\t return allEqual && a.size === bSize;\n\t\t}\n\t\tfunction hashIterable(iterable) {\n\t\t if (iterable.size === Infinity) {\n\t\t return 0;\n\t\t }\n\t\t var ordered = isOrdered(iterable);\n\t\t var keyed = isKeyed(iterable);\n\t\t var h = ordered ? 1 : 0;\n\t\t var size = iterable.__iterate(keyed ? ordered ? (function(v, k) {\n\t\t h = 31 * h + hashMerge(hash(v), hash(k)) | 0;\n\t\t }) : (function(v, k) {\n\t\t h = h + hashMerge(hash(v), hash(k)) | 0;\n\t\t }) : ordered ? (function(v) {\n\t\t h = 31 * h + hash(v) | 0;\n\t\t }) : (function(v) {\n\t\t h = h + hash(v) | 0;\n\t\t }));\n\t\t return murmurHashOfSize(size, h);\n\t\t}\n\t\tfunction murmurHashOfSize(size, h) {\n\t\t h = imul(h, 0xCC9E2D51);\n\t\t h = imul(h << 15 | h >>> -15, 0x1B873593);\n\t\t h = imul(h << 13 | h >>> -13, 5);\n\t\t h = (h + 0xE6546B64 | 0) ^ size;\n\t\t h = imul(h ^ h >>> 16, 0x85EBCA6B);\n\t\t h = imul(h ^ h >>> 13, 0xC2B2AE35);\n\t\t h = smi(h ^ h >>> 16);\n\t\t return h;\n\t\t}\n\t\tfunction hashMerge(a, b) {\n\t\t return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0;\n\t\t}\n\t\tfunction mixin(ctor, methods) {\n\t\t var proto = ctor.prototype;\n\t\t var keyCopier = (function(key) {\n\t\t proto[key] = methods[key];\n\t\t });\n\t\t Object.keys(methods).forEach(keyCopier);\n\t\t Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n\t\t return ctor;\n\t\t}\n\t\tvar Seq = function Seq(value) {\n\t\t return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);\n\t\t};\n\t\tvar $Seq = Seq;\n\t\t($traceurRuntime.createClass)(Seq, {\n\t\t toSeq: function() {\n\t\t return this;\n\t\t },\n\t\t toString: function() {\n\t\t return this.__toString('Seq {', '}');\n\t\t },\n\t\t cacheResult: function() {\n\t\t if (!this._cache && this.__iterateUncached) {\n\t\t this._cache = this.entrySeq().toArray();\n\t\t this.size = this._cache.length;\n\t\t }\n\t\t return this;\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t return seqIterate(this, fn, reverse, true);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return seqIterator(this, type, reverse, true);\n\t\t }\n\t\t}, {of: function() {\n\t\t return $Seq(arguments);\n\t\t }}, Iterable);\n\t\tvar KeyedSeq = function KeyedSeq(value) {\n\t\t return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : keyedSeqFromValue(value);\n\t\t};\n\t\tvar $KeyedSeq = KeyedSeq;\n\t\t($traceurRuntime.createClass)(KeyedSeq, {\n\t\t toKeyedSeq: function() {\n\t\t return this;\n\t\t },\n\t\t toSeq: function() {\n\t\t return this;\n\t\t }\n\t\t}, {of: function() {\n\t\t return $KeyedSeq(arguments);\n\t\t }}, Seq);\n\t\tmixin(KeyedSeq, KeyedIterable.prototype);\n\t\tvar IndexedSeq = function IndexedSeq(value) {\n\t\t return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();\n\t\t};\n\t\tvar $IndexedSeq = IndexedSeq;\n\t\t($traceurRuntime.createClass)(IndexedSeq, {\n\t\t toIndexedSeq: function() {\n\t\t return this;\n\t\t },\n\t\t toString: function() {\n\t\t return this.__toString('Seq [', ']');\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t return seqIterate(this, fn, reverse, false);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return seqIterator(this, type, reverse, false);\n\t\t }\n\t\t}, {of: function() {\n\t\t return $IndexedSeq(arguments);\n\t\t }}, Seq);\n\t\tmixin(IndexedSeq, IndexedIterable.prototype);\n\t\tvar SetSeq = function SetSeq(value) {\n\t\t return (value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value).toSetSeq();\n\t\t};\n\t\tvar $SetSeq = SetSeq;\n\t\t($traceurRuntime.createClass)(SetSeq, {toSetSeq: function() {\n\t\t return this;\n\t\t }}, {of: function() {\n\t\t return $SetSeq(arguments);\n\t\t }}, Seq);\n\t\tmixin(SetSeq, SetIterable.prototype);\n\t\tSeq.isSeq = isSeq;\n\t\tSeq.Keyed = KeyedSeq;\n\t\tSeq.Set = SetSeq;\n\t\tSeq.Indexed = IndexedSeq;\n\t\tvar IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\n\t\tSeq.prototype[IS_SEQ_SENTINEL] = true;\n\t\tvar ArraySeq = function ArraySeq(array) {\n\t\t this._array = array;\n\t\t this.size = array.length;\n\t\t};\n\t\t($traceurRuntime.createClass)(ArraySeq, {\n\t\t get: function(index, notSetValue) {\n\t\t return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var array = this._array;\n\t\t var maxIndex = array.length - 1;\n\t\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t\t if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t }\n\t\t return ii;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var array = this._array;\n\t\t var maxIndex = array.length - 1;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);\n\t\t }));\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar ObjectSeq = function ObjectSeq(object) {\n\t\t var keys = Object.keys(object);\n\t\t this._object = object;\n\t\t this._keys = keys;\n\t\t this.size = keys.length;\n\t\t};\n\t\t($traceurRuntime.createClass)(ObjectSeq, {\n\t\t get: function(key, notSetValue) {\n\t\t if (notSetValue !== undefined && !this.has(key)) {\n\t\t return notSetValue;\n\t\t }\n\t\t return this._object[key];\n\t\t },\n\t\t has: function(key) {\n\t\t return this._object.hasOwnProperty(key);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var object = this._object;\n\t\t var keys = this._keys;\n\t\t var maxIndex = keys.length - 1;\n\t\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t\t var key = keys[reverse ? maxIndex - ii : ii];\n\t\t if (fn(object[key], key, this) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t }\n\t\t return ii;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var object = this._object;\n\t\t var keys = this._keys;\n\t\t var maxIndex = keys.length - 1;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t var key = keys[reverse ? maxIndex - ii : ii];\n\t\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);\n\t\t }));\n\t\t }\n\t\t}, {}, KeyedSeq);\n\t\tObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;\n\t\tvar IterableSeq = function IterableSeq(iterable) {\n\t\t this._iterable = iterable;\n\t\t this.size = iterable.length || iterable.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(IterableSeq, {\n\t\t __iterateUncached: function(fn, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var iterable = this._iterable;\n\t\t var iterator = getIterator(iterable);\n\t\t var iterations = 0;\n\t\t if (isIterator(iterator)) {\n\t\t var step;\n\t\t while (!(step = iterator.next()).done) {\n\t\t if (fn(step.value, iterations++, this) === false) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t }\n\t\t return iterations;\n\t\t },\n\t\t __iteratorUncached: function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterable = this._iterable;\n\t\t var iterator = getIterator(iterable);\n\t\t if (!isIterator(iterator)) {\n\t\t return new Iterator(iteratorDone);\n\t\t }\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t return step.done ? step : iteratorValue(type, iterations++, step.value);\n\t\t }));\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar IteratorSeq = function IteratorSeq(iterator) {\n\t\t this._iterator = iterator;\n\t\t this._iteratorCache = [];\n\t\t};\n\t\t($traceurRuntime.createClass)(IteratorSeq, {\n\t\t __iterateUncached: function(fn, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var iterator = this._iterator;\n\t\t var cache = this._iteratorCache;\n\t\t var iterations = 0;\n\t\t while (iterations < cache.length) {\n\t\t if (fn(cache[iterations], iterations++, this) === false) {\n\t\t return iterations;\n\t\t }\n\t\t }\n\t\t var step;\n\t\t while (!(step = iterator.next()).done) {\n\t\t var val = step.value;\n\t\t cache[iterations] = val;\n\t\t if (fn(val, iterations++, this) === false) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t return iterations;\n\t\t },\n\t\t __iteratorUncached: function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = this._iterator;\n\t\t var cache = this._iteratorCache;\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t if (iterations >= cache.length) {\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t cache[iterations] = step.value;\n\t\t }\n\t\t return iteratorValue(type, iterations, cache[iterations++]);\n\t\t }));\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tfunction isSeq(maybeSeq) {\n\t\t return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);\n\t\t}\n\t\tvar EMPTY_SEQ;\n\t\tfunction emptySequence() {\n\t\t return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n\t\t}\n\t\tfunction keyedSeqFromValue(value) {\n\t\t var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined;\n\t\t if (!seq) {\n\t\t throw new TypeError('Expected Array or iterable object of [k, v] entries, ' + 'or keyed object: ' + value);\n\t\t }\n\t\t return seq;\n\t\t}\n\t\tfunction indexedSeqFromValue(value) {\n\t\t var seq = maybeIndexedSeqFromValue(value);\n\t\t if (!seq) {\n\t\t throw new TypeError('Expected Array or iterable object of values: ' + value);\n\t\t }\n\t\t return seq;\n\t\t}\n\t\tfunction seqFromValue(value) {\n\t\t var seq = maybeIndexedSeqFromValue(value) || (typeof value === 'object' && new ObjectSeq(value));\n\t\t if (!seq) {\n\t\t throw new TypeError('Expected Array or iterable object of values, or keyed object: ' + value);\n\t\t }\n\t\t return seq;\n\t\t}\n\t\tfunction maybeIndexedSeqFromValue(value) {\n\t\t return (isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined);\n\t\t}\n\t\tfunction isArrayLike(value) {\n\t\t return value && typeof value.length === 'number';\n\t\t}\n\t\tfunction seqIterate(seq, fn, reverse, useKeys) {\n\t\t var cache = seq._cache;\n\t\t if (cache) {\n\t\t var maxIndex = cache.length - 1;\n\t\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t\t if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t }\n\t\t return ii;\n\t\t }\n\t\t return seq.__iterateUncached(fn, reverse);\n\t\t}\n\t\tfunction seqIterator(seq, type, reverse, useKeys) {\n\t\t var cache = seq._cache;\n\t\t if (cache) {\n\t\t var maxIndex = cache.length - 1;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n\t\t }));\n\t\t }\n\t\t return seq.__iteratorUncached(type, reverse);\n\t\t}\n\t\tfunction fromJS(json, converter) {\n\t\t return converter ? _fromJSWith(converter, json, '', {'': json}) : _fromJSDefault(json);\n\t\t}\n\t\tfunction _fromJSWith(converter, json, key, parentJSON) {\n\t\t if (Array.isArray(json)) {\n\t\t return converter.call(parentJSON, key, IndexedSeq(json).map((function(v, k) {\n\t\t return _fromJSWith(converter, v, k, json);\n\t\t })));\n\t\t }\n\t\t if (isPlainObj(json)) {\n\t\t return converter.call(parentJSON, key, KeyedSeq(json).map((function(v, k) {\n\t\t return _fromJSWith(converter, v, k, json);\n\t\t })));\n\t\t }\n\t\t return json;\n\t\t}\n\t\tfunction _fromJSDefault(json) {\n\t\t if (Array.isArray(json)) {\n\t\t return IndexedSeq(json).map(_fromJSDefault).toList();\n\t\t }\n\t\t if (isPlainObj(json)) {\n\t\t return KeyedSeq(json).map(_fromJSDefault).toMap();\n\t\t }\n\t\t return json;\n\t\t}\n\t\tfunction isPlainObj(value) {\n\t\t return value && value.constructor === Object;\n\t\t}\n\t\tvar Collection = function Collection() {\n\t\t throw TypeError('Abstract');\n\t\t};\n\t\t($traceurRuntime.createClass)(Collection, {}, {}, Iterable);\n\t\tvar KeyedCollection = function KeyedCollection() {\n\t\t $traceurRuntime.defaultSuperCall(this, $KeyedCollection.prototype, arguments);\n\t\t};\n\t\tvar $KeyedCollection = KeyedCollection;\n\t\t($traceurRuntime.createClass)(KeyedCollection, {}, {}, Collection);\n\t\tmixin(KeyedCollection, KeyedIterable.prototype);\n\t\tvar IndexedCollection = function IndexedCollection() {\n\t\t $traceurRuntime.defaultSuperCall(this, $IndexedCollection.prototype, arguments);\n\t\t};\n\t\tvar $IndexedCollection = IndexedCollection;\n\t\t($traceurRuntime.createClass)(IndexedCollection, {}, {}, Collection);\n\t\tmixin(IndexedCollection, IndexedIterable.prototype);\n\t\tvar SetCollection = function SetCollection() {\n\t\t $traceurRuntime.defaultSuperCall(this, $SetCollection.prototype, arguments);\n\t\t};\n\t\tvar $SetCollection = SetCollection;\n\t\t($traceurRuntime.createClass)(SetCollection, {}, {}, Collection);\n\t\tmixin(SetCollection, SetIterable.prototype);\n\t\tCollection.Keyed = KeyedCollection;\n\t\tCollection.Indexed = IndexedCollection;\n\t\tCollection.Set = SetCollection;\n\t\tvar Map = function Map(value) {\n\t\t return value === null || value === undefined ? emptyMap() : isMap(value) ? value : emptyMap().withMutations((function(map) {\n\t\t var iter = KeyedIterable(value);\n\t\t assertNotInfinite(iter.size);\n\t\t iter.forEach((function(v, k) {\n\t\t return map.set(k, v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(Map, {\n\t\t toString: function() {\n\t\t return this.__toString('Map {', '}');\n\t\t },\n\t\t get: function(k, notSetValue) {\n\t\t return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue;\n\t\t },\n\t\t set: function(k, v) {\n\t\t return updateMap(this, k, v);\n\t\t },\n\t\t setIn: function(keyPath, v) {\n\t\t return this.updateIn(keyPath, NOT_SET, (function() {\n\t\t return v;\n\t\t }));\n\t\t },\n\t\t remove: function(k) {\n\t\t return updateMap(this, k, NOT_SET);\n\t\t },\n\t\t deleteIn: function(keyPath) {\n\t\t return this.updateIn(keyPath, (function() {\n\t\t return NOT_SET;\n\t\t }));\n\t\t },\n\t\t update: function(k, notSetValue, updater) {\n\t\t return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater);\n\t\t },\n\t\t updateIn: function(keyPath, notSetValue, updater) {\n\t\t if (!updater) {\n\t\t updater = notSetValue;\n\t\t notSetValue = undefined;\n\t\t }\n\t\t var updatedValue = updateInDeepMap(this, getIterator(keyPath) || getIterator(Iterable(keyPath)), notSetValue, updater);\n\t\t return updatedValue === NOT_SET ? undefined : updatedValue;\n\t\t },\n\t\t clear: function() {\n\t\t if (this.size === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = 0;\n\t\t this._root = null;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return emptyMap();\n\t\t },\n\t\t merge: function() {\n\t\t return mergeIntoMapWith(this, undefined, arguments);\n\t\t },\n\t\t mergeWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__3 = 1; $__3 < arguments.length; $__3++)\n\t\t iters[$__3 - 1] = arguments[$__3];\n\t\t return mergeIntoMapWith(this, merger, iters);\n\t\t },\n\t\t mergeIn: function(keyPath) {\n\t\t for (var iters = [],\n\t\t $__4 = 1; $__4 < arguments.length; $__4++)\n\t\t iters[$__4 - 1] = arguments[$__4];\n\t\t return this.updateIn(keyPath, emptyMap(), (function(m) {\n\t\t return m.merge.apply(m, iters);\n\t\t }));\n\t\t },\n\t\t mergeDeep: function() {\n\t\t return mergeIntoMapWith(this, deepMerger(undefined), arguments);\n\t\t },\n\t\t mergeDeepWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__5 = 1; $__5 < arguments.length; $__5++)\n\t\t iters[$__5 - 1] = arguments[$__5];\n\t\t return mergeIntoMapWith(this, deepMerger(merger), iters);\n\t\t },\n\t\t mergeDeepIn: function(keyPath) {\n\t\t for (var iters = [],\n\t\t $__6 = 1; $__6 < arguments.length; $__6++)\n\t\t iters[$__6 - 1] = arguments[$__6];\n\t\t return this.updateIn(keyPath, emptyMap(), (function(m) {\n\t\t return m.mergeDeep.apply(m, iters);\n\t\t }));\n\t\t },\n\t\t sort: function(comparator) {\n\t\t return OrderedMap(sortFactory(this, comparator));\n\t\t },\n\t\t sortBy: function(mapper, comparator) {\n\t\t return OrderedMap(sortFactory(this, comparator, mapper));\n\t\t },\n\t\t withMutations: function(fn) {\n\t\t var mutable = this.asMutable();\n\t\t fn(mutable);\n\t\t return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n\t\t },\n\t\t asMutable: function() {\n\t\t return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n\t\t },\n\t\t asImmutable: function() {\n\t\t return this.__ensureOwner();\n\t\t },\n\t\t wasAltered: function() {\n\t\t return this.__altered;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return new MapIterator(this, type, reverse);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t this._root && this._root.iterate((function(entry) {\n\t\t iterations++;\n\t\t return fn(entry[1], entry[0], $__0);\n\t\t }), reverse);\n\t\t return iterations;\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this.__altered = false;\n\t\t return this;\n\t\t }\n\t\t return makeMap(this.size, this._root, ownerID, this.__hash);\n\t\t }\n\t\t}, {}, KeyedCollection);\n\t\tfunction isMap(maybeMap) {\n\t\t return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);\n\t\t}\n\t\tMap.isMap = isMap;\n\t\tvar IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\n\t\tvar MapPrototype = Map.prototype;\n\t\tMapPrototype[IS_MAP_SENTINEL] = true;\n\t\tMapPrototype[DELETE] = MapPrototype.remove;\n\t\tMapPrototype.removeIn = MapPrototype.deleteIn;\n\t\tvar ArrayMapNode = function ArrayMapNode(ownerID, entries) {\n\t\t this.ownerID = ownerID;\n\t\t this.entries = entries;\n\t\t};\n\t\tvar $ArrayMapNode = ArrayMapNode;\n\t\t($traceurRuntime.createClass)(ArrayMapNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t var entries = this.entries;\n\t\t for (var ii = 0,\n\t\t len = entries.length; ii < len; ii++) {\n\t\t if (is(key, entries[ii][0])) {\n\t\t return entries[ii][1];\n\t\t }\n\t\t }\n\t\t return notSetValue;\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t var removed = value === NOT_SET;\n\t\t var entries = this.entries;\n\t\t var idx = 0;\n\t\t for (var len = entries.length; idx < len; idx++) {\n\t\t if (is(key, entries[idx][0])) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t var exists = idx < len;\n\t\t if (exists ? entries[idx][1] === value : removed) {\n\t\t return this;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t (removed || !exists) && SetRef(didChangeSize);\n\t\t if (removed && entries.length === 1) {\n\t\t return;\n\t\t }\n\t\t if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {\n\t\t return createNodes(ownerID, entries, key, value);\n\t\t }\n\t\t var isEditable = ownerID && ownerID === this.ownerID;\n\t\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t\t if (exists) {\n\t\t if (removed) {\n\t\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t\t } else {\n\t\t newEntries[idx] = [key, value];\n\t\t }\n\t\t } else {\n\t\t newEntries.push([key, value]);\n\t\t }\n\t\t if (isEditable) {\n\t\t this.entries = newEntries;\n\t\t return this;\n\t\t }\n\t\t return new $ArrayMapNode(ownerID, newEntries);\n\t\t }\n\t\t}, {});\n\t\tvar BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) {\n\t\t this.ownerID = ownerID;\n\t\t this.bitmap = bitmap;\n\t\t this.nodes = nodes;\n\t\t};\n\t\tvar $BitmapIndexedNode = BitmapIndexedNode;\n\t\t($traceurRuntime.createClass)(BitmapIndexedNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));\n\t\t var bitmap = this.bitmap;\n\t\t return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t\t var bit = 1 << keyHashFrag;\n\t\t var bitmap = this.bitmap;\n\t\t var exists = (bitmap & bit) !== 0;\n\t\t if (!exists && value === NOT_SET) {\n\t\t return this;\n\t\t }\n\t\t var idx = popCount(bitmap & (bit - 1));\n\t\t var nodes = this.nodes;\n\t\t var node = exists ? nodes[idx] : undefined;\n\t\t var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\t\t if (newNode === node) {\n\t\t return this;\n\t\t }\n\t\t if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {\n\t\t return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);\n\t\t }\n\t\t if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n\t\t return nodes[idx ^ 1];\n\t\t }\n\t\t if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n\t\t return newNode;\n\t\t }\n\t\t var isEditable = ownerID && ownerID === this.ownerID;\n\t\t var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n\t\t var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);\n\t\t if (isEditable) {\n\t\t this.bitmap = newBitmap;\n\t\t this.nodes = newNodes;\n\t\t return this;\n\t\t }\n\t\t return new $BitmapIndexedNode(ownerID, newBitmap, newNodes);\n\t\t }\n\t\t}, {});\n\t\tvar HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) {\n\t\t this.ownerID = ownerID;\n\t\t this.count = count;\n\t\t this.nodes = nodes;\n\t\t};\n\t\tvar $HashArrayMapNode = HashArrayMapNode;\n\t\t($traceurRuntime.createClass)(HashArrayMapNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t\t var node = this.nodes[idx];\n\t\t return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t\t var removed = value === NOT_SET;\n\t\t var nodes = this.nodes;\n\t\t var node = nodes[idx];\n\t\t if (removed && !node) {\n\t\t return this;\n\t\t }\n\t\t var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\t\t if (newNode === node) {\n\t\t return this;\n\t\t }\n\t\t var newCount = this.count;\n\t\t if (!node) {\n\t\t newCount++;\n\t\t } else if (!newNode) {\n\t\t newCount--;\n\t\t if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {\n\t\t return packNodes(ownerID, nodes, newCount, idx);\n\t\t }\n\t\t }\n\t\t var isEditable = ownerID && ownerID === this.ownerID;\n\t\t var newNodes = setIn(nodes, idx, newNode, isEditable);\n\t\t if (isEditable) {\n\t\t this.count = newCount;\n\t\t this.nodes = newNodes;\n\t\t return this;\n\t\t }\n\t\t return new $HashArrayMapNode(ownerID, newCount, newNodes);\n\t\t }\n\t\t}, {});\n\t\tvar HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) {\n\t\t this.ownerID = ownerID;\n\t\t this.keyHash = keyHash;\n\t\t this.entries = entries;\n\t\t};\n\t\tvar $HashCollisionNode = HashCollisionNode;\n\t\t($traceurRuntime.createClass)(HashCollisionNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t var entries = this.entries;\n\t\t for (var ii = 0,\n\t\t len = entries.length; ii < len; ii++) {\n\t\t if (is(key, entries[ii][0])) {\n\t\t return entries[ii][1];\n\t\t }\n\t\t }\n\t\t return notSetValue;\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var removed = value === NOT_SET;\n\t\t if (keyHash !== this.keyHash) {\n\t\t if (removed) {\n\t\t return this;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t SetRef(didChangeSize);\n\t\t return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);\n\t\t }\n\t\t var entries = this.entries;\n\t\t var idx = 0;\n\t\t for (var len = entries.length; idx < len; idx++) {\n\t\t if (is(key, entries[idx][0])) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t var exists = idx < len;\n\t\t if (exists ? entries[idx][1] === value : removed) {\n\t\t return this;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t (removed || !exists) && SetRef(didChangeSize);\n\t\t if (removed && len === 2) {\n\t\t return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);\n\t\t }\n\t\t var isEditable = ownerID && ownerID === this.ownerID;\n\t\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t\t if (exists) {\n\t\t if (removed) {\n\t\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t\t } else {\n\t\t newEntries[idx] = [key, value];\n\t\t }\n\t\t } else {\n\t\t newEntries.push([key, value]);\n\t\t }\n\t\t if (isEditable) {\n\t\t this.entries = newEntries;\n\t\t return this;\n\t\t }\n\t\t return new $HashCollisionNode(ownerID, this.keyHash, newEntries);\n\t\t }\n\t\t}, {});\n\t\tvar ValueNode = function ValueNode(ownerID, keyHash, entry) {\n\t\t this.ownerID = ownerID;\n\t\t this.keyHash = keyHash;\n\t\t this.entry = entry;\n\t\t};\n\t\tvar $ValueNode = ValueNode;\n\t\t($traceurRuntime.createClass)(ValueNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t var removed = value === NOT_SET;\n\t\t var keyMatch = is(key, this.entry[0]);\n\t\t if (keyMatch ? value === this.entry[1] : removed) {\n\t\t return this;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t if (removed) {\n\t\t SetRef(didChangeSize);\n\t\t return;\n\t\t }\n\t\t if (keyMatch) {\n\t\t if (ownerID && ownerID === this.ownerID) {\n\t\t this.entry[1] = value;\n\t\t return this;\n\t\t }\n\t\t return new $ValueNode(ownerID, this.keyHash, [key, value]);\n\t\t }\n\t\t SetRef(didChangeSize);\n\t\t return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);\n\t\t }\n\t\t}, {});\n\t\tArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function(fn, reverse) {\n\t\t var entries = this.entries;\n\t\t for (var ii = 0,\n\t\t maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n\t\t if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n\t\t return false;\n\t\t }\n\t\t }\n\t\t};\n\t\tBitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function(fn, reverse) {\n\t\t var nodes = this.nodes;\n\t\t for (var ii = 0,\n\t\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t\t var node = nodes[reverse ? maxIndex - ii : ii];\n\t\t if (node && node.iterate(fn, reverse) === false) {\n\t\t return false;\n\t\t }\n\t\t }\n\t\t};\n\t\tValueNode.prototype.iterate = function(fn, reverse) {\n\t\t return fn(this.entry);\n\t\t};\n\t\tvar MapIterator = function MapIterator(map, type, reverse) {\n\t\t this._type = type;\n\t\t this._reverse = reverse;\n\t\t this._stack = map._root && mapIteratorFrame(map._root);\n\t\t};\n\t\t($traceurRuntime.createClass)(MapIterator, {next: function() {\n\t\t var type = this._type;\n\t\t var stack = this._stack;\n\t\t while (stack) {\n\t\t var node = stack.node;\n\t\t var index = stack.index++;\n\t\t var maxIndex;\n\t\t if (node.entry) {\n\t\t if (index === 0) {\n\t\t return mapIteratorValue(type, node.entry);\n\t\t }\n\t\t } else if (node.entries) {\n\t\t maxIndex = node.entries.length - 1;\n\t\t if (index <= maxIndex) {\n\t\t return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n\t\t }\n\t\t } else {\n\t\t maxIndex = node.nodes.length - 1;\n\t\t if (index <= maxIndex) {\n\t\t var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n\t\t if (subNode) {\n\t\t if (subNode.entry) {\n\t\t return mapIteratorValue(type, subNode.entry);\n\t\t }\n\t\t stack = this._stack = mapIteratorFrame(subNode, stack);\n\t\t }\n\t\t continue;\n\t\t }\n\t\t }\n\t\t stack = this._stack = this._stack.__prev;\n\t\t }\n\t\t return iteratorDone();\n\t\t }}, {}, Iterator);\n\t\tfunction mapIteratorValue(type, entry) {\n\t\t return iteratorValue(type, entry[0], entry[1]);\n\t\t}\n\t\tfunction mapIteratorFrame(node, prev) {\n\t\t return {\n\t\t node: node,\n\t\t index: 0,\n\t\t __prev: prev\n\t\t };\n\t\t}\n\t\tfunction makeMap(size, root, ownerID, hash) {\n\t\t var map = Object.create(MapPrototype);\n\t\t map.size = size;\n\t\t map._root = root;\n\t\t map.__ownerID = ownerID;\n\t\t map.__hash = hash;\n\t\t map.__altered = false;\n\t\t return map;\n\t\t}\n\t\tvar EMPTY_MAP;\n\t\tfunction emptyMap() {\n\t\t return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n\t\t}\n\t\tfunction updateMap(map, k, v) {\n\t\t var newRoot;\n\t\t var newSize;\n\t\t if (!map._root) {\n\t\t if (v === NOT_SET) {\n\t\t return map;\n\t\t }\n\t\t newSize = 1;\n\t\t newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);\n\t\t } else {\n\t\t var didChangeSize = MakeRef(CHANGE_LENGTH);\n\t\t var didAlter = MakeRef(DID_ALTER);\n\t\t newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);\n\t\t if (!didAlter.value) {\n\t\t return map;\n\t\t }\n\t\t newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n\t\t }\n\t\t if (map.__ownerID) {\n\t\t map.size = newSize;\n\t\t map._root = newRoot;\n\t\t map.__hash = undefined;\n\t\t map.__altered = true;\n\t\t return map;\n\t\t }\n\t\t return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n\t\t}\n\t\tfunction updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t if (!node) {\n\t\t if (value === NOT_SET) {\n\t\t return node;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t SetRef(didChangeSize);\n\t\t return new ValueNode(ownerID, keyHash, [key, value]);\n\t\t }\n\t\t return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);\n\t\t}\n\t\tfunction isLeafNode(node) {\n\t\t return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n\t\t}\n\t\tfunction mergeIntoNode(node, ownerID, shift, keyHash, entry) {\n\t\t if (node.keyHash === keyHash) {\n\t\t return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);\n\t\t }\n\t\t var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;\n\t\t var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t\t var newNode;\n\t\t var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n\t\t return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);\n\t\t}\n\t\tfunction createNodes(ownerID, entries, key, value) {\n\t\t if (!ownerID) {\n\t\t ownerID = new OwnerID();\n\t\t }\n\t\t var node = new ValueNode(ownerID, hash(key), [key, value]);\n\t\t for (var ii = 0; ii < entries.length; ii++) {\n\t\t var entry = entries[ii];\n\t\t node = node.update(ownerID, 0, undefined, entry[0], entry[1]);\n\t\t }\n\t\t return node;\n\t\t}\n\t\tfunction packNodes(ownerID, nodes, count, excluding) {\n\t\t var bitmap = 0;\n\t\t var packedII = 0;\n\t\t var packedNodes = new Array(count);\n\t\t for (var ii = 0,\n\t\t bit = 1,\n\t\t len = nodes.length; ii < len; ii++, bit <<= 1) {\n\t\t var node = nodes[ii];\n\t\t if (node !== undefined && ii !== excluding) {\n\t\t bitmap |= bit;\n\t\t packedNodes[packedII++] = node;\n\t\t }\n\t\t }\n\t\t return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n\t\t}\n\t\tfunction expandNodes(ownerID, nodes, bitmap, including, node) {\n\t\t var count = 0;\n\t\t var expandedNodes = new Array(SIZE);\n\t\t for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n\t\t expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n\t\t }\n\t\t expandedNodes[including] = node;\n\t\t return new HashArrayMapNode(ownerID, count + 1, expandedNodes);\n\t\t}\n\t\tfunction mergeIntoMapWith(map, merger, iterables) {\n\t\t var iters = [];\n\t\t for (var ii = 0; ii < iterables.length; ii++) {\n\t\t var value = iterables[ii];\n\t\t var iter = KeyedIterable(value);\n\t\t if (!isIterable(value)) {\n\t\t iter = iter.map((function(v) {\n\t\t return fromJS(v);\n\t\t }));\n\t\t }\n\t\t iters.push(iter);\n\t\t }\n\t\t return mergeIntoCollectionWith(map, merger, iters);\n\t\t}\n\t\tfunction deepMerger(merger) {\n\t\t return (function(existing, value) {\n\t\t return existing && existing.mergeDeepWith && isIterable(value) ? existing.mergeDeepWith(merger, value) : merger ? merger(existing, value) : value;\n\t\t });\n\t\t}\n\t\tfunction mergeIntoCollectionWith(collection, merger, iters) {\n\t\t iters = iters.filter((function(x) {\n\t\t return x.size !== 0;\n\t\t }));\n\t\t if (iters.length === 0) {\n\t\t return collection;\n\t\t }\n\t\t if (collection.size === 0 && iters.length === 1) {\n\t\t return collection.constructor(iters[0]);\n\t\t }\n\t\t return collection.withMutations((function(collection) {\n\t\t var mergeIntoMap = merger ? (function(value, key) {\n\t\t collection.update(key, NOT_SET, (function(existing) {\n\t\t return existing === NOT_SET ? value : merger(existing, value);\n\t\t }));\n\t\t }) : (function(value, key) {\n\t\t collection.set(key, value);\n\t\t });\n\t\t for (var ii = 0; ii < iters.length; ii++) {\n\t\t iters[ii].forEach(mergeIntoMap);\n\t\t }\n\t\t }));\n\t\t}\n\t\tfunction updateInDeepMap(existing, keyPathIter, notSetValue, updater) {\n\t\t var isNotSet = existing === NOT_SET;\n\t\t var step = keyPathIter.next();\n\t\t if (step.done) {\n\t\t var existingValue = isNotSet ? notSetValue : existing;\n\t\t var newValue = updater(existingValue);\n\t\t return newValue === existingValue ? existing : newValue;\n\t\t }\n\t\t invariant(isNotSet || (existing && existing.set), 'invalid keyPath');\n\t\t var key = step.value;\n\t\t var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);\n\t\t var nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater);\n\t\t return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated);\n\t\t}\n\t\tfunction popCount(x) {\n\t\t x = x - ((x >> 1) & 0x55555555);\n\t\t x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n\t\t x = (x + (x >> 4)) & 0x0f0f0f0f;\n\t\t x = x + (x >> 8);\n\t\t x = x + (x >> 16);\n\t\t return x & 0x7f;\n\t\t}\n\t\tfunction setIn(array, idx, val, canEdit) {\n\t\t var newArray = canEdit ? array : arrCopy(array);\n\t\t newArray[idx] = val;\n\t\t return newArray;\n\t\t}\n\t\tfunction spliceIn(array, idx, val, canEdit) {\n\t\t var newLen = array.length + 1;\n\t\t if (canEdit && idx + 1 === newLen) {\n\t\t array[idx] = val;\n\t\t return array;\n\t\t }\n\t\t var newArray = new Array(newLen);\n\t\t var after = 0;\n\t\t for (var ii = 0; ii < newLen; ii++) {\n\t\t if (ii === idx) {\n\t\t newArray[ii] = val;\n\t\t after = -1;\n\t\t } else {\n\t\t newArray[ii] = array[ii + after];\n\t\t }\n\t\t }\n\t\t return newArray;\n\t\t}\n\t\tfunction spliceOut(array, idx, canEdit) {\n\t\t var newLen = array.length - 1;\n\t\t if (canEdit && idx === newLen) {\n\t\t array.pop();\n\t\t return array;\n\t\t }\n\t\t var newArray = new Array(newLen);\n\t\t var after = 0;\n\t\t for (var ii = 0; ii < newLen; ii++) {\n\t\t if (ii === idx) {\n\t\t after = 1;\n\t\t }\n\t\t newArray[ii] = array[ii + after];\n\t\t }\n\t\t return newArray;\n\t\t}\n\t\tvar MAX_ARRAY_MAP_SIZE = SIZE / 4;\n\t\tvar MAX_BITMAP_INDEXED_SIZE = SIZE / 2;\n\t\tvar MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;\n\t\tvar ToKeyedSequence = function ToKeyedSequence(indexed, useKeys) {\n\t\t this._iter = indexed;\n\t\t this._useKeys = useKeys;\n\t\t this.size = indexed.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(ToKeyedSequence, {\n\t\t get: function(key, notSetValue) {\n\t\t return this._iter.get(key, notSetValue);\n\t\t },\n\t\t has: function(key) {\n\t\t return this._iter.has(key);\n\t\t },\n\t\t valueSeq: function() {\n\t\t return this._iter.valueSeq();\n\t\t },\n\t\t reverse: function() {\n\t\t var $__0 = this;\n\t\t var reversedSequence = reverseFactory(this, true);\n\t\t if (!this._useKeys) {\n\t\t reversedSequence.valueSeq = (function() {\n\t\t return $__0._iter.toSeq().reverse();\n\t\t });\n\t\t }\n\t\t return reversedSequence;\n\t\t },\n\t\t map: function(mapper, context) {\n\t\t var $__0 = this;\n\t\t var mappedSequence = mapFactory(this, mapper, context);\n\t\t if (!this._useKeys) {\n\t\t mappedSequence.valueSeq = (function() {\n\t\t return $__0._iter.toSeq().map(mapper, context);\n\t\t });\n\t\t }\n\t\t return mappedSequence;\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var ii;\n\t\t return this._iter.__iterate(this._useKeys ? (function(v, k) {\n\t\t return fn(v, k, $__0);\n\t\t }) : ((ii = reverse ? resolveSize(this) : 0), (function(v) {\n\t\t return fn(v, reverse ? --ii : ii++, $__0);\n\t\t })), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t if (this._useKeys) {\n\t\t return this._iter.__iterator(type, reverse);\n\t\t }\n\t\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t\t var ii = reverse ? resolveSize(this) : 0;\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n\t\t }));\n\t\t }\n\t\t}, {}, KeyedSeq);\n\t\tToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;\n\t\tvar ToIndexedSequence = function ToIndexedSequence(iter) {\n\t\t this._iter = iter;\n\t\t this.size = iter.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(ToIndexedSequence, {\n\t\t contains: function(value) {\n\t\t return this._iter.contains(value);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t return this._iter.__iterate((function(v) {\n\t\t return fn(v, iterations++, $__0);\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t return step.done ? step : iteratorValue(type, iterations++, step.value, step);\n\t\t }));\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar ToSetSequence = function ToSetSequence(iter) {\n\t\t this._iter = iter;\n\t\t this.size = iter.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(ToSetSequence, {\n\t\t has: function(key) {\n\t\t return this._iter.contains(key);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return this._iter.__iterate((function(v) {\n\t\t return fn(v, v, $__0);\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t return step.done ? step : iteratorValue(type, step.value, step.value, step);\n\t\t }));\n\t\t }\n\t\t}, {}, SetSeq);\n\t\tvar FromEntriesSequence = function FromEntriesSequence(entries) {\n\t\t this._iter = entries;\n\t\t this.size = entries.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(FromEntriesSequence, {\n\t\t entrySeq: function() {\n\t\t return this._iter.toSeq();\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return this._iter.__iterate((function(entry) {\n\t\t if (entry) {\n\t\t validateEntry(entry);\n\t\t return fn(entry[1], entry[0], $__0);\n\t\t }\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t\t return new Iterator((function() {\n\t\t while (true) {\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t var entry = step.value;\n\t\t if (entry) {\n\t\t validateEntry(entry);\n\t\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, entry[0], entry[1], step);\n\t\t }\n\t\t }\n\t\t }));\n\t\t }\n\t\t}, {}, KeyedSeq);\n\t\tToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;\n\t\tfunction flipFactory(iterable) {\n\t\t var flipSequence = makeSequence(iterable);\n\t\t flipSequence._iter = iterable;\n\t\t flipSequence.size = iterable.size;\n\t\t flipSequence.flip = (function() {\n\t\t return iterable;\n\t\t });\n\t\t flipSequence.reverse = function() {\n\t\t var reversedSequence = iterable.reverse.apply(this);\n\t\t reversedSequence.flip = (function() {\n\t\t return iterable.reverse();\n\t\t });\n\t\t return reversedSequence;\n\t\t };\n\t\t flipSequence.has = (function(key) {\n\t\t return iterable.contains(key);\n\t\t });\n\t\t flipSequence.contains = (function(key) {\n\t\t return iterable.has(key);\n\t\t });\n\t\t flipSequence.cacheResult = cacheResultThrough;\n\t\t flipSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return iterable.__iterate((function(v, k) {\n\t\t return fn(k, v, $__0) !== false;\n\t\t }), reverse);\n\t\t };\n\t\t flipSequence.__iteratorUncached = function(type, reverse) {\n\t\t if (type === ITERATE_ENTRIES) {\n\t\t var iterator = iterable.__iterator(type, reverse);\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t if (!step.done) {\n\t\t var k = step.value[0];\n\t\t step.value[0] = step.value[1];\n\t\t step.value[1] = k;\n\t\t }\n\t\t return step;\n\t\t }));\n\t\t }\n\t\t return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);\n\t\t };\n\t\t return flipSequence;\n\t\t}\n\t\tfunction mapFactory(iterable, mapper, context) {\n\t\t var mappedSequence = makeSequence(iterable);\n\t\t mappedSequence.size = iterable.size;\n\t\t mappedSequence.has = (function(key) {\n\t\t return iterable.has(key);\n\t\t });\n\t\t mappedSequence.get = (function(key, notSetValue) {\n\t\t var v = iterable.get(key, NOT_SET);\n\t\t return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);\n\t\t });\n\t\t mappedSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return iterable.__iterate((function(v, k, c) {\n\t\t return fn(mapper.call(context, v, k, c), k, $__0) !== false;\n\t\t }), reverse);\n\t\t };\n\t\t mappedSequence.__iteratorUncached = function(type, reverse) {\n\t\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t var entry = step.value;\n\t\t var key = entry[0];\n\t\t return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);\n\t\t }));\n\t\t };\n\t\t return mappedSequence;\n\t\t}\n\t\tfunction reverseFactory(iterable, useKeys) {\n\t\t var reversedSequence = makeSequence(iterable);\n\t\t reversedSequence._iter = iterable;\n\t\t reversedSequence.size = iterable.size;\n\t\t reversedSequence.reverse = (function() {\n\t\t return iterable;\n\t\t });\n\t\t if (iterable.flip) {\n\t\t reversedSequence.flip = function() {\n\t\t var flipSequence = flipFactory(iterable);\n\t\t flipSequence.reverse = (function() {\n\t\t return iterable.flip();\n\t\t });\n\t\t return flipSequence;\n\t\t };\n\t\t }\n\t\t reversedSequence.get = (function(key, notSetValue) {\n\t\t return iterable.get(useKeys ? key : -1 - key, notSetValue);\n\t\t });\n\t\t reversedSequence.has = (function(key) {\n\t\t return iterable.has(useKeys ? key : -1 - key);\n\t\t });\n\t\t reversedSequence.contains = (function(value) {\n\t\t return iterable.contains(value);\n\t\t });\n\t\t reversedSequence.cacheResult = cacheResultThrough;\n\t\t reversedSequence.__iterate = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return iterable.__iterate((function(v, k) {\n\t\t return fn(v, k, $__0);\n\t\t }), !reverse);\n\t\t };\n\t\t reversedSequence.__iterator = (function(type, reverse) {\n\t\t return iterable.__iterator(type, !reverse);\n\t\t });\n\t\t return reversedSequence;\n\t\t}\n\t\tfunction filterFactory(iterable, predicate, context, useKeys) {\n\t\t var filterSequence = makeSequence(iterable);\n\t\t if (useKeys) {\n\t\t filterSequence.has = (function(key) {\n\t\t var v = iterable.get(key, NOT_SET);\n\t\t return v !== NOT_SET && !!predicate.call(context, v, key, iterable);\n\t\t });\n\t\t filterSequence.get = (function(key, notSetValue) {\n\t\t var v = iterable.get(key, NOT_SET);\n\t\t return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;\n\t\t });\n\t\t }\n\t\t filterSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k, c) {\n\t\t if (predicate.call(context, v, k, c)) {\n\t\t iterations++;\n\t\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t\t }\n\t\t }), reverse);\n\t\t return iterations;\n\t\t };\n\t\t filterSequence.__iteratorUncached = function(type, reverse) {\n\t\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t while (true) {\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t var entry = step.value;\n\t\t var key = entry[0];\n\t\t var value = entry[1];\n\t\t if (predicate.call(context, value, key, iterable)) {\n\t\t return iteratorValue(type, useKeys ? key : iterations++, value, step);\n\t\t }\n\t\t }\n\t\t }));\n\t\t };\n\t\t return filterSequence;\n\t\t}\n\t\tfunction countByFactory(iterable, grouper, context) {\n\t\t var groups = Map().asMutable();\n\t\t iterable.__iterate((function(v, k) {\n\t\t groups.update(grouper.call(context, v, k, iterable), 0, (function(a) {\n\t\t return a + 1;\n\t\t }));\n\t\t }));\n\t\t return groups.asImmutable();\n\t\t}\n\t\tfunction groupByFactory(iterable, grouper, context) {\n\t\t var isKeyedIter = isKeyed(iterable);\n\t\t var groups = Map().asMutable();\n\t\t iterable.__iterate((function(v, k) {\n\t\t groups.update(grouper.call(context, v, k, iterable), (function(a) {\n\t\t return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a);\n\t\t }));\n\t\t }));\n\t\t var coerce = iterableClass(iterable);\n\t\t return groups.map((function(arr) {\n\t\t return reify(iterable, coerce(arr));\n\t\t }));\n\t\t}\n\t\tfunction takeFactory(iterable, amount) {\n\t\t if (amount > iterable.size) {\n\t\t return iterable;\n\t\t }\n\t\t if (amount < 0) {\n\t\t amount = 0;\n\t\t }\n\t\t var takeSequence = makeSequence(iterable);\n\t\t takeSequence.size = iterable.size && Math.min(iterable.size, amount);\n\t\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t if (amount === 0) {\n\t\t return 0;\n\t\t }\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k) {\n\t\t return ++iterations && fn(v, k, $__0) !== false && iterations < amount;\n\t\t }));\n\t\t return iterations;\n\t\t };\n\t\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = amount && iterable.__iterator(type, reverse);\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t if (iterations++ > amount) {\n\t\t return iteratorDone();\n\t\t }\n\t\t return iterator.next();\n\t\t }));\n\t\t };\n\t\t return takeSequence;\n\t\t}\n\t\tfunction takeWhileFactory(iterable, predicate, context) {\n\t\t var takeSequence = makeSequence(iterable);\n\t\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k, c) {\n\t\t return predicate.call(context, v, k, c) && ++iterations && fn(v, k, $__0);\n\t\t }));\n\t\t return iterations;\n\t\t };\n\t\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t\t var iterating = true;\n\t\t return new Iterator((function() {\n\t\t if (!iterating) {\n\t\t return iteratorDone();\n\t\t }\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t var entry = step.value;\n\t\t var k = entry[0];\n\t\t var v = entry[1];\n\t\t if (!predicate.call(context, v, k, $__0)) {\n\t\t iterating = false;\n\t\t return iteratorDone();\n\t\t }\n\t\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t\t }));\n\t\t };\n\t\t return takeSequence;\n\t\t}\n\t\tfunction skipFactory(iterable, amount, useKeys) {\n\t\t if (amount <= 0) {\n\t\t return iterable;\n\t\t }\n\t\t var skipSequence = makeSequence(iterable);\n\t\t skipSequence.size = iterable.size && Math.max(0, iterable.size - amount);\n\t\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var skipped = 0;\n\t\t var isSkipping = true;\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k) {\n\t\t if (!(isSkipping && (isSkipping = skipped++ < amount))) {\n\t\t iterations++;\n\t\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t\t }\n\t\t }));\n\t\t return iterations;\n\t\t };\n\t\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = amount && iterable.__iterator(type, reverse);\n\t\t var skipped = 0;\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t while (skipped < amount) {\n\t\t skipped++;\n\t\t iterator.next();\n\t\t }\n\t\t var step = iterator.next();\n\t\t if (useKeys || type === ITERATE_VALUES) {\n\t\t return step;\n\t\t } else if (type === ITERATE_KEYS) {\n\t\t return iteratorValue(type, iterations++, undefined, step);\n\t\t } else {\n\t\t return iteratorValue(type, iterations++, step.value[1], step);\n\t\t }\n\t\t }));\n\t\t };\n\t\t return skipSequence;\n\t\t}\n\t\tfunction skipWhileFactory(iterable, predicate, context, useKeys) {\n\t\t var skipSequence = makeSequence(iterable);\n\t\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var isSkipping = true;\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k, c) {\n\t\t if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n\t\t iterations++;\n\t\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t\t }\n\t\t }));\n\t\t return iterations;\n\t\t };\n\t\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t\t var skipping = true;\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t var step,\n\t\t k,\n\t\t v;\n\t\t do {\n\t\t step = iterator.next();\n\t\t if (step.done) {\n\t\t if (useKeys || type === ITERATE_VALUES) {\n\t\t return step;\n\t\t } else if (type === ITERATE_KEYS) {\n\t\t return iteratorValue(type, iterations++, undefined, step);\n\t\t } else {\n\t\t return iteratorValue(type, iterations++, step.value[1], step);\n\t\t }\n\t\t }\n\t\t var entry = step.value;\n\t\t k = entry[0];\n\t\t v = entry[1];\n\t\t skipping && (skipping = predicate.call(context, v, k, $__0));\n\t\t } while (skipping);\n\t\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t\t }));\n\t\t };\n\t\t return skipSequence;\n\t\t}\n\t\tfunction concatFactory(iterable, values) {\n\t\t var isKeyedIterable = isKeyed(iterable);\n\t\t var iters = [iterable].concat(values).map((function(v) {\n\t\t if (!isIterable(v)) {\n\t\t v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n\t\t } else if (isKeyedIterable) {\n\t\t v = KeyedIterable(v);\n\t\t }\n\t\t return v;\n\t\t })).filter((function(v) {\n\t\t return v.size !== 0;\n\t\t }));\n\t\t if (iters.length === 0) {\n\t\t return iterable;\n\t\t }\n\t\t if (iters.length === 1) {\n\t\t var singleton = iters[0];\n\t\t if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) {\n\t\t return singleton;\n\t\t }\n\t\t }\n\t\t var concatSeq = new ArraySeq(iters);\n\t\t if (isKeyedIterable) {\n\t\t concatSeq = concatSeq.toKeyedSeq();\n\t\t } else if (!isIndexed(iterable)) {\n\t\t concatSeq = concatSeq.toSetSeq();\n\t\t }\n\t\t concatSeq = concatSeq.flatten(true);\n\t\t concatSeq.size = iters.reduce((function(sum, seq) {\n\t\t if (sum !== undefined) {\n\t\t var size = seq.size;\n\t\t if (size !== undefined) {\n\t\t return sum + size;\n\t\t }\n\t\t }\n\t\t }), 0);\n\t\t return concatSeq;\n\t\t}\n\t\tfunction flattenFactory(iterable, depth, useKeys) {\n\t\t var flatSequence = makeSequence(iterable);\n\t\t flatSequence.__iterateUncached = function(fn, reverse) {\n\t\t var iterations = 0;\n\t\t var stopped = false;\n\t\t function flatDeep(iter, currentDepth) {\n\t\t var $__0 = this;\n\t\t iter.__iterate((function(v, k) {\n\t\t if ((!depth || currentDepth < depth) && isIterable(v)) {\n\t\t flatDeep(v, currentDepth + 1);\n\t\t } else if (fn(v, useKeys ? k : iterations++, $__0) === false) {\n\t\t stopped = true;\n\t\t }\n\t\t return !stopped;\n\t\t }), reverse);\n\t\t }\n\t\t flatDeep(iterable, 0);\n\t\t return iterations;\n\t\t };\n\t\t flatSequence.__iteratorUncached = function(type, reverse) {\n\t\t var iterator = iterable.__iterator(type, reverse);\n\t\t var stack = [];\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t while (iterator) {\n\t\t var step = iterator.next();\n\t\t if (step.done !== false) {\n\t\t iterator = stack.pop();\n\t\t continue;\n\t\t }\n\t\t var v = step.value;\n\t\t if (type === ITERATE_ENTRIES) {\n\t\t v = v[1];\n\t\t }\n\t\t if ((!depth || stack.length < depth) && isIterable(v)) {\n\t\t stack.push(iterator);\n\t\t iterator = v.__iterator(type, reverse);\n\t\t } else {\n\t\t return useKeys ? step : iteratorValue(type, iterations++, v, step);\n\t\t }\n\t\t }\n\t\t return iteratorDone();\n\t\t }));\n\t\t };\n\t\t return flatSequence;\n\t\t}\n\t\tfunction flatMapFactory(iterable, mapper, context) {\n\t\t var coerce = iterableClass(iterable);\n\t\t return iterable.toSeq().map((function(v, k) {\n\t\t return coerce(mapper.call(context, v, k, iterable));\n\t\t })).flatten(true);\n\t\t}\n\t\tfunction interposeFactory(iterable, separator) {\n\t\t var interposedSequence = makeSequence(iterable);\n\t\t interposedSequence.size = iterable.size && iterable.size * 2 - 1;\n\t\t interposedSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k) {\n\t\t return (!iterations || fn(separator, iterations++, $__0) !== false) && fn(v, iterations++, $__0) !== false;\n\t\t }), reverse);\n\t\t return iterations;\n\t\t };\n\t\t interposedSequence.__iteratorUncached = function(type, reverse) {\n\t\t var iterator = iterable.__iterator(ITERATE_VALUES, reverse);\n\t\t var iterations = 0;\n\t\t var step;\n\t\t return new Iterator((function() {\n\t\t if (!step || iterations % 2) {\n\t\t step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t }\n\t\t return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);\n\t\t }));\n\t\t };\n\t\t return interposedSequence;\n\t\t}\n\t\tfunction sortFactory(iterable, comparator, mapper) {\n\t\t if (!comparator) {\n\t\t comparator = defaultComparator;\n\t\t }\n\t\t var isKeyedIterable = isKeyed(iterable);\n\t\t var index = 0;\n\t\t var entries = iterable.toSeq().map((function(v, k) {\n\t\t return [k, v, index++, mapper ? mapper(v, k, iterable) : v];\n\t\t })).toArray();\n\t\t entries.sort((function(a, b) {\n\t\t return comparator(a[3], b[3]) || a[2] - b[2];\n\t\t })).forEach(isKeyedIterable ? (function(v, i) {\n\t\t entries[i].length = 2;\n\t\t }) : (function(v, i) {\n\t\t entries[i] = v[1];\n\t\t }));\n\t\t return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries);\n\t\t}\n\t\tfunction maxFactory(iterable, comparator, mapper) {\n\t\t if (!comparator) {\n\t\t comparator = defaultComparator;\n\t\t }\n\t\t if (mapper) {\n\t\t var entry = iterable.toSeq().map((function(v, k) {\n\t\t return [v, mapper(v, k, iterable)];\n\t\t })).reduce((function(a, b) {\n\t\t return _maxCompare(comparator, a[1], b[1]) ? b : a;\n\t\t }));\n\t\t return entry && entry[0];\n\t\t } else {\n\t\t return iterable.reduce((function(a, b) {\n\t\t return _maxCompare(comparator, a, b) ? b : a;\n\t\t }));\n\t\t }\n\t\t}\n\t\tfunction _maxCompare(comparator, a, b) {\n\t\t var comp = comparator(b, a);\n\t\t return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;\n\t\t}\n\t\tfunction reify(iter, seq) {\n\t\t return isSeq(iter) ? seq : iter.constructor(seq);\n\t\t}\n\t\tfunction validateEntry(entry) {\n\t\t if (entry !== Object(entry)) {\n\t\t throw new TypeError('Expected [K, V] tuple: ' + entry);\n\t\t }\n\t\t}\n\t\tfunction resolveSize(iter) {\n\t\t assertNotInfinite(iter.size);\n\t\t return ensureSize(iter);\n\t\t}\n\t\tfunction iterableClass(iterable) {\n\t\t return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;\n\t\t}\n\t\tfunction makeSequence(iterable) {\n\t\t return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);\n\t\t}\n\t\tfunction cacheResultThrough() {\n\t\t if (this._iter.cacheResult) {\n\t\t this._iter.cacheResult();\n\t\t this.size = this._iter.size;\n\t\t return this;\n\t\t } else {\n\t\t return Seq.prototype.cacheResult.call(this);\n\t\t }\n\t\t}\n\t\tfunction defaultComparator(a, b) {\n\t\t return a > b ? 1 : a < b ? -1 : 0;\n\t\t}\n\t\tvar List = function List(value) {\n\t\t var empty = emptyList();\n\t\t if (value === null || value === undefined) {\n\t\t return empty;\n\t\t }\n\t\t if (isList(value)) {\n\t\t return value;\n\t\t }\n\t\t var iter = IndexedIterable(value);\n\t\t var size = iter.size;\n\t\t if (size === 0) {\n\t\t return empty;\n\t\t }\n\t\t assertNotInfinite(size);\n\t\t if (size > 0 && size < SIZE) {\n\t\t return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));\n\t\t }\n\t\t return empty.withMutations((function(list) {\n\t\t list.setSize(size);\n\t\t iter.forEach((function(v, i) {\n\t\t return list.set(i, v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(List, {\n\t\t toString: function() {\n\t\t return this.__toString('List [', ']');\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t index = wrapIndex(this, index);\n\t\t if (index < 0 || index >= this.size) {\n\t\t return notSetValue;\n\t\t }\n\t\t index += this._origin;\n\t\t var node = listNodeFor(this, index);\n\t\t return node && node.array[index & MASK];\n\t\t },\n\t\t set: function(index, value) {\n\t\t return updateList(this, index, value);\n\t\t },\n\t\t remove: function(index) {\n\t\t return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1);\n\t\t },\n\t\t clear: function() {\n\t\t if (this.size === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = this._origin = this._capacity = 0;\n\t\t this._level = SHIFT;\n\t\t this._root = this._tail = null;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return emptyList();\n\t\t },\n\t\t push: function() {\n\t\t var values = arguments;\n\t\t var oldSize = this.size;\n\t\t return this.withMutations((function(list) {\n\t\t setListBounds(list, 0, oldSize + values.length);\n\t\t for (var ii = 0; ii < values.length; ii++) {\n\t\t list.set(oldSize + ii, values[ii]);\n\t\t }\n\t\t }));\n\t\t },\n\t\t pop: function() {\n\t\t return setListBounds(this, 0, -1);\n\t\t },\n\t\t unshift: function() {\n\t\t var values = arguments;\n\t\t return this.withMutations((function(list) {\n\t\t setListBounds(list, -values.length);\n\t\t for (var ii = 0; ii < values.length; ii++) {\n\t\t list.set(ii, values[ii]);\n\t\t }\n\t\t }));\n\t\t },\n\t\t shift: function() {\n\t\t return setListBounds(this, 1);\n\t\t },\n\t\t merge: function() {\n\t\t return mergeIntoListWith(this, undefined, arguments);\n\t\t },\n\t\t mergeWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__7 = 1; $__7 < arguments.length; $__7++)\n\t\t iters[$__7 - 1] = arguments[$__7];\n\t\t return mergeIntoListWith(this, merger, iters);\n\t\t },\n\t\t mergeDeep: function() {\n\t\t return mergeIntoListWith(this, deepMerger(undefined), arguments);\n\t\t },\n\t\t mergeDeepWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__8 = 1; $__8 < arguments.length; $__8++)\n\t\t iters[$__8 - 1] = arguments[$__8];\n\t\t return mergeIntoListWith(this, deepMerger(merger), iters);\n\t\t },\n\t\t setSize: function(size) {\n\t\t return setListBounds(this, 0, size);\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t var size = this.size;\n\t\t if (wholeSlice(begin, end, size)) {\n\t\t return this;\n\t\t }\n\t\t return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var index = 0;\n\t\t var values = iterateList(this, reverse);\n\t\t return new Iterator((function() {\n\t\t var value = values();\n\t\t return value === DONE ? iteratorDone() : iteratorValue(type, index++, value);\n\t\t }));\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var index = 0;\n\t\t var values = iterateList(this, reverse);\n\t\t var value;\n\t\t while ((value = values()) !== DONE) {\n\t\t if (fn(value, index++, this) === false) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t return index;\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t return this;\n\t\t }\n\t\t return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n\t\t }\n\t\t}, {of: function() {\n\t\t return this(arguments);\n\t\t }}, IndexedCollection);\n\t\tfunction isList(maybeList) {\n\t\t return !!(maybeList && maybeList[IS_LIST_SENTINEL]);\n\t\t}\n\t\tList.isList = isList;\n\t\tvar IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\n\t\tvar ListPrototype = List.prototype;\n\t\tListPrototype[IS_LIST_SENTINEL] = true;\n\t\tListPrototype[DELETE] = ListPrototype.remove;\n\t\tListPrototype.setIn = MapPrototype.setIn;\n\t\tListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn;\n\t\tListPrototype.update = MapPrototype.update;\n\t\tListPrototype.updateIn = MapPrototype.updateIn;\n\t\tListPrototype.mergeIn = MapPrototype.mergeIn;\n\t\tListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n\t\tListPrototype.withMutations = MapPrototype.withMutations;\n\t\tListPrototype.asMutable = MapPrototype.asMutable;\n\t\tListPrototype.asImmutable = MapPrototype.asImmutable;\n\t\tListPrototype.wasAltered = MapPrototype.wasAltered;\n\t\tvar VNode = function VNode(array, ownerID) {\n\t\t this.array = array;\n\t\t this.ownerID = ownerID;\n\t\t};\n\t\tvar $VNode = VNode;\n\t\t($traceurRuntime.createClass)(VNode, {\n\t\t removeBefore: function(ownerID, level, index) {\n\t\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t\t return this;\n\t\t }\n\t\t var originIndex = (index >>> level) & MASK;\n\t\t if (originIndex >= this.array.length) {\n\t\t return new $VNode([], ownerID);\n\t\t }\n\t\t var removingFirst = originIndex === 0;\n\t\t var newChild;\n\t\t if (level > 0) {\n\t\t var oldChild = this.array[originIndex];\n\t\t newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n\t\t if (newChild === oldChild && removingFirst) {\n\t\t return this;\n\t\t }\n\t\t }\n\t\t if (removingFirst && !newChild) {\n\t\t return this;\n\t\t }\n\t\t var editable = editableVNode(this, ownerID);\n\t\t if (!removingFirst) {\n\t\t for (var ii = 0; ii < originIndex; ii++) {\n\t\t editable.array[ii] = undefined;\n\t\t }\n\t\t }\n\t\t if (newChild) {\n\t\t editable.array[originIndex] = newChild;\n\t\t }\n\t\t return editable;\n\t\t },\n\t\t removeAfter: function(ownerID, level, index) {\n\t\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t\t return this;\n\t\t }\n\t\t var sizeIndex = ((index - 1) >>> level) & MASK;\n\t\t if (sizeIndex >= this.array.length) {\n\t\t return this;\n\t\t }\n\t\t var removingLast = sizeIndex === this.array.length - 1;\n\t\t var newChild;\n\t\t if (level > 0) {\n\t\t var oldChild = this.array[sizeIndex];\n\t\t newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n\t\t if (newChild === oldChild && removingLast) {\n\t\t return this;\n\t\t }\n\t\t }\n\t\t if (removingLast && !newChild) {\n\t\t return this;\n\t\t }\n\t\t var editable = editableVNode(this, ownerID);\n\t\t if (!removingLast) {\n\t\t editable.array.pop();\n\t\t }\n\t\t if (newChild) {\n\t\t editable.array[sizeIndex] = newChild;\n\t\t }\n\t\t return editable;\n\t\t }\n\t\t}, {});\n\t\tvar DONE = {};\n\t\tfunction iterateList(list, reverse) {\n\t\t var left = list._origin;\n\t\t var right = list._capacity;\n\t\t var tailPos = getTailOffset(right);\n\t\t var tail = list._tail;\n\t\t return iterateNodeOrLeaf(list._root, list._level, 0);\n\t\t function iterateNodeOrLeaf(node, level, offset) {\n\t\t return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset);\n\t\t }\n\t\t function iterateLeaf(node, offset) {\n\t\t var array = offset === tailPos ? tail && tail.array : node && node.array;\n\t\t var from = offset > left ? 0 : left - offset;\n\t\t var to = right - offset;\n\t\t if (to > SIZE) {\n\t\t to = SIZE;\n\t\t }\n\t\t return (function() {\n\t\t if (from === to) {\n\t\t return DONE;\n\t\t }\n\t\t var idx = reverse ? --to : from++;\n\t\t return array && array[idx];\n\t\t });\n\t\t }\n\t\t function iterateNode(node, level, offset) {\n\t\t var values;\n\t\t var array = node && node.array;\n\t\t var from = offset > left ? 0 : (left - offset) >> level;\n\t\t var to = ((right - offset) >> level) + 1;\n\t\t if (to > SIZE) {\n\t\t to = SIZE;\n\t\t }\n\t\t return (function() {\n\t\t do {\n\t\t if (values) {\n\t\t var value = values();\n\t\t if (value !== DONE) {\n\t\t return value;\n\t\t }\n\t\t values = null;\n\t\t }\n\t\t if (from === to) {\n\t\t return DONE;\n\t\t }\n\t\t var idx = reverse ? --to : from++;\n\t\t values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level));\n\t\t } while (true);\n\t\t });\n\t\t }\n\t\t}\n\t\tfunction makeList(origin, capacity, level, root, tail, ownerID, hash) {\n\t\t var list = Object.create(ListPrototype);\n\t\t list.size = capacity - origin;\n\t\t list._origin = origin;\n\t\t list._capacity = capacity;\n\t\t list._level = level;\n\t\t list._root = root;\n\t\t list._tail = tail;\n\t\t list.__ownerID = ownerID;\n\t\t list.__hash = hash;\n\t\t list.__altered = false;\n\t\t return list;\n\t\t}\n\t\tvar EMPTY_LIST;\n\t\tfunction emptyList() {\n\t\t return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n\t\t}\n\t\tfunction updateList(list, index, value) {\n\t\t index = wrapIndex(list, index);\n\t\t if (index >= list.size || index < 0) {\n\t\t return list.withMutations((function(list) {\n\t\t index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);\n\t\t }));\n\t\t }\n\t\t index += list._origin;\n\t\t var newTail = list._tail;\n\t\t var newRoot = list._root;\n\t\t var didAlter = MakeRef(DID_ALTER);\n\t\t if (index >= getTailOffset(list._capacity)) {\n\t\t newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n\t\t } else {\n\t\t newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n\t\t }\n\t\t if (!didAlter.value) {\n\t\t return list;\n\t\t }\n\t\t if (list.__ownerID) {\n\t\t list._root = newRoot;\n\t\t list._tail = newTail;\n\t\t list.__hash = undefined;\n\t\t list.__altered = true;\n\t\t return list;\n\t\t }\n\t\t return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n\t\t}\n\t\tfunction updateVNode(node, ownerID, level, index, value, didAlter) {\n\t\t var idx = (index >>> level) & MASK;\n\t\t var nodeHas = node && idx < node.array.length;\n\t\t if (!nodeHas && value === undefined) {\n\t\t return node;\n\t\t }\n\t\t var newNode;\n\t\t if (level > 0) {\n\t\t var lowerNode = node && node.array[idx];\n\t\t var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n\t\t if (newLowerNode === lowerNode) {\n\t\t return node;\n\t\t }\n\t\t newNode = editableVNode(node, ownerID);\n\t\t newNode.array[idx] = newLowerNode;\n\t\t return newNode;\n\t\t }\n\t\t if (nodeHas && node.array[idx] === value) {\n\t\t return node;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t newNode = editableVNode(node, ownerID);\n\t\t if (value === undefined && idx === newNode.array.length - 1) {\n\t\t newNode.array.pop();\n\t\t } else {\n\t\t newNode.array[idx] = value;\n\t\t }\n\t\t return newNode;\n\t\t}\n\t\tfunction editableVNode(node, ownerID) {\n\t\t if (ownerID && node && ownerID === node.ownerID) {\n\t\t return node;\n\t\t }\n\t\t return new VNode(node ? node.array.slice() : [], ownerID);\n\t\t}\n\t\tfunction listNodeFor(list, rawIndex) {\n\t\t if (rawIndex >= getTailOffset(list._capacity)) {\n\t\t return list._tail;\n\t\t }\n\t\t if (rawIndex < 1 << (list._level + SHIFT)) {\n\t\t var node = list._root;\n\t\t var level = list._level;\n\t\t while (node && level > 0) {\n\t\t node = node.array[(rawIndex >>> level) & MASK];\n\t\t level -= SHIFT;\n\t\t }\n\t\t return node;\n\t\t }\n\t\t}\n\t\tfunction setListBounds(list, begin, end) {\n\t\t var owner = list.__ownerID || new OwnerID();\n\t\t var oldOrigin = list._origin;\n\t\t var oldCapacity = list._capacity;\n\t\t var newOrigin = oldOrigin + begin;\n\t\t var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n\t\t if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n\t\t return list;\n\t\t }\n\t\t if (newOrigin >= newCapacity) {\n\t\t return list.clear();\n\t\t }\n\t\t var newLevel = list._level;\n\t\t var newRoot = list._root;\n\t\t var offsetShift = 0;\n\t\t while (newOrigin + offsetShift < 0) {\n\t\t newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n\t\t newLevel += SHIFT;\n\t\t offsetShift += 1 << newLevel;\n\t\t }\n\t\t if (offsetShift) {\n\t\t newOrigin += offsetShift;\n\t\t oldOrigin += offsetShift;\n\t\t newCapacity += offsetShift;\n\t\t oldCapacity += offsetShift;\n\t\t }\n\t\t var oldTailOffset = getTailOffset(oldCapacity);\n\t\t var newTailOffset = getTailOffset(newCapacity);\n\t\t while (newTailOffset >= 1 << (newLevel + SHIFT)) {\n\t\t newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n\t\t newLevel += SHIFT;\n\t\t }\n\t\t var oldTail = list._tail;\n\t\t var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;\n\t\t if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n\t\t newRoot = editableVNode(newRoot, owner);\n\t\t var node = newRoot;\n\t\t for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n\t\t var idx = (oldTailOffset >>> level) & MASK;\n\t\t node = node.array[idx] = editableVNode(node.array[idx], owner);\n\t\t }\n\t\t node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;\n\t\t }\n\t\t if (newCapacity < oldCapacity) {\n\t\t newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n\t\t }\n\t\t if (newOrigin >= newTailOffset) {\n\t\t newOrigin -= newTailOffset;\n\t\t newCapacity -= newTailOffset;\n\t\t newLevel = SHIFT;\n\t\t newRoot = null;\n\t\t newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);\n\t\t } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n\t\t offsetShift = 0;\n\t\t while (newRoot) {\n\t\t var beginIndex = (newOrigin >>> newLevel) & MASK;\n\t\t if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {\n\t\t break;\n\t\t }\n\t\t if (beginIndex) {\n\t\t offsetShift += (1 << newLevel) * beginIndex;\n\t\t }\n\t\t newLevel -= SHIFT;\n\t\t newRoot = newRoot.array[beginIndex];\n\t\t }\n\t\t if (newRoot && newOrigin > oldOrigin) {\n\t\t newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n\t\t }\n\t\t if (newRoot && newTailOffset < oldTailOffset) {\n\t\t newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n\t\t }\n\t\t if (offsetShift) {\n\t\t newOrigin -= offsetShift;\n\t\t newCapacity -= offsetShift;\n\t\t }\n\t\t }\n\t\t if (list.__ownerID) {\n\t\t list.size = newCapacity - newOrigin;\n\t\t list._origin = newOrigin;\n\t\t list._capacity = newCapacity;\n\t\t list._level = newLevel;\n\t\t list._root = newRoot;\n\t\t list._tail = newTail;\n\t\t list.__hash = undefined;\n\t\t list.__altered = true;\n\t\t return list;\n\t\t }\n\t\t return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n\t\t}\n\t\tfunction mergeIntoListWith(list, merger, iterables) {\n\t\t var iters = [];\n\t\t var maxSize = 0;\n\t\t for (var ii = 0; ii < iterables.length; ii++) {\n\t\t var value = iterables[ii];\n\t\t var iter = IndexedIterable(value);\n\t\t if (iter.size > maxSize) {\n\t\t maxSize = iter.size;\n\t\t }\n\t\t if (!isIterable(value)) {\n\t\t iter = iter.map((function(v) {\n\t\t return fromJS(v);\n\t\t }));\n\t\t }\n\t\t iters.push(iter);\n\t\t }\n\t\t if (maxSize > list.size) {\n\t\t list = list.setSize(maxSize);\n\t\t }\n\t\t return mergeIntoCollectionWith(list, merger, iters);\n\t\t}\n\t\tfunction getTailOffset(size) {\n\t\t return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);\n\t\t}\n\t\tvar OrderedMap = function OrderedMap(value) {\n\t\t return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations((function(map) {\n\t\t var iter = KeyedIterable(value);\n\t\t assertNotInfinite(iter.size);\n\t\t iter.forEach((function(v, k) {\n\t\t return map.set(k, v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(OrderedMap, {\n\t\t toString: function() {\n\t\t return this.__toString('OrderedMap {', '}');\n\t\t },\n\t\t get: function(k, notSetValue) {\n\t\t var index = this._map.get(k);\n\t\t return index !== undefined ? this._list.get(index)[1] : notSetValue;\n\t\t },\n\t\t clear: function() {\n\t\t if (this.size === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = 0;\n\t\t this._map.clear();\n\t\t this._list.clear();\n\t\t return this;\n\t\t }\n\t\t return emptyOrderedMap();\n\t\t },\n\t\t set: function(k, v) {\n\t\t return updateOrderedMap(this, k, v);\n\t\t },\n\t\t remove: function(k) {\n\t\t return updateOrderedMap(this, k, NOT_SET);\n\t\t },\n\t\t wasAltered: function() {\n\t\t return this._map.wasAltered() || this._list.wasAltered();\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return this._list.__iterate((function(entry) {\n\t\t return entry && fn(entry[1], entry[0], $__0);\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return this._list.fromEntrySeq().__iterator(type, reverse);\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t var newMap = this._map.__ensureOwner(ownerID);\n\t\t var newList = this._list.__ensureOwner(ownerID);\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this._map = newMap;\n\t\t this._list = newList;\n\t\t return this;\n\t\t }\n\t\t return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n\t\t }\n\t\t}, {of: function() {\n\t\t return this(arguments);\n\t\t }}, Map);\n\t\tfunction isOrderedMap(maybeOrderedMap) {\n\t\t return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);\n\t\t}\n\t\tOrderedMap.isOrderedMap = isOrderedMap;\n\t\tOrderedMap.prototype[IS_ORDERED_SENTINEL] = true;\n\t\tOrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\t\tfunction makeOrderedMap(map, list, ownerID, hash) {\n\t\t var omap = Object.create(OrderedMap.prototype);\n\t\t omap.size = map ? map.size : 0;\n\t\t omap._map = map;\n\t\t omap._list = list;\n\t\t omap.__ownerID = ownerID;\n\t\t omap.__hash = hash;\n\t\t return omap;\n\t\t}\n\t\tvar EMPTY_ORDERED_MAP;\n\t\tfunction emptyOrderedMap() {\n\t\t return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n\t\t}\n\t\tfunction updateOrderedMap(omap, k, v) {\n\t\t var map = omap._map;\n\t\t var list = omap._list;\n\t\t var i = map.get(k);\n\t\t var has = i !== undefined;\n\t\t var newMap;\n\t\t var newList;\n\t\t if (v === NOT_SET) {\n\t\t if (!has) {\n\t\t return omap;\n\t\t }\n\t\t if (list.size >= SIZE && list.size >= map.size * 2) {\n\t\t newList = list.filter((function(entry, idx) {\n\t\t return entry !== undefined && i !== idx;\n\t\t }));\n\t\t newMap = newList.toKeyedSeq().map((function(entry) {\n\t\t return entry[0];\n\t\t })).flip().toMap();\n\t\t if (omap.__ownerID) {\n\t\t newMap.__ownerID = newList.__ownerID = omap.__ownerID;\n\t\t }\n\t\t } else {\n\t\t newMap = map.remove(k);\n\t\t newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);\n\t\t }\n\t\t } else {\n\t\t if (has) {\n\t\t if (v === list.get(i)[1]) {\n\t\t return omap;\n\t\t }\n\t\t newMap = map;\n\t\t newList = list.set(i, [k, v]);\n\t\t } else {\n\t\t newMap = map.set(k, list.size);\n\t\t newList = list.set(list.size, [k, v]);\n\t\t }\n\t\t }\n\t\t if (omap.__ownerID) {\n\t\t omap.size = newMap.size;\n\t\t omap._map = newMap;\n\t\t omap._list = newList;\n\t\t omap.__hash = undefined;\n\t\t return omap;\n\t\t }\n\t\t return makeOrderedMap(newMap, newList);\n\t\t}\n\t\tvar Stack = function Stack(value) {\n\t\t return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);\n\t\t};\n\t\tvar $Stack = Stack;\n\t\t($traceurRuntime.createClass)(Stack, {\n\t\t toString: function() {\n\t\t return this.__toString('Stack [', ']');\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t var head = this._head;\n\t\t while (head && index--) {\n\t\t head = head.next;\n\t\t }\n\t\t return head ? head.value : notSetValue;\n\t\t },\n\t\t peek: function() {\n\t\t return this._head && this._head.value;\n\t\t },\n\t\t push: function() {\n\t\t if (arguments.length === 0) {\n\t\t return this;\n\t\t }\n\t\t var newSize = this.size + arguments.length;\n\t\t var head = this._head;\n\t\t for (var ii = arguments.length - 1; ii >= 0; ii--) {\n\t\t head = {\n\t\t value: arguments[ii],\n\t\t next: head\n\t\t };\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = newSize;\n\t\t this._head = head;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return makeStack(newSize, head);\n\t\t },\n\t\t pushAll: function(iter) {\n\t\t iter = IndexedIterable(iter);\n\t\t if (iter.size === 0) {\n\t\t return this;\n\t\t }\n\t\t assertNotInfinite(iter.size);\n\t\t var newSize = this.size;\n\t\t var head = this._head;\n\t\t iter.reverse().forEach((function(value) {\n\t\t newSize++;\n\t\t head = {\n\t\t value: value,\n\t\t next: head\n\t\t };\n\t\t }));\n\t\t if (this.__ownerID) {\n\t\t this.size = newSize;\n\t\t this._head = head;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return makeStack(newSize, head);\n\t\t },\n\t\t pop: function() {\n\t\t return this.slice(1);\n\t\t },\n\t\t unshift: function() {\n\t\t return this.push.apply(this, arguments);\n\t\t },\n\t\t unshiftAll: function(iter) {\n\t\t return this.pushAll(iter);\n\t\t },\n\t\t shift: function() {\n\t\t return this.pop.apply(this, arguments);\n\t\t },\n\t\t clear: function() {\n\t\t if (this.size === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = 0;\n\t\t this._head = undefined;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return emptyStack();\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t if (wholeSlice(begin, end, this.size)) {\n\t\t return this;\n\t\t }\n\t\t var resolvedBegin = resolveBegin(begin, this.size);\n\t\t var resolvedEnd = resolveEnd(end, this.size);\n\t\t if (resolvedEnd !== this.size) {\n\t\t return $traceurRuntime.superCall(this, $Stack.prototype, \"slice\", [begin, end]);\n\t\t }\n\t\t var newSize = this.size - resolvedBegin;\n\t\t var head = this._head;\n\t\t while (resolvedBegin--) {\n\t\t head = head.next;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = newSize;\n\t\t this._head = head;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return makeStack(newSize, head);\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this.__altered = false;\n\t\t return this;\n\t\t }\n\t\t return makeStack(this.size, this._head, ownerID, this.__hash);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t if (reverse) {\n\t\t return this.toSeq().cacheResult.__iterate(fn, reverse);\n\t\t }\n\t\t var iterations = 0;\n\t\t var node = this._head;\n\t\t while (node) {\n\t\t if (fn(node.value, iterations++, this) === false) {\n\t\t break;\n\t\t }\n\t\t node = node.next;\n\t\t }\n\t\t return iterations;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.toSeq().cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterations = 0;\n\t\t var node = this._head;\n\t\t return new Iterator((function() {\n\t\t if (node) {\n\t\t var value = node.value;\n\t\t node = node.next;\n\t\t return iteratorValue(type, iterations++, value);\n\t\t }\n\t\t return iteratorDone();\n\t\t }));\n\t\t }\n\t\t}, {of: function() {\n\t\t return this(arguments);\n\t\t }}, IndexedCollection);\n\t\tfunction isStack(maybeStack) {\n\t\t return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);\n\t\t}\n\t\tStack.isStack = isStack;\n\t\tvar IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\t\tvar StackPrototype = Stack.prototype;\n\t\tStackPrototype[IS_STACK_SENTINEL] = true;\n\t\tStackPrototype.withMutations = MapPrototype.withMutations;\n\t\tStackPrototype.asMutable = MapPrototype.asMutable;\n\t\tStackPrototype.asImmutable = MapPrototype.asImmutable;\n\t\tStackPrototype.wasAltered = MapPrototype.wasAltered;\n\t\tfunction makeStack(size, head, ownerID, hash) {\n\t\t var map = Object.create(StackPrototype);\n\t\t map.size = size;\n\t\t map._head = head;\n\t\t map.__ownerID = ownerID;\n\t\t map.__hash = hash;\n\t\t map.__altered = false;\n\t\t return map;\n\t\t}\n\t\tvar EMPTY_STACK;\n\t\tfunction emptyStack() {\n\t\t return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n\t\t}\n\t\tvar Set = function Set(value) {\n\t\t return value === null || value === undefined ? emptySet() : isSet(value) ? value : emptySet().withMutations((function(set) {\n\t\t var iter = SetIterable(value);\n\t\t assertNotInfinite(iter.size);\n\t\t iter.forEach((function(v) {\n\t\t return set.add(v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(Set, {\n\t\t toString: function() {\n\t\t return this.__toString('Set {', '}');\n\t\t },\n\t\t has: function(value) {\n\t\t return this._map.has(value);\n\t\t },\n\t\t add: function(value) {\n\t\t return updateSet(this, this._map.set(value, true));\n\t\t },\n\t\t remove: function(value) {\n\t\t return updateSet(this, this._map.remove(value));\n\t\t },\n\t\t clear: function() {\n\t\t return updateSet(this, this._map.clear());\n\t\t },\n\t\t union: function() {\n\t\t for (var iters = [],\n\t\t $__9 = 0; $__9 < arguments.length; $__9++)\n\t\t iters[$__9] = arguments[$__9];\n\t\t iters = iters.filter((function(x) {\n\t\t return x.size !== 0;\n\t\t }));\n\t\t if (iters.length === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.size === 0 && iters.length === 1) {\n\t\t return this.constructor(iters[0]);\n\t\t }\n\t\t return this.withMutations((function(set) {\n\t\t for (var ii = 0; ii < iters.length; ii++) {\n\t\t SetIterable(iters[ii]).forEach((function(value) {\n\t\t return set.add(value);\n\t\t }));\n\t\t }\n\t\t }));\n\t\t },\n\t\t intersect: function() {\n\t\t for (var iters = [],\n\t\t $__10 = 0; $__10 < arguments.length; $__10++)\n\t\t iters[$__10] = arguments[$__10];\n\t\t if (iters.length === 0) {\n\t\t return this;\n\t\t }\n\t\t iters = iters.map((function(iter) {\n\t\t return SetIterable(iter);\n\t\t }));\n\t\t var originalSet = this;\n\t\t return this.withMutations((function(set) {\n\t\t originalSet.forEach((function(value) {\n\t\t if (!iters.every((function(iter) {\n\t\t return iter.contains(value);\n\t\t }))) {\n\t\t set.remove(value);\n\t\t }\n\t\t }));\n\t\t }));\n\t\t },\n\t\t subtract: function() {\n\t\t for (var iters = [],\n\t\t $__11 = 0; $__11 < arguments.length; $__11++)\n\t\t iters[$__11] = arguments[$__11];\n\t\t if (iters.length === 0) {\n\t\t return this;\n\t\t }\n\t\t iters = iters.map((function(iter) {\n\t\t return SetIterable(iter);\n\t\t }));\n\t\t var originalSet = this;\n\t\t return this.withMutations((function(set) {\n\t\t originalSet.forEach((function(value) {\n\t\t if (iters.some((function(iter) {\n\t\t return iter.contains(value);\n\t\t }))) {\n\t\t set.remove(value);\n\t\t }\n\t\t }));\n\t\t }));\n\t\t },\n\t\t merge: function() {\n\t\t return this.union.apply(this, arguments);\n\t\t },\n\t\t mergeWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__12 = 1; $__12 < arguments.length; $__12++)\n\t\t iters[$__12 - 1] = arguments[$__12];\n\t\t return this.union.apply(this, iters);\n\t\t },\n\t\t sort: function(comparator) {\n\t\t return OrderedSet(sortFactory(this, comparator));\n\t\t },\n\t\t sortBy: function(mapper, comparator) {\n\t\t return OrderedSet(sortFactory(this, comparator, mapper));\n\t\t },\n\t\t wasAltered: function() {\n\t\t return this._map.wasAltered();\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return this._map.__iterate((function(_, k) {\n\t\t return fn(k, k, $__0);\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return this._map.map((function(_, k) {\n\t\t return k;\n\t\t })).__iterator(type, reverse);\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t var newMap = this._map.__ensureOwner(ownerID);\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this._map = newMap;\n\t\t return this;\n\t\t }\n\t\t return this.__make(newMap, ownerID);\n\t\t }\n\t\t}, {\n\t\t of: function() {\n\t\t return this(arguments);\n\t\t },\n\t\t fromKeys: function(value) {\n\t\t return this(KeyedIterable(value).keySeq());\n\t\t }\n\t\t}, SetCollection);\n\t\tfunction isSet(maybeSet) {\n\t\t return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);\n\t\t}\n\t\tSet.isSet = isSet;\n\t\tvar IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\n\t\tvar SetPrototype = Set.prototype;\n\t\tSetPrototype[IS_SET_SENTINEL] = true;\n\t\tSetPrototype[DELETE] = SetPrototype.remove;\n\t\tSetPrototype.mergeDeep = SetPrototype.merge;\n\t\tSetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n\t\tSetPrototype.withMutations = MapPrototype.withMutations;\n\t\tSetPrototype.asMutable = MapPrototype.asMutable;\n\t\tSetPrototype.asImmutable = MapPrototype.asImmutable;\n\t\tSetPrototype.__empty = emptySet;\n\t\tSetPrototype.__make = makeSet;\n\t\tfunction updateSet(set, newMap) {\n\t\t if (set.__ownerID) {\n\t\t set.size = newMap.size;\n\t\t set._map = newMap;\n\t\t return set;\n\t\t }\n\t\t return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap);\n\t\t}\n\t\tfunction makeSet(map, ownerID) {\n\t\t var set = Object.create(SetPrototype);\n\t\t set.size = map ? map.size : 0;\n\t\t set._map = map;\n\t\t set.__ownerID = ownerID;\n\t\t return set;\n\t\t}\n\t\tvar EMPTY_SET;\n\t\tfunction emptySet() {\n\t\t return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n\t\t}\n\t\tvar OrderedSet = function OrderedSet(value) {\n\t\t return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations((function(set) {\n\t\t var iter = SetIterable(value);\n\t\t assertNotInfinite(iter.size);\n\t\t iter.forEach((function(v) {\n\t\t return set.add(v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(OrderedSet, {toString: function() {\n\t\t return this.__toString('OrderedSet {', '}');\n\t\t }}, {\n\t\t of: function() {\n\t\t return this(arguments);\n\t\t },\n\t\t fromKeys: function(value) {\n\t\t return this(KeyedIterable(value).keySeq());\n\t\t }\n\t\t}, Set);\n\t\tfunction isOrderedSet(maybeOrderedSet) {\n\t\t return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);\n\t\t}\n\t\tOrderedSet.isOrderedSet = isOrderedSet;\n\t\tvar OrderedSetPrototype = OrderedSet.prototype;\n\t\tOrderedSetPrototype[IS_ORDERED_SENTINEL] = true;\n\t\tOrderedSetPrototype.__empty = emptyOrderedSet;\n\t\tOrderedSetPrototype.__make = makeOrderedSet;\n\t\tfunction makeOrderedSet(map, ownerID) {\n\t\t var set = Object.create(OrderedSetPrototype);\n\t\t set.size = map ? map.size : 0;\n\t\t set._map = map;\n\t\t set.__ownerID = ownerID;\n\t\t return set;\n\t\t}\n\t\tvar EMPTY_ORDERED_SET;\n\t\tfunction emptyOrderedSet() {\n\t\t return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));\n\t\t}\n\t\tvar Record = function Record(defaultValues, name) {\n\t\t var RecordType = function Record(values) {\n\t\t if (!(this instanceof RecordType)) {\n\t\t return new RecordType(values);\n\t\t }\n\t\t this._map = Map(values);\n\t\t };\n\t\t var keys = Object.keys(defaultValues);\n\t\t var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n\t\t RecordTypePrototype.constructor = RecordType;\n\t\t name && (RecordTypePrototype._name = name);\n\t\t RecordTypePrototype._defaultValues = defaultValues;\n\t\t RecordTypePrototype._keys = keys;\n\t\t RecordTypePrototype.size = keys.length;\n\t\t try {\n\t\t keys.forEach((function(key) {\n\t\t Object.defineProperty(RecordType.prototype, key, {\n\t\t get: function() {\n\t\t return this.get(key);\n\t\t },\n\t\t set: function(value) {\n\t\t invariant(this.__ownerID, 'Cannot set on an immutable record.');\n\t\t this.set(key, value);\n\t\t }\n\t\t });\n\t\t }));\n\t\t } catch (error) {}\n\t\t return RecordType;\n\t\t};\n\t\t($traceurRuntime.createClass)(Record, {\n\t\t toString: function() {\n\t\t return this.__toString(recordName(this) + ' {', '}');\n\t\t },\n\t\t has: function(k) {\n\t\t return this._defaultValues.hasOwnProperty(k);\n\t\t },\n\t\t get: function(k, notSetValue) {\n\t\t if (!this.has(k)) {\n\t\t return notSetValue;\n\t\t }\n\t\t var defaultVal = this._defaultValues[k];\n\t\t return this._map ? this._map.get(k, defaultVal) : defaultVal;\n\t\t },\n\t\t clear: function() {\n\t\t if (this.__ownerID) {\n\t\t this._map && this._map.clear();\n\t\t return this;\n\t\t }\n\t\t var SuperRecord = Object.getPrototypeOf(this).constructor;\n\t\t return SuperRecord._empty || (SuperRecord._empty = makeRecord(this, emptyMap()));\n\t\t },\n\t\t set: function(k, v) {\n\t\t if (!this.has(k)) {\n\t\t throw new Error('Cannot set unknown key \"' + k + '\" on ' + recordName(this));\n\t\t }\n\t\t var newMap = this._map && this._map.set(k, v);\n\t\t if (this.__ownerID || newMap === this._map) {\n\t\t return this;\n\t\t }\n\t\t return makeRecord(this, newMap);\n\t\t },\n\t\t remove: function(k) {\n\t\t if (!this.has(k)) {\n\t\t return this;\n\t\t }\n\t\t var newMap = this._map && this._map.remove(k);\n\t\t if (this.__ownerID || newMap === this._map) {\n\t\t return this;\n\t\t }\n\t\t return makeRecord(this, newMap);\n\t\t },\n\t\t wasAltered: function() {\n\t\t return this._map.wasAltered();\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var $__0 = this;\n\t\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t\t return $__0.get(k);\n\t\t })).__iterator(type, reverse);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t\t return $__0.get(k);\n\t\t })).__iterate(fn, reverse);\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t var newMap = this._map && this._map.__ensureOwner(ownerID);\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this._map = newMap;\n\t\t return this;\n\t\t }\n\t\t return makeRecord(this, newMap, ownerID);\n\t\t }\n\t\t}, {}, KeyedCollection);\n\t\tvar RecordPrototype = Record.prototype;\n\t\tRecordPrototype[DELETE] = RecordPrototype.remove;\n\t\tRecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn;\n\t\tRecordPrototype.merge = MapPrototype.merge;\n\t\tRecordPrototype.mergeWith = MapPrototype.mergeWith;\n\t\tRecordPrototype.mergeIn = MapPrototype.mergeIn;\n\t\tRecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n\t\tRecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n\t\tRecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n\t\tRecordPrototype.setIn = MapPrototype.setIn;\n\t\tRecordPrototype.update = MapPrototype.update;\n\t\tRecordPrototype.updateIn = MapPrototype.updateIn;\n\t\tRecordPrototype.withMutations = MapPrototype.withMutations;\n\t\tRecordPrototype.asMutable = MapPrototype.asMutable;\n\t\tRecordPrototype.asImmutable = MapPrototype.asImmutable;\n\t\tfunction makeRecord(likeRecord, map, ownerID) {\n\t\t var record = Object.create(Object.getPrototypeOf(likeRecord));\n\t\t record._map = map;\n\t\t record.__ownerID = ownerID;\n\t\t return record;\n\t\t}\n\t\tfunction recordName(record) {\n\t\t return record._name || record.constructor.name;\n\t\t}\n\t\tvar Range = function Range(start, end, step) {\n\t\t if (!(this instanceof $Range)) {\n\t\t return new $Range(start, end, step);\n\t\t }\n\t\t invariant(step !== 0, 'Cannot step a Range by 0');\n\t\t start = start || 0;\n\t\t if (end === undefined) {\n\t\t end = Infinity;\n\t\t }\n\t\t if (start === end && __EMPTY_RANGE) {\n\t\t return __EMPTY_RANGE;\n\t\t }\n\t\t step = step === undefined ? 1 : Math.abs(step);\n\t\t if (end < start) {\n\t\t step = -step;\n\t\t }\n\t\t this._start = start;\n\t\t this._end = end;\n\t\t this._step = step;\n\t\t this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n\t\t};\n\t\tvar $Range = Range;\n\t\t($traceurRuntime.createClass)(Range, {\n\t\t toString: function() {\n\t\t if (this.size === 0) {\n\t\t return 'Range []';\n\t\t }\n\t\t return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]';\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;\n\t\t },\n\t\t contains: function(searchValue) {\n\t\t var possibleIndex = (searchValue - this._start) / this._step;\n\t\t return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t if (wholeSlice(begin, end, this.size)) {\n\t\t return this;\n\t\t }\n\t\t begin = resolveBegin(begin, this.size);\n\t\t end = resolveEnd(end, this.size);\n\t\t if (end <= begin) {\n\t\t return __EMPTY_RANGE;\n\t\t }\n\t\t return new $Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n\t\t },\n\t\t indexOf: function(searchValue) {\n\t\t var offsetValue = searchValue - this._start;\n\t\t if (offsetValue % this._step === 0) {\n\t\t var index = offsetValue / this._step;\n\t\t if (index >= 0 && index < this.size) {\n\t\t return index;\n\t\t }\n\t\t }\n\t\t return -1;\n\t\t },\n\t\t lastIndexOf: function(searchValue) {\n\t\t return this.indexOf(searchValue);\n\t\t },\n\t\t take: function(amount) {\n\t\t return this.slice(0, Math.max(0, amount));\n\t\t },\n\t\t skip: function(amount) {\n\t\t return this.slice(Math.max(0, amount));\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var maxIndex = this.size - 1;\n\t\t var step = this._step;\n\t\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t\t if (fn(value, ii, this) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t value += reverse ? -step : step;\n\t\t }\n\t\t return ii;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var maxIndex = this.size - 1;\n\t\t var step = this._step;\n\t\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t var v = value;\n\t\t value += reverse ? -step : step;\n\t\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n\t\t }));\n\t\t },\n\t\t equals: function(other) {\n\t\t return other instanceof $Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other);\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar RangePrototype = Range.prototype;\n\t\tRangePrototype.__toJS = RangePrototype.toArray;\n\t\tRangePrototype.first = ListPrototype.first;\n\t\tRangePrototype.last = ListPrototype.last;\n\t\tvar __EMPTY_RANGE = Range(0, 0);\n\t\tvar Repeat = function Repeat(value, times) {\n\t\t if (times <= 0 && EMPTY_REPEAT) {\n\t\t return EMPTY_REPEAT;\n\t\t }\n\t\t if (!(this instanceof $Repeat)) {\n\t\t return new $Repeat(value, times);\n\t\t }\n\t\t this._value = value;\n\t\t this.size = times === undefined ? Infinity : Math.max(0, times);\n\t\t if (this.size === 0) {\n\t\t EMPTY_REPEAT = this;\n\t\t }\n\t\t};\n\t\tvar $Repeat = Repeat;\n\t\t($traceurRuntime.createClass)(Repeat, {\n\t\t toString: function() {\n\t\t if (this.size === 0) {\n\t\t return 'Repeat []';\n\t\t }\n\t\t return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t return this.has(index) ? this._value : notSetValue;\n\t\t },\n\t\t contains: function(searchValue) {\n\t\t return is(this._value, searchValue);\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t var size = this.size;\n\t\t return wholeSlice(begin, end, size) ? this : new $Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n\t\t },\n\t\t reverse: function() {\n\t\t return this;\n\t\t },\n\t\t indexOf: function(searchValue) {\n\t\t if (is(this._value, searchValue)) {\n\t\t return 0;\n\t\t }\n\t\t return -1;\n\t\t },\n\t\t lastIndexOf: function(searchValue) {\n\t\t if (is(this._value, searchValue)) {\n\t\t return this.size;\n\t\t }\n\t\t return -1;\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t for (var ii = 0; ii < this.size; ii++) {\n\t\t if (fn(this._value, ii, this) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t }\n\t\t return ii;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var $__0 = this;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t return ii < $__0.size ? iteratorValue(type, ii++, $__0._value) : iteratorDone();\n\t\t }));\n\t\t },\n\t\t equals: function(other) {\n\t\t return other instanceof $Repeat ? is(this._value, other._value) : deepEqual(other);\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar RepeatPrototype = Repeat.prototype;\n\t\tRepeatPrototype.last = RepeatPrototype.first;\n\t\tRepeatPrototype.has = RangePrototype.has;\n\t\tRepeatPrototype.take = RangePrototype.take;\n\t\tRepeatPrototype.skip = RangePrototype.skip;\n\t\tRepeatPrototype.__toJS = RangePrototype.__toJS;\n\t\tvar EMPTY_REPEAT;\n\t\tvar Immutable = {\n\t\t Iterable: Iterable,\n\t\t Seq: Seq,\n\t\t Collection: Collection,\n\t\t Map: Map,\n\t\t OrderedMap: OrderedMap,\n\t\t List: List,\n\t\t Stack: Stack,\n\t\t Set: Set,\n\t\t OrderedSet: OrderedSet,\n\t\t Record: Record,\n\t\t Range: Range,\n\t\t Repeat: Repeat,\n\t\t is: is,\n\t\t fromJS: fromJS\n\t\t};\n\n\t\t return Immutable;\n\t\t}", "function Module(stdlib, imports, buffer) {\n \"use asm\";\n\n function f() {\n return 281474976710655 * 1048575 | 0;\n }\n\n return {\n f: f\n };\n}", "function v7(v8,v9) {\n const v10 = gc;\n // v10 = .function([] => .undefined)\n let v13 = 0;\n const v16 = [13.37,13.37,13.37,13.37];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = [1337,1337,1337,1337];\n // v18 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v19 = [3697200800,v16,v18];\n // v19 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v20 = v6[0];\n // v20 = .unknown\n const v21 = Symbol;\n // v21 = .object(ofGroup: SymbolConstructor, withProperties: [\"match\", \"asyncIterator\", \"search\", \"iterator\", \"replace\", \"isConcatSpreadable\", \"toStringTag\", \"split\", \"toPrimitive\", \"matchAll\", \"hasInstance\", \"unscopable\", \"species\"], withMethods: [\"for\", \"keyFor\"]) + .function([.string] => .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"]))\n for (let v25 = 0; v25 < 4; v25 = v25 + 1) {\n }\n function v27(v28,v29) {\n }\n do {\n const v31 = [13.37,13.37,13.37,13.37];\n // v31 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v34 = [1337,1337,Function,1337];\n // v34 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v35 = {__proto__:v34,a:v31,c:1337,d:Function,e:v34,toString:Function};\n // v35 = .object(ofGroup: Object, withProperties: [\"a\", \"__proto__\", \"toString\", \"d\", \"c\", \"e\"])\n let v39 = 0;\n while (v39 < 1337) {\n const v40 = v39 + 1;\n // v40 = .primitive\n v39 = v40;\n }\n const v41 = [13.37,13.37,13.37,13.37];\n // v41 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v43 = [1337,1337,1337,1337];\n // v43 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v44 = [3697200800,v41,v43];\n // v44 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v45 = v13 + 1;\n // v45 = .primitive\n function v48(v49,v50) {\n return v44;\n }\n const v51 = [1337,1337,1337,1337];\n // v51 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n for (let v54 = 0; v54 < 100; v54 = v54 + 100) {\n }\n const v55 = {__proto__:v51,a:1337,c:1337,d:Function,e:v51,toString:Function};\n // v55 = .object(ofGroup: Object, withProperties: [\"e\", \"c\", \"__proto__\", \"toString\", \"d\", \"a\"])\n const v56 = v48(1337,v41,...v55);\n // v56 = .unknown\n v13 = v45;\n } while (v13 < 7);\n return v3;\n}", "function e(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "function universalModule() {\n\t var $Object = Object;\n\n\tfunction createClass(ctor, methods, staticMethods, superClass) {\n\t var proto;\n\t if (superClass) {\n\t var superProto = superClass.prototype;\n\t proto = $Object.create(superProto);\n\t } else {\n\t proto = ctor.prototype;\n\t }\n\t $Object.keys(methods).forEach(function (key) {\n\t proto[key] = methods[key];\n\t });\n\t $Object.keys(staticMethods).forEach(function (key) {\n\t ctor[key] = staticMethods[key];\n\t });\n\t proto.constructor = ctor;\n\t ctor.prototype = proto;\n\t return ctor;\n\t}\n\n\tfunction superCall(self, proto, name, args) {\n\t return $Object.getPrototypeOf(proto)[name].apply(self, args);\n\t}\n\n\tfunction defaultSuperCall(self, proto, args) {\n\t superCall(self, proto, 'constructor', args);\n\t}\n\n\tvar $traceurRuntime = {};\n\t$traceurRuntime.createClass = createClass;\n\t$traceurRuntime.superCall = superCall;\n\t$traceurRuntime.defaultSuperCall = defaultSuperCall;\n\t\"use strict\";\n\tfunction is(first, second) {\n\t if (first === second) {\n\t return first !== 0 || second !== 0 || 1 / first === 1 / second;\n\t }\n\t if (first !== first) {\n\t return second !== second;\n\t }\n\t if (first && typeof first.equals === 'function') {\n\t return first.equals(second);\n\t }\n\t return false;\n\t}\n\tfunction invariant(condition, error) {\n\t if (!condition)\n\t throw new Error(error);\n\t}\n\tvar DELETE = 'delete';\n\tvar SHIFT = 5;\n\tvar SIZE = 1 << SHIFT;\n\tvar MASK = SIZE - 1;\n\tvar NOT_SET = {};\n\tvar CHANGE_LENGTH = {value: false};\n\tvar DID_ALTER = {value: false};\n\tfunction MakeRef(ref) {\n\t ref.value = false;\n\t return ref;\n\t}\n\tfunction SetRef(ref) {\n\t ref && (ref.value = true);\n\t}\n\tfunction OwnerID() {}\n\tfunction arrCopy(arr, offset) {\n\t offset = offset || 0;\n\t var len = Math.max(0, arr.length - offset);\n\t var newArr = new Array(len);\n\t for (var ii = 0; ii < len; ii++) {\n\t newArr[ii] = arr[ii + offset];\n\t }\n\t return newArr;\n\t}\n\tfunction assertNotInfinite(size) {\n\t invariant(size !== Infinity, 'Cannot perform this action with an infinite size.');\n\t}\n\tfunction ensureSize(iter) {\n\t if (iter.size === undefined) {\n\t iter.size = iter.__iterate(returnTrue);\n\t }\n\t return iter.size;\n\t}\n\tfunction wrapIndex(iter, index) {\n\t return index >= 0 ? index : ensureSize(iter) + index;\n\t}\n\tfunction returnTrue() {\n\t return true;\n\t}\n\tfunction wholeSlice(begin, end, size) {\n\t return (begin === 0 || (size !== undefined && begin <= -size)) && (end === undefined || (size !== undefined && end >= size));\n\t}\n\tfunction resolveBegin(begin, size) {\n\t return resolveIndex(begin, size, 0);\n\t}\n\tfunction resolveEnd(end, size) {\n\t return resolveIndex(end, size, size);\n\t}\n\tfunction resolveIndex(index, size, defaultIndex) {\n\t return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index);\n\t}\n\tfunction hash(o) {\n\t if (!o) {\n\t return 0;\n\t }\n\t if (o === true) {\n\t return 1;\n\t }\n\t var type = typeof o;\n\t if (type === 'number') {\n\t if ((o | 0) === o) {\n\t return o & HASH_MAX_VAL;\n\t }\n\t o = '' + o;\n\t type = 'string';\n\t }\n\t if (type === 'string') {\n\t return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n\t }\n\t if (o.hashCode) {\n\t return hash(typeof o.hashCode === 'function' ? o.hashCode() : o.hashCode);\n\t }\n\t return hashJSObj(o);\n\t}\n\tfunction cachedHashString(string) {\n\t var hash = stringHashCache[string];\n\t if (hash === undefined) {\n\t hash = hashString(string);\n\t if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n\t STRING_HASH_CACHE_SIZE = 0;\n\t stringHashCache = {};\n\t }\n\t STRING_HASH_CACHE_SIZE++;\n\t stringHashCache[string] = hash;\n\t }\n\t return hash;\n\t}\n\tfunction hashString(string) {\n\t var hash = 0;\n\t for (var ii = 0; ii < string.length; ii++) {\n\t hash = (31 * hash + string.charCodeAt(ii)) & HASH_MAX_VAL;\n\t }\n\t return hash;\n\t}\n\tfunction hashJSObj(obj) {\n\t var hash = weakMap && weakMap.get(obj);\n\t if (hash)\n\t return hash;\n\t hash = obj[UID_HASH_KEY];\n\t if (hash)\n\t return hash;\n\t if (!canDefineProperty) {\n\t hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n\t if (hash)\n\t return hash;\n\t hash = getIENodeHash(obj);\n\t if (hash)\n\t return hash;\n\t }\n\t if (Object.isExtensible && !Object.isExtensible(obj)) {\n\t throw new Error('Non-extensible objects are not allowed as keys.');\n\t }\n\t hash = ++objHashUID & HASH_MAX_VAL;\n\t if (weakMap) {\n\t weakMap.set(obj, hash);\n\t } else if (canDefineProperty) {\n\t Object.defineProperty(obj, UID_HASH_KEY, {\n\t 'enumerable': false,\n\t 'configurable': false,\n\t 'writable': false,\n\t 'value': hash\n\t });\n\t } else if (obj.propertyIsEnumerable && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n\t obj.propertyIsEnumerable = function() {\n\t return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n\t };\n\t obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n\t } else if (obj.nodeType) {\n\t obj[UID_HASH_KEY] = hash;\n\t } else {\n\t throw new Error('Unable to set a non-enumerable property on object.');\n\t }\n\t return hash;\n\t}\n\tvar canDefineProperty = (function() {\n\t try {\n\t Object.defineProperty({}, 'x', {});\n\t return true;\n\t } catch (e) {\n\t return false;\n\t }\n\t}());\n\tfunction getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1:\n\t return node.uniqueID;\n\t case 9:\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t}\n\tvar weakMap = typeof WeakMap === 'function' && new WeakMap();\n\tvar HASH_MAX_VAL = 0x7FFFFFFF;\n\tvar objHashUID = 0;\n\tvar UID_HASH_KEY = '__immutablehash__';\n\tif (typeof Symbol === 'function') {\n\t UID_HASH_KEY = Symbol(UID_HASH_KEY);\n\t}\n\tvar STRING_HASH_CACHE_MIN_STRLEN = 16;\n\tvar STRING_HASH_CACHE_MAX_SIZE = 255;\n\tvar STRING_HASH_CACHE_SIZE = 0;\n\tvar stringHashCache = {};\n\tvar ITERATE_KEYS = 0;\n\tvar ITERATE_VALUES = 1;\n\tvar ITERATE_ENTRIES = 2;\n\tvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\tvar REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n\tvar ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\tvar Iterator = function Iterator(next) {\n\t this.next = next;\n\t};\n\t($traceurRuntime.createClass)(Iterator, {toString: function() {\n\t return '[Iterator]';\n\t }}, {});\n\tIterator.KEYS = ITERATE_KEYS;\n\tIterator.VALUES = ITERATE_VALUES;\n\tIterator.ENTRIES = ITERATE_ENTRIES;\n\tvar IteratorPrototype = Iterator.prototype;\n\tIteratorPrototype.inspect = IteratorPrototype.toSource = function() {\n\t return this.toString();\n\t};\n\tIteratorPrototype[ITERATOR_SYMBOL] = function() {\n\t return this;\n\t};\n\tfunction iteratorValue(type, k, v, iteratorResult) {\n\t var value = type === 0 ? k : type === 1 ? v : [k, v];\n\t iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {\n\t value: value,\n\t done: false\n\t });\n\t return iteratorResult;\n\t}\n\tfunction iteratorDone() {\n\t return {\n\t value: undefined,\n\t done: true\n\t };\n\t}\n\tfunction hasIterator(maybeIterable) {\n\t return !!_iteratorFn(maybeIterable);\n\t}\n\tfunction isIterator(maybeIterator) {\n\t return maybeIterator && typeof maybeIterator.next === 'function';\n\t}\n\tfunction getIterator(iterable) {\n\t var iteratorFn = _iteratorFn(iterable);\n\t return iteratorFn && iteratorFn.call(iterable);\n\t}\n\tfunction _iteratorFn(iterable) {\n\t var iteratorFn = iterable && ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL]);\n\t if (typeof iteratorFn === 'function') {\n\t return iteratorFn;\n\t }\n\t}\n\tvar Iterable = function Iterable(value) {\n\t return isIterable(value) ? value : Seq(value);\n\t};\n\tvar $Iterable = Iterable;\n\t($traceurRuntime.createClass)(Iterable, {\n\t toArray: function() {\n\t assertNotInfinite(this.size);\n\t var array = new Array(this.size || 0);\n\t this.valueSeq().__iterate((function(v, i) {\n\t array[i] = v;\n\t }));\n\t return array;\n\t },\n\t toIndexedSeq: function() {\n\t return new ToIndexedSequence(this);\n\t },\n\t toJS: function() {\n\t return this.toSeq().map((function(value) {\n\t return value && typeof value.toJS === 'function' ? value.toJS() : value;\n\t })).__toJS();\n\t },\n\t toKeyedSeq: function() {\n\t return new ToKeyedSequence(this, true);\n\t },\n\t toMap: function() {\n\t assertNotInfinite(this.size);\n\t return Map(this.toKeyedSeq());\n\t },\n\t toObject: function() {\n\t assertNotInfinite(this.size);\n\t var object = {};\n\t this.__iterate((function(v, k) {\n\t object[k] = v;\n\t }));\n\t return object;\n\t },\n\t toOrderedMap: function() {\n\t assertNotInfinite(this.size);\n\t return OrderedMap(this.toKeyedSeq());\n\t },\n\t toSet: function() {\n\t assertNotInfinite(this.size);\n\t return Set(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toSetSeq: function() {\n\t return new ToSetSequence(this);\n\t },\n\t toSeq: function() {\n\t return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();\n\t },\n\t toStack: function() {\n\t assertNotInfinite(this.size);\n\t return Stack(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toList: function() {\n\t assertNotInfinite(this.size);\n\t return List(isKeyed(this) ? this.valueSeq() : this);\n\t },\n\t toString: function() {\n\t return '[Iterable]';\n\t },\n\t __toString: function(head, tail) {\n\t if (this.size === 0) {\n\t return head + tail;\n\t }\n\t return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n\t },\n\t concat: function() {\n\t for (var values = [],\n\t $__2 = 0; $__2 < arguments.length; $__2++)\n\t values[$__2] = arguments[$__2];\n\t return reify(this, concatFactory(this, values));\n\t },\n\t contains: function(searchValue) {\n\t return this.some((function(value) {\n\t return is(value, searchValue);\n\t }));\n\t },\n\t entries: function() {\n\t return this.__iterator(ITERATE_ENTRIES);\n\t },\n\t every: function(predicate, context) {\n\t var returnValue = true;\n\t this.__iterate((function(v, k, c) {\n\t if (!predicate.call(context, v, k, c)) {\n\t returnValue = false;\n\t return false;\n\t }\n\t }));\n\t return returnValue;\n\t },\n\t filter: function(predicate, context) {\n\t return reify(this, filterFactory(this, predicate, context, true));\n\t },\n\t find: function(predicate, context, notSetValue) {\n\t var foundValue = notSetValue;\n\t this.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t foundValue = v;\n\t return false;\n\t }\n\t }));\n\t return foundValue;\n\t },\n\t forEach: function(sideEffect, context) {\n\t return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n\t },\n\t join: function(separator) {\n\t separator = separator !== undefined ? '' + separator : ',';\n\t var joined = '';\n\t var isFirst = true;\n\t this.__iterate((function(v) {\n\t isFirst ? (isFirst = false) : (joined += separator);\n\t joined += v !== null && v !== undefined ? v : '';\n\t }));\n\t return joined;\n\t },\n\t keys: function() {\n\t return this.__iterator(ITERATE_KEYS);\n\t },\n\t map: function(mapper, context) {\n\t return reify(this, mapFactory(this, mapper, context));\n\t },\n\t reduce: function(reducer, initialReduction, context) {\n\t var reduction;\n\t var useFirst;\n\t if (arguments.length < 2) {\n\t useFirst = true;\n\t } else {\n\t reduction = initialReduction;\n\t }\n\t this.__iterate((function(v, k, c) {\n\t if (useFirst) {\n\t useFirst = false;\n\t reduction = v;\n\t } else {\n\t reduction = reducer.call(context, reduction, v, k, c);\n\t }\n\t }));\n\t return reduction;\n\t },\n\t reduceRight: function(reducer, initialReduction, context) {\n\t var reversed = this.toKeyedSeq().reverse();\n\t return reversed.reduce.apply(reversed, arguments);\n\t },\n\t reverse: function() {\n\t return reify(this, reverseFactory(this, true));\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t var resolvedBegin = resolveBegin(begin, this.size);\n\t var resolvedEnd = resolveEnd(end, this.size);\n\t if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n\t return this.toSeq().cacheResult().slice(begin, end);\n\t }\n\t var skipped = resolvedBegin === 0 ? this : this.skip(resolvedBegin);\n\t return reify(this, resolvedEnd === undefined || resolvedEnd === this.size ? skipped : skipped.take(resolvedEnd - resolvedBegin));\n\t },\n\t some: function(predicate, context) {\n\t return !this.every(not(predicate), context);\n\t },\n\t sort: function(comparator) {\n\t return this.sortBy(valueMapper, comparator);\n\t },\n\t values: function() {\n\t return this.__iterator(ITERATE_VALUES);\n\t },\n\t butLast: function() {\n\t return this.slice(0, -1);\n\t },\n\t count: function(predicate, context) {\n\t return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);\n\t },\n\t countBy: function(grouper, context) {\n\t return countByFactory(this, grouper, context);\n\t },\n\t equals: function(other) {\n\t if (this === other) {\n\t return true;\n\t }\n\t if (!other || typeof other.equals !== 'function') {\n\t return false;\n\t }\n\t if (this.size !== undefined && other.size !== undefined) {\n\t if (this.size !== other.size) {\n\t return false;\n\t }\n\t if (this.size === 0 && other.size === 0) {\n\t return true;\n\t }\n\t }\n\t if (this.__hash !== undefined && other.__hash !== undefined && this.__hash !== other.__hash) {\n\t return false;\n\t }\n\t return this.__deepEquals(other);\n\t },\n\t __deepEquals: function(other) {\n\t var entries = this.entries();\n\t return typeof other.every === 'function' && other.every((function(v, k) {\n\t var entry = entries.next().value;\n\t return entry && is(entry[0], k) && is(entry[1], v);\n\t })) && entries.next().done;\n\t },\n\t entrySeq: function() {\n\t var iterable = this;\n\t if (iterable._cache) {\n\t return new ArraySeq(iterable._cache);\n\t }\n\t var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();\n\t entriesSequence.fromEntrySeq = (function() {\n\t return iterable.toSeq();\n\t });\n\t return entriesSequence;\n\t },\n\t filterNot: function(predicate, context) {\n\t return this.filter(not(predicate), context);\n\t },\n\t findLast: function(predicate, context, notSetValue) {\n\t return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n\t },\n\t first: function() {\n\t return this.find(returnTrue);\n\t },\n\t flatMap: function(mapper, context) {\n\t return reify(this, flatMapFactory(this, mapper, context));\n\t },\n\t flatten: function(depth) {\n\t return reify(this, flattenFactory(this, depth, true));\n\t },\n\t fromEntrySeq: function() {\n\t return new FromEntriesSequence(this);\n\t },\n\t get: function(searchKey, notSetValue) {\n\t return this.find((function(_, key) {\n\t return is(key, searchKey);\n\t }), undefined, notSetValue);\n\t },\n\t getIn: function(searchKeyPath, notSetValue) {\n\t var nested = this;\n\t if (searchKeyPath) {\n\t for (var ii = 0; ii < searchKeyPath.length; ii++) {\n\t nested = nested && nested.get ? nested.get(searchKeyPath[ii], NOT_SET) : NOT_SET;\n\t if (nested === NOT_SET) {\n\t return notSetValue;\n\t }\n\t }\n\t }\n\t return nested;\n\t },\n\t groupBy: function(grouper, context) {\n\t return groupByFactory(this, grouper, context);\n\t },\n\t has: function(searchKey) {\n\t return this.get(searchKey, NOT_SET) !== NOT_SET;\n\t },\n\t isSubset: function(iter) {\n\t iter = typeof iter.contains === 'function' ? iter : $Iterable(iter);\n\t return this.every((function(value) {\n\t return iter.contains(value);\n\t }));\n\t },\n\t isSuperset: function(iter) {\n\t return iter.isSubset(this);\n\t },\n\t keySeq: function() {\n\t return this.toSeq().map(keyMapper).toIndexedSeq();\n\t },\n\t last: function() {\n\t return this.toSeq().reverse().first();\n\t },\n\t max: function(comparator) {\n\t return this.maxBy(valueMapper, comparator);\n\t },\n\t maxBy: function(mapper, comparator) {\n\t var $__0 = this;\n\t comparator = comparator || defaultComparator;\n\t var maxEntry = this.entrySeq().reduce((function(max, next) {\n\t return comparator(mapper(next[1], next[0], $__0), mapper(max[1], max[0], $__0)) > 0 ? next : max;\n\t }));\n\t return maxEntry && maxEntry[1];\n\t },\n\t min: function(comparator) {\n\t return this.minBy(valueMapper, comparator);\n\t },\n\t minBy: function(mapper, comparator) {\n\t var $__0 = this;\n\t comparator = comparator || defaultComparator;\n\t var minEntry = this.entrySeq().reduce((function(min, next) {\n\t return comparator(mapper(next[1], next[0], $__0), mapper(min[1], min[0], $__0)) < 0 ? next : min;\n\t }));\n\t return minEntry && minEntry[1];\n\t },\n\t rest: function() {\n\t return this.slice(1);\n\t },\n\t skip: function(amount) {\n\t return reify(this, skipFactory(this, amount, true));\n\t },\n\t skipLast: function(amount) {\n\t return reify(this, this.toSeq().reverse().skip(amount).reverse());\n\t },\n\t skipWhile: function(predicate, context) {\n\t return reify(this, skipWhileFactory(this, predicate, context, true));\n\t },\n\t skipUntil: function(predicate, context) {\n\t return this.skipWhile(not(predicate), context);\n\t },\n\t sortBy: function(mapper, comparator) {\n\t var $__0 = this;\n\t comparator = comparator || defaultComparator;\n\t return reify(this, new ArraySeq(this.entrySeq().entrySeq().toArray().sort((function(a, b) {\n\t return comparator(mapper(a[1][1], a[1][0], $__0), mapper(b[1][1], b[1][0], $__0)) || a[0] - b[0];\n\t }))).fromEntrySeq().valueSeq().fromEntrySeq());\n\t },\n\t take: function(amount) {\n\t return reify(this, takeFactory(this, amount));\n\t },\n\t takeLast: function(amount) {\n\t return reify(this, this.toSeq().reverse().take(amount).reverse());\n\t },\n\t takeWhile: function(predicate, context) {\n\t return reify(this, takeWhileFactory(this, predicate, context));\n\t },\n\t takeUntil: function(predicate, context) {\n\t return this.takeWhile(not(predicate), context);\n\t },\n\t valueSeq: function() {\n\t return this.toIndexedSeq();\n\t },\n\t hashCode: function() {\n\t return this.__hash || (this.__hash = this.size === Infinity ? 0 : this.reduce((function(h, v, k) {\n\t return (h + (hash(v) ^ (v === k ? 0 : hash(k)))) & HASH_MAX_VAL;\n\t }), 0));\n\t }\n\t}, {});\n\tvar IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n\tvar IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n\tvar IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n\tvar IterablePrototype = Iterable.prototype;\n\tIterablePrototype[IS_ITERABLE_SENTINEL] = true;\n\tIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;\n\tIterablePrototype.toJSON = IterablePrototype.toJS;\n\tIterablePrototype.__toJS = IterablePrototype.toArray;\n\tIterablePrototype.__toStringMapper = quoteString;\n\tIterablePrototype.inspect = IterablePrototype.toSource = function() {\n\t return this.toString();\n\t};\n\tIterablePrototype.chain = IterablePrototype.flatMap;\n\t(function() {\n\t try {\n\t Object.defineProperty(IterablePrototype, 'length', {get: function() {\n\t if (!Iterable.noLengthWarning) {\n\t var stack;\n\t try {\n\t throw new Error();\n\t } catch (error) {\n\t stack = error.stack;\n\t }\n\t if (stack.indexOf('_wrapObject') === -1) {\n\t console && console.warn && console.warn('iterable.length has been deprecated, ' + 'use iterable.size or iterable.count(). ' + 'This warning will become a silent error in a future version. ' + stack);\n\t return this.size;\n\t }\n\t }\n\t }});\n\t } catch (e) {}\n\t})();\n\tvar KeyedIterable = function KeyedIterable(value) {\n\t return isKeyed(value) ? value : KeyedSeq(value);\n\t};\n\t($traceurRuntime.createClass)(KeyedIterable, {\n\t flip: function() {\n\t return reify(this, flipFactory(this));\n\t },\n\t findKey: function(predicate, context) {\n\t var foundKey;\n\t this.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t foundKey = k;\n\t return false;\n\t }\n\t }));\n\t return foundKey;\n\t },\n\t findLastKey: function(predicate, context) {\n\t return this.toSeq().reverse().findKey(predicate, context);\n\t },\n\t keyOf: function(searchValue) {\n\t return this.findKey((function(value) {\n\t return is(value, searchValue);\n\t }));\n\t },\n\t lastKeyOf: function(searchValue) {\n\t return this.toSeq().reverse().keyOf(searchValue);\n\t },\n\t mapEntries: function(mapper, context) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t return reify(this, this.toSeq().map((function(v, k) {\n\t return mapper.call(context, [k, v], iterations++, $__0);\n\t })).fromEntrySeq());\n\t },\n\t mapKeys: function(mapper, context) {\n\t var $__0 = this;\n\t return reify(this, this.toSeq().flip().map((function(k, v) {\n\t return mapper.call(context, k, v, $__0);\n\t })).flip());\n\t }\n\t}, {}, Iterable);\n\tvar KeyedIterablePrototype = KeyedIterable.prototype;\n\tKeyedIterablePrototype[IS_KEYED_SENTINEL] = true;\n\tKeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;\n\tKeyedIterablePrototype.__toJS = IterablePrototype.toObject;\n\tKeyedIterablePrototype.__toStringMapper = (function(v, k) {\n\t return k + ': ' + quoteString(v);\n\t});\n\tvar IndexedIterable = function IndexedIterable(value) {\n\t return isIndexed(value) ? value : IndexedSeq(value);\n\t};\n\t($traceurRuntime.createClass)(IndexedIterable, {\n\t toKeyedSeq: function() {\n\t return new ToKeyedSequence(this, false);\n\t },\n\t filter: function(predicate, context) {\n\t return reify(this, filterFactory(this, predicate, context, false));\n\t },\n\t findIndex: function(predicate, context) {\n\t var key = this.toKeyedSeq().findKey(predicate, context);\n\t return key === undefined ? -1 : key;\n\t },\n\t indexOf: function(searchValue) {\n\t var key = this.toKeyedSeq().keyOf(searchValue);\n\t return key === undefined ? -1 : key;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t var key = this.toKeyedSeq().lastKeyOf(searchValue);\n\t return key === undefined ? -1 : key;\n\t },\n\t reverse: function() {\n\t return reify(this, reverseFactory(this, false));\n\t },\n\t splice: function(index, removeNum) {\n\t var numArgs = arguments.length;\n\t removeNum = Math.max(removeNum | 0, 0);\n\t if (numArgs === 0 || (numArgs === 2 && !removeNum)) {\n\t return this;\n\t }\n\t index = resolveBegin(index, this.size);\n\t var spliced = this.slice(0, index);\n\t return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));\n\t },\n\t findLastIndex: function(predicate, context) {\n\t var key = this.toKeyedSeq().findLastKey(predicate, context);\n\t return key === undefined ? -1 : key;\n\t },\n\t first: function() {\n\t return this.get(0);\n\t },\n\t flatten: function(depth) {\n\t return reify(this, flattenFactory(this, depth, false));\n\t },\n\t get: function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return (index < 0 || (this.size === Infinity || (this.size !== undefined && index > this.size))) ? notSetValue : this.find((function(_, key) {\n\t return key === index;\n\t }), undefined, notSetValue);\n\t },\n\t has: function(index) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1);\n\t },\n\t interpose: function(separator) {\n\t return reify(this, interposeFactory(this, separator));\n\t },\n\t last: function() {\n\t return this.get(-1);\n\t },\n\t skip: function(amount) {\n\t var iter = this;\n\t var skipSeq = skipFactory(iter, amount, false);\n\t if (isSeq(iter) && skipSeq !== iter) {\n\t skipSeq.get = function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 ? iter.get(index + amount, notSetValue) : notSetValue;\n\t };\n\t }\n\t return reify(this, skipSeq);\n\t },\n\t skipWhile: function(predicate, context) {\n\t return reify(this, skipWhileFactory(this, predicate, context, false));\n\t },\n\t sortBy: function(mapper, comparator) {\n\t var $__0 = this;\n\t comparator = comparator || defaultComparator;\n\t return reify(this, new ArraySeq(this.entrySeq().toArray().sort((function(a, b) {\n\t return comparator(mapper(a[1], a[0], $__0), mapper(b[1], b[0], $__0)) || a[0] - b[0];\n\t }))).fromEntrySeq().valueSeq());\n\t },\n\t take: function(amount) {\n\t var iter = this;\n\t var takeSeq = takeFactory(iter, amount);\n\t if (isSeq(iter) && takeSeq !== iter) {\n\t takeSeq.get = function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 && index < amount ? iter.get(index, notSetValue) : notSetValue;\n\t };\n\t }\n\t return reify(this, takeSeq);\n\t }\n\t}, {}, Iterable);\n\tIndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;\n\tvar SetIterable = function SetIterable(value) {\n\t return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);\n\t};\n\t($traceurRuntime.createClass)(SetIterable, {\n\t get: function(value, notSetValue) {\n\t return this.has(value) ? value : notSetValue;\n\t },\n\t contains: function(value) {\n\t return this.has(value);\n\t },\n\t keySeq: function() {\n\t return this.valueSeq();\n\t }\n\t}, {}, Iterable);\n\tSetIterable.prototype.has = IterablePrototype.contains;\n\tfunction isIterable(maybeIterable) {\n\t return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);\n\t}\n\tfunction isKeyed(maybeKeyed) {\n\t return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);\n\t}\n\tfunction isIndexed(maybeIndexed) {\n\t return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);\n\t}\n\tfunction isAssociative(maybeAssociative) {\n\t return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n\t}\n\tIterable.isIterable = isIterable;\n\tIterable.isKeyed = isKeyed;\n\tIterable.isIndexed = isIndexed;\n\tIterable.isAssociative = isAssociative;\n\tIterable.Keyed = KeyedIterable;\n\tIterable.Indexed = IndexedIterable;\n\tIterable.Set = SetIterable;\n\tIterable.Iterator = Iterator;\n\tfunction valueMapper(v) {\n\t return v;\n\t}\n\tfunction keyMapper(v, k) {\n\t return k;\n\t}\n\tfunction entryMapper(v, k) {\n\t return [k, v];\n\t}\n\tfunction not(predicate) {\n\t return function() {\n\t return !predicate.apply(this, arguments);\n\t };\n\t}\n\tfunction quoteString(value) {\n\t return typeof value === 'string' ? JSON.stringify(value) : value;\n\t}\n\tfunction defaultComparator(a, b) {\n\t return a > b ? 1 : a < b ? -1 : 0;\n\t}\n\tfunction mixin(ctor, methods) {\n\t var proto = ctor.prototype;\n\t var keyCopier = (function(key) {\n\t proto[key] = methods[key];\n\t });\n\t Object.keys(methods).forEach(keyCopier);\n\t Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n\t return ctor;\n\t}\n\tvar Seq = function Seq(value) {\n\t return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);\n\t};\n\tvar $Seq = Seq;\n\t($traceurRuntime.createClass)(Seq, {\n\t toSeq: function() {\n\t return this;\n\t },\n\t toString: function() {\n\t return this.__toString('Seq {', '}');\n\t },\n\t cacheResult: function() {\n\t if (!this._cache && this.__iterateUncached) {\n\t this._cache = this.entrySeq().toArray();\n\t this.size = this._cache.length;\n\t }\n\t return this;\n\t },\n\t __iterate: function(fn, reverse) {\n\t return seqIterate(this, fn, reverse, true);\n\t },\n\t __iterator: function(type, reverse) {\n\t return seqIterator(this, type, reverse, true);\n\t }\n\t}, {of: function() {\n\t return $Seq(arguments);\n\t }}, Iterable);\n\tvar KeyedSeq = function KeyedSeq(value) {\n\t return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : keyedSeqFromValue(value);\n\t};\n\tvar $KeyedSeq = KeyedSeq;\n\t($traceurRuntime.createClass)(KeyedSeq, {\n\t toKeyedSeq: function() {\n\t return this;\n\t },\n\t toSeq: function() {\n\t return this;\n\t }\n\t}, {of: function() {\n\t return $KeyedSeq(arguments);\n\t }}, Seq);\n\tmixin(KeyedSeq, KeyedIterable.prototype);\n\tvar IndexedSeq = function IndexedSeq(value) {\n\t return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();\n\t};\n\tvar $IndexedSeq = IndexedSeq;\n\t($traceurRuntime.createClass)(IndexedSeq, {\n\t toIndexedSeq: function() {\n\t return this;\n\t },\n\t toString: function() {\n\t return this.__toString('Seq [', ']');\n\t },\n\t __iterate: function(fn, reverse) {\n\t return seqIterate(this, fn, reverse, false);\n\t },\n\t __iterator: function(type, reverse) {\n\t return seqIterator(this, type, reverse, false);\n\t }\n\t}, {of: function() {\n\t return $IndexedSeq(arguments);\n\t }}, Seq);\n\tmixin(IndexedSeq, IndexedIterable.prototype);\n\tvar SetSeq = function SetSeq(value) {\n\t return (value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value).toSetSeq();\n\t};\n\tvar $SetSeq = SetSeq;\n\t($traceurRuntime.createClass)(SetSeq, {toSetSeq: function() {\n\t return this;\n\t }}, {of: function() {\n\t return $SetSeq(arguments);\n\t }}, Seq);\n\tmixin(SetSeq, SetIterable.prototype);\n\tSeq.isSeq = isSeq;\n\tSeq.Keyed = KeyedSeq;\n\tSeq.Set = SetSeq;\n\tSeq.Indexed = IndexedSeq;\n\tvar IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\n\tSeq.prototype[IS_SEQ_SENTINEL] = true;\n\tvar ArraySeq = function ArraySeq(array) {\n\t this._array = array;\n\t this.size = array.length;\n\t};\n\t($traceurRuntime.createClass)(ArraySeq, {\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var array = this._array;\n\t var maxIndex = array.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var array = this._array;\n\t var maxIndex = array.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar ObjectSeq = function ObjectSeq(object) {\n\t var keys = Object.keys(object);\n\t this._object = object;\n\t this._keys = keys;\n\t this.size = keys.length;\n\t};\n\t($traceurRuntime.createClass)(ObjectSeq, {\n\t get: function(key, notSetValue) {\n\t if (notSetValue !== undefined && !this.has(key)) {\n\t return notSetValue;\n\t }\n\t return this._object[key];\n\t },\n\t has: function(key) {\n\t return this._object.hasOwnProperty(key);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var object = this._object;\n\t var keys = this._keys;\n\t var maxIndex = keys.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t var key = keys[reverse ? maxIndex - ii : ii];\n\t if (fn(object[key], key, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var object = this._object;\n\t var keys = this._keys;\n\t var maxIndex = keys.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var key = keys[reverse ? maxIndex - ii : ii];\n\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tvar IterableSeq = function IterableSeq(iterable) {\n\t this._iterable = iterable;\n\t this.size = iterable.length || iterable.size;\n\t};\n\t($traceurRuntime.createClass)(IterableSeq, {\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterable = this._iterable;\n\t var iterator = getIterator(iterable);\n\t var iterations = 0;\n\t if (isIterator(iterator)) {\n\t var step;\n\t while (!(step = iterator.next()).done) {\n\t if (fn(step.value, iterations++, this) === false) {\n\t break;\n\t }\n\t }\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterable = this._iterable;\n\t var iterator = getIterator(iterable);\n\t if (!isIterator(iterator)) {\n\t return new Iterator(iteratorDone);\n\t }\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, iterations++, step.value);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar IteratorSeq = function IteratorSeq(iterator) {\n\t this._iterator = iterator;\n\t this._iteratorCache = [];\n\t};\n\t($traceurRuntime.createClass)(IteratorSeq, {\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterator = this._iterator;\n\t var cache = this._iteratorCache;\n\t var iterations = 0;\n\t while (iterations < cache.length) {\n\t if (fn(cache[iterations], iterations++, this) === false) {\n\t return iterations;\n\t }\n\t }\n\t var step;\n\t while (!(step = iterator.next()).done) {\n\t var val = step.value;\n\t cache[iterations] = val;\n\t if (fn(val, iterations++, this) === false) {\n\t break;\n\t }\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = this._iterator;\n\t var cache = this._iteratorCache;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t if (iterations >= cache.length) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t cache[iterations] = step.value;\n\t }\n\t return iteratorValue(type, iterations, cache[iterations++]);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tfunction isSeq(maybeSeq) {\n\t return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);\n\t}\n\tvar EMPTY_SEQ;\n\tfunction emptySequence() {\n\t return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n\t}\n\tfunction keyedSeqFromValue(value) {\n\t var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined;\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of [k, v] entries, ' + 'or keyed object: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction indexedSeqFromValue(value) {\n\t var seq = maybeIndexedSeqFromValue(value);\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of values: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction seqFromValue(value) {\n\t var seq = maybeIndexedSeqFromValue(value) || (typeof value === 'object' && new ObjectSeq(value));\n\t if (!seq) {\n\t throw new TypeError('Expected Array or iterable object of values, or keyed object: ' + value);\n\t }\n\t return seq;\n\t}\n\tfunction maybeIndexedSeqFromValue(value) {\n\t return (isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined);\n\t}\n\tfunction isArrayLike(value) {\n\t return value && typeof value.length === 'number';\n\t}\n\tfunction seqIterate(seq, fn, reverse, useKeys) {\n\t assertNotInfinite(seq.size);\n\t var cache = seq._cache;\n\t if (cache) {\n\t var maxIndex = cache.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t }\n\t return seq.__iterateUncached(fn, reverse);\n\t}\n\tfunction seqIterator(seq, type, reverse, useKeys) {\n\t var cache = seq._cache;\n\t if (cache) {\n\t var maxIndex = cache.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n\t }));\n\t }\n\t return seq.__iteratorUncached(type, reverse);\n\t}\n\tfunction fromJS(json, converter) {\n\t return converter ? _fromJSWith(converter, json, '', {'': json}) : _fromJSDefault(json);\n\t}\n\tfunction _fromJSWith(converter, json, key, parentJSON) {\n\t if (Array.isArray(json)) {\n\t return converter.call(parentJSON, key, IndexedSeq(json).map((function(v, k) {\n\t return _fromJSWith(converter, v, k, json);\n\t })));\n\t }\n\t if (isPlainObj(json)) {\n\t return converter.call(parentJSON, key, KeyedSeq(json).map((function(v, k) {\n\t return _fromJSWith(converter, v, k, json);\n\t })));\n\t }\n\t return json;\n\t}\n\tfunction _fromJSDefault(json) {\n\t if (Array.isArray(json)) {\n\t return IndexedSeq(json).map(_fromJSDefault).toList();\n\t }\n\t if (isPlainObj(json)) {\n\t return KeyedSeq(json).map(_fromJSDefault).toMap();\n\t }\n\t return json;\n\t}\n\tfunction isPlainObj(value) {\n\t return value && value.constructor === Object;\n\t}\n\tvar Collection = function Collection() {\n\t throw TypeError('Abstract');\n\t};\n\t($traceurRuntime.createClass)(Collection, {}, {}, Iterable);\n\tvar KeyedCollection = function KeyedCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $KeyedCollection.prototype, arguments);\n\t};\n\tvar $KeyedCollection = KeyedCollection;\n\t($traceurRuntime.createClass)(KeyedCollection, {}, {}, Collection);\n\tmixin(KeyedCollection, KeyedIterable.prototype);\n\tvar IndexedCollection = function IndexedCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $IndexedCollection.prototype, arguments);\n\t};\n\tvar $IndexedCollection = IndexedCollection;\n\t($traceurRuntime.createClass)(IndexedCollection, {}, {}, Collection);\n\tmixin(IndexedCollection, IndexedIterable.prototype);\n\tvar SetCollection = function SetCollection() {\n\t $traceurRuntime.defaultSuperCall(this, $SetCollection.prototype, arguments);\n\t};\n\tvar $SetCollection = SetCollection;\n\t($traceurRuntime.createClass)(SetCollection, {}, {}, Collection);\n\tmixin(SetCollection, SetIterable.prototype);\n\tCollection.Keyed = KeyedCollection;\n\tCollection.Indexed = IndexedCollection;\n\tCollection.Set = SetCollection;\n\tvar Map = function Map(value) {\n\t return value === null || value === undefined ? emptyMap() : isMap(value) ? value : emptyMap().merge(KeyedIterable(value));\n\t};\n\t($traceurRuntime.createClass)(Map, {\n\t toString: function() {\n\t return this.__toString('Map {', '}');\n\t },\n\t get: function(k, notSetValue) {\n\t return this._root ? this._root.get(0, hash(k), k, notSetValue) : notSetValue;\n\t },\n\t set: function(k, v) {\n\t return updateMap(this, k, v);\n\t },\n\t setIn: function(keyPath, v) {\n\t invariant(keyPath.length > 0, 'Requires non-empty key path.');\n\t return this.updateIn(keyPath, (function() {\n\t return v;\n\t }));\n\t },\n\t remove: function(k) {\n\t return updateMap(this, k, NOT_SET);\n\t },\n\t removeIn: function(keyPath) {\n\t invariant(keyPath.length > 0, 'Requires non-empty key path.');\n\t return this.updateIn(keyPath, (function() {\n\t return NOT_SET;\n\t }));\n\t },\n\t update: function(k, notSetValue, updater) {\n\t return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater);\n\t },\n\t updateIn: function(keyPath, notSetValue, updater) {\n\t if (!updater) {\n\t updater = notSetValue;\n\t notSetValue = undefined;\n\t }\n\t return keyPath.length === 0 ? updater(this) : updateInDeepMap(this, keyPath, notSetValue, updater, 0);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._root = null;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyMap();\n\t },\n\t merge: function() {\n\t return mergeIntoMapWith(this, undefined, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__3 = 1; $__3 < arguments.length; $__3++)\n\t iters[$__3 - 1] = arguments[$__3];\n\t return mergeIntoMapWith(this, merger, iters);\n\t },\n\t mergeDeep: function() {\n\t return mergeIntoMapWith(this, deepMerger(undefined), arguments);\n\t },\n\t mergeDeepWith: function(merger) {\n\t for (var iters = [],\n\t $__4 = 1; $__4 < arguments.length; $__4++)\n\t iters[$__4 - 1] = arguments[$__4];\n\t return mergeIntoMapWith(this, deepMerger(merger), iters);\n\t },\n\t withMutations: function(fn) {\n\t var mutable = this.asMutable();\n\t fn(mutable);\n\t return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n\t },\n\t asMutable: function() {\n\t return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n\t },\n\t asImmutable: function() {\n\t return this.__ensureOwner();\n\t },\n\t wasAltered: function() {\n\t return this.__altered;\n\t },\n\t __iterator: function(type, reverse) {\n\t return new MapIterator(this, type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t this._root && this._root.iterate((function(entry) {\n\t iterations++;\n\t return fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t return iterations;\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this.__altered = false;\n\t return this;\n\t }\n\t return makeMap(this.size, this._root, ownerID, this.__hash);\n\t }\n\t}, {}, KeyedCollection);\n\tfunction isMap(maybeMap) {\n\t return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);\n\t}\n\tMap.isMap = isMap;\n\tvar IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\n\tvar MapPrototype = Map.prototype;\n\tMapPrototype[IS_MAP_SENTINEL] = true;\n\tMapPrototype[DELETE] = MapPrototype.remove;\n\tvar BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) {\n\t this.ownerID = ownerID;\n\t this.bitmap = bitmap;\n\t this.nodes = nodes;\n\t};\n\tvar $BitmapIndexedNode = BitmapIndexedNode;\n\t($traceurRuntime.createClass)(BitmapIndexedNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var bit = (1 << ((shift === 0 ? hash : hash >>> shift) & MASK));\n\t var bitmap = this.bitmap;\n\t return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, hash, key, notSetValue);\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t var hashFrag = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var bit = 1 << hashFrag;\n\t var bitmap = this.bitmap;\n\t var exists = (bitmap & bit) !== 0;\n\t if (!exists && value === NOT_SET) {\n\t return this;\n\t }\n\t var idx = popCount(bitmap & (bit - 1));\n\t var nodes = this.nodes;\n\t var node = exists ? nodes[idx] : undefined;\n\t var newNode = updateNode(node, ownerID, shift + SHIFT, hash, key, value, didChangeSize, didAlter);\n\t if (newNode === node) {\n\t return this;\n\t }\n\t if (!exists && newNode && nodes.length >= MAX_BITMAP_SIZE) {\n\t return expandNodes(ownerID, nodes, bitmap, hashFrag, newNode);\n\t }\n\t if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n\t return nodes[idx ^ 1];\n\t }\n\t if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n\t return newNode;\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n\t var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);\n\t if (isEditable) {\n\t this.bitmap = newBitmap;\n\t this.nodes = newNodes;\n\t return this;\n\t }\n\t return new $BitmapIndexedNode(ownerID, newBitmap, newNodes);\n\t },\n\t iterate: function(fn, reverse) {\n\t var nodes = this.nodes;\n\t for (var ii = 0,\n\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t if (nodes[reverse ? maxIndex - ii : ii].iterate(fn, reverse) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar ArrayNode = function ArrayNode(ownerID, count, nodes) {\n\t this.ownerID = ownerID;\n\t this.count = count;\n\t this.nodes = nodes;\n\t};\n\tvar $ArrayNode = ArrayNode;\n\t($traceurRuntime.createClass)(ArrayNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var idx = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var node = this.nodes[idx];\n\t return node ? node.get(shift + SHIFT, hash, key, notSetValue) : notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t var idx = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var removed = value === NOT_SET;\n\t var nodes = this.nodes;\n\t var node = nodes[idx];\n\t if (removed && !node) {\n\t return this;\n\t }\n\t var newNode = updateNode(node, ownerID, shift + SHIFT, hash, key, value, didChangeSize, didAlter);\n\t if (newNode === node) {\n\t return this;\n\t }\n\t var newCount = this.count;\n\t if (!node) {\n\t newCount++;\n\t } else if (!newNode) {\n\t newCount--;\n\t if (newCount < MIN_ARRAY_SIZE) {\n\t return packNodes(ownerID, nodes, newCount, idx);\n\t }\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newNodes = setIn(nodes, idx, newNode, isEditable);\n\t if (isEditable) {\n\t this.count = newCount;\n\t this.nodes = newNodes;\n\t return this;\n\t }\n\t return new $ArrayNode(ownerID, newCount, newNodes);\n\t },\n\t iterate: function(fn, reverse) {\n\t var nodes = this.nodes;\n\t for (var ii = 0,\n\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t var node = nodes[reverse ? maxIndex - ii : ii];\n\t if (node && node.iterate(fn, reverse) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar HashCollisionNode = function HashCollisionNode(ownerID, hash, entries) {\n\t this.ownerID = ownerID;\n\t this.hash = hash;\n\t this.entries = entries;\n\t};\n\tvar $HashCollisionNode = HashCollisionNode;\n\t($traceurRuntime.createClass)(HashCollisionNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t len = entries.length; ii < len; ii++) {\n\t if (is(key, entries[ii][0])) {\n\t return entries[ii][1];\n\t }\n\t }\n\t return notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t var removed = value === NOT_SET;\n\t if (hash !== this.hash) {\n\t if (removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t SetRef(didChangeSize);\n\t return mergeIntoNode(this, ownerID, shift, hash, [key, value]);\n\t }\n\t var entries = this.entries;\n\t var idx = 0;\n\t for (var len = entries.length; idx < len; idx++) {\n\t if (is(key, entries[idx][0])) {\n\t break;\n\t }\n\t }\n\t var exists = idx < len;\n\t if (removed && !exists) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t (removed || !exists) && SetRef(didChangeSize);\n\t if (removed && len === 2) {\n\t return new ValueNode(ownerID, this.hash, entries[idx ^ 1]);\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t if (exists) {\n\t if (removed) {\n\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t } else {\n\t newEntries[idx] = [key, value];\n\t }\n\t } else {\n\t newEntries.push([key, value]);\n\t }\n\t if (isEditable) {\n\t this.entries = newEntries;\n\t return this;\n\t }\n\t return new $HashCollisionNode(ownerID, this.hash, newEntries);\n\t },\n\t iterate: function(fn, reverse) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n\t if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar ValueNode = function ValueNode(ownerID, hash, entry) {\n\t this.ownerID = ownerID;\n\t this.hash = hash;\n\t this.entry = entry;\n\t};\n\tvar $ValueNode = ValueNode;\n\t($traceurRuntime.createClass)(ValueNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t var removed = value === NOT_SET;\n\t var keyMatch = is(key, this.entry[0]);\n\t if (keyMatch ? value === this.entry[1] : removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t if (removed) {\n\t SetRef(didChangeSize);\n\t return;\n\t }\n\t if (keyMatch) {\n\t if (ownerID && ownerID === this.ownerID) {\n\t this.entry[1] = value;\n\t return this;\n\t }\n\t return new $ValueNode(ownerID, hash, [key, value]);\n\t }\n\t SetRef(didChangeSize);\n\t return mergeIntoNode(this, ownerID, shift, hash, [key, value]);\n\t },\n\t iterate: function(fn) {\n\t return fn(this.entry);\n\t }\n\t}, {});\n\tvar MapIterator = function MapIterator(map, type, reverse) {\n\t this._type = type;\n\t this._reverse = reverse;\n\t this._stack = map._root && mapIteratorFrame(map._root);\n\t};\n\t($traceurRuntime.createClass)(MapIterator, {next: function() {\n\t var type = this._type;\n\t var stack = this._stack;\n\t while (stack) {\n\t var node = stack.node;\n\t var index = stack.index++;\n\t var maxIndex;\n\t if (node.entry) {\n\t if (index === 0) {\n\t return mapIteratorValue(type, node.entry);\n\t }\n\t } else if (node.entries) {\n\t maxIndex = node.entries.length - 1;\n\t if (index <= maxIndex) {\n\t return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n\t }\n\t } else {\n\t maxIndex = node.nodes.length - 1;\n\t if (index <= maxIndex) {\n\t var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n\t if (subNode) {\n\t if (subNode.entry) {\n\t return mapIteratorValue(type, subNode.entry);\n\t }\n\t stack = this._stack = mapIteratorFrame(subNode, stack);\n\t }\n\t continue;\n\t }\n\t }\n\t stack = this._stack = this._stack.__prev;\n\t }\n\t return iteratorDone();\n\t }}, {}, Iterator);\n\tfunction mapIteratorValue(type, entry) {\n\t return iteratorValue(type, entry[0], entry[1]);\n\t}\n\tfunction mapIteratorFrame(node, prev) {\n\t return {\n\t node: node,\n\t index: 0,\n\t __prev: prev\n\t };\n\t}\n\tfunction makeMap(size, root, ownerID, hash) {\n\t var map = Object.create(MapPrototype);\n\t map.size = size;\n\t map._root = root;\n\t map.__ownerID = ownerID;\n\t map.__hash = hash;\n\t map.__altered = false;\n\t return map;\n\t}\n\tvar EMPTY_MAP;\n\tfunction emptyMap() {\n\t return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n\t}\n\tfunction updateMap(map, k, v) {\n\t var didChangeSize = MakeRef(CHANGE_LENGTH);\n\t var didAlter = MakeRef(DID_ALTER);\n\t var newRoot = updateNode(map._root, map.__ownerID, 0, hash(k), k, v, didChangeSize, didAlter);\n\t if (!didAlter.value) {\n\t return map;\n\t }\n\t var newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n\t if (map.__ownerID) {\n\t map.size = newSize;\n\t map._root = newRoot;\n\t map.__hash = undefined;\n\t map.__altered = true;\n\t return map;\n\t }\n\t return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n\t}\n\tfunction updateNode(node, ownerID, shift, hash, key, value, didChangeSize, didAlter) {\n\t if (!node) {\n\t if (value === NOT_SET) {\n\t return node;\n\t }\n\t SetRef(didAlter);\n\t SetRef(didChangeSize);\n\t return new ValueNode(ownerID, hash, [key, value]);\n\t }\n\t return node.update(ownerID, shift, hash, key, value, didChangeSize, didAlter);\n\t}\n\tfunction isLeafNode(node) {\n\t return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n\t}\n\tfunction mergeIntoNode(node, ownerID, shift, hash, entry) {\n\t if (node.hash === hash) {\n\t return new HashCollisionNode(ownerID, hash, [node.entry, entry]);\n\t }\n\t var idx1 = (shift === 0 ? node.hash : node.hash >>> shift) & MASK;\n\t var idx2 = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var newNode;\n\t var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, hash, entry)] : ((newNode = new ValueNode(ownerID, hash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n\t return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);\n\t}\n\tfunction packNodes(ownerID, nodes, count, excluding) {\n\t var bitmap = 0;\n\t var packedII = 0;\n\t var packedNodes = new Array(count);\n\t for (var ii = 0,\n\t bit = 1,\n\t len = nodes.length; ii < len; ii++, bit <<= 1) {\n\t var node = nodes[ii];\n\t if (node !== undefined && ii !== excluding) {\n\t bitmap |= bit;\n\t packedNodes[packedII++] = node;\n\t }\n\t }\n\t return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n\t}\n\tfunction expandNodes(ownerID, nodes, bitmap, including, node) {\n\t var count = 0;\n\t var expandedNodes = new Array(SIZE);\n\t for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n\t expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n\t }\n\t expandedNodes[including] = node;\n\t return new ArrayNode(ownerID, count + 1, expandedNodes);\n\t}\n\tfunction mergeIntoMapWith(map, merger, iterables) {\n\t var iters = [];\n\t for (var ii = 0; ii < iterables.length; ii++) {\n\t var value = iterables[ii];\n\t var iter = KeyedIterable(value);\n\t if (!isIterable(value)) {\n\t iter = iter.map((function(v) {\n\t return fromJS(v);\n\t }));\n\t }\n\t iters.push(iter);\n\t }\n\t return mergeIntoCollectionWith(map, merger, iters);\n\t}\n\tfunction deepMerger(merger) {\n\t return (function(existing, value) {\n\t return existing && existing.mergeDeepWith && isIterable(value) ? existing.mergeDeepWith(merger, value) : merger ? merger(existing, value) : value;\n\t });\n\t}\n\tfunction mergeIntoCollectionWith(collection, merger, iters) {\n\t if (iters.length === 0) {\n\t return collection;\n\t }\n\t return collection.withMutations((function(collection) {\n\t var mergeIntoMap = merger ? (function(value, key) {\n\t collection.update(key, NOT_SET, (function(existing) {\n\t return existing === NOT_SET ? value : merger(existing, value);\n\t }));\n\t }) : (function(value, key) {\n\t collection.set(key, value);\n\t });\n\t for (var ii = 0; ii < iters.length; ii++) {\n\t iters[ii].forEach(mergeIntoMap);\n\t }\n\t }));\n\t}\n\tfunction updateInDeepMap(collection, keyPath, notSetValue, updater, offset) {\n\t invariant(!collection || collection.set, 'updateIn with invalid keyPath');\n\t var key = keyPath[offset];\n\t var existing = collection ? collection.get(key, NOT_SET) : NOT_SET;\n\t var existingValue = existing === NOT_SET ? undefined : existing;\n\t var value = offset === keyPath.length - 1 ? updater(existing === NOT_SET ? notSetValue : existing) : updateInDeepMap(existingValue, keyPath, notSetValue, updater, offset + 1);\n\t return value === existingValue ? collection : value === NOT_SET ? collection && collection.remove(key) : (collection || emptyMap()).set(key, value);\n\t}\n\tfunction popCount(x) {\n\t x = x - ((x >> 1) & 0x55555555);\n\t x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n\t x = (x + (x >> 4)) & 0x0f0f0f0f;\n\t x = x + (x >> 8);\n\t x = x + (x >> 16);\n\t return x & 0x7f;\n\t}\n\tfunction setIn(array, idx, val, canEdit) {\n\t var newArray = canEdit ? array : arrCopy(array);\n\t newArray[idx] = val;\n\t return newArray;\n\t}\n\tfunction spliceIn(array, idx, val, canEdit) {\n\t var newLen = array.length + 1;\n\t if (canEdit && idx + 1 === newLen) {\n\t array[idx] = val;\n\t return array;\n\t }\n\t var newArray = new Array(newLen);\n\t var after = 0;\n\t for (var ii = 0; ii < newLen; ii++) {\n\t if (ii === idx) {\n\t newArray[ii] = val;\n\t after = -1;\n\t } else {\n\t newArray[ii] = array[ii + after];\n\t }\n\t }\n\t return newArray;\n\t}\n\tfunction spliceOut(array, idx, canEdit) {\n\t var newLen = array.length - 1;\n\t if (canEdit && idx === newLen) {\n\t array.pop();\n\t return array;\n\t }\n\t var newArray = new Array(newLen);\n\t var after = 0;\n\t for (var ii = 0; ii < newLen; ii++) {\n\t if (ii === idx) {\n\t after = 1;\n\t }\n\t newArray[ii] = array[ii + after];\n\t }\n\t return newArray;\n\t}\n\tvar MAX_BITMAP_SIZE = SIZE / 2;\n\tvar MIN_ARRAY_SIZE = SIZE / 4;\n\tvar ToKeyedSequence = function ToKeyedSequence(indexed, useKeys) {\n\t this._iter = indexed;\n\t this._useKeys = useKeys;\n\t this.size = indexed.size;\n\t};\n\t($traceurRuntime.createClass)(ToKeyedSequence, {\n\t get: function(key, notSetValue) {\n\t return this._iter.get(key, notSetValue);\n\t },\n\t has: function(key) {\n\t return this._iter.has(key);\n\t },\n\t valueSeq: function() {\n\t return this._iter.valueSeq();\n\t },\n\t reverse: function() {\n\t var $__0 = this;\n\t var reversedSequence = reverseFactory(this, true);\n\t if (!this._useKeys) {\n\t reversedSequence.valueSeq = (function() {\n\t return $__0._iter.toSeq().reverse();\n\t });\n\t }\n\t return reversedSequence;\n\t },\n\t map: function(mapper, context) {\n\t var $__0 = this;\n\t var mappedSequence = mapFactory(this, mapper, context);\n\t if (!this._useKeys) {\n\t mappedSequence.valueSeq = (function() {\n\t return $__0._iter.toSeq().map(mapper, context);\n\t });\n\t }\n\t return mappedSequence;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var ii;\n\t return this._iter.__iterate(this._useKeys ? (function(v, k) {\n\t return fn(v, k, $__0);\n\t }) : ((ii = reverse ? resolveSize(this) : 0), (function(v) {\n\t return fn(v, reverse ? --ii : ii++, $__0);\n\t })), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t if (this._useKeys) {\n\t return this._iter.__iterator(type, reverse);\n\t }\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t var ii = reverse ? resolveSize(this) : 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tvar ToIndexedSequence = function ToIndexedSequence(iter) {\n\t this._iter = iter;\n\t this.size = iter.size;\n\t};\n\t($traceurRuntime.createClass)(ToIndexedSequence, {\n\t contains: function(value) {\n\t return this._iter.contains(value);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t return this._iter.__iterate((function(v) {\n\t return fn(v, iterations++, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, iterations++, step.value, step);\n\t }));\n\t }\n\t}, {}, IndexedSeq);\n\tvar ToSetSequence = function ToSetSequence(iter) {\n\t this._iter = iter;\n\t this.size = iter.size;\n\t};\n\t($traceurRuntime.createClass)(ToSetSequence, {\n\t has: function(key) {\n\t return this._iter.contains(key);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._iter.__iterate((function(v) {\n\t return fn(v, v, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, step.value, step.value, step);\n\t }));\n\t }\n\t}, {}, SetSeq);\n\tvar FromEntriesSequence = function FromEntriesSequence(entries) {\n\t this._iter = entries;\n\t this.size = entries.size;\n\t};\n\t($traceurRuntime.createClass)(FromEntriesSequence, {\n\t entrySeq: function() {\n\t return this._iter.toSeq();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._iter.__iterate((function(entry) {\n\t if (entry) {\n\t validateEntry(entry);\n\t return fn(entry[1], entry[0], $__0);\n\t }\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t return new Iterator((function() {\n\t while (true) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t if (entry) {\n\t validateEntry(entry);\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, entry[0], entry[1], step);\n\t }\n\t }\n\t }));\n\t }\n\t}, {}, KeyedSeq);\n\tToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;\n\tfunction flipFactory(iterable) {\n\t var flipSequence = makeSequence(iterable);\n\t flipSequence._iter = iterable;\n\t flipSequence.size = iterable.size;\n\t flipSequence.flip = (function() {\n\t return iterable;\n\t });\n\t flipSequence.reverse = function() {\n\t var reversedSequence = iterable.reverse.apply(this);\n\t reversedSequence.flip = (function() {\n\t return iterable.reverse();\n\t });\n\t return reversedSequence;\n\t };\n\t flipSequence.has = (function(key) {\n\t return iterable.contains(key);\n\t });\n\t flipSequence.contains = (function(key) {\n\t return iterable.has(key);\n\t });\n\t flipSequence.cacheResult = cacheResultThrough;\n\t flipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k) {\n\t return fn(k, v, $__0) !== false;\n\t }), reverse);\n\t };\n\t flipSequence.__iteratorUncached = function(type, reverse) {\n\t if (type === ITERATE_ENTRIES) {\n\t var iterator = iterable.__iterator(type, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t if (!step.done) {\n\t var k = step.value[0];\n\t step.value[0] = step.value[1];\n\t step.value[1] = k;\n\t }\n\t return step;\n\t }));\n\t }\n\t return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);\n\t };\n\t return flipSequence;\n\t}\n\tfunction mapFactory(iterable, mapper, context) {\n\t var mappedSequence = makeSequence(iterable);\n\t mappedSequence.size = iterable.size;\n\t mappedSequence.has = (function(key) {\n\t return iterable.has(key);\n\t });\n\t mappedSequence.get = (function(key, notSetValue) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);\n\t });\n\t mappedSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k, c) {\n\t return fn(mapper.call(context, v, k, c), k, $__0) !== false;\n\t }), reverse);\n\t };\n\t mappedSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var key = entry[0];\n\t return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);\n\t }));\n\t };\n\t return mappedSequence;\n\t}\n\tfunction reverseFactory(iterable, useKeys) {\n\t var reversedSequence = makeSequence(iterable);\n\t reversedSequence._iter = iterable;\n\t reversedSequence.size = iterable.size;\n\t reversedSequence.reverse = (function() {\n\t return iterable;\n\t });\n\t if (iterable.flip) {\n\t reversedSequence.flip = function() {\n\t var flipSequence = flipFactory(iterable);\n\t flipSequence.reverse = (function() {\n\t return iterable.flip();\n\t });\n\t return flipSequence;\n\t };\n\t }\n\t reversedSequence.get = (function(key, notSetValue) {\n\t return iterable.get(useKeys ? key : -1 - key, notSetValue);\n\t });\n\t reversedSequence.has = (function(key) {\n\t return iterable.has(useKeys ? key : -1 - key);\n\t });\n\t reversedSequence.contains = (function(value) {\n\t return iterable.contains(value);\n\t });\n\t reversedSequence.cacheResult = cacheResultThrough;\n\t reversedSequence.__iterate = function(fn, reverse) {\n\t var $__0 = this;\n\t return iterable.__iterate((function(v, k) {\n\t return fn(v, k, $__0);\n\t }), !reverse);\n\t };\n\t reversedSequence.__iterator = (function(type, reverse) {\n\t return iterable.__iterator(type, !reverse);\n\t });\n\t return reversedSequence;\n\t}\n\tfunction filterFactory(iterable, predicate, context, useKeys) {\n\t var filterSequence = makeSequence(iterable);\n\t if (useKeys) {\n\t filterSequence.has = (function(key) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v !== NOT_SET && !!predicate.call(context, v, key, iterable);\n\t });\n\t filterSequence.get = (function(key, notSetValue) {\n\t var v = iterable.get(key, NOT_SET);\n\t return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;\n\t });\n\t }\n\t filterSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }), reverse);\n\t return iterations;\n\t };\n\t filterSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (true) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var key = entry[0];\n\t var value = entry[1];\n\t if (predicate.call(context, value, key, iterable)) {\n\t return iteratorValue(type, useKeys ? key : iterations++, value, step);\n\t }\n\t }\n\t }));\n\t };\n\t return filterSequence;\n\t}\n\tfunction countByFactory(iterable, grouper, context) {\n\t var groups = Map().asMutable();\n\t iterable.__iterate((function(v, k) {\n\t groups.update(grouper.call(context, v, k, iterable), 0, (function(a) {\n\t return a + 1;\n\t }));\n\t }));\n\t return groups.asImmutable();\n\t}\n\tfunction groupByFactory(iterable, grouper, context) {\n\t var isKeyedIter = isKeyed(iterable);\n\t var groups = Map().asMutable();\n\t iterable.__iterate((function(v, k) {\n\t groups.update(grouper.call(context, v, k, iterable), [], (function(a) {\n\t return (a.push(isKeyedIter ? [k, v] : v), a);\n\t }));\n\t }));\n\t var coerce = iterableClass(iterable);\n\t return groups.map((function(arr) {\n\t return reify(iterable, coerce(arr));\n\t }));\n\t}\n\tfunction takeFactory(iterable, amount) {\n\t if (amount > iterable.size) {\n\t return iterable;\n\t }\n\t if (amount < 0) {\n\t amount = 0;\n\t }\n\t var takeSequence = makeSequence(iterable);\n\t takeSequence.size = iterable.size && Math.min(iterable.size, amount);\n\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (amount === 0) {\n\t return 0;\n\t }\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t return ++iterations && fn(v, k, $__0) !== false && iterations < amount;\n\t }));\n\t return iterations;\n\t };\n\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = amount && iterable.__iterator(type, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t if (iterations++ > amount) {\n\t return iteratorDone();\n\t }\n\t return iterator.next();\n\t }));\n\t };\n\t return takeSequence;\n\t}\n\tfunction takeWhileFactory(iterable, predicate, context) {\n\t var takeSequence = makeSequence(iterable);\n\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t return predicate.call(context, v, k, c) && ++iterations && fn(v, k, $__0);\n\t }));\n\t return iterations;\n\t };\n\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var iterating = true;\n\t return new Iterator((function() {\n\t if (!iterating) {\n\t return iteratorDone();\n\t }\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var k = entry[0];\n\t var v = entry[1];\n\t if (!predicate.call(context, v, k, $__0)) {\n\t iterating = false;\n\t return iteratorDone();\n\t }\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t }));\n\t };\n\t return takeSequence;\n\t}\n\tfunction skipFactory(iterable, amount, useKeys) {\n\t if (amount <= 0) {\n\t return iterable;\n\t }\n\t var skipSequence = makeSequence(iterable);\n\t skipSequence.size = iterable.size && Math.max(0, iterable.size - amount);\n\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var skipped = 0;\n\t var isSkipping = true;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t if (!(isSkipping && (isSkipping = skipped++ < amount))) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }));\n\t return iterations;\n\t };\n\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = amount && iterable.__iterator(type, reverse);\n\t var skipped = 0;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (skipped < amount) {\n\t skipped++;\n\t iterator.next();\n\t }\n\t var step = iterator.next();\n\t if (useKeys || type === ITERATE_VALUES) {\n\t return step;\n\t } else if (type === ITERATE_KEYS) {\n\t return iteratorValue(type, iterations++, undefined, step);\n\t } else {\n\t return iteratorValue(type, iterations++, step.value[1], step);\n\t }\n\t }));\n\t };\n\t return skipSequence;\n\t}\n\tfunction skipWhileFactory(iterable, predicate, context, useKeys) {\n\t var skipSequence = makeSequence(iterable);\n\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var isSkipping = true;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k, c) {\n\t if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }));\n\t return iterations;\n\t };\n\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t var skipping = true;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step,\n\t k,\n\t v;\n\t do {\n\t step = iterator.next();\n\t if (step.done) {\n\t if (useKeys || type === ITERATE_VALUES) {\n\t return step;\n\t } else if (type === ITERATE_KEYS) {\n\t return iteratorValue(type, iterations++, undefined, step);\n\t } else {\n\t return iteratorValue(type, iterations++, step.value[1], step);\n\t }\n\t }\n\t var entry = step.value;\n\t k = entry[0];\n\t v = entry[1];\n\t skipping && (skipping = predicate.call(context, v, k, $__0));\n\t } while (skipping);\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t }));\n\t };\n\t return skipSequence;\n\t}\n\tfunction concatFactory(iterable, values) {\n\t var isKeyedIterable = isKeyed(iterable);\n\t var iters = new ArraySeq([iterable].concat(values)).map((function(v) {\n\t if (!isIterable(v)) {\n\t v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n\t } else if (isKeyedIterable) {\n\t v = KeyedIterable(v);\n\t }\n\t return v;\n\t }));\n\t if (isKeyedIterable) {\n\t iters = iters.toKeyedSeq();\n\t } else if (!isIndexed(iterable)) {\n\t iters = iters.toSetSeq();\n\t }\n\t var flat = iters.flatten(true);\n\t flat.size = iters.reduce((function(sum, seq) {\n\t if (sum !== undefined) {\n\t var size = seq.size;\n\t if (size !== undefined) {\n\t return sum + size;\n\t }\n\t }\n\t }), 0);\n\t return flat;\n\t}\n\tfunction flattenFactory(iterable, depth, useKeys) {\n\t var flatSequence = makeSequence(iterable);\n\t flatSequence.__iterateUncached = function(fn, reverse) {\n\t var iterations = 0;\n\t var stopped = false;\n\t function flatDeep(iter, currentDepth) {\n\t var $__0 = this;\n\t iter.__iterate((function(v, k) {\n\t if ((!depth || currentDepth < depth) && isIterable(v)) {\n\t flatDeep(v, currentDepth + 1);\n\t } else if (fn(v, useKeys ? k : iterations++, $__0) === false) {\n\t stopped = true;\n\t }\n\t return !stopped;\n\t }), reverse);\n\t }\n\t flatDeep(iterable, 0);\n\t return iterations;\n\t };\n\t flatSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(type, reverse);\n\t var stack = [];\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (iterator) {\n\t var step = iterator.next();\n\t if (step.done !== false) {\n\t iterator = stack.pop();\n\t continue;\n\t }\n\t var v = step.value;\n\t if (type === ITERATE_ENTRIES) {\n\t v = v[1];\n\t }\n\t if ((!depth || stack.length < depth) && isIterable(v)) {\n\t stack.push(iterator);\n\t iterator = v.__iterator(type, reverse);\n\t } else {\n\t return useKeys ? step : iteratorValue(type, iterations++, v, step);\n\t }\n\t }\n\t return iteratorDone();\n\t }));\n\t };\n\t return flatSequence;\n\t}\n\tfunction flatMapFactory(iterable, mapper, context) {\n\t var coerce = iterableClass(iterable);\n\t return iterable.toSeq().map((function(v, k) {\n\t return coerce(mapper.call(context, v, k, iterable));\n\t })).flatten(true);\n\t}\n\tfunction interposeFactory(iterable, separator) {\n\t var interposedSequence = makeSequence(iterable);\n\t interposedSequence.size = iterable.size && iterable.size * 2 - 1;\n\t interposedSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t iterable.__iterate((function(v, k) {\n\t return (!iterations || fn(separator, iterations++, $__0) !== false) && fn(v, iterations++, $__0) !== false;\n\t }), reverse);\n\t return iterations;\n\t };\n\t interposedSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = iterable.__iterator(ITERATE_VALUES, reverse);\n\t var iterations = 0;\n\t var step;\n\t return new Iterator((function() {\n\t if (!step || iterations % 2) {\n\t step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t }\n\t return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);\n\t }));\n\t };\n\t return interposedSequence;\n\t}\n\tfunction reify(iter, seq) {\n\t return isSeq(iter) ? seq : iter.constructor(seq);\n\t}\n\tfunction validateEntry(entry) {\n\t if (entry !== Object(entry)) {\n\t throw new TypeError('Expected [K, V] tuple: ' + entry);\n\t }\n\t}\n\tfunction resolveSize(iter) {\n\t assertNotInfinite(iter.size);\n\t return ensureSize(iter);\n\t}\n\tfunction iterableClass(iterable) {\n\t return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;\n\t}\n\tfunction makeSequence(iterable) {\n\t return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);\n\t}\n\tfunction cacheResultThrough() {\n\t if (this._iter.cacheResult) {\n\t this._iter.cacheResult();\n\t this.size = this._iter.size;\n\t return this;\n\t } else {\n\t return Seq.prototype.cacheResult.call(this);\n\t }\n\t}\n\tvar List = function List(value) {\n\t var empty = emptyList();\n\t if (value === null || value === undefined) {\n\t return empty;\n\t }\n\t if (isList(value)) {\n\t return value;\n\t }\n\t value = IndexedIterable(value);\n\t var size = value.size;\n\t if (size === 0) {\n\t return empty;\n\t }\n\t if (size > 0 && size < SIZE) {\n\t return makeList(0, size, SHIFT, null, new VNode(value.toArray()));\n\t }\n\t return empty.merge(value);\n\t};\n\t($traceurRuntime.createClass)(List, {\n\t toString: function() {\n\t return this.__toString('List [', ']');\n\t },\n\t get: function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t if (index < 0 || index >= this.size) {\n\t return notSetValue;\n\t }\n\t index += this._origin;\n\t var node = listNodeFor(this, index);\n\t return node && node.array[index & MASK];\n\t },\n\t set: function(index, value) {\n\t return updateList(this, index, value);\n\t },\n\t remove: function(index) {\n\t return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = this._origin = this._capacity = 0;\n\t this._level = SHIFT;\n\t this._root = this._tail = null;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyList();\n\t },\n\t push: function() {\n\t var values = arguments;\n\t var oldSize = this.size;\n\t return this.withMutations((function(list) {\n\t setListBounds(list, 0, oldSize + values.length);\n\t for (var ii = 0; ii < values.length; ii++) {\n\t list.set(oldSize + ii, values[ii]);\n\t }\n\t }));\n\t },\n\t pop: function() {\n\t return setListBounds(this, 0, -1);\n\t },\n\t unshift: function() {\n\t var values = arguments;\n\t return this.withMutations((function(list) {\n\t setListBounds(list, -values.length);\n\t for (var ii = 0; ii < values.length; ii++) {\n\t list.set(ii, values[ii]);\n\t }\n\t }));\n\t },\n\t shift: function() {\n\t return setListBounds(this, 1);\n\t },\n\t merge: function() {\n\t return mergeIntoListWith(this, undefined, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__5 = 1; $__5 < arguments.length; $__5++)\n\t iters[$__5 - 1] = arguments[$__5];\n\t return mergeIntoListWith(this, merger, iters);\n\t },\n\t mergeDeep: function() {\n\t return mergeIntoListWith(this, deepMerger(undefined), arguments);\n\t },\n\t mergeDeepWith: function(merger) {\n\t for (var iters = [],\n\t $__6 = 1; $__6 < arguments.length; $__6++)\n\t iters[$__6 - 1] = arguments[$__6];\n\t return mergeIntoListWith(this, deepMerger(merger), iters);\n\t },\n\t setSize: function(size) {\n\t return setListBounds(this, 0, size);\n\t },\n\t slice: function(begin, end) {\n\t var size = this.size;\n\t if (wholeSlice(begin, end, size)) {\n\t return this;\n\t }\n\t return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));\n\t },\n\t __iterator: function(type, reverse) {\n\t return new ListIterator(this, type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t var eachFn = (function(v) {\n\t return fn(v, iterations++, $__0);\n\t });\n\t var tailOffset = getTailOffset(this._capacity);\n\t if (reverse) {\n\t iterateVNode(this._tail, 0, tailOffset - this._origin, this._capacity - this._origin, eachFn, reverse) && iterateVNode(this._root, this._level, -this._origin, tailOffset - this._origin, eachFn, reverse);\n\t } else {\n\t iterateVNode(this._root, this._level, -this._origin, tailOffset - this._origin, eachFn, reverse) && iterateVNode(this._tail, 0, tailOffset - this._origin, this._capacity - this._origin, eachFn, reverse);\n\t }\n\t return iterations;\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t return this;\n\t }\n\t return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, IndexedCollection);\n\tfunction isList(maybeList) {\n\t return !!(maybeList && maybeList[IS_LIST_SENTINEL]);\n\t}\n\tList.isList = isList;\n\tvar IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\n\tvar ListPrototype = List.prototype;\n\tListPrototype[IS_LIST_SENTINEL] = true;\n\tListPrototype[DELETE] = ListPrototype.remove;\n\tListPrototype.setIn = MapPrototype.setIn;\n\tListPrototype.removeIn = MapPrototype.removeIn;\n\tListPrototype.update = MapPrototype.update;\n\tListPrototype.updateIn = MapPrototype.updateIn;\n\tListPrototype.withMutations = MapPrototype.withMutations;\n\tListPrototype.asMutable = MapPrototype.asMutable;\n\tListPrototype.asImmutable = MapPrototype.asImmutable;\n\tListPrototype.wasAltered = MapPrototype.wasAltered;\n\tvar VNode = function VNode(array, ownerID) {\n\t this.array = array;\n\t this.ownerID = ownerID;\n\t};\n\tvar $VNode = VNode;\n\t($traceurRuntime.createClass)(VNode, {\n\t removeBefore: function(ownerID, level, index) {\n\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t return this;\n\t }\n\t var originIndex = (index >>> level) & MASK;\n\t if (originIndex >= this.array.length) {\n\t return new $VNode([], ownerID);\n\t }\n\t var removingFirst = originIndex === 0;\n\t var newChild;\n\t if (level > 0) {\n\t var oldChild = this.array[originIndex];\n\t newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n\t if (newChild === oldChild && removingFirst) {\n\t return this;\n\t }\n\t }\n\t if (removingFirst && !newChild) {\n\t return this;\n\t }\n\t var editable = editableVNode(this, ownerID);\n\t if (!removingFirst) {\n\t for (var ii = 0; ii < originIndex; ii++) {\n\t editable.array[ii] = undefined;\n\t }\n\t }\n\t if (newChild) {\n\t editable.array[originIndex] = newChild;\n\t }\n\t return editable;\n\t },\n\t removeAfter: function(ownerID, level, index) {\n\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t return this;\n\t }\n\t var sizeIndex = ((index - 1) >>> level) & MASK;\n\t if (sizeIndex >= this.array.length) {\n\t return this;\n\t }\n\t var removingLast = sizeIndex === this.array.length - 1;\n\t var newChild;\n\t if (level > 0) {\n\t var oldChild = this.array[sizeIndex];\n\t newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n\t if (newChild === oldChild && removingLast) {\n\t return this;\n\t }\n\t }\n\t if (removingLast && !newChild) {\n\t return this;\n\t }\n\t var editable = editableVNode(this, ownerID);\n\t if (!removingLast) {\n\t editable.array.pop();\n\t }\n\t if (newChild) {\n\t editable.array[sizeIndex] = newChild;\n\t }\n\t return editable;\n\t }\n\t}, {});\n\tfunction iterateVNode(node, level, offset, max, fn, reverse) {\n\t var ii;\n\t var array = node && node.array;\n\t if (level === 0) {\n\t var from = offset < 0 ? -offset : 0;\n\t var to = max - offset;\n\t if (to > SIZE) {\n\t to = SIZE;\n\t }\n\t for (ii = from; ii < to; ii++) {\n\t if (fn(array && array[reverse ? from + to - 1 - ii : ii]) === false) {\n\t return false;\n\t }\n\t }\n\t } else {\n\t var step = 1 << level;\n\t var newLevel = level - SHIFT;\n\t for (ii = 0; ii <= MASK; ii++) {\n\t var levelIndex = reverse ? MASK - ii : ii;\n\t var newOffset = offset + (levelIndex << level);\n\t if (newOffset < max && newOffset + step > 0) {\n\t var nextNode = array && array[levelIndex];\n\t if (!iterateVNode(nextNode, newLevel, newOffset, max, fn, reverse)) {\n\t return false;\n\t }\n\t }\n\t }\n\t }\n\t return true;\n\t}\n\tvar ListIterator = function ListIterator(list, type, reverse) {\n\t this._type = type;\n\t this._reverse = !!reverse;\n\t this._maxIndex = list.size - 1;\n\t var tailOffset = getTailOffset(list._capacity);\n\t var rootStack = listIteratorFrame(list._root && list._root.array, list._level, -list._origin, tailOffset - list._origin - 1);\n\t var tailStack = listIteratorFrame(list._tail && list._tail.array, 0, tailOffset - list._origin, list._capacity - list._origin - 1);\n\t this._stack = reverse ? tailStack : rootStack;\n\t this._stack.__prev = reverse ? rootStack : tailStack;\n\t};\n\t($traceurRuntime.createClass)(ListIterator, {next: function() {\n\t var stack = this._stack;\n\t while (stack) {\n\t var array = stack.array;\n\t var rawIndex = stack.index++;\n\t if (this._reverse) {\n\t rawIndex = MASK - rawIndex;\n\t if (rawIndex > stack.rawMax) {\n\t rawIndex = stack.rawMax;\n\t stack.index = SIZE - rawIndex;\n\t }\n\t }\n\t if (rawIndex >= 0 && rawIndex < SIZE && rawIndex <= stack.rawMax) {\n\t var value = array && array[rawIndex];\n\t if (stack.level === 0) {\n\t var type = this._type;\n\t var index;\n\t if (type !== 1) {\n\t index = stack.offset + (rawIndex << stack.level);\n\t if (this._reverse) {\n\t index = this._maxIndex - index;\n\t }\n\t }\n\t return iteratorValue(type, index, value);\n\t } else {\n\t this._stack = stack = listIteratorFrame(value && value.array, stack.level - SHIFT, stack.offset + (rawIndex << stack.level), stack.max, stack);\n\t }\n\t continue;\n\t }\n\t stack = this._stack = this._stack.__prev;\n\t }\n\t return iteratorDone();\n\t }}, {}, Iterator);\n\tfunction listIteratorFrame(array, level, offset, max, prevFrame) {\n\t return {\n\t array: array,\n\t level: level,\n\t offset: offset,\n\t max: max,\n\t rawMax: ((max - offset) >> level),\n\t index: 0,\n\t __prev: prevFrame\n\t };\n\t}\n\tfunction makeList(origin, capacity, level, root, tail, ownerID, hash) {\n\t var list = Object.create(ListPrototype);\n\t list.size = capacity - origin;\n\t list._origin = origin;\n\t list._capacity = capacity;\n\t list._level = level;\n\t list._root = root;\n\t list._tail = tail;\n\t list.__ownerID = ownerID;\n\t list.__hash = hash;\n\t list.__altered = false;\n\t return list;\n\t}\n\tvar EMPTY_LIST;\n\tfunction emptyList() {\n\t return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n\t}\n\tfunction updateList(list, index, value) {\n\t index = wrapIndex(list, index);\n\t if (index >= list.size || index < 0) {\n\t return list.withMutations((function(list) {\n\t index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);\n\t }));\n\t }\n\t index += list._origin;\n\t var newTail = list._tail;\n\t var newRoot = list._root;\n\t var didAlter = MakeRef(DID_ALTER);\n\t if (index >= getTailOffset(list._capacity)) {\n\t newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n\t } else {\n\t newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n\t }\n\t if (!didAlter.value) {\n\t return list;\n\t }\n\t if (list.__ownerID) {\n\t list._root = newRoot;\n\t list._tail = newTail;\n\t list.__hash = undefined;\n\t list.__altered = true;\n\t return list;\n\t }\n\t return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n\t}\n\tfunction updateVNode(node, ownerID, level, index, value, didAlter) {\n\t var idx = (index >>> level) & MASK;\n\t var nodeHas = node && idx < node.array.length;\n\t if (!nodeHas && value === undefined) {\n\t return node;\n\t }\n\t var newNode;\n\t if (level > 0) {\n\t var lowerNode = node && node.array[idx];\n\t var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n\t if (newLowerNode === lowerNode) {\n\t return node;\n\t }\n\t newNode = editableVNode(node, ownerID);\n\t newNode.array[idx] = newLowerNode;\n\t return newNode;\n\t }\n\t if (nodeHas && node.array[idx] === value) {\n\t return node;\n\t }\n\t SetRef(didAlter);\n\t newNode = editableVNode(node, ownerID);\n\t if (value === undefined && idx === newNode.array.length - 1) {\n\t newNode.array.pop();\n\t } else {\n\t newNode.array[idx] = value;\n\t }\n\t return newNode;\n\t}\n\tfunction editableVNode(node, ownerID) {\n\t if (ownerID && node && ownerID === node.ownerID) {\n\t return node;\n\t }\n\t return new VNode(node ? node.array.slice() : [], ownerID);\n\t}\n\tfunction listNodeFor(list, rawIndex) {\n\t if (rawIndex >= getTailOffset(list._capacity)) {\n\t return list._tail;\n\t }\n\t if (rawIndex < 1 << (list._level + SHIFT)) {\n\t var node = list._root;\n\t var level = list._level;\n\t while (node && level > 0) {\n\t node = node.array[(rawIndex >>> level) & MASK];\n\t level -= SHIFT;\n\t }\n\t return node;\n\t }\n\t}\n\tfunction setListBounds(list, begin, end) {\n\t var owner = list.__ownerID || new OwnerID();\n\t var oldOrigin = list._origin;\n\t var oldCapacity = list._capacity;\n\t var newOrigin = oldOrigin + begin;\n\t var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n\t if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n\t return list;\n\t }\n\t if (newOrigin >= newCapacity) {\n\t return list.clear();\n\t }\n\t var newLevel = list._level;\n\t var newRoot = list._root;\n\t var offsetShift = 0;\n\t while (newOrigin + offsetShift < 0) {\n\t newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n\t newLevel += SHIFT;\n\t offsetShift += 1 << newLevel;\n\t }\n\t if (offsetShift) {\n\t newOrigin += offsetShift;\n\t oldOrigin += offsetShift;\n\t newCapacity += offsetShift;\n\t oldCapacity += offsetShift;\n\t }\n\t var oldTailOffset = getTailOffset(oldCapacity);\n\t var newTailOffset = getTailOffset(newCapacity);\n\t while (newTailOffset >= 1 << (newLevel + SHIFT)) {\n\t newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n\t newLevel += SHIFT;\n\t }\n\t var oldTail = list._tail;\n\t var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;\n\t if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n\t newRoot = editableVNode(newRoot, owner);\n\t var node = newRoot;\n\t for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n\t var idx = (oldTailOffset >>> level) & MASK;\n\t node = node.array[idx] = editableVNode(node.array[idx], owner);\n\t }\n\t node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;\n\t }\n\t if (newCapacity < oldCapacity) {\n\t newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n\t }\n\t if (newOrigin >= newTailOffset) {\n\t newOrigin -= newTailOffset;\n\t newCapacity -= newTailOffset;\n\t newLevel = SHIFT;\n\t newRoot = null;\n\t newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);\n\t } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n\t offsetShift = 0;\n\t while (newRoot) {\n\t var beginIndex = (newOrigin >>> newLevel) & MASK;\n\t if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {\n\t break;\n\t }\n\t if (beginIndex) {\n\t offsetShift += (1 << newLevel) * beginIndex;\n\t }\n\t newLevel -= SHIFT;\n\t newRoot = newRoot.array[beginIndex];\n\t }\n\t if (newRoot && newOrigin > oldOrigin) {\n\t newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n\t }\n\t if (newRoot && newTailOffset < oldTailOffset) {\n\t newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n\t }\n\t if (offsetShift) {\n\t newOrigin -= offsetShift;\n\t newCapacity -= offsetShift;\n\t }\n\t }\n\t if (list.__ownerID) {\n\t list.size = newCapacity - newOrigin;\n\t list._origin = newOrigin;\n\t list._capacity = newCapacity;\n\t list._level = newLevel;\n\t list._root = newRoot;\n\t list._tail = newTail;\n\t list.__hash = undefined;\n\t list.__altered = true;\n\t return list;\n\t }\n\t return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n\t}\n\tfunction mergeIntoListWith(list, merger, iterables) {\n\t var iters = [];\n\t var maxSize = 0;\n\t for (var ii = 0; ii < iterables.length; ii++) {\n\t var value = iterables[ii];\n\t var iter = IndexedIterable(value);\n\t if (iter.size > maxSize) {\n\t maxSize = iter.size;\n\t }\n\t if (!isIterable(value)) {\n\t iter = iter.map((function(v) {\n\t return fromJS(v);\n\t }));\n\t }\n\t iters.push(iter);\n\t }\n\t if (maxSize > list.size) {\n\t list = list.setSize(maxSize);\n\t }\n\t return mergeIntoCollectionWith(list, merger, iters);\n\t}\n\tfunction getTailOffset(size) {\n\t return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);\n\t}\n\tvar Stack = function Stack(value) {\n\t return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);\n\t};\n\tvar $Stack = Stack;\n\t($traceurRuntime.createClass)(Stack, {\n\t toString: function() {\n\t return this.__toString('Stack [', ']');\n\t },\n\t get: function(index, notSetValue) {\n\t var head = this._head;\n\t while (head && index--) {\n\t head = head.next;\n\t }\n\t return head ? head.value : notSetValue;\n\t },\n\t peek: function() {\n\t return this._head && this._head.value;\n\t },\n\t push: function() {\n\t if (arguments.length === 0) {\n\t return this;\n\t }\n\t var newSize = this.size + arguments.length;\n\t var head = this._head;\n\t for (var ii = arguments.length - 1; ii >= 0; ii--) {\n\t head = {\n\t value: arguments[ii],\n\t next: head\n\t };\n\t }\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t pushAll: function(iter) {\n\t iter = IndexedIterable(iter);\n\t if (iter.size === 0) {\n\t return this;\n\t }\n\t var newSize = this.size;\n\t var head = this._head;\n\t iter.reverse().forEach((function(value) {\n\t newSize++;\n\t head = {\n\t value: value,\n\t next: head\n\t };\n\t }));\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t pop: function() {\n\t return this.slice(1);\n\t },\n\t unshift: function() {\n\t return this.push.apply(this, arguments);\n\t },\n\t unshiftAll: function(iter) {\n\t return this.pushAll(iter);\n\t },\n\t shift: function() {\n\t return this.pop.apply(this, arguments);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._head = undefined;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return emptyStack();\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t var resolvedBegin = resolveBegin(begin, this.size);\n\t var resolvedEnd = resolveEnd(end, this.size);\n\t if (resolvedEnd !== this.size) {\n\t return $traceurRuntime.superCall(this, $Stack.prototype, \"slice\", [begin, end]);\n\t }\n\t var newSize = this.size - resolvedBegin;\n\t var head = this._head;\n\t while (resolvedBegin--) {\n\t head = head.next;\n\t }\n\t if (this.__ownerID) {\n\t this.size = newSize;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newSize, head);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this.__altered = false;\n\t return this;\n\t }\n\t return makeStack(this.size, this._head, ownerID, this.__hash);\n\t },\n\t __iterate: function(fn, reverse) {\n\t if (reverse) {\n\t return this.toSeq().cacheResult.__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t var node = this._head;\n\t while (node) {\n\t if (fn(node.value, iterations++, this) === false) {\n\t break;\n\t }\n\t node = node.next;\n\t }\n\t return iterations;\n\t },\n\t __iterator: function(type, reverse) {\n\t if (reverse) {\n\t return this.toSeq().cacheResult().__iterator(type, reverse);\n\t }\n\t var iterations = 0;\n\t var node = this._head;\n\t return new Iterator((function() {\n\t if (node) {\n\t var value = node.value;\n\t node = node.next;\n\t return iteratorValue(type, iterations++, value);\n\t }\n\t return iteratorDone();\n\t }));\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, IndexedCollection);\n\tfunction isStack(maybeStack) {\n\t return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);\n\t}\n\tStack.isStack = isStack;\n\tvar IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\tvar StackPrototype = Stack.prototype;\n\tStackPrototype[IS_STACK_SENTINEL] = true;\n\tStackPrototype.withMutations = MapPrototype.withMutations;\n\tStackPrototype.asMutable = MapPrototype.asMutable;\n\tStackPrototype.asImmutable = MapPrototype.asImmutable;\n\tStackPrototype.wasAltered = MapPrototype.wasAltered;\n\tfunction makeStack(size, head, ownerID, hash) {\n\t var map = Object.create(StackPrototype);\n\t map.size = size;\n\t map._head = head;\n\t map.__ownerID = ownerID;\n\t map.__hash = hash;\n\t map.__altered = false;\n\t return map;\n\t}\n\tvar EMPTY_STACK;\n\tfunction emptyStack() {\n\t return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n\t}\n\tvar Set = function Set(value) {\n\t return value === null || value === undefined ? emptySet() : isSet(value) ? value : emptySet().union(value);\n\t};\n\t($traceurRuntime.createClass)(Set, {\n\t toString: function() {\n\t return this.__toString('Set {', '}');\n\t },\n\t has: function(value) {\n\t return this._map.has(value);\n\t },\n\t add: function(value) {\n\t var newMap = this._map.set(value, true);\n\t if (this.__ownerID) {\n\t this.size = newMap.size;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return newMap === this._map ? this : makeSet(newMap);\n\t },\n\t remove: function(value) {\n\t var newMap = this._map.remove(value);\n\t if (this.__ownerID) {\n\t this.size = newMap.size;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return newMap === this._map ? this : newMap.size === 0 ? emptySet() : makeSet(newMap);\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._map.clear();\n\t return this;\n\t }\n\t return emptySet();\n\t },\n\t union: function() {\n\t var iters = arguments;\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t return this.withMutations((function(set) {\n\t for (var ii = 0; ii < iters.length; ii++) {\n\t SetIterable(iters[ii]).forEach((function(value) {\n\t return set.add(value);\n\t }));\n\t }\n\t }));\n\t },\n\t intersect: function() {\n\t for (var iters = [],\n\t $__7 = 0; $__7 < arguments.length; $__7++)\n\t iters[$__7] = arguments[$__7];\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t iters = iters.map((function(iter) {\n\t return SetIterable(iter);\n\t }));\n\t var originalSet = this;\n\t return this.withMutations((function(set) {\n\t originalSet.forEach((function(value) {\n\t if (!iters.every((function(iter) {\n\t return iter.contains(value);\n\t }))) {\n\t set.remove(value);\n\t }\n\t }));\n\t }));\n\t },\n\t subtract: function() {\n\t for (var iters = [],\n\t $__8 = 0; $__8 < arguments.length; $__8++)\n\t iters[$__8] = arguments[$__8];\n\t if (iters.length === 0) {\n\t return this;\n\t }\n\t iters = iters.map((function(iter) {\n\t return SetIterable(iter);\n\t }));\n\t var originalSet = this;\n\t return this.withMutations((function(set) {\n\t originalSet.forEach((function(value) {\n\t if (iters.some((function(iter) {\n\t return iter.contains(value);\n\t }))) {\n\t set.remove(value);\n\t }\n\t }));\n\t }));\n\t },\n\t merge: function() {\n\t return this.union.apply(this, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var iters = [],\n\t $__9 = 1; $__9 < arguments.length; $__9++)\n\t iters[$__9 - 1] = arguments[$__9];\n\t return this.union.apply(this, iters);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._map.__iterate((function(_, k) {\n\t return fn(k, k, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._map.map((function(_, k) {\n\t return k;\n\t })).__iterator(type, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return makeSet(newMap, ownerID);\n\t }\n\t}, {\n\t of: function() {\n\t return this(arguments);\n\t },\n\t fromKeys: function(value) {\n\t return this(KeyedSeq(value).flip().valueSeq());\n\t }\n\t}, SetCollection);\n\tfunction isSet(maybeSet) {\n\t return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);\n\t}\n\tSet.isSet = isSet;\n\tvar IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\n\tvar SetPrototype = Set.prototype;\n\tSetPrototype[IS_SET_SENTINEL] = true;\n\tSetPrototype[DELETE] = SetPrototype.remove;\n\tSetPrototype.mergeDeep = SetPrototype.merge;\n\tSetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n\tSetPrototype.withMutations = MapPrototype.withMutations;\n\tSetPrototype.asMutable = MapPrototype.asMutable;\n\tSetPrototype.asImmutable = MapPrototype.asImmutable;\n\tfunction makeSet(map, ownerID) {\n\t var set = Object.create(SetPrototype);\n\t set.size = map ? map.size : 0;\n\t set._map = map;\n\t set.__ownerID = ownerID;\n\t return set;\n\t}\n\tvar EMPTY_SET;\n\tfunction emptySet() {\n\t return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n\t}\n\tvar OrderedMap = function OrderedMap(value) {\n\t return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().merge(KeyedIterable(value));\n\t};\n\t($traceurRuntime.createClass)(OrderedMap, {\n\t toString: function() {\n\t return this.__toString('OrderedMap {', '}');\n\t },\n\t get: function(k, notSetValue) {\n\t var index = this._map.get(k);\n\t return index !== undefined ? this._list.get(index)[1] : notSetValue;\n\t },\n\t clear: function() {\n\t if (this.size === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.size = 0;\n\t this._map.clear();\n\t this._list.clear();\n\t return this;\n\t }\n\t return emptyOrderedMap();\n\t },\n\t set: function(k, v) {\n\t return updateOrderedMap(this, k, v);\n\t },\n\t remove: function(k) {\n\t return updateOrderedMap(this, k, NOT_SET);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered() || this._list.wasAltered();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._list.__iterate((function(entry) {\n\t return entry && fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._list.fromEntrySeq().__iterator(type, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map.__ensureOwner(ownerID);\n\t var newList = this._list.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t this._list = newList;\n\t return this;\n\t }\n\t return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n\t }\n\t}, {of: function() {\n\t return this(arguments);\n\t }}, Map);\n\tfunction isOrderedMap(maybeOrderedMap) {\n\t return !!(maybeOrderedMap && maybeOrderedMap[IS_ORDERED_MAP_SENTINEL]);\n\t}\n\tOrderedMap.isOrderedMap = isOrderedMap;\n\tvar IS_ORDERED_MAP_SENTINEL = '@@__IMMUTABLE_ORDERED_MAP__@@';\n\tOrderedMap.prototype[IS_ORDERED_MAP_SENTINEL] = true;\n\tOrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\tfunction makeOrderedMap(map, list, ownerID, hash) {\n\t var omap = Object.create(OrderedMap.prototype);\n\t omap.size = map ? map.size : 0;\n\t omap._map = map;\n\t omap._list = list;\n\t omap.__ownerID = ownerID;\n\t omap.__hash = hash;\n\t return omap;\n\t}\n\tvar EMPTY_ORDERED_MAP;\n\tfunction emptyOrderedMap() {\n\t return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n\t}\n\tfunction updateOrderedMap(omap, k, v) {\n\t var map = omap._map;\n\t var list = omap._list;\n\t var i = map.get(k);\n\t var has = i !== undefined;\n\t var removed = v === NOT_SET;\n\t if ((!has && removed) || (has && v === list.get(i)[1])) {\n\t return omap;\n\t }\n\t if (!has) {\n\t i = list.size;\n\t }\n\t var newMap = removed ? map.remove(k) : has ? map : map.set(k, i);\n\t var newList = removed ? list.set(i, undefined) : list.set(i, [k, v]);\n\t if (omap.__ownerID) {\n\t omap.size = newMap.size;\n\t omap._map = newMap;\n\t omap._list = newList;\n\t omap.__hash = undefined;\n\t return omap;\n\t }\n\t return makeOrderedMap(newMap, newList);\n\t}\n\tvar Record = function Record(defaultValues, name) {\n\t var RecordType = function Record(values) {\n\t if (!(this instanceof RecordType)) {\n\t return new RecordType(values);\n\t }\n\t this._map = Map(values);\n\t };\n\t var keys = Object.keys(defaultValues);\n\t var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n\t RecordTypePrototype.constructor = RecordType;\n\t name && (RecordTypePrototype._name = name);\n\t RecordTypePrototype._defaultValues = defaultValues;\n\t RecordTypePrototype._keys = keys;\n\t RecordTypePrototype.size = keys.length;\n\t try {\n\t keys.forEach((function(key) {\n\t Object.defineProperty(RecordType.prototype, key, {\n\t get: function() {\n\t return this.get(key);\n\t },\n\t set: function(value) {\n\t invariant(this.__ownerID, 'Cannot set on an immutable record.');\n\t this.set(key, value);\n\t }\n\t });\n\t }));\n\t } catch (error) {}\n\t return RecordType;\n\t};\n\t($traceurRuntime.createClass)(Record, {\n\t toString: function() {\n\t return this.__toString(recordName(this) + ' {', '}');\n\t },\n\t has: function(k) {\n\t return this._defaultValues.hasOwnProperty(k);\n\t },\n\t get: function(k, notSetValue) {\n\t if (notSetValue !== undefined && !this.has(k)) {\n\t return notSetValue;\n\t }\n\t var defaultVal = this._defaultValues[k];\n\t return this._map ? this._map.get(k, defaultVal) : defaultVal;\n\t },\n\t clear: function() {\n\t if (this.__ownerID) {\n\t this._map && this._map.clear();\n\t return this;\n\t }\n\t var SuperRecord = Object.getPrototypeOf(this).constructor;\n\t return SuperRecord._empty || (SuperRecord._empty = makeRecord(this, emptyMap()));\n\t },\n\t set: function(k, v) {\n\t if (!this.has(k)) {\n\t throw new Error('Cannot set unknown key \"' + k + '\" on ' + recordName(this));\n\t }\n\t var newMap = this._map && this._map.set(k, v);\n\t if (this.__ownerID || newMap === this._map) {\n\t return this;\n\t }\n\t return makeRecord(this, newMap);\n\t },\n\t remove: function(k) {\n\t if (!this.has(k)) {\n\t return this;\n\t }\n\t var newMap = this._map && this._map.remove(k);\n\t if (this.__ownerID || newMap === this._map) {\n\t return this;\n\t }\n\t return makeRecord(this, newMap);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered();\n\t },\n\t __iterator: function(type, reverse) {\n\t var $__0 = this;\n\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t return $__0.get(k);\n\t })).__iterator(type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t return $__0.get(k);\n\t })).__iterate(fn, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map && this._map.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return makeRecord(this, newMap, ownerID);\n\t }\n\t}, {}, KeyedCollection);\n\tvar RecordPrototype = Record.prototype;\n\tRecordPrototype[DELETE] = RecordPrototype.remove;\n\tRecordPrototype.merge = MapPrototype.merge;\n\tRecordPrototype.mergeWith = MapPrototype.mergeWith;\n\tRecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n\tRecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n\tRecordPrototype.update = MapPrototype.update;\n\tRecordPrototype.updateIn = MapPrototype.updateIn;\n\tRecordPrototype.withMutations = MapPrototype.withMutations;\n\tRecordPrototype.asMutable = MapPrototype.asMutable;\n\tRecordPrototype.asImmutable = MapPrototype.asImmutable;\n\tfunction makeRecord(likeRecord, map, ownerID) {\n\t var record = Object.create(Object.getPrototypeOf(likeRecord));\n\t record._map = map;\n\t record.__ownerID = ownerID;\n\t return record;\n\t}\n\tfunction recordName(record) {\n\t return record._name || record.constructor.name;\n\t}\n\tvar Range = function Range(start, end, step) {\n\t if (!(this instanceof $Range)) {\n\t return new $Range(start, end, step);\n\t }\n\t invariant(step !== 0, 'Cannot step a Range by 0');\n\t start = start || 0;\n\t if (end === undefined) {\n\t end = Infinity;\n\t }\n\t if (start === end && __EMPTY_RANGE) {\n\t return __EMPTY_RANGE;\n\t }\n\t step = step === undefined ? 1 : Math.abs(step);\n\t if (end < start) {\n\t step = -step;\n\t }\n\t this._start = start;\n\t this._end = end;\n\t this._step = step;\n\t this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n\t};\n\tvar $Range = Range;\n\t($traceurRuntime.createClass)(Range, {\n\t toString: function() {\n\t if (this.size === 0) {\n\t return 'Range []';\n\t }\n\t return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]';\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;\n\t },\n\t contains: function(searchValue) {\n\t var possibleIndex = (searchValue - this._start) / this._step;\n\t return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.size)) {\n\t return this;\n\t }\n\t begin = resolveBegin(begin, this.size);\n\t end = resolveEnd(end, this.size);\n\t if (end <= begin) {\n\t return __EMPTY_RANGE;\n\t }\n\t return new $Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n\t },\n\t indexOf: function(searchValue) {\n\t var offsetValue = searchValue - this._start;\n\t if (offsetValue % this._step === 0) {\n\t var index = offsetValue / this._step;\n\t if (index >= 0 && index < this.size) {\n\t return index;\n\t }\n\t }\n\t return -1;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t return this.indexOf(searchValue);\n\t },\n\t take: function(amount) {\n\t return this.slice(0, Math.max(0, amount));\n\t },\n\t skip: function(amount) {\n\t return this.slice(Math.max(0, amount));\n\t },\n\t __iterate: function(fn, reverse) {\n\t var maxIndex = this.size - 1;\n\t var step = this._step;\n\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t if (fn(value, ii, this) === false) {\n\t return ii + 1;\n\t }\n\t value += reverse ? -step : step;\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var maxIndex = this.size - 1;\n\t var step = this._step;\n\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var v = value;\n\t value += reverse ? -step : step;\n\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n\t }));\n\t },\n\t __deepEquals: function(other) {\n\t return other instanceof $Range ? this._start === other._start && this._end === other._end && this._step === other._step : $traceurRuntime.superCall(this, $Range.prototype, \"__deepEquals\", [other]);\n\t }\n\t}, {}, IndexedSeq);\n\tvar RangePrototype = Range.prototype;\n\tRangePrototype.__toJS = RangePrototype.toArray;\n\tRangePrototype.first = ListPrototype.first;\n\tRangePrototype.last = ListPrototype.last;\n\tvar __EMPTY_RANGE = Range(0, 0);\n\tvar Repeat = function Repeat(value, times) {\n\t if (times <= 0 && EMPTY_REPEAT) {\n\t return EMPTY_REPEAT;\n\t }\n\t if (!(this instanceof $Repeat)) {\n\t return new $Repeat(value, times);\n\t }\n\t this._value = value;\n\t this.size = times === undefined ? Infinity : Math.max(0, times);\n\t if (this.size === 0) {\n\t EMPTY_REPEAT = this;\n\t }\n\t};\n\tvar $Repeat = Repeat;\n\t($traceurRuntime.createClass)(Repeat, {\n\t toString: function() {\n\t if (this.size === 0) {\n\t return 'Repeat []';\n\t }\n\t return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._value : notSetValue;\n\t },\n\t contains: function(searchValue) {\n\t return is(this._value, searchValue);\n\t },\n\t slice: function(begin, end) {\n\t var size = this.size;\n\t return wholeSlice(begin, end, size) ? this : new $Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n\t },\n\t reverse: function() {\n\t return this;\n\t },\n\t indexOf: function(searchValue) {\n\t if (is(this._value, searchValue)) {\n\t return 0;\n\t }\n\t return -1;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t if (is(this._value, searchValue)) {\n\t return this.size;\n\t }\n\t return -1;\n\t },\n\t __iterate: function(fn, reverse) {\n\t for (var ii = 0; ii < this.size; ii++) {\n\t if (fn(this._value, ii, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var $__0 = this;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t return ii < $__0.size ? iteratorValue(type, ii++, $__0._value) : iteratorDone();\n\t }));\n\t },\n\t __deepEquals: function(other) {\n\t return other instanceof $Repeat ? is(this._value, other._value) : $traceurRuntime.superCall(this, $Repeat.prototype, \"__deepEquals\", [other]);\n\t }\n\t}, {}, IndexedSeq);\n\tvar RepeatPrototype = Repeat.prototype;\n\tRepeatPrototype.last = RepeatPrototype.first;\n\tRepeatPrototype.has = RangePrototype.has;\n\tRepeatPrototype.take = RangePrototype.take;\n\tRepeatPrototype.skip = RangePrototype.skip;\n\tRepeatPrototype.__toJS = RangePrototype.__toJS;\n\tvar EMPTY_REPEAT;\n\tvar Immutable = {\n\t Iterable: Iterable,\n\t Seq: Seq,\n\t Collection: Collection,\n\t Map: Map,\n\t List: List,\n\t Stack: Stack,\n\t Set: Set,\n\t OrderedMap: OrderedMap,\n\t Record: Record,\n\t Range: Range,\n\t Repeat: Repeat,\n\t is: is,\n\t fromJS: fromJS\n\t};\n\n\t return Immutable;\n\t}", "function r(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "function r(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "function r(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "function FooBar() {\n // TODO: implement this module\n}", "function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "patch() {\n }", "function v8(v9,v10) {\n const v16 = [1337,1337];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v17 = [\"536870912\",-3848843708,v16,-3848843708,1337,13.37,13.37,WeakMap,-3848843708];\n // v17 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = {constructor:13.37,e:v16};\n // v18 = .object(ofGroup: Object, withProperties: [\"constructor\", \"e\", \"__proto__\"])\n const v19 = {__proto__:-3848843708,a:v18,b:-3848843708,constructor:1337,d:v18,e:v17,length:WeakMap};\n // v19 = .object(ofGroup: Object, withProperties: [\"d\", \"b\", \"a\", \"__proto__\", \"e\", \"constructor\", \"length\"])\n const v21 = new Float64Array(v19);\n // v21 = .object(ofGroup: Float64Array, withProperties: [\"byteOffset\", \"constructor\", \"buffer\", \"__proto__\", \"byteLength\", \"length\"], withMethods: [\"map\", \"values\", \"subarray\", \"find\", \"fill\", \"set\", \"findIndex\", \"some\", \"reduceRight\", \"reverse\", \"join\", \"includes\", \"entries\", \"reduce\", \"every\", \"copyWithin\", \"sort\", \"forEach\", \"lastIndexOf\", \"indexOf\", \"filter\", \"slice\", \"keys\"])\n v6[6] = v7;\n v7.toString = v9;\n }", "function Utils() {}", "function Utils() {}", "function o(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function c() {}", "constructor( ) {}", "function main() {\n}", "use(fn) {}", "function FooRule() {\n}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "function test() {\n var o35 = Object.getOwnPropertyDescriptor(Object.prototype, \"__proto__\").function(o1, o2)\n{\n var o3 = 0;\n var o4 = 0;\n try {\nfor (var o5 = 1; o5 < 10000; o5++)\n {\n try {\no3 = (o1.o3 + o1.o3 + o1.o3 + o1.o3 + o1.o3) & 0x3FFFF;\n}catch(e){}\n try {\no2.o3 = o3 + o4;\n}catch(e){}\n try {\no4 = (o1.o3 + o1.o3 + o1.o3 + o1.o3 + o1.o3) & 0xFFFF;\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn o3 + o4;\n}catch(e){}\n};\n function o1() {\n }\n var o2 = ((o863 & 0x4000) >> Object.o157) | ((o863 & 0x40) >> 6);\n var o38 = o839.o906.o917(o308);\n var o6 = Array('Math.ceil((' + target + ')/');\n var o867 = this.o543[0x200 | (o768 >> 4)];\n var o8 = o1(\"willValidate\");\n try {\no21 = function () {\n try {\no337++;\n}catch(e){}\n };\n}catch(e){}\n try {\ntry { o1(\"MSGestureEvent\"); } catch(e) {}try { try {\no1(\"setImmediate\");\n}catch(e){} } catch(e) {}\n}catch(e){}\n try {\n({ o9: !o3.call(o2, o1, '!') });\n}catch(e){}\n try {\nif (o0 != 2)\n try {\nprint(\"FAIL\");\n}catch(e){}\n else\n try {\nprint(\"PASS\");\n}catch(e){}\n}catch(e){}\n}", "function Bevy() {}", "function hc(){return hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hc.apply(this,arguments)}", "function u(t,e){return t(e={exports:{}},e.exports),e.exports}", "function main() {\n\n}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}" ]
[ "0.6149275", "0.54203457", "0.53920096", "0.53668714", "0.53668714", "0.53668714", "0.53408384", "0.5318133", "0.5318133", "0.5318133", "0.5308971", "0.52618045", "0.5255616", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52386945", "0.52386945", "0.52386945", "0.52386945", "0.52386945", "0.52386945", "0.52386945", "0.52386945", "0.52386945", "0.5236023", "0.52302927", "0.5209219", "0.518569", "0.51775223", "0.5161208", "0.5151423", "0.51483786", "0.51154035", "0.5104374", "0.5089039", "0.5086965", "0.5086965", "0.5086965", "0.50813836", "0.50768495", "0.50768495", "0.5072789", "0.5072789", "0.5072789", "0.5072789", "0.5072789", "0.5072789", "0.507222", "0.5066842", "0.50424546", "0.50424546", "0.5039841", "0.5036415", "0.50292754", "0.5027302", "0.5018287", "0.5016567", "0.5004397", "0.5004397", "0.5004397", "0.5004397", "0.5004397", "0.5004397", "0.50028014", "0.5001212", "0.49986866", "0.4986019", "0.4979444", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006", "0.49765006" ]
0.0
-1
++++++++++++++++++++++++++++++++++++++++++++ DATA Constructor and Instances ++++++++++++++++++++++++++++++++++++++++++++
function CatalogItem (imageName, filePath) { this.imageName = imageName; this.filePath = filePath; this.tallyClicked = 0; this.tallyDisplayed = 0; //Push the object to imageArray catalogArray.push(this); imageNameArray.push(this.imageName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Data() { }", "constructor() {\n super();\n this.data = new Data();\n }", "constructor(data) { }", "constructor(data) {\n \n }", "constructor() {\n this.data = this._loadData();\n }", "constructor(data) {\n this.data = data;\n }", "constructor(dataInput) {\n this.data = dataInput;\n this.length = Object.keys(dataInput).length;\n this.names = this.dataNames(); \n this.counts = this.dataCounts();\n this.data360 = this.dataMap360();\n this.percent100 = this.dataPercents();\n console.log(this);\n }", "init(){\n var self = this;\n self.generateData();\n self.insertInfo();\n self.copyData();\n }", "constructor(data) {\n this.data = data;\n }", "constructor () {\n this.data = {}\n }", "constructor(data) {\n const dataKeys = Object.keys(data);\n for (let i = 0; i < dataKeys.length; i++) {\n this[dataKeys[i]] = data[dataKeys[i]];\n }\n }", "constructor(data = {}) {\n super(data);\n \n this.init(data);\n }", "function Data() {\n this.mariopower = 1;\n this.scorelevs = [100, 200, 400, 500, 800, 1000, 2000, 4000, 5000, 8000];\n this.score = new dataObject(0, 6, \"SCORE\");\n this.time = new dataObject(350, 3, \"TIME\");\n this.world = new dataObject(0, 0, \"WORLD\");\n this.coins = new dataObject(0, 0, \"COINS\");\n this.lives = new dataObject(3, 1, \"LIVES\");\n}", "function Data()\n{\n //parameters\n this.total = 0;\n this.domestic = 0;\n this.transborder = 0;\n this.other = 0;\n}", "constructor(data){ \n this.data = data;\n }", "constructor() {\n this.data = {};\n }", "constructor() {\n this.data = {};\n }", "function Data() {\n this.columns = null;\n this.items = null;\n this.projection = null;\n this.num_rows = 0;\n this.num_cols = 0;\n}", "constructor(_data, _target) {\n // Define fields\n this.data = _data;\n this.target = _target;\n\n // Call init\n this.init();\n }", "constructor() {\n super() // required after extends\n this.data = []\n }", "constructor(data) {\n super(data);\n }", "constructor(_data = {}) {\n this._data = _data;\n }", "init(data) {\r\n this.object = data.object;\r\n }", "constructor(data = {}) {\n Object.assign(this, data)\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8317c0c3;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.data = args.data;\n }", "init (data = {}) {\n for(let key in data){\n this[key] = data[key];\n }\n }", "init (data = {}) {\n for(let key in data){\n this[key] = data[key];\n }\n }", "static $new(data) {\n\t\tvar className = this;\n\t\tvar instance = new className();\n\t\tvar defaultProps = className.$properties();\n\t\t// bind data\n\t\tif(_.isPlainObject(defaultProps)){\n\t\t\tvar propNames = Object.getOwnPropertyNames(defaultProps);\n\t\t\tfor(let propName of propNames) {\n\t\t\t\tvar propVal\n\t\t\t\tif(_.isPlainObject(data) && data[propName] !== undefined){\n\t\t\t\t\tpropVal = data[propName];\n\t\t\t\t} else if(typeof defaultProps[propName] === 'function'){\n\t\t\t\t\tpropVal = defaultProps[propName].apply(instance, [data]);\n\t\t\t\t} else {\n\t\t\t\t\tpropVal = defaultProps[propName];\n\t\t\t\t}\n\t\t\t\tinstance[propName] = propVal;\n\t\t\t}\n\t\t}\n\t\t// Object.seal(instance)\n\t\treturn instance;\n\t}", "function _newDataClass(oBoss)\r\n{\r\n\tthis.n = 0;\r\n\tthis.o = 0;\r\n\tthis.h = 0;\r\n\tthis.c = 0;\r\n\tthis.l = 0;\r\n\tthis.html = \"xxx\";\r\n\tthis.ui\t\t= null;\r\n}", "constructor() {\r\n this.datas = new Array(16);\r\n this.identity();\r\n }", "function Data() {\n\n this.expando = cepto.expando + Data.uid++;\n\n Object.defineProperty(this.cache = {}, 0, {\n get: function() {\n return {};\n }\n });\n\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4218a164;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.data = args.data;\n }", "static instantiate (data) {\n return new InstancesCollection(data)\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x7d748d04;\n this.SUBCLASS_OF_ID = 0xad0352e8;\n\n this.data = args.data;\n }", "initialize(data) {\n this.$exists = false;\n this.$changed = {};\n this.$attributes = {};\n this.fill(data);\n this.$initialized = true;\n\n return this;\n }", "function Data() { // 4029\n\tthis.expando = jQuery.expando + Data.uid++; // 4030\n} // 4031", "SetData() {}", "constructor( data ){\n this._emitter = new EventTarget();\n this._converters = new Map();\n this._dynamicProperties = false;\n this._data = data;\n }", "constructor() {\n\n /**\n * @type {Array.<{type: string, label: string, url: string}>}\n * @private\n */\n this._data = []\n }", "function Data() {\n this.mariopower = 1;\n this.traveled = this.traveledold = 0; // only used for random\n this.scorelevs = [100, 200, 400, 500, 800, 1000, 2000, 4000, 5000, 8000];\n this.score = new DataObject(0, 6, \"SCORE\");\n this.time = new DataObject(350, 3, \"TIME\");\n this.world = new DataObject(0, 0, \"WORLD\");\n this.coins = new DataObject(0, 0, \"COINS\");\n this.lives = new DataObject(3, 1, \"LIVES\");\n this.time.dir = -1;\n this.scoreold = 0;\n}", "function DataManager() {}", "function LC() {\n this.data = {};\n}", "constructur() {}", "constructor (data) {\n\t\tthis.rows = data;\n\t}", "constructor(data) {\n\n //TODO - your code goes here -\n\n }", "constructor(){\r\n\t\tthis.data = [];//initializing the array as blank...\r\n\t\tthis.data.push(new employee(123, \"Phaniraj\", \"Bangalore\"));\r\n\t\tthis.data.push(new employee(124, \"Mahesh\", \"Bangalore\"));\r\n\t\tthis.data.push(new employee(125, \"Gopal\", \"Mysore\"));\r\n\t\tthis.data.push(new employee(126, \"Venkatesh\", \"Chennai\"));\r\n\t}", "function or(){this.__data__=new Ut}", "constructor (){}", "constructor (data) {\n super(data, InstanceModel)\n }", "consructor() {\n }", "initInstance() {\n this.instance = {};\n this.instance.epiHiperSchema = '';\n this.instance.diseaseModel = {};\n this.instance.sets = [];\n this.instance.variables = [];\n this.instance.initializations = [];\n this.instance.triggers = [];\n this.instance.interventions = [];\n this.instance.traits = [];\n this.instance.personTraitDBs = [];\n this.instance.network = {};\n this.instance.runParameters = {};\n }", "constructor (data) {\n\n // the data array\n this.data = [];\n\n // should we parse the todos data?\n if (data && data.todos) data.todos.map(function (item) {\n return new Todo(item);\n }).forEach((item) => { this.data.push(item); });\n }", "function DataObject() {\n\tthis.string = 'string';\n\tthis.number = 1234;\n\tthis.bool = false;\n\tthis.undef = undefined;\n\tthis.nul = null;\n\tthis.nan = NaN;\n\tthis.array = [1, 2, 3, 4];\n\tthis.func = function() {};\n\tthis.obj = {};\n}", "GetData() {}", "constructor(data = {}) {\r\n //super(data);\r\n for (const prop in data) {\r\n this[prop] = data[prop];\r\n }\r\n }", "constructor(){\r\n\t\tthis.data=[]\r\n\t}", "constructor () {\n this.#data = {} // Objeto vazio\n this.#tail = -1 // Pilha vazia\n }", "function Data(dia, mes, ano) {\n this.dia = dia;\n this.mes = mes;\n this.ano = ano;\n // this.dia = dia;\n // this.mes = mes;\n // this.ano = ano;\n }", "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "constructor(list, data) {\n this._list = list;\n this._data = data;\n }", "constructor() {\n\n _data.set( this, new Map() );\n _validity.set( this, new Map() );\n\n // Immutable object.\n Object.freeze( this );\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8aeabec3;\n this.SUBCLASS_OF_ID = 0x7cd41eb4;\n\n this.data = args.data;\n this.dataHash = args.dataHash;\n this.secret = args.secret;\n }", "constructor(data) {\n this.type = data.type;\n this.byDevice = data.byDevice;\n this.byMonth = data.byMonth;\n this.symbol = data.symbol;\n }", "constructor(data = {}) {\n //super(data);\n for (const prop in data) {\n this[prop] = data[prop];\n }\n }", "function _construct()\n\t\t{;\n\t\t}", "constructor() {\n this.data = [];\n }", "constructor(){\n this.data = [] //armazenamento\n }", "constructor(x,y){\n this.a = x;\n this.b = y;\n this.#data = y;\n console.log(`Private data = ${this.#data}`);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x187fa0ca;\n this.SUBCLASS_OF_ID = 0x51138ae;\n\n this.type = args.type;\n this.data = args.data || null;\n this.frontSide = args.frontSide || null;\n this.reverseSide = args.reverseSide || null;\n this.selfie = args.selfie || null;\n this.translation = args.translation || null;\n this.files = args.files || null;\n this.plainData = args.plainData || null;\n this.hash = args.hash;\n }", "function Data(dia, mes, ano) {\n if (ano === void 0) { ano = 1970; }\n this.dia = dia;\n this.mes = mes;\n this.ano = ano;\n // this.dia = dia;\n // this.mes = mes;\n // this.ano = ano;\n }", "function chartData( dataNum = 0,inputTitle = \"\", attrbuteArray = [], datasetArray = []) {\n\tlet self = this;\n\tthis.title = inputTitle;\n\tthis.count = dataNum;\n\tthis.attributes = attrbuteArray;\n\tthis.datasets = datasetArray;\n\n}", "constructor() {\n /**\n * Data holder for the stats class\n * @type {Object}\n */\n this.data = {};\n }", "constructor(data) {\n this.data = data\n this.next = null\n }", "constructor(data){\n // super para acceder el constructor del padre\n super(data.name, data.sellIn, data.quality)\n \n }", "function Initialize1(data) {\n // Make sure all variables in this thread are initialized only once.\n self.littleEndian = data.littleEndian;\n self.compressed = data.compressed;\n self.memoryBudget = data.memoryBudget;\n self.attributesData = data.attributesData;\n self.sceneData = data.sceneData;\n self.version = data.version;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xdb21d0a7;\n this.SUBCLASS_OF_ID = 0xb49da1fc;\n\n this.type = args.type;\n this.data = args.data || null;\n this.frontSide = args.frontSide || null;\n this.reverseSide = args.reverseSide || null;\n this.selfie = args.selfie || null;\n this.translation = args.translation || null;\n this.files = args.files || null;\n this.plainData = args.plainData || null;\n }", "constructor(data) {\n this.data = data;\n this.rebuild_population();\n this.list_of_infoBoxData = [];\n }", "constructor (number = 1) {\n this.data = number;\n }", "function VersionData() {\r\n this.allUnits = {};\r\n this.playerUnits = {};\r\n this.computerUnits = {};\r\n this.camps = {};\r\n this.generals = {};\r\n this.functions = {};\r\n}", "initData(data) {\n if (!data || !data.sys) {\n return;\n }\n this.data = this.data || {};\n let dict = data.sys.dict;\n let protos = data.sys.protos;\n\n //Init compress dict\n if (dict) {\n this.data.dict = dict;\n this.data.abbrs = {};\n\n for (let route in dict) {\n this.data.abbrs[dict[route]] = route;\n }\n }\n\n //Init protobuf protos\n if (protos) {\n this.data.protos = {\n server: protos.server || {},\n client: protos.client || {}\n };\n if (!tools.isNull(this.protobuf)) {\n this.protobuf.init({\n encoderProtos: protos.client,\n decoderProtos: protos.server\n });\n }\n }\n }", "constructor(options, ...args){\n super(options, ...args);\n this.data = options ? options.data : undefined;\n }", "function Data(tag, fields) {\n this.type = DATA;\n this.tag = tag;\n this.fields = fields;\n}", "constructor(data) {\n this._id = data._id\n this.imgUrl = data.imgUrl\n this.price = data.price\n this.year = data.year\n this.levels = data.levels\n this.bedrooms = data.bedrooms\n this.bathrooms = data.bathrooms\n this.description = data.description\n }", "constructor(id, data = ''){\n\t\tthis.id = id;\n this.data = data;\t\t\n\t}", "init (data = {}) {\n for(let _key in data){\n this[_key] = data[_key];\n }\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3417d728;\n this.SUBCLASS_OF_ID = 0x2899a53d;\n\n this.save = args.save || null;\n this.data = args.data;\n }", "constructor(data) {\n // here the data is passed grouped as an object, rather than indivually in order\n const { name, price, stock = 0, description = \"\", tags = [] } = data;\n // log(arguments);\n\n \n\n this._id = MenuItem.uuidv4();\n this.name = name;\n this.price = price;\n this.stock = stock;\n this.description = description;\n this.tags = tags;\n }", "constructor(data) {\n if (data !== undefined) {\n this._matrix = ExtMath.matrix(data);\n }\n }", "constructor(data) {\n this.id = data.id\n this.nombre = data.nombre.toUpperCase();\n this.precio = parseFloat(data.precio);\n this.vendido = false;\n }", "static create( data ) {\n\t\tlet obj = new ( this )();\n\t\tfor( var key in data ) {\n\t\t\tif( data.hasOwnProperty( key ) ) {\n\t\t\t\tobj[key] = data[key];\n\t\t\t}\n\t\t}\n\t\treturn obj.save();\n\t}", "initDataRaw(X) {\n\t\t\tconst N = X.length;\n\t\t\tconst D = X[0].length;\n\t\t\tassert(N > 0, ' X is empty? You must have some data!');\n\t\t\tassert(D > 0, ' X[0] is empty? Where is the data?');\n\t\t\tconst pairwiseDistancesOfInput = pairwiseDistances(X); // convert X to distances using gaussian kernel\n\t\t\tthis.P = d2p(pairwiseDistancesOfInput, this.perplexity, 1e-4); // attach to object\n\t\t\tthis.N = N; // back up the size of the dataset\n\t\t\tthis.initSolution(); // refresh this\n\t\t}", "initData(data) {\n this.status = data.status;\n this.id = data.id;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x33f0ea47;\n this.SUBCLASS_OF_ID = 0x94dc7633;\n\n this.data = args.data;\n this.hash = args.hash;\n this.secret = args.secret;\n }", "constructor() {\n\t\t\t// Create a storage object for this class. This will serve as our 'memory' and corresponds to 'collection' in the first solution.\n\t\t\tthis.memState = {};\n\t\t}", "constructor(data) {\n this.data = data || {},\n this.trainDataUrl = { //! object for holding/organizing random query string parts\n baseUrl: 'http://lapi.transitchicago.com/api/1.0/ttarrivals.aspx',\n apiKey: '3106a8d27f8b4f8fb99b7c8d895163dd',\n mapId: '',\n stpId: '',\n outputType: 'JSON',\n }\n }", "function Dataobject(ServerData) {\n this.Head = ServerData.Head;\n this.Data = ServerData.Data;\n this.Config = ServerData.Config; //toNo-Arr indexes\n this.Grid = ServerData.Grid;\n\n //------------------------------------------------------------------------------------------------------------------\n //--------------------Object converters------------------------------------------------------------------------------\n //----------------------------------------------------------------------------------------------------------------\n}", "function Vt(){this.__data__=[]}", "constructor() {\n this._name = 'Hake';\n this._version = '0.0.0';\n this.data = data;\n this.dom = dom;\n this.observe = observe;\n this.parse = parse;\n this.event = event;\n this.item = item;\n }" ]
[ "0.7691085", "0.753114", "0.7498393", "0.73728585", "0.7296609", "0.7263449", "0.7160494", "0.7158822", "0.71553206", "0.70138717", "0.7013545", "0.69452906", "0.69428927", "0.68995243", "0.688462", "0.6873593", "0.6873593", "0.68278205", "0.68025386", "0.6752245", "0.6751113", "0.6749138", "0.6747565", "0.6708915", "0.6701723", "0.6701398", "0.6701398", "0.6701198", "0.66992193", "0.6695931", "0.6694994", "0.665871", "0.665305", "0.6645085", "0.6636177", "0.662002", "0.66162205", "0.66047615", "0.6588096", "0.65844715", "0.65800315", "0.65785426", "0.65623945", "0.6557694", "0.65548027", "0.65403384", "0.6540047", "0.65148455", "0.65027773", "0.648983", "0.64896375", "0.6474517", "0.64735234", "0.6450476", "0.6445122", "0.6435978", "0.6412877", "0.640967", "0.6408561", "0.6408561", "0.6408561", "0.6408561", "0.6404268", "0.6401824", "0.64010805", "0.63995844", "0.639475", "0.63932014", "0.6391255", "0.63906235", "0.6387246", "0.6382113", "0.63799", "0.6368787", "0.6363083", "0.63625604", "0.635934", "0.6350419", "0.6345456", "0.63435525", "0.6331289", "0.6328642", "0.63193786", "0.6311776", "0.63048357", "0.63010216", "0.62916076", "0.6284753", "0.6279267", "0.6234816", "0.6212262", "0.61933273", "0.6191214", "0.61886126", "0.6186381", "0.6182196", "0.61700124", "0.6151601", "0.6147353", "0.6146106", "0.6141949" ]
0.0
-1
++++++++++++++++++++++++++++++++++++++++++++ FUNCTION DECLARATIONS ++++++++++++++++++++++++++++++++++++++++++++ Function to randomly generate randomIndex1, randomIndex2, and randomIndex3
function checkForData() { if (localStorage.userResults) { catalogArray = JSON.parse(localStorage.userResults); for (var i = 0; i < catalogArray.length; i++) { imageNameArray.push(catalogArray[i].imageName); } } else { catalogArray = []; createCatalogItems(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createThreeRandomIndexes(){\n\n let randomIndexes = [];\n while (randomIndexes.length !== 3){\n let rand = generateRandomNumber();\n if(!randomIndexes.includes(rand)){\n randomIndexes.push(rand);\n\n }\n }\n return randomIndexes;\n}", "function randomIndex() {\n let n = floor(random(0, 4));\n return n;\n}", "function randomIndex(n) {\n return Math.floor(Math.random() * parseInt(n));\n }", "function renderThreeRandomImages(){\n let tempIndexes = createThreeRandomIndexes();\n if(randomIndexs.length === 0){\n randomIndexs = tempIndexes;\n }else{\n while(compareTwoArrays(randomIndexs,tempIndexes)){\n tempIndexes = createThreeRandomIndexes();\n }\n randomIndexs = tempIndexes;\n }\n\n\n console.log(randomIndexs);\n leftIndex = randomIndexs[0];\n rightIndex = randomIndexs[1];\n middleIndex = randomIndexs[2];\n\n\n leftImageEl.setAttribute('src',products[leftIndex].imagePath);\n rightImageEl.setAttribute('src',products[rightIndex].imagePath);\n middleImageEL.setAttribute('src',products[middleIndex].imagePath);\n products[leftIndex].viewedNum++;\n products[rightIndex].viewedNum++;\n products[middleIndex].viewedNum++;\n}", "function getRandomIndex () {\n let min = 0, max = 9;\n //generate random number as index between min and max\n //floor to get an integer\n randomIndex = Math.floor(Math.random() * (max - min + 1)) + min;\n}", "function generateRandomIndex() {\n return Math.floor(Math.random() * 10);\n}", "function randomindex() {\n return Math.floor(Math.random() * Busmall.allimg.length);\n}", "function randomindexPath() {\n\n do {\n var right = randomNum();\n var middle = randomNum();\n var left = randomNum();\n var equality = right == left || right == middle || left == middle;\n } while (equality || availableItem([left, middle, right]))\n\n uniqueItem = [];\n\n uniqueItem.push(\n itemsArray[left],\n itemsArray[middle],\n itemsArray[right]\n )\n render(left, middle, right);\n}", "function getRandomIndex() {\n // 0=>20\n return Math.floor(Math.random() * products.length);\n}", "function randIndex (N) { // improve, se w3c example\n var a = [];\n Array.from (Array(N), (e, i) => {\n a [i] = {index: i, value: Math.random()};\n });\n a = a.sort ((a,b)=>{return a.value - b.value});\n Array.from (Array (N), (e, i) => {a [i] = a [i].index})\n return a;\n}", "function getRandomIndex() {\n // 0=>18\n return Math.floor(Math.random() * (products.length));\n}", "function getRandomIndex(indexSize) {\n return Math.floor(Math.random() * indexSize);\n}", "function generateRandomIndex(imgIndexSelected) {\n var randIndex = Math.floor(Math.random() * products.length);\n while (previouslyDisplayedIndexs.includes(randIndex) || imgIndexSelected.includes(randIndex) ) {\n randIndex = Math.floor(Math.random() * products.length);\n }\n\n return randIndex;\n\n}", "function possibleIndex(n) {\n return Math.floor(Math.random() * n);\n }", "function generateRandomIndex() {\n return Math.floor(Math.random() * productsArray.length);\n}", "function getRandomIndex() {\n return Math.floor(Math.random() * allProducts.length);\n}", "function getRandomIndex() {\n return Math.floor(Math.random() * Product.all.length);\n}", "function generateRandomIndex() {\n\n return Math.floor(Math.random() * Product.allProducts.length);\n}", "function randomIndex(length) {\n return Math.floor(Math.random() * (length));\n}", "function pickrandom(){\r\n //chose horizontal or vertical\r\n var axis = Math.floor(Math.random()*10);\r\n //random horizontal postion\r\n if (axis <=4){\r\n //chose 0 or 9\r\n var row = Math.floor(Math.random()*10);\r\n //0\r\n if (row <=4){\r\n row = 0;\r\n var col = Math.floor(Math.random()*(n-1));\r\n var ind = index(col,row);\r\n return linearVertex[ind];\r\n }\r\n //9\r\n else {\r\n row = n-1;\r\n var col = Math.floor(Math.random()*(n-1));\r\n var ind = index(col,row);\r\n return linearVertex[ind];\r\n }\r\n }\r\n //random vertical postion.\r\n else {\r\n //chose 0 or 9\r\n var col = Math.floor(Math.random()*10);\r\n //0\r\n if (col <=4){\r\n col = 0;\r\n var row = Math.floor(Math.random()*(n-1));\r\n var ind = index(col,row);\r\n return linearVertex[ind];\r\n }\r\n //9\r\n else {\r\n col = n-1;\r\n var row = Math.floor(Math.random()*(n-1));\r\n var ind = index(col,row);\r\n return linearVertex[ind];\r\n }\r\n }\r\n}", "function rng(){\n return Math.floor(Math.random() * 3);\n}", "function genrateRandomIndex(){\n return Math.floor(Math.random() * Goat.allImages.length); \n // 0.99999999999 * 8 => 7.999999994 floor() => 7\n // 0.99999999999 * 5 => 4.999999 floor => 4\n}", "function randomIndex(list){\n return Math.floor(Math.random()*list.length);\n}", "static randomPosition(count) {\n\t\treturn [random(-width, width), random(-height, height), random(width)].slice(0, count === undefined ? 3 : count);\n\t}", "function getRandomIndex(){\n\n var index = getRandomNumber(allBusMall.length);\n\n while (uniqueIndexArray.includes(index)){\n index = getRandomNumber(allBusMall.length);\n }\n uniqueIndexArray.push(index);\n if(uniqueIndexArray.length > 6){\n uniqueIndexArray.shift();\n }\n return index;\n}", "function getRandomIndices(num_residents) {\n\tvar possibleIndices = [];\n\tfor (var i = 0; i < num_residents; i++) {\n\t\tpossibleIndices.push(i);\n\t}\n\tvar rand1 = possibleIndices[Math.floor(Math.random() * possibleIndices.length)];\n\tpossibleIndices.splice(rand1, 1);\n\tvar rand2 = possibleIndices[Math.floor(Math.random() * possibleIndices.length)];\n\n\treturn { index1: rand1, index2: rand2 };\n}", "function random() {\n return (Math.floor(Math.random() * 3));\n }", "function randomIndex(data) {\n return Math.floor(Math.random() * data.length);\n }", "function getRandomIndex(maxIndex) {\n return Math.floor(Math.random() * maxIndex);\n}", "function generateRandomIndex() {\n return Math.floor(Math.random() * busMall.length);\n}", "function randomsuggestion(){\n $('#match').css({ 'order': Math.floor((Math.random() * 3) + 1)});\n $('.suggData1').css({ 'order': Math.floor((Math.random() * 3) + 1)});\n $('.suggData2').css({ 'order': Math.floor((Math.random() * 3) + 1)});\n } // end function to generate random index", "generateRandomIndex(){\n var index = {index:{}, string: \"\"};\n for(var field in this.fields){\n var i = (Math.floor(Math.random() * this.fields[field].length) );\n index.index[field] = i;\n index.string += i.toString() + \".\";\n }\n return index;\n }", "function randomIndex(){\n let last_index = audio_utility.index_curr_track;\n let current_index = getRandomIntInclusive(0, audio_utility.track_list_length-1);\n while(last_index == current_index){\n current_index = getRandomIntInclusive(0, audio_utility.track_list_length-1);\n }\n audio_utility.index_curr_track = current_index;\n}", "function createRandom(flo,index){\n let\n}", "function randomIndex (max){\n return Math.floor(Math.random() * max);\n}", "function random() {\n random1 = Math.floor((Math.random() * startupX.length));\n random2 = Math.floor((Math.random() * startupY.length));\n\n}", "function generateRandomPuzzle(){\n//Random number of rows and cols and picture\n\n\tvar num = Math.ceil(Math.random()*6); // set the random magical number to access the array of images through\n\t_image_path = String(images[num].path); // get the image path using the index generated\n\t_image_width = images[num].swidth; //get the picture width\n\t_image_height = images[num].sheight; //get the picture height\n\t\n\tvar puzzleSize = Math.ceil(Math.random()*9); //get the random puzzle size\n\t_num_rows = puzzleSize; //set the number of rows\n\t_num_cols = puzzleSize; // set the number of columns\n\t\n\t\n\t\n\t\n\t\n\t\n}", "function randomButtons() {\n randomBtn1 = Math.floor(Math.random() * 19 + 1);\n randomBtn2 = Math.floor(Math.random() * 19 + 1);\n randomBtn3 = Math.floor(Math.random() * 19 + 1);\n randomBtn4 = Math.floor(Math.random() * 19 + 1);\n randomBtn5 = Math.floor(Math.random() * 19 + 1);\n }", "function setRandomIndices(n){\n\t\tvar temp = [],\n\t\tmax = array.length-1;\n\t\t\t\n\t\twhile(max >= 0) temp.push(max--)\n\t\t\n\t\t//From http://stackoverflow.com/questions/962802/is-it-correct-to-use-javascript-array-sort-method-for-shuffling#answer-962890\n\t\tvar shuffled = (function shuffle(array) {\n\t\t var tmp, current, top = array.length;\n\n\t\t if(top) while(--top) {\n\t\t current = Math.floor(Math.random() * (top + 1))\n\t\t tmp = array[current]\n\t\t array[current] = array[top]\n\t\t array[top] = tmp\n\t\t }\n\n\t\t return array;\n\t\t})(temp)\n\n\t\treturn shuffled.slice(0, n)\n\t}", "function randInt() {\n return Math.floor(Math.random()*3);\n}", "function setRandom(){\n\tvar lstShuffle = new Array();\n\tvar\tlst = [0,1,2,3,4,5,6,7,8,9,10,11];\n\twhile(lst.length>0){\n\t\tvar tempIndex = randomXToY(0, lst.length);\n\t\tif(typeof lst[tempIndex] != \"undefined\"){\n\t\t\tlstShuffle.push(lst[tempIndex]);\n\t\t\tlst.splice(tempIndex,1);\t\n\t\t}\n\t}\t\n\t\n\t//mergin\n\tvar obj;\n\tfor(var i = 0; i < lstShuffle.length;i++){\n\t\tobj = new Object();\n\t\tobj.index = lstShuffle[i];\n\t\tobj.num = irandom[i].num;\n\t\tobj.xAngle = irandom[i].xAngle;\n\t\tobj.yAngle = irandom[i].yAngle;\n\t\tirandom[i] = obj;\n\t}\n\n}", "function multiRand () {\n return Math.floor(Math.random() * 11);\n}", "function shuffle()\n{\n var tem = getRandom(shuffleIndexCount);\n var tem2 = shuffleIndex[tem];\n shuffleIndex[tem] = shuffleIndex[shuffleIndexCount];\n\n shuffleIndexCount--;\n if(shuffleIndexCount < 0)\n {\n shuffleIndexCount = songsList.length;\n }\n return tem2;\n}", "function getRandomIndex(array){\n return Math.floor(Math.random() * array.length);\n}", "function renderThreeRandomImages(){\n do{\n firstImageIndex = generateRandomIndex();\n secondImageIndex = generateRandomIndex();\n thirdImageIndex = generateRandomIndex();\n } while(firstImageIndex === previousRow[0] || firstImageIndex === previousRow[1] || firstImageIndex === previousRow[2] || secondImageIndex === previousRow[0] || secondImageIndex === previousRow[1] || secondImageIndex === previousRow[2] || thirdImageIndex === previousRow[0] || thirdImageIndex === previousRow[1] || thirdImageIndex === previousRow[2] || firstImageIndex === secondImageIndex || firstImageIndex === thirdImageIndex || secondImageIndex === thirdImageIndex );\n\n previousRow = [];\n previousRow.push(firstImageIndex);\n previousRow.push(secondImageIndex);\n previousRow.push(thirdImageIndex);\n\n firstImageProduct.src = Product.prototype.allProduct[firstImageIndex].pathImage;\n secondImageProduct.src = Product.prototype.allProduct[secondImageIndex].pathImage;\n thirdImageProduct.src = Product.prototype.allProduct[thirdImageIndex].pathImage;\n\n console.log(previousRow);\n}", "function getNextRandomIndex(indexArr) {\n if (indexArr.length <= 0) return -1;\n let j = getRandomInt(0, indexArr.length-1);\n\n //swap\n let ret = indexArr[j];\n indexArr[j] = indexArr[indexArr.length-1];\n indexArr.pop();\n\n return ret;\n}", "function randomNumber(index) {\n if (selectedFeatures[(index - 1)] == \"specChars\") {\n random = specChars.charAt(Math.floor(Math.random() * specChars.length));\n } else if (selectedFeatures[(index - 1)] == \"numerals\") {\n random = numerals.charAt(Math.floor(Math.random() * numerals.length));\n } else if (selectedFeatures[(index - 1)] == \"alphabetLower\") {\n random = alphabetLower.charAt(Math.floor(Math.random() * alphabetLower.length));\n } else if (selectedFeatures[(index - 1)] == \"alphabetUpper\") {\n random = alphabetUpper.charAt(Math.floor(Math.random() * alphabetUpper.length));\n }\n return random;\n }", "function getRandomIndex (arr) {\n return Math.round(Math.random() * (arr.length - 1));\n}", "function aRandomArray() {\n randomIndex = [];\n for (let i = 0; i < 9; i++) {\n let randomArray = Math.floor(Math.random() * 9);\n if (randomIndex.indexOf(randomArray) === -1) {\n randomIndex.push(randomArray);\n } else {\n i = i - 1;\n }\n }\n} //aRandomArray()", "function randomPickedColorIndex()\r\n{\r\n\treturn Math.floor(Math.random()*arr.length);\r\n}", "generateRandomDirections() {\n let randoms = [];\n for (let i = 0; i < 4; i++) {\n randoms.push(i + 1);\n }\n return this.shuffle(randoms);\n }", "function index (max){\n return Math.floor(Math.random() * max)\n }", "function getRandomIndex(array) {\n return Math.floor(Math.random() * array.length);\n}", "function getRandomIndex(array) {\n return Math.floor(Math.random() * array.length);\n}", "function getRandomIndex(array) {\n return Math.floor(Math.random() * array.length);\n}", "@autobind\n initShuffleIndexes() {\n for (var i=0; i< this.particleCount; i++) {\n this.shuffleIndexArray[i] = i * 3;\n }\n this.shuffleIndexes();\n }", "function getRandomIndex(max){\n\t\treturn Math.round(Math.random() * max);\n\t}", "function getRandomIndex(array) {\n return Math.floor(Math.random() * array.length);\n }", "function getRandomIndex(array) {\n return Math.floor(Math.random() * array.length);\n }", "function randomIndexOf(arr) {\n if(arr.length < 1) return -1;\n return Math.floor(Math.random() * arr.length);\n}", "function rpsBotRandomInt() {\n return Math.floor(Math.random() * 3);\n}", "function randControl()\n{\n while(leftIndex === usedImg[0] || leftIndex === usedImg[1] || leftIndex === usedImg[2])\n {\n leftIndex = randomImage();\n }\n while(midIndex === usedImg[0] || midIndex === usedImg[1] || midIndex === usedImg[2])\n {\n midIndex = randomImage();\n }\n while(rightIndex === usedImg[0] || rightIndex === usedImg[1] || rightIndex === usedImg[2])\n {\n rightIndex = randomImage();\n }\n}", "randomizeDirection() {\n //Create variables to pick randomly from array\n let directions = [this.size, 0, -this.size];\n //Pick from the array index and set the next direction on a horizontal axis\n let randomDirection = floor(random(0, 1) * directions.length);\n this.nextDirectionX = directions[randomDirection];\n //Pick from the array index and set the next direction on a vertical axis\n randomDirection = floor(random(0, 1) * directions.length);\n this.nextDirectionY = directions[randomDirection];\n\n\n\n }", "function generateExcuse (arr1,arr2,arr3){\n\n let num1=generateNumRandom(clearArray(arr1))\n let num2=generateNumRandom(clearArray(arr2))\n let num3=generateNumRandom(clearArray(arr3))\n\n return `${arr1[num1]} ${arr2[num2]} ${arr3[num3]} `\n\n}", "function chooseRandomIndex(array) {\n return Math.floor(Math.random() * array.length);\n}", "function randomIndexForUA() {\n return Math.floor(Math.random() * 10**Math.ceil(Math.log10(UA.length))) % UA.length;\n}", "function getRandom(animals){ //declare a function called get randonm with 1 parameter\n return animals[Math.floor(Math.random() * animals.length-1)];//hahve function returns a random number that reps index of random animal in animals array\n }", "function randomIndex(max)\n{\n\treturn Math.floor(randomNumber(0,max));\n}", "function randomizer() {\n return Math.floor((Math.randon() * 3) + 1)\n}", "function randomizer() {\n return Math.floor((Math.randon() * 3) + 1)\n}", "generateRandomPoisonIndex() {\n let randoms = [];\n while (randoms.length <= this.numberOfGrids) {\n let currentNumber = Math.floor(\n Math.random() * this.numberOfGrids * this.numberOfGrids\n );\n if (randoms.indexOf(currentNumber) < 0) {\n randoms.push(currentNumber);\n }\n }\n return randoms;\n }", "function generateTarget() { \n return Math.floor(Math.random() * 9)\n;}", "function random(){\n\tvar randomIndex = mathRandom(workoutArray.length);\n\twhile(current == randomIndex){\n\t\trandomIndex = mathRandom(workoutArray.length);\n\t}\n\n if(randomIndex == 0){\n window.location.href=\"chest.html\";\n }\n else if(randomIndex == 1){\n window.location.href=\"back.html\";\n }\n else if(randomIndex == 2){\n window.location.href=\"arms.html\";\n }\n\telse if(randomIndex == 3){\n\t\twindow.location.href=\"legs.html\";\n\t}\n}", "function random_nums() {\n\t\t\tvar max = all_coords.length + 1;\n\t\t\treturn Math.floor(Math.random() * max) \n\t\t}", "function generateTarget() {\n return Math.floor(Math.random()* 9)\n}", "function generateRandomColors() {\r\n color1.value = getRandom();\r\n color2.value = getRandom();\r\n setGradient();\r\n}", "function rndIndx(arr) {\n return Math.floor(Math.random() * arr.length);\n}", "function getRandom1to5(index){\r\n\tvar rand=Math.floor(Math.random()*5+1);\r\n\tdocument.getElementById(\"indictor\"+index).innerHTML=rand;\r\n\treturn rand;\r\n}", "function generate() {\n return [getRand(categories), getRand(gameType), 'where you', getRand(action), getRand(thing)].join(' ');\n}", "function pickADoor() {\n return Math.floor(Math.random() * 3 + 1) // get a random integer: 1, 2, or 3\n}", "getRandomGift(index) {\n let i = Math.floor(Math.random() * giftList.length),\n set_index = this.state.show_index;\n set_index[index] = i;\n this.setState({ show_index: set_index });\n }", "function generateRandomGameSequence() {\n // random number between 0 and 3\n var rnd = Math.floor(Math.random() * 4);\n gameSequence.push(rnd);\n reproduceGameSequence(gameSequence);\n}", "function randomnum() {\n //Sets var randArray to a random index of 0-3; relates to arrays: lower, upper, number, special\n var randArray = Math.floor((Math.random() * array.length));\n //Sets var random to the index of selected var randArray from 0 - max length of the randArray\n var random = Math.floor((Math.random() * array[randArray].length));\n //returns the value in var randArray with an index of var random\n return array[randArray][random];\n}", "function randomAll() {\n var random = [];\n random.push(randomNova());\n random.push(randomVodafone());\n random.push(randomTwoForOne());\n var allRandom = random[Math.floor(Math.random() * random.length)];\n return allRandom;\n}", "function Random() {\n var RandomNumber1 = Math.floor(Math.random() * 10).toString();\n var RandomNumber2 = Math.floor(Math.random() * 10).toString();\n var RandomNumber3 = Math.floor(Math.random() * 10).toString();\n var linkRandom = RandomNumber1 + RandomNumber2 + RandomNumber3;\n return linkRandom;\n }", "function generateAnIdea(){\n thisArrayRandom = Math.floor(Math.random() * thisArray.length) + 1;\n thatArrayRandom = Math.floor(Math.random() * thatArray.length) + 1;\n console.log(\"Idea \"+(i + 1) +\": \"+thisArray[thisArrayRandom] + \" for \"+ thatArray[thatArrayRandom]);\n}", "function generateRandomNumbers() {\n let delay = [];\n delay[0] = generateRandom(60, 100);\n for (let i = 1; i < 3; i++) {\n delay[i] = generateRandom(delay[i-1] + 5, 100 + i * 5);\n }\n return delay;\n}", "function randomSequence () {\n\tvar random = Math.floor(Math.random() * sequence.length);\n\treturn sequence[random];\n}", "function randGenInvValues(){\n for(var i = 0; i < itemList1.length; i++){\n itemList1[i].value = Math.floor(Math.random() * 300)\n }\n for(var i = 0; i < itemList2.length; i++){\n itemList2[i].value = Math.floor(Math.random() * 300)\n }\n for(var i = 0; i < itemList3.length; i++){\n itemList3[i].value = Math.floor(Math.random() * 300)\n }\n}", "function generateRandomAge() {\n var randomIdx = getRandomIndex(5);\n return randomIdx;\n}", "function generateIndices() {\n let samples = [];\n while (samples.length < n) {\n let sample = Math.floor(index_prng() * face_genders.length);\n if (!samples.includes(sample) && face_genders[sample] != \"unknown\") {\n samples.push(sample);\n }\n }\n return samples;\n }", "function random() {\n rndCnt++; // console.log(rndCnt);\n\n return rndFunc();\n }", "function randomize(){\n num1 = int(random(1,10))\n num2 = int(random(1,10))\n num3 = int(random(1,10))\n num4 = int(random(1,10))\n num5 = int(random(1,10))\n num6 = int(random(1,10))\n num7 = int(random(1,10))\n}", "function SpeedLeft(Index)\n{\n\tvar rando = Math.floor(Math.random() * 2 );\n\tif (rando == 0) \n\t{\n\t\tLeftSpeed[Index] = ((Math.ceil(Math.random() * 3)));\n\t} \n\telse \n\t{\n\t\tLeftSpeed[Index] =((Math.ceil(Math.random() * 3))) * -1;\n\t}\n\n}", "function showRandomProducts() {\n let currentProductIndexes = [];\n\n for (let i = 0; i < 3; i++) {\n let randomNumber = Math.floor(Math.random() * allProducts.length);\n\n if (!currentProductIndexes.includes(randomNumber)) {\n currentProductIndexes.push(randomNumber);\n } else {\n while(currentProductIndexes.includes(randomNumber)) {\n randomNumber = Math.floor(Math.random() * allProducts.length);\n }\n\n currentProductIndexes.push(randomNumber);\n }\n }\n\n console.log(`CURRENT: ${ currentProductIndexes[0] }, ${ currentProductIndexes[1] }, ${ currentProductIndexes[2] }`);\n\n for (let i = 0; i < currentProductIndexes.length; i++) {\n allProducts[currentProductIndexes[i]].views++;\n\n if (i === 0) {\n firstProduct.src = allProducts[currentProductIndexes[i]].filepath;\n firstProduct.alt = allProducts[currentProductIndexes[i]].name;\n firstProductTitle.innerText = allProducts[currentProductIndexes[i]].name;\n }\n\n if (i === 1) {\n secondProduct.src = allProducts[currentProductIndexes[i]].filepath;\n secondProduct.alt = allProducts[currentProductIndexes[i]].name;\n secondProductTitle.innerText = allProducts[currentProductIndexes[i]].name;\n }\n\n if (i === 2) {\n thirdProduct.src = allProducts[currentProductIndexes[i]].filepath;\n thirdProduct.alt = allProducts[currentProductIndexes[i]].name;\n thirdProductTitle.innerText = allProducts[currentProductIndexes[i]].name;\n }\n }\n }", "function random_index( N, bias ) {\n if (bias == undefined) bias = 1\n return Math.min(N-1, Math.floor(Math.pow(Math.random(), 1/bias) * N))\n}", "function getRandomNumber(){\r\n return Math.floor(Math.random() * colors.length);\r\n}", "function randomIndex(vect) {\n return Math.floor(Math.random() * vect.length);\n}", "function selectRandomIndex(arr) {\n const index = Math.floor(Math.random() * arr.length);\n return index;\n }", "function addRandomNumber(){\t\t\n\tvar index=Math.floor(Math.random() * 4);\n\tsequence.push(index);\t\n}", "function getRandomNumber(){\r\n return Math.floor(Math.random()*colors.length);\r\n}" ]
[ "0.7604658", "0.7136812", "0.71226996", "0.6999024", "0.69741267", "0.69292235", "0.69046384", "0.6896481", "0.687405", "0.68581074", "0.68324506", "0.678987", "0.6762413", "0.6676587", "0.66665584", "0.6651931", "0.6639924", "0.66346294", "0.6617684", "0.65913737", "0.658985", "0.6589808", "0.6569774", "0.65663785", "0.6552915", "0.6546491", "0.6529126", "0.65076566", "0.6504564", "0.6492415", "0.64914244", "0.6487891", "0.6455799", "0.64480543", "0.6432957", "0.6362661", "0.6357535", "0.63557327", "0.63439834", "0.6324656", "0.6314304", "0.6298868", "0.62519187", "0.6248629", "0.623509", "0.6230954", "0.6223914", "0.62204635", "0.62107414", "0.6208143", "0.62063915", "0.6205709", "0.61891055", "0.61891055", "0.61891055", "0.61836594", "0.61715704", "0.6166397", "0.6166397", "0.6149086", "0.6144036", "0.61409783", "0.613731", "0.61309993", "0.61256194", "0.61217827", "0.6119108", "0.61146784", "0.6102417", "0.6102417", "0.6102316", "0.6078829", "0.6075063", "0.6067423", "0.6066605", "0.6064869", "0.6059372", "0.6049646", "0.60281265", "0.6027817", "0.60269713", "0.60216373", "0.60200495", "0.6011811", "0.60112214", "0.60097474", "0.5999399", "0.5997383", "0.5994149", "0.5989857", "0.5987151", "0.5982611", "0.5980743", "0.59802735", "0.5976648", "0.5973318", "0.5973147", "0.5960367", "0.5954164", "0.59494615", "0.5944105" ]
0.0
-1
Function to end survey at 25 clicks
function surveyEnd() { viewResultsButton.textContent = 'View Results'; picSection.appendChild(viewResultsButton); picSection.removeEventListener('click', handleUserClick); for (var i = 0; i < catalogArray.length; i++) { tallyClickFinal.push(catalogArray[i].tallyClicked); tallyViewFinal.push(catalogArray[i].tallyDisplayed); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": Math.round(performance.now() - trial_onset),\n \"digit_response\": digit_response,\n 'click_history': click_history\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n if (trial.post_trial_duration !== null) {\n jsPsych.pluginAPI.setTimeout(function () {\n jsPsych.finishTrial(trial_data);\n }, trial.post_trial_duration);\n } else {\n jsPsych.finishTrial(trial_data);\n }\n\n }", "function click() {\r\n console.log(questions[questionIndex].answer)\r\n console.log(this.value)\r\nif(this.value !== questions[questionIndex].answer) {\r\n time -= 5;\r\n\r\n if (time < 0) {\r\n time = 0;\r\n }\r\n}\r\n\r\n$(\"#time-counter\").text(time);\r\n\r\nquestionIndex++;\r\nif(questionIndex === questions.length) {\r\n finish();\r\n} else {\r\nstartQuestions();\r\n}}", "function correctAnswerClicked() {\n console.log(\"correct answer\");\n correctAnswerCount++;\n $(\"#correct-answers-view\").html(correctAnswerCount);\n $(\".footer\").html(\"Correct!!! <br>Waiting 5 seconds to go next!\");\n \n stop();\n waitBeforeGoingNextAutomatically();\n\n}", "function ansClick(e) {\n if(qIndex >= (questions.length - 1)) {\n postScore();\n } else {\n var currentQuestion = questions[qIndex];\n var ansClick = e.target.textContent;\n if(ansClick.toLowerCase() === currentQuestion.answer.toLowerCase()) {\n currentScore+= 5;\n } else {\n time -= 10;\n currentScore -= 5;\n }\n qIndex++;\n getQuestion();\n };\n}", "function nextQuestion() {\n // currentQuestion++\n $(\"#question\").html(test[nextUp].hint);\n $(\"#guess1\").html(test[nextUp].guess1);\n $(\"#guess2\").html(test[nextUp].guess2);\n $(\"#guess3\").html(test[nextUp].guess3);\n $(\"#guess4\").html(test[nextUp].guess4);\n // console.log(nextUp)\n countDown();\n // $('#timeToGo').each(countDown); //starts counter\n anser = (test[nextUp].Answer);\n nextUp++\n // console.log(currentQuestion)\n\n //-------------------------------------------------------------------------------------------------------\n //clicks for answer 1\n}", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n for (var i = 0; i < setTimeoutHandlers.length; i++) {\r\n clearTimeout(setTimeoutHandlers[i]);\r\n }\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"rt\": response.rt,\r\n \"stimulus\": trial.stimulus,\r\n \"button_pressed\": response.button\r\n };\r\n\r\n // clear the display\r\n display_element.html('');\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "function nextQuestion(){\n $(\"#alerts\").hide();\n       currentQuestion = triviaQuestions[currentQuestionIndex + 1];\n       currentQuestionIndex++;\n if (currentQuestionIndex >= 10) {\n $(\"#alerts\").html(\"<h2> Nice job! Click the Start 90s Trivia button to play again! <br> Questions Correct: \" + correctAnswers.length + \" <br> Questions Incorrect: \" + incorrectAnswers.length + \" </h2>\");\n $(\"#alerts\").show();\n stopTimer();\n } else {\n       displayQuestion(currentQuestion);\n };\n    }", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"button_pressed\": response.button\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function end(){\n\t\tclearTimeout(timerId);\n\t\t$(\"#Time-Remaining\").hide();\n\t\t$(\"#Question\").hide();\n $(\"#score\").show();\n $(\"#score\").text(\"You got \"+ correct +\" out of \"+questions.length+\" correct!\")\n $(\".answer\").hide();\n $(\"#Ready\").show();\n $(\"#retry\").show();\n cQ = 0;\n correct = 0;\n $(\"#Ready\").click(function(){\n\t\t\ttimeLeft = 60\n $(\".answer\").empty();\n $(\"#Question\").empty();\n $(\"#Time-Remaining\").show();\n $(\"#Ready\").hide();\n $(\"#score\").hide();\n $(\"#retry\").hide();\n\t\t\tsetTimeout(Question,500);\n });\n }", "function answerClick(x) {\n var answer = questions[questionCounter].answer;\n showAnswer(x == answer);\n if (x !== answer) {\n time -= wrongAnswerPenalty;\n showTime();\n }\n questionCounter ++;\n if (questionCounter < questions.length) {\n getQuestions();\n }\n else {\n showEndScreen();\n }\n}", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n jsPsych.pluginAPI.clearAllTimeouts();\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"stimulus\": trial.stimulus,\r\n \"correct\": trial.correct,\r\n \"choice\": response.choice,\r\n \"accuracy\": response.accuracy,\r\n \"rt\": response.rt,\r\n };\r\n\r\n // clear the display\r\n display_element.innerHTML = '';\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "function lastClicked() { \n // end the quiz and show the score\n console.log(\"last clik func active\");\n clearInterval(timeInterval);\n quiz.style.display = \"none\";\n\n //todo//\n }", "function end_trial() {\r\n\r\n // kill any remaining setTimeout handlers\r\n jsPsych.pluginAPI.clearAllTimeouts();\r\n\r\n // gather the data to store for the trial\r\n var trial_data = {\r\n \"rt\": response.rt,\r\n \"stimulus\": trial.stimulus,\r\n \"response\": response.response\r\n };\r\n\r\n // clear the display\r\n display_element.innerHTML = '';\r\n\r\n // move on to the next trial\r\n jsPsych.finishTrial(trial_data);\r\n }", "function end_trial() {\n response.rt = performance.now() - start_time;\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(response);\n }", "function end_trial() {\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n const trial_data = {\n rt: response.rt,\n stimulus: trial.stimulus,\n button_pressed: response.button,\n switched_queries: response.switched_queries,\n confidence: response.confidence,\n choice: response.choice,\n correct: response.choice == trial.correct_query_choice,\n };\n\n // clear the display\n display_element.innerHTML = \"\";\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function end_trial() {\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n \"stimulus\": trial.stimulus,\n \"rating\": trial.rating,\n \"condition\": trial.condition,\n \"with loading\": trial.cognitive_loading,\n \"rating_rt\": trial.rating_rt,\n \"grid_rt\": trial.grid_rt,\n \"scale type\": trial.scale_type,\n \"correct anser\": trial.correct_answer,\n \"hits\": trial.hits,\n \"misses\": trial.misses,\n \"false alarms\": trial.false_alarms,\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function end_trial() {\n\n\t\t\tjsPsych.pluginAPI.clearAllTimeouts();\n\t\t\t//Kill the keyboard listener if keyboardListener has been defined\n\t\t\tif (typeof keyboardListener !== 'undefined') {\n\t\t\t\tjsPsych.pluginAPI.cancelKeyboardResponse(keyboardListener);\n\t\t\t}\n\n\t\t\t//Place all the data to be saved from this trial in one data object\n\t\t\tvar trial_data = {\n\t\t\t\t\"rt\": response.rt, //The response time\n\t\t\t\t\"key_press\": response.key, //The key that the subject pressed\n\t\t\t\t\"mean\": trial.mean,\n\t\t\t\t\"sd\": trial.sd,\n\t\t\t\t'left_circles': circles_left,\n\t\t\t\t'right_circles': circles_right,\n\t\t\t\t'larger_magnitude': larger_magnitude,\n\t\t\t\t'left_radius': r1,\n\t\t\t\t'right_radius': r2\n\t\t\t}\n\n\t\t\tif (trial_data.key_press == trial.choices[0] && larger_magnitude == 'left'){\n\t\t\t\ttrial_data.correct = true\n\t\t\t}\n\t\t\telse if (trial_data.key_press == trial.choices[1] && larger_magnitude == 'right'){\n\t\t\t\ttrial_data.correct = true\n\t\t\t}\n\t\t\telse if (trial_data.key_press == -1 ){\n\t\t\t\ttrial_data.correct = null\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttrial_data.correct = false\n\t\t\t}\n\n\n\t\t\t//Remove the canvas as the child of the display_element element\n\t\t\tdisplay_element.innerHTML='';\n\n\t\t\t//Restore the settings to JsPsych defaults\n\t\t\tbody.style.margin = originalMargin;\n\t\t\tbody.style.padding = originalPadding;\n\t\t\tbody.style.backgroundColor = originalBackgroundColor\n\t\t\tbody.style.cursor = originalCursorType\n\n\t\t\tjsPsych.finishTrial(trial_data); //End this trial and move on to the next trial\n\n\t\t}", "function nextQuestion(){\t\n\t\thideAnswerBox();\n\t\tremovePosters();\n\t\tstopAudio();\n\t\tquestionCount++;\n\t\t\n\t\tif (questionCount > 9) {\n\t\t\tendGame();\n\t\t\tshowOverlay($('.endGame'));\n\t\t}\n\t\telse if (questionCount > 4 && gameCount < 1) {\n\t\t\tendRound();\n\t\t\tshowOverlay($('.end_round'));\n\t\t}\n\t\telse {\n\t\t\tupdateQuestion();\n\t\t\tplayAudio();\n\t\t}\n\t}", "function nextQuestions() {\n number++;\n count = 30;\n timeRemain = setInterval(timer, 1000);\n $(\"#timer\").html(\"Time remaining: \" + count + \" secs\");\n questions(number);\n $(\"#image\").hide();\n }", "function end_trial() {\n 'use strict';\n\n // gather the data to store for the trial\n let trial_data = {\n end_rt: response.rt,\n end_x: Math.round(x_coords[x_coords.length - 1]),\n end_y: Math.round(y_coords[y_coords.length - 1]),\n x_coords: roundArray(x_coords),\n y_coords: roundArray(y_coords),\n time: time,\n text_bounds: text_bounds,\n };\n\n // remove canvas mouse events\n canvas.removeEventListener('mousemove', mousePosition);\n canvas.removeEventListener('mousedown', mouseResponse);\n\n // clear the display and move on the the next trial\n display_element.innerHTML = '';\n jsPsych.finishTrial(trial_data);\n }", "function end_trial() {\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n let trial_data = {\n \"rt\": response.rt,\n \"stimulus\": trial.stimulus,\n \"audio_data\": response.audio_data\n };\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n }", "function reask() {\n cb.call(surveyResponse, null, surveyResponse, responseLength);\n }", "function count() {\n time--;\n $(\".timer\").text(time);\n if (time <= 0) {\n clearInterval(questionInterval);\n buttonClicked(0);\n // calling the buttonClicked function as if unanswered = wrong.\n }\n }", "function wait(){\n $(\"#showAnswer\").hide().empty();\n if(questionCounter<8){\n stepforward();\n \n } else {\n console.log(\"gameover!\");\n finalResults();\n \n }\n}", "function nextQuestion() {\n // clean the record\n var allId = [\"A\", \"B\", \"C\", \"D\"];\n for (var i in allId) {\n $(\"#\" + allId[i]).removeClass(\"selected\");\n }\n\n\n // if the answer is right, score pluses 1\n if (right === answer) {\n isRightAnswer();\n }\n\n // increment the number of questions count\n increment(\"#count\", 1);\n\n $(\"#time\").html(\"10\"); // set time to the maximum\n clearInterval(myInterval);\n myInterval = setInterval(timer, 1000); // time click each 1 second\n score(); // show the score and question number\n\n ajax_get_json();\n}", "function nextQuestion() {\n questionsIndex++\n console.log(\"click worked!\")\n\n if (questionsIndex === questions.length) {\n endQuiz()\n } else {\n generateQuestion()\n }\n\n}", "function doneWeaponsQuestSponsor() {\n\tconsole.log(totalStages);\n\tif(totalStages == 0) {\n\t\t$('body').off('click');\n\t\tdocument.getElementById('doneQuest').style.display = \"inline\";\n\t\tdoneQuestSetup();\n\t\treturn;\n\t}\n\t$('body').off('click');\n\tsetupQuestRound();\n\tdocument.getElementById('doneQuest').style.display = \"none\";\n}", "function nextQuestion() {\n resetTime();\n setTimeout(function() {\n clearScreen();\n answersQuestionPrint();\n }, 3000);\n }", "function after_response(choice) {\n\n // measure rt\n rating_end_time = Date.now();\n trial.rating_rt = rating_end_time - rating_start_time;\n\n trial.rating = choice;\n\n\n // after a valid response, the stimulus will have the CSS class 'responded'\n // which can be used to provide visual feedback that a response was recorded\n display_element.querySelector('#jspsych-html-button-response-stimulus').className += ' responded';\n\n // disable all the buttons after a response\n var btns = document.querySelectorAll('.jspsych-html-button-response-button button');\n for(var i=0; i<btns.length; i++){\n //btns[i].removeEventListener('click');\n btns[i].setAttribute('disabled', 'disabled');\n }\n\n // end trial\n // if (trial.stimulus_debrief) {\n //\n // if (trial.cognitive_loading) {\n // // ERROR please please no debrief with loading please\n // alert(\"error please no debrief with loading please no please\");\n // }\n // jsPsych.pluginAPI.setTimeout(function() {\n // display_element.querySelector('#debriefing').style.display = 'block';\n // }, 0);\n // jsPsych.pluginAPI.setTimeout(function() {\n // display_element.querySelector('#jspsych-html-button-response-prompt').style.display = 'none';\n // }, 0);\n // jsPsych.pluginAPI.setTimeout(function() {\n // display_element.querySelector('#jspsych-html-button-response-rating').style.display = 'none';\n // }, 0);\n // console.log(\"in debrief\");\n // setTimeout(end_trial, trial.debrief_duration);\n // }\n //FIXME this part is mushy with the no dual-debrief-loading bill\n // else if (trial.cognitive_loading) {\n if (trial.cognitive_loading) {\n grid_start_time = Date.now()\n console.log(\"here in line 194\");\n // jsPsych.pluginAPI.setTimeout(function() {\n // display_element.querySelector('#board').style.display = 'none';\n // }, 0);\n // NOTE comented out 4/18\n console.log(\"here inline 201\");\n setTimeout(prepare_board_for_user_input, 0); //trial.debrief_duration);\n } else {\n setTimeout(end_trial, 0);// trial.debrief_duration); //NOTE\n }\n }", "function nextQuestion() {\n timerInterval = 15;\n questionNum++;\n answerOrder = shuffle(answerOrder);\n checkEndGame();\n updateDisplays();\n $('#sectionResults').addClass('hidden');\n $('#sectionQuestions').removeClass('hidden');\n countDown;\n }", "function wrongAnswerClicked() {\n console.log(\"wrong answer\");\n\n $(\".footer\").html(\"Darn! Wrong answer! <br> The correct answer is <strong>\" + questions[currentQuestionToPlay].correctResponse + \"</strong>. <br>Waiting 5 seconds to go next!\");\n\n wrongAnswerCount++;\n $(\"#wrong-answers-view\").html(wrongAnswerCount);\n\n stop();\n waitBeforeGoingNextAutomatically();\n}", "function nextQuestion() {\n countDown = 10;\n clearInterval(timer);\n currQuestion++;\n displaymyQuestion();\n\n\n}", "function fiveSecondBreak() {\n $(`#answers button[index=${qsAndAs[questionIndex].correctIndexAnswer}]`).removeClass(`btn-outline-dark`).addClass(`btn-success`);\n \n var startdown = 6;\n var intervalId;\n \n if(guesses[questionIndex] == qsAndAs[questionIndex].correctIndexAnswer) {\n score++;\n $('.score').html(`<p>Correct Answers: ${score}</p>`)\n }else{\n $(`#answers button[index=${guesses[questionIndex]}]`).removeClass(`btn-outline-dark`).addClass(`btn-danger`);\n $('.score').html(`<p>Correct Answers: ${score}</p>`)\n }\n \n function lilBreak() {\n clearInterval(intervalId);\n intervalId = setInterval(decrement, 1000);\n }\n function decrement() {\n startdown--;\n console.log(\"QIndex : \" + (parseInt(questionIndex) + 2));\n console.log(\"qsAndAs.length: \" + qsAndAs.length); \n console.log((parseInt(questionIndex) + 2) === qsAndAs.length);\n if((parseInt(questionIndex) + 2) < qsAndAs.length){\n $('.next').html(`<p>Next question in ${startdown}</p>`);\n }if((parseInt(questionIndex) + 2) === qsAndAs.length){\n $('.next').html(`<p>Last question in ${startdown}</p>`);\n }if((parseInt(questionIndex) + 1) === qsAndAs.length){\n $('.next').html(`<p>Trivia Game Over - Calculating...</p>`);\n }if (startdown === 0) {\n breaksOver(); \n } \n }\n function breaksOver() {\n clearInterval(intervalId);\n questionIndex += 1;\n $('.next').text(``);\n $(`button.answer`).removeClass(`btn-success btn-danger`).addClass(`btn-outline-dark`);\n if(questionIndex >= qsAndAs.length) {\n gameOver();\n clearInterval(intervalId);\n }else{\n start();\n } \n }\n lilBreak();\n}", "function checkEndGame() {\n if (questionNum == 15) {\n clearInterval(countDown);\n $('#sectionQuestions').addClass('hidden');\n $('#sectionResults').removeClass('hidden');\n $('#feedback').html('Game Over!!');\n $('#feedbackDetail').html(\"You got \" + correctCounter + \" questions right, \" + incorrectCounter + \" questions wrong, and didn't answer \" + timeoutCounter + \" questions at all.\");\n };\n }", "function endQuiz() {\n //calculate final score\n score = Math.max((timer * 10).toFixed(), 0);\n timer = 0;\n $timer.text(\"Timer: \" + timer.toFixed(1));\n //stop the timer\n clearInterval(interval);\n //write the end message, buttons, and scores\n setEndDOM();\n }", "function after_response(choice) {\n\n // measure rt\n var end_time = Date.now();\n var rt = end_time - start_time;\n response.button = choice;\n response.rt = rt;\n\n // after a valid response, the stimulus will have the CSS class 'responded'\n // which can be used to provide visual feedback that a response was recorded\n display_element.querySelector('#jspsych-html-click-stimulus').className += ' responded';\n\n // disable all the buttons after a response\n var btns = document.querySelectorAll('.jspsych-html-click-button button');\n for(var i=0; i<btns.length; i++){\n // btns[i].removeEventListener('click');\n display_element.removeEventListener('click', getClickPos); // remove event listener for grid stimulus \n btns[i].setAttribute('disabled', 'disabled');\n }\n\n if (trial.response_ends_trial) {\n end_trial();\n }\n \n // save data\n jsPsych.data.addProperties({\n chosenRow: chosenRow[sampTrialNum],\n chosenCol: chosenCol[sampTrialNum]\n });\n\n clickedOn = false; // reset\n clickCounter = 0; // reset\n clicks = 0; // reset\n sampTrialNum = sampTrialNum + 1;\n getClickNow = false; // this ends the trial\n\n }", "function nextAnswer() {\n\n //Clear popup timer\n clearTimeout(setTimeOutAnswer);\n setTimeOutAnswer = null;\n\n //Hidde popup\n $(\"#popup\").css(\"visibility\", \"hidden\");\n\n //Set count in 13 again\n countTime = 13;\n $(\"#time\").text = countTime; \n\n //Increment in 1 to show the next question\n countQuestion++;\n\n //Draw question\n drawQuestion();\n\n //Clear and set question timer\n clearTimeout(time);\n time = setInterval(timeQuestion, intervalTime);\n }", "function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}", "function endTrial() {\n \n // Kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n \n // Remove from bandit styles css (in case the next trial uses standard jspsych.css)\n content.classList.remove(\"bandit-grid-container\")\n \n // Clear the display\n display_element.innerHTML = '';\n \n // End trial and save responses\n jsPsych.finishTrial(responses);\n \n }", "function endEarlyButton() {\n endEarlyDetails();\n}", "function roundEnd(){\n $(\"#choice-container\").hide();\n $(\"#band\").attr(\"src\", \"assets/images/bands-\"+bandIndex+\".png\")\n $(\"#member\").attr(\"src\", \"assets/images/member\"+whoIndex+\".png\")\n $(\"#results\").show();\n if (round < 10) {\n time = 5;\n $(\"#question\").text(\"Next round starting in \"+time+\" seconds\")\n timeInterval = setInterval(function(){\n if (time>1){\n time--;\n $(\"#question\").text(\"Next round starting in \"+time+\" seconds\");\n } else { \n time--;\n $(\"#question\").text(\"Next round starting in \"+time+\" seconds\");\n clearInterval(timeInterval);\n displayQuestion();\n }\n }, 1000)} else {\n $(\"#timer\").text($(\"#timer\").text()+\" You got \"+correct+\"/10 correct!\")\n $(\"#question\").text(\"Click here to start over!\")\n questionType = -1; \n }\n $(\"#results-text\").text(who+\" is the \"+where+\" for \"+band+\"!\") \n }", "function nextPage() {\n setTimeout(function(){\n if (questionCount < (questions.length-1)) {\n number = t;\n questionCount++;\n createQuestionArea();\n createAnswerArea();\n startTimer();\n $('#timer').show(); \n } else {\n createFinalScreen();\n }\n },1000*5);\n}", "function questionTimedout() {\n acceptingResponsesFromUser = false;\n\n console.log(\"timeout\");\n $(\"#timer-view\").html(\"- -\");\n $(\".footer\").html(\"Darn! Time out! <br> The correct answer is <strong>\" + questions[currentQuestionToPlay].correctResponse + \"</strong>. <br>Waiting 5 seconds to go next!\");\n\n timeoutCount++;\n $(\"#timeout-view\").html(timeoutCount);\n waitBeforeGoingNextAutomatically();\n}", "function timeRunsOut() {\n noAnswer++;\n console.log(noAnswer);\n $(\".timer\").hide();\n $(\".question\").empty();\n $(\".answers\").empty();\n $(\".results\").html(\"<p class='answer-message'>Too slow!</p>\" + \"<src=\" + trivia[questionCount].gif + \"</>\");\n setTimeout(nextQuestion, 1000 *4);\n }", "exitMoreQuestion(ctx) {\n\t}", "function after_response(choice) {\r\n\r\n // measure rt\r\n var end_time = Date.now();\r\n var rt = end_time - start_time;\r\n response.button = choice;\r\n response.rt = rt;\r\n\r\n // disable all the buttons after a response\r\n $('.jspsych-button-response-button').off('click').attr('disabled', 'disabled');\r\n\r\n if (trial.response_ends_trial) {\r\n end_trial();\r\n }\r\n }", "function EndTrial() {\n\n // clear keyboard listener\n jsPsych.pluginAPI.cancelAllKeyboardResponses();\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // gather the data to store for the trial\n var trial_data = {\n 'trial_type': trial.choice_type,\n 'left_image_number': display.left_image_number,\n 'right_image_number': display.right_image_number,\n 'left_image_type': trial.left_image_type,\n 'right_image_type': trial.right_image_type,\n 'ur_left_image': trial.image_allocation.findIndex(function(element, index, arr){return element == this}, display.left_image_number),\n 'ur_right_image': trial.image_allocation.findIndex(function(element, index, arr){return element == this}, display.right_image_number),\n 'chosen_image': response.chosen_image,\n 'ur_chosen_image': response.ur_chosen_image,\n 'rt': response.rt,\n 'key_char': response.key_char,\n 'choice': response.choice,\n 'stimulus_array': [trial.left_image_number, trial.right_image_number],\n 'feedback': response.feedback\n };\n\n // increment the trial counter\n counter.trial += 1;\n\n // move on to the next trial\n jsPsych.finishTrial(trial_data);\n\n }", "function waitBeforeNextQuestion() {\n setTimeout(function nextQuestion() {\n \n questionIndex++;\n if (questionIndex === 4) {\n submitScore();\n } else {\n\n showQuestion();\n }\n \n \n \n }, 1000);\n}", "function showNext(){\n\n // if(index >=(questions.length - 1)){\n // showResult(0);\n // return;\n // }\n if(index>=8){\n $(\"#Next\").text(\"Finish\");\n }\n\n if(index >=9){\n alert(\"Press ok to get result\")\n showResult(0);\n return;\n \n }\n\n index++;\n\n $(\".optionBox span\").removeClass();\n $(\".optionBox span\").attr(\"onclick\",\"checkAnswer(this)\");\n\n\n printQuestion(index);\n \n\n}", "function theSelection(){\n \n theSelectionScore +=1;\n //so every time this function is used, it increases the counter by 1\nquestionCount +=1;\n alert(\"The Selection Score went up!\");\n \n //how do we know when to end the quiz and show results? thats what the questionCount variable is for!\n \n if (questionCount >=3){\n \n updateResult();\n \n}\n \n}", "function verifyAnswer() {\n // if clicked button's 'value' attr does not match correct answer\n if (this.value !== quizQuestions[index].correct) {\n // cut off 2 seconds from time\n timerCount -= 2;\n }\n\n // increment index by 1\n index++;\n\n // if index matches length of questions array\n if (index === quizQuestions.length) {\n // end quiz\n quizOver(); \n } else {\n // get next question\n getQuestions();\n }\n}", "function submitQuestion() {\n\n $('body').on('click', '#answer-button', function (event) {\n event.preventDefault();\n let selectAns = $('input[name=answer]:checked', '.js-quiz-form').val();\n\n //If no answer is selected, prompt User\n if (!selectAns) {\n // console.log('selection is required');\n selectionRequired(selectAns);\n } else if (currentInd < 10) {\n answerChoice(selectAns);\n loadQuestion();\n }\n //After all questions have been asked, Final Score Page is loaded\n else {\n answerChoice(selectAns);\n if (currentScore === 10) {\n $('.close').click((event) => perfectScore())\n }\n finalScorePage();\n // console.log('Current index is higher than 10');\n }\n })\n\n let selectAns = ``;\n}", "function nextQuestion() {\n if (questionCount < 7) {\n questionCount++\n console.log(questionCount);\n buildQuiz();\n $(\".results\").empty();\n $(\".timer\").show();\n timeLeft = 20;\n countdown();\n } else {\n gameOver();\n }\n}", "function countDown () {\n seconds--;\n $(\".time-remaining\").text(\"Time Remaining: \" + seconds + \" seconds\");\n if (seconds < 1) {\n clearInterval(time);\n answered = false;\n //Run function to transition to next question page\n nextQuestion ();\n }\n}", "function callTimeoutAdapt(time,trial){ \n\tsetTimeout(function () {\n\t\t$('.Qbuttons').show();$('.textQuestion').show();\n\t\tvar writeTrials=trial;\n\t\tdocument.getElementById(\"counter\").innerHTML = \"Trial: \"+writeTrials+ \"/\" +nAdaptTrials;\n\t\n\n\t\t// ******************************* KEYBOARD responses ****************************************** \n\t\t// allow=true;\n\t\t// $( document ).keyup(function(e) { \n\t\t// if(e.which == 49 && allow==true) {\n\t\t// \tkeyAnswer1();\n\t\t// \tallow=false; \n\n\t\t// } \n\t\t// else if (e.which == 50 && allow==true) {\n\t\t// \tkeyAnswer2();\n\t\t// \tallow=false; \t\n\t\t// }\t\n\t// });\n\t},time);\t\n\n\t// ******************************* MOUSE response 1 ****************************************** \n\tdocument.getElementById('button1').onclick = function() {\n\t\t$('.Qbuttons').hide();\t\t\n\t\tresponse[trial-1]=1;\n\t\t\n\t\tif (tone1[trial-1]>tone2[trial-1]){\n\t\t\t$('#incorrect').show();\n\t\t\tacc[trial-1] = 0;\n\t\t}else{\n\t\t\t$('#correct').show();\n\t\t\tacc[trial-1] = 1;\n\t\t}\t\n\t\t//pressButton();\n\t\t// Determine the next smt\n\t\tadapt(acc[trial-1]);\n\t\tsetTimeout(function () {$('.feedback').hide();staircaseTask();},500);\n\t\t//setTimeout(function () {$('.feedback').hide();staircaseTask();},500);\n\t} \t\n\t// ******************************* MOUSE response 2 ****************************************** \n\tdocument.getElementById('button2').onclick = function() {\t\n\t\t$('.Qbuttons').hide();\n\t\tresponse[trial-1]=0;\n\t\t\n\t\tif (tone1[trial-1]>tone2[trial-1]){\n\t\t\t$('#correct').show();\n\t\t\tacc[trial-1] = 1;\n\t\t}else{\n\t\t\t$('#incorrect').show();\n\t\t\tacc[trial-1] = 0;\n\t\t}\t\n\t\t//pressButton();\n\t\t// Determine the next smt\n\t\tadapt(acc[trial-1]);\n\t\tsetTimeout(function () {$('.feedback').hide();staircaseTask();},500);\n\t\t//setTimeout(function () {$('.feedback').hide();staircaseTask();},500);\n\t} \n\t// Determine the next smt\n\t// adapt(acc[trial-1]);\n\t// setTimeout(function () {$('.feedback').hide();staircaseTask();},500);\n}", "function nextClick() {\n if(questionIndex < questionsArray.length-1) {\n $(\"#nextQ\").css(\"display\", \"block\");\n }\n $(\"#nextQ\").off(\"click\").on(\"click\", function () {\n if (questionIndex === 10 ) {\n bonusResults();\n }\n else if(questionIndex === 9) {\n /* when the user has answer index 9 question (question 10) and clicks on next the f gameOver is initiated */\n gameOver();\n }\n else {\n timeLeft = 11;\n playGame();\n }\n });\n}", "function wait() {\n if (questionCounter < 7) {\n questionCounter++;\n generateHTML();\n counter = 5;\n timerWrapper();\n }\n else {\n finalScreen();\n }\n}", "function handleNextQuestion() {\n checkForAnswer();\n unCheckRadioButtons();\n setTimeout(() => {\n \n//This if/else statement checks for index number to be not greater than 9, otherwise the game ends. \n if (indexNumber <= 9) {\n NextQuestion(indexNumber);\n } else {\n handleEndGame();\n }\n resetOptionBackground();\n }, 1000);\n}", "function count() {\n time--;\n displayCurrentTime();\n\n if (time < 1) {\n console.log('Out of time, I guess...');\n prependNewMessage('alert-danger', 'OUT OF TIME!!!!');\n stopTimer();\n setTimeout(nextQuestion, 1.2 * 1000);\n }\n }", "function answerClick(event) {\n clearInterval(perQuestionInterval);\n clearInterval(feedbackInterval); // get rid of any outstanding intervals\n var elem = event.target;\n if (elem.matches(\"li\")) {\n if (elem.getAttribute(\"choice\") === questionsArray[questionCounter].answer) {\n //answerResult.textContent = \"Correct!\";\n showFeedback(\"Correct!\");\n if (perQuestionTimer >= 5) {\n playerScore += 20; // 20 points for answering correct within 10 seconds\n } else {\n playerScore += 5; // 5 points for answering correct but taking longer than 10 seconds\n }\n } else {\n // write incorrect and move on\n time = time - 15;\n\n showFeedback(\"Wrong!\");\n //answerResult.textContent = \"Wrong\";\n }\n questionCounter++;\n removeAllChildren(answerList);\n renderQuestion(questionCounter);\n }\n}", "function sleepQuiz() {\n startQuiz();\n choiceVal();\n nextQuestionIndex();\n restartQuiz();\n}", "function clickFunction() {\n qIndex = qIndex + 1;\n if (qIndex < questions.length && this.textContent === currentQuestion.correctAnswer) {\n score = score + 100;\n displayBox.textContent = \"Correct!\"\n askQuestion();\n } else if (qIndex === questions.length && this.textContent === currentQuestion.correctAnswer) {\n score = score + 100;\n displayBox.textContent = \"Correct!\"\n endGame();\n } else if (qIndex < questions.length && this.textContent !== currentQuestion.correctAnswer) {\n timerCount = timerCount - 10;\n displayBox.textContent = \"Incorrect\";\n askQuestion();\n } else if (qIndex === questions.length && this.textContent !== currentQuestion.correctAnswer) {\n timerCount = timerCount - 10;\n displayBox.textContent = \"Incorrect\";\n endGame();\n }\n}", "function waitBeforeGoingNextAutomatically() {\n setTimeout(goToNextQuestion, 1000 * 5);\n}", "function endquiz() {\n submitButton.hide();\n $(\"#quiz\").hide();\n $(\"#timer\").hide();\n stop();\n }", "function TimeoutNextClick(tot) {\n//\talert(\"new func\");\n\tvar checked = 0;\n\tfor(nn = 0; nn < tot; nn++) {\n\t\tif(document.QuestionForm.pre_answer[nn].checked) {\n\t\t\tdocument.QuestionForm.answer.value = document.QuestionForm.pre_answer[nn].value;\n\t\t\tchecked = 1;\n\t\t}\n//\t\talert(checked + \":\" + document.QuestionForm.pre_answer[nn].value);\n\t}\n\tif(checked == 0) {\n\t\tdocument.QuestionForm.answer.value = document.QuestionForm.timeout_answer.value;\n\t}\n\treturn true;\n}", "function nextPage() {\n setTimeout(function(){\n if (questionCount < (questions.length-1)) {\n number = t;\n questionCount++;\n createQuestionArea();\n createAnswerArea();\n startTimer();\n $('#timer').show(); \n \n } else {\n createFinalScreen();\n } \n },1000*4.8);\n}", "function nextQuestion() {\n\t\tqCounter++;\n\t\t// clears previous selection\n\t\t$(\"input[name='choice']\").prop(\"checked\", false);\n\n\t\t// checks to see if qCounter is equal to 10\n if (qCounter == 10) {\n\t \tstopwatch.stop();\n\t $(\"#main\").hide();\n\t $(\"#end\").show();\n\t $(\"#final-score\").html(\"<h2>You got \" + correct + \" out of \" + questions.length + \" questions correct!\");\n }\n\n //calls displayQuestions\n stopwatch.stop();\n displayQuestions();\n }", "function timeLimit() {\n timer = setInterval(function () {\n $(\"#clock\").css(\"animation\", \"none\");\n $(\"#timer\").text(\"Time left: \" + seconds);\n seconds--;\n\n if (seconds < 5) {\n $(\"#clock\").css(\"animation\", \"pulse 5s infinite\");\n }\n\n if (seconds === -1 && click < questions.length) {\n seconds = 15;\n click++;\n incorrect++;\n clearTimeout(timer);\n showAnswer();\n }\n else if (click === questions.length) {\n displayScore();\n }\n }, 1000);\n }", "function chooseFoodQuiz() {\n $(foodQuiz).click();\n questions = foodQuestions;\n finalQuestion = foodQuestions.length - 1;\n startQuiz();\n}", "function startSurvey(element){\r\n //Starts timer\r\n setInterval(startTimer, 1000);\r\n //Hides the button you clicked to start the survey\r\n hideStart(element);\r\n //Starts the survey, showing the first question\r\n startQuiz();\r\n}", "function quizEnd() {\n /*\n @TODO: write your function code here\n */\n clearInterval(timerId);\n finalScore.textContent= score;\n questionsEl.setAttribute(\"class\", \"hide\");\n choicesEl.setAttribute(\"class\",\"hide\");\n endScreen.removeAttribute(\"class\");\n endScreen.setAttribute(\"style\",\"text-align:center\")\n}", "function countDown() {\n timeRemaining--;\n $('#timeCount').text(timeRemaining);\n if (timeRemaining <= 0 && count === 10) {\n clearInterval(time);\n answered.push(\"0\")\n finalScreen();\n } else if (timeRemaining <= 0) {\n clearInterval(time);\n answered.push(\"0\");\n loadingScreen();\n }\n}", "function TimeoutNextClickCheck(tot) {\n\tif(IsRadioClick==false) {\n// BMOD: use confirm instead of alert\n//\t\talert(\"You did not click on an answer\");\n//\t\treturn false;\n\t\tif(!confirm(\"Proceed without answer?\")) {\n\t\t\treturn false;\n\t\t}\n\t}\n//\talert(\"new func\");\n\tvar checked = 0;\n\tfor(nn = 0; nn < tot; nn++) {\n\t\tif(document.QuestionForm.pre_answer[nn].checked) {\n\t\t\tdocument.QuestionForm.answer.value = document.QuestionForm.pre_answer[nn].value;\n\t\t\tchecked = 1;\n\t\t}\n//\t\talert(checked + \":\" + document.QuestionForm.pre_answer[nn].value);\n\t}\n\tif(checked == 0) {\n\t\tdocument.QuestionForm.answer.value = document.QuestionForm.timeout_answer.value;\n\t}\n\treturn true;\n}", "finishQuestion() {\n this.stoptimer();\n this.allowAnwsers = false;\n this.scorePlayers();\n //show results\n this.generateRoundup().then((state) => {\n this.masters.forEach((socket) => {\n socket.emit('roundup', state);\n });\n });\n\n //nextquestion\n if (this.timer === null) {\n this.timer = setTimeout(() => {\n this.nextQuestion();\n }, 10 * 1000); //after 10s\n }\n }", "function handleClick(e){\n Product.current = [];\n Product.click++;\n for(let i = 0; i < Product.all.length; i++){\n if(e.target.alt === Product.all[i].name){\n Product.all[i].timesClick++;\n updateChartArrays();\n }\n }\n runSurvey();\n}", "function after_response(choice) {\n\n // measure rt\n var end_time = Date.now();\n var rt = end_time - start_time;\n response.button = choice;\n response.rt = rt;\n\n\n // disable all the buttons after a response\n var btns = document.querySelectorAll('.jspsych-html-button-response-button button');\n for(var i=0; i<btns.length; i++){\n //btns[i].removeEventListener('click');\n btns[i].setAttribute('disabled', 'disabled');\n }\n\n end_trial();\n }", "function handleQuestionNextButtonReport(){\n\tif(SOUNDS_MODE){\n \t\taudioClick.play();\n \t}\n \t\n\tmtbImport(\"question_report.js\");\n\tbuildQuestionReportView();\n\t\n\tvar curlDown = Titanium.UI.createAnimation();\n\tcurlDown.transition = Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_RIGHT;\n\tcurlDown.duration = 800;\n\tcurlDown.opacity = 1;\n\t\n\treportWin.open(curlDown);\n\tviewQuestionReport.opacity = 1;\n}", "function nextQuestion() {\n\n $('#startPage').hide();\n $(\"#resultsPage\").hide();\n $(\"#giphyPage\").hide();\n $('#questionPage').show();\n clearInterval(timerId);\n run();\n\n }", "function endingScreen(STORE, questionNumber, totalQuestions, score) {\r\n $('.results').on('click', '.restartButton', function (event) {\r\n let questionNumberDisp = 1;\r\n\r\n updateAnswerList(STORE, questionNumber, totalQuestions, questionNumberDisp, score);\r\n\r\n $('.results').css('display', 'none');\r\n $('.quizQuestions').css('display', 'block'); \r\n });\r\n\r\n return questionNumber;\r\n}", "function quizGo(){\n\t\tif (i < 11){\n\tstopwatch.start(stopwatch.time);\n\tvar currentQuestion = quiz[i];\n\t$(\"#question\").html(currentQuestion.question);\n\t$(\"#choiceA\").html(currentQuestion.choices[0]);\n\t$(\"#choiceB\").html(currentQuestion.choices[1]);\n\t$(\"#choiceC\").html(currentQuestion.choices[2]);\n\t$(\"#choiceD\").html(currentQuestion.choices[3]);\n\t$(\"#choiceE\").html(currentQuestion.choices[4]);\n\t//Switch to end game screen after 11 questions\n\t}else{\n\t\t$(\"#question\").html(\"That's the end of the quiz! Thanks for playing! <p>Correct: \" + correct + \"</p><p>Wrong: \" + incorrect + \"</p><p>Trivia written by Glen Weldon for NPR podcast 'Pop Culture Happy Hour.' Weldon is the author of 'The Caped Crusade: Batman and the Rise of Nerd Culture.'</p>\");\n\t\t$(\".choice\").hide();\n\t\t$(\"#startBtn\").show();\n\t}\n\t}", "function endTracking() {\n tryingToTrack = false;\n timeCounter = 0;\n\n $(\"#stopTrackingMe\").css({\n \"display\": \"none\"\n });\n $(\"#extendTrackingMe\").css({\n \"display\": \"none\"\n });\n $(\"#extendTrackingMe\").on('click', () => {\n alert(\"Timer set to 30 mins\")\n });\n $(\"#startTrackingMe\").css({\n \"display\": \"inline-block\"\n });\n }", "function nextQuestion() {\n if (questionCounter < questions.length) {\n time = 15;\n $(\"#gameScreen\").html(\"<p>You have <span id='timer'>\" + time + \"</span> seconds left!</p>\");\n questionContent();\n timer();\n userTimeout();\n }\n else {\n resultsScreen();\n }\n\n }", "function nextQuestion() {\n\t\tif (questionCounter < questions.length) {\n\t\t\ttime = 15;\n\t\t\t$(\".gameScreen\").html(\"<p>You have <span id='timer'>\" + time + \"</span> seconds left!</p>\");\n\t\t\tquestionContent();\n\t\t\ttimer();\n\t\t\ttimesUp();\n\t\t}\n\t\telse {\n\t\t\tresultsScreen();\n\t\t}\n\t}", "function goToLastQuestion(){ \r\n\tcount--\r\n\tupdateItems();\r\n}", "function nextQuestion(event) {\n\n\n // condition uses click event to add to user score if correct ansser is made //\n if (event.target.value === questions[currentQuesIndex].correctAns) {\n score++;\n } else {\n time -= 5;\n counter.textContent = time + \" Seconds left on quiz.\";\n }\n\n\n\n // Condition executes next question\n if (currentQuesIndex < questions.length) {\n currentQuesIndex++;\n // moves to next section once condition is met\n } if (currentQuesIndex === questions.length) {\n\n quizEl.style.display = \"none\";\n // this function call takes user to results section\n quizResults();\n return;\n\n }\n showQuestion();\n}", "function nextQuestion() {\n if (questionCounter < questions.length)\n { time = 10;\n $(\"#gameScreen\").html(\"<p> You have <span id ='timer'>\" + time + \n \"</span> seconds left! </p>\");\n questionContent();\n timer();\n userTimeout();\n \n }\n \n else {\n resultsScreen();\n }\n\t}", "function incorrect() {\n timeLeft -=20;\n nextQuestion();\n}", "function tally() {\r\n alert('You are have reached the end of the game! Your answers gave you a cool rating of: ' + correct);\r\n alert('Explore the rest of the page to check out more about me that wasn\\'t included in the game!');\r\n\r\n }", "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "function after_response(choice) {\n\n // measure rt\n var end_time = Date.now();\n var rt = end_time - start_time;\n response.choice = data.prompt_type == \"count\" ? parseInt(choice) : choice;\n response.rt = rt;\n\n // after a valid response, the stimulus will have the CSS class 'responded'\n // which can be used to provide visual feedback that a response was recorded\n display_element.querySelector('#scene-stimulus').className += ' responded';\n\n // disable all the buttons after a response\n var btns = document.querySelectorAll('.scene-choice-button button');\n for(var i=0; i<btns.length; i++){\n //btns[i].removeEventListener('click');\n btns[i].setAttribute('disabled', 'disabled');\n }\n\n // kill any remaining setTimeout handlers\n jsPsych.pluginAPI.clearAllTimeouts();\n\n // clear the display\n display_element.innerHTML = '';\n\n // move on to the next trial\n jsPsych.finishTrial(response);\n }", "function adbpEndSlateClick() {\n\ttry {\n\t\ttrackMetrics({ \n\t\t\ttype: \"endslate-click\", \n\t\t\tdata: {}\n\t\t}); \n\t} catch(e){}\n}", "function handleNextQuestion() {\r\n\t\r\n\t\r\n\t\r\n checkForAnswer()\r\n unCheckRadioButtons()\r\n //delays next question displaying for a second\r\n setTimeout(() => {\r\n if (indexNumber <= 9) {\r\n NextQuestion(indexNumber)\r\n }\r\n else {\r\n handleEndGame()\r\n }\r\n resetOptionBackground()\r\n\t\t\r\n }, 1000);\r\n\t\r\n\t\r\n}", "function collectedDone() { //Collection of functions meant to run when you press the Done-button in the quiz.\n correctAnswers();\n roundsPlayed();\n collectedRights();\n collectedWrongs()\n correctPercentage();\n controlChildrenTabIndexMinus() \n}", "function askNextQuestion(){ \n $('.questions').on('click', '.submit-next', function(){\n currentQuestion++; \n if (currentQuestion > QUESTIONS.length-1){\n showFinalResult();\n }else{\n console.log('next question asked');\n resetOptions();\n renderQuestion();\n updateProgress();\n $('.submit-answer').removeClass('hidden');\n $('.submit-next').addClass('hidden');\n } \n });\n}", "function checkGameEnd() {\n if (count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function () {\n resetResults();\n startGame();\n });\n }\n }", "function wait() {\n\tif (questionCounter < 7) {\n\tquestionCounter++;\n\tgenerateHTML();\n\tcounter = 30;\n\ttimerWrapper();\n\t}\n\telse {\n\t\tfinalScreen();\n\t}\n}", "function timingQuestion() {\n \n displayQuestionAndListenForInput();\n\n\n if (count == questionArr.length + 1) {\n clearInterval(intervalid);\n clearInterval(timeIntervalID);\n $(\"#timer-id\").empty();\n $(\"main\").empty();\n\n \n $(\"main\").append(\"<p class='ending-stats'>Correct Answers: \" + correctAnswer + \"</p>\");\n $(\"main\").append(\"<p class='ending-stats'>Wrong Answers: \" + wrongAnswer + \"</p>\");\n $(\"main\").append(\"<p class='ending-stats'>Missed Answers: \" + missedAnswer + \"</p>\");\n\n time = 30;\n clicked = false;\n count =0;\n correctAnswer = 0;\n wrongAnswer = 0;\n missedAnswer = 0;\n\n $(\"main\").append(\"<button id='start-button'>RESTART!</button>\");\n $(\"#start-button\").on(\"click\", timingQuestion);\n }\n }", "function correctAnswer(){\n $(\"#timer\").text(\"You are correct!\"); \n if (clickCount == 0) {\n correct++;\n }; \n clickCount++; //used to prevent multiple clicks adding to the total amount\n clearInterval(timeInterval); \n roundEnd();\n $(\"button\").remove(); //used to remove previous events from existing buttons\n $(\"#choice-container\").html('<button id=\"choice-a\" class=\"choices\"></button><button id=\"choice-b\" class=\"choices\"></button><button id=\"choice-c\" class=\"choices\"></button><button id=\"choice-d\" class=\"choices\"></button>')\n }" ]
[ "0.64227456", "0.6413096", "0.6383165", "0.6315035", "0.61615896", "0.6158293", "0.6154531", "0.61421865", "0.61421865", "0.6108407", "0.60826856", "0.60767287", "0.6074042", "0.6061887", "0.60602075", "0.6058682", "0.60495466", "0.6020223", "0.6019584", "0.60044336", "0.5961336", "0.5948536", "0.5941623", "0.5940533", "0.5930909", "0.5922732", "0.5918794", "0.5917989", "0.5916928", "0.59047616", "0.59028244", "0.5901223", "0.59007424", "0.5899033", "0.5888634", "0.58700985", "0.58596915", "0.58575135", "0.5834327", "0.58333564", "0.58283097", "0.58141315", "0.5812859", "0.5809388", "0.5805613", "0.58001727", "0.5798387", "0.57858586", "0.57813084", "0.57790124", "0.5776532", "0.5774767", "0.57726187", "0.57705057", "0.5762136", "0.5744722", "0.5743024", "0.57420653", "0.5737513", "0.5737474", "0.57348746", "0.572924", "0.57273334", "0.5726199", "0.57247525", "0.57216424", "0.57031", "0.5702565", "0.5701889", "0.5698703", "0.56970567", "0.5694414", "0.56874555", "0.5686841", "0.56852555", "0.567838", "0.5674172", "0.56570846", "0.5655508", "0.5654415", "0.56490713", "0.5644633", "0.5635947", "0.5631291", "0.5627927", "0.56263185", "0.5623375", "0.5619338", "0.5615136", "0.561425", "0.561425", "0.5613537", "0.5613175", "0.5610761", "0.5610715", "0.56096053", "0.5608574", "0.56063783", "0.56061655", "0.5602974" ]
0.66317606
0
Function to Load Images to Page
function loadImages() { if (surveyLength > 24) { surveyEnd(); } lastIndex = []; lastIndex.push(randomIndex1); lastIndex.push(randomIndex2); lastIndex.push(randomIndex3); //Re-assigning the variables for each picture randomIndexGenerator(); //While loop to prevent double choices AND no prior choice repeats while (randomIndex1 === lastIndex[0] || randomIndex1 === lastIndex[1] || randomIndex1 === lastIndex[2] || randomIndex2 === lastIndex[0] || randomIndex2 === lastIndex[1] || randomIndex2 === lastIndex[2] || randomIndex3 === lastIndex[0] || randomIndex3 === lastIndex[1] || randomIndex3 === lastIndex[2] || randomIndex1 === randomIndex2 || randomIndex1 === randomIndex3 || randomIndex2 === randomIndex3) { randomIndexGenerator(); } //Makes leftImg's src property equal to the fileName of the indexed item leftImg.src = catalogArray[randomIndex1].filePath; centerImg.src = catalogArray[randomIndex2].filePath; rightImg.src = catalogArray[randomIndex3].filePath; //Adds 1 to the display tally property of the indexed object catalogArray[randomIndex1].tallyDisplayed += 1; catalogArray[randomIndex2].tallyDisplayed += 1; catalogArray[randomIndex3].tallyDisplayed += 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadImages() {\n\t\t const button = document.querySelector('#loadImages');\n\t\t const container = document.querySelector('#image-container');\n\n\t\t button.addEventListener(\"click\", (event) => {\n\n\t\t const images = imageNames();\n\t\t images.forEach((image) => {\n\t\t requestFor(image, container).then(imageData => {\n\t\t const imageElement = imageData.imageElement;\n\t\t const imageSrc = imageData.objectURL;\n\t\t imageElement.src = imageSrc;\n\t\t });\n\t\t });\n\t\t });\n\t\t}", "function load_images() {\n data.each(function(frame) {\n var imgs = []\n frame.images.each(function(imgstr) {\n var img = new Image(IMG_WIDTH, IMG_HEIGHT);\n img.src = \"/img/\" + imgstr;\n img.style.float = \"left\";\n imgs.push(img); \n });\n frame['imageobjs'] = imgs;\n }) \n }", "function getImages() {\n\t$.get(\"resources/get_images.php\", {\"page\": globalPage}).success(function(data) {\n\t\tglobalPage++;\n\t\t\n\t\tvar imgz = JSON.parse(data).images;\n\t\tgenerateThumbnails(imgz);\n\t\tgenerateShowMoreButton(imgz);\n\t}).fail(function() {\n\t\twindow.location.replace(\"index.php\");\n\t});\n}", "function renderImages() {\n $('.landing-page').addClass('hidden');\n $('.img-round').removeClass('hidden');\n updateSrcs();\n currentOffset+=100;\n }", "function start_loadImages()\n {\n methods.loadImages(\n function() {\n methods.getDataURI();\n run_app();\n },\n imagesRack.imgList\n );\n }", "function loadImages() {\r\n new Image('(\"Robot\") Bag','/images/bag.jpg', 0);\r\n new Image('Bathroom Phone Holder','/images/bathroom.jpg', 0);\r\n new Image('Breakfast Maker','/images/breakfast.jpg', 0);\r\n new Image('Meatball Bubblegum','/images/bubblegum.jpg', 0);\r\n new Image('Chair','/images/chair.jpg', 0);\r\n new Image('Cthulhu','/images/cthulhu.jpg', 0);\r\n new Image('Duck Mask','/images/dog-duck.jpg', 0);\r\n new Image('Dragon','/images/dragon.jpg', 0);\r\n new Image('U-Pensils','/images/pen.jpg', 0);\r\n new Image('Pet Sweep','/images/pet-sweep.jpg', 0);\r\n new Image('Pizza Scissors','/images/scissors.jpg', 0);\r\n new Image('Shark Blanket','/images/shark.jpg', 0);\r\n new Image('Baby Sweep','/images/sweep.png', 0);\r\n new Image('TaunTaun Sleepingbag','/images/tauntaun.jpg', 0);\r\n new Image('Unicorn Meat','/images/unicorn.jpg', 0);\r\n new Image('USB','/images/usb.gif', 0);\r\n new Image('Water Can','/images/water-can.jpg', 0);\r\n new Image('Wine Glass','/images/wine-glass.jpg', 0);\r\n new Image('boots', '/images/boots.jpg', 0);\r\n new Image('banana','/images/banana.jpg', 0);\r\n }", "function loadAllImages() {\n var images = document.querySelectorAll('img[data-src]');\n\n for (var i = 0; i < images.length; i++) {\n ImageLoader.load(images[i]);\n }\n }", "function loadImages() {\n $('img[data-src]').each(function () {\n var src = $(this).data('src');\n var style = $(this).data('style');\n $(this).attr('src', src);\n $(this).attr('style', style);\n });\n}", "function loadImages() {\n var files = [ 'outer_light.png', 'layer_down_light.png',\n 'layer_up_light.png', 'angle_prev_light.png',\n 'angle_next_light.png', 'linked_data_light.png',\n 'raw_scan_light.png', 'dig_positive_light.png',\n 'text_view_light.png', 'vector_view_light.png',\n 'overlays_light.png', 'thumbnails_light.png',\n '3d_view_light.png', 'step_back_light.png',\n 'step_fwd_light.png', 'minimize_light.png' ];\n\n var i = 0;\n for (i = 0; i < files.length; i++) {\n btnImages[i] = new Image(); btnImages[i].src = files[i];\n }\n}", "function findImagesToLoad() {\n\tsetLazyImagePositions.call(this);\n\tconst imagesToLoad = getImagesInView(this.images);\n\tloadImages.call(this, imagesToLoad);\n}", "function LoadImages()\n{\n\tvar loadedImages = 0;\n\tvar numImages = 0;\n\tfor (var src in ImgList)\n\t{\n\t\tnumImages++;\n\t}\n\tfor (var src in ImgList)\n\t{\n\t\tImgs[src] = new Image();\n\t\tImgs[src].onload = function()\n\t\t{\n\t\t\tloadedImages = loadedImages +1;\n\t\t\tif(loadedImages >= numImages)\n\t\t\t{\n\t\t\t\t//Finished loading!\n\t\t\t\ttstsetup();\n\t\t\t\tImgsFinished = 1;\n\t\t\t}\n\t\t};\n\n\t\tif (src < 6)\n\t\t{\n\t\t\tImgs[src].src = ImgList[src];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tImgs[src].src = ImgURL + ImgList[src];\n\t\t}\n\t}\n}", "function fetchImages() {\n $.getJSON(\"/images.php\", function(data) {\n preloadImages(data);\n }); \n }", "function loadImages() {\n bsImage = new Image();\n bsImage.src = \"resources/resources/images/spritesheets/buttons_1.png\";\n wallImag = new Image();\n wallImag.src = \"resources/resources/images/spritesheets/jungle_wall.png\";\n ssImage = new Image();\n ssImage.src = \"resources/resources/images/spritesheets/sprites_final.png\";\n window.setTimeout(setup, 1500);\n aImage = new Image();\n aImage.src = \"resources/resources/images/spritesheets/uparr.png\"\n}", "function loadImages(div){\r\n\tvar images = [];\r\n\tjQuery.each(jQuery(div+' img'), function(i,img){\r\n\t\tif(!jQuery(img).attr('src') || jQuery(img).attr('src')==''){\r\n\t\t\timages.push(img);\r\n\t\t}\r\n\t});\r\n\tjQuery(images).each( function(i,image) {\r\n\t\tjQuery(this).attr('src',jQuery(this).attr('longdesc'));\r\n\t});\r\n}", "function loadImage() {\n var baseUrl = 'https://source.unsplash.com/category';\n var category = 'nature';\n var size = '1920x1080';\n\n var source = baseUrl + '/' + category + '/' + size;\n\n buildElement(source)\n .then(render);\n }", "function loadImages() {\r\n var files = document.getElementById('images').files, i, file, reader;\r\n for (i = 0; i < files.length; i = i + 1) {\r\n file = files[i];\r\n if (file.name.endsWith(\".jpg\") || file.name.endsWith(\".gif\") || file.name.endsWith(\".png\")) {\r\n images.push(file);\r\n }\r\n }\r\n if (images.length > 0) {\r\n showLoadedImages(\"list\");\r\n } else {\r\n alert(\"No images found. Try another directory.\");\r\n }\r\n }", "function loadVisiblePages() {\n // Fetch page images that are currently shown on the site\n var firstVisibleImageLinks = $('#imageList li>a').not('.page-text').withinviewport();\n $.each(firstVisibleImageLinks, function(index, aEl) {\n var imgEl = $(aEl).find('img');\n // Check if the image is already loaded\n if( $(imgEl).attr('src') !== '' )\n return;\n\n // Load page images via Ajax\n $.get( \"ajax/image/page\", { \"imageId\" : globalImageType, \"pageId\" : $(aEl).attr('data-pageid'), \"width\" : 150 } )\n .always(function( data ) {\n // Remove broken image icon first\n var nextEl = $(imgEl).next();\n if( nextEl.length !== 0 ) {\n $(nextEl).remove();\n }\n })\n .done(function( data ) {\n $(imgEl).attr('src', \"data:image/jpeg;base64, \" + data);\n })\n .fail(function( data ) {\n $(imgEl).after('<i class=\"material-icons image-list-broken-image\" data-info=\"broken-image\">broken_image</i>');\n });\n });\n}", "function loadImage() {\n\n // image file not loaded yet? => load image file\n if ( !resource ) jQuery( '<img src=\"' + url + '\">' );\n\n // immediate perform success callback\n success();\n\n }", "function loadImages() {\n\t// for each image container\n\t$('.image-container').each(function() {\n\t\t// get medium-sized image filename\n\t\tvar img_filename = $('img', $(this)).attr('data-imglarge')\n\t\tvar img_med_filename = img_filename.substring(0, img_filename.indexOf('.png')) + '_medium.jpg'\n\n\t\t// // load medium-sized image\n\t\t// var imgLarge = new Image()\n\t\t// $(imgLarge).addClass('artwork')\n\t\t// \t.attr('src', img_med_filename)\n\t\t// \t.attr('data-imglarge', img_filename)\n\t\t// \t.attr('alt', $('.placeholder', $(this)).attr('alt'))\n\t\t// \t.on('load', () => {\n\t\t// \t\t$(imgLarge).addClass('loaded')\n\t\t// \t})\n\t\t// $(this).append($(imgLarge))\n\n\t\t// update placeholder image src\n\t\t$('.placeholder', $(this)).attr('src', img_med_filename)\n\t\t\t.attr('data-imglarge', img_filename)\n\t\t\t.css('filter', 'none')\n\t})\n\tconsole.log('window loaded!')\n}", "function loadImages (){\n var img = [\n 'src/Barba Garcia, Francisco.jpg',\n 'src/Barba Rodriguez, Arturo.jpg',\n 'src/Caro Bernal, Miguel Angel.jpg',\n 'src/Castillo Peña, José Luis.jpg',\n 'src/Cruz Vidal, Alejandro.jpg',\n 'src/Gallego Martel, Jose Maria.jpg',\n 'src/Garci Peña, José Joaquín.jpg',\n 'src/Vazquez Rodriguez, Maria del Mar.jpg',\n ];\n\n setImgs(shuffle(initImgs(img)));\n}", "function loadImages() {\n floor = new Image();\n background = new Image();\n ring = new Image();\n platform = new Image();\n\n floor.src = './tile-images/floorpath.png';\n background.src = './tile-images/plainbackgroundtile.png';\n ring.src = './tile-images/ring.png';\n platform.src = './tile-images/platform.png';\n}", "function display_advertise_images() {\n}", "function refreshImages() {\n var images = document.querySelectorAll('img[data-src]');\n\n for (var i = 0; i < images.length; i++) {\n ImageLoader.load(images[i]);\n }\n }", "function loadImages(){\n prev_btnj.addClass('loading')\n next_btnj.addClass('loading')\n fs.readdir(dirname, (err, files) => {\n if (!err){\n images = files.filter(isImage)\n curIndex = images.indexOf(basename)\n prev_btnj.removeClass('loading')\n next_btnj.removeClass('loading')\n setBtn()\n }\n })\n}", "function loadImages() {\n testPattern = new Image();\n testPattern.src = \"testpattern.gif\";\n }", "function loadImages() {\r\n\t\tremoveUnseenImages();\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar range = getPixelRange();\r\n\t\tfor(var i=range.start.x; i<range.end.x && i<sets.resolutions[sets.zoom-1].width; i+=addi(i)) {\r\n\t\t\tfor(var j=range.start.y; j<range.end.y && j<sets.resolutions[sets.zoom-1].height; j+=256) {\r\n\t\t\t\tvar col = getColumn(i);\r\n\t\t\t\tif(!isLoaded(col,i,j)) { // Prevent already loaded images from being reloaded\r\n\t\t\t\t\tvar imgurl = sets.image_name.replace(/%Z/, sets.zoom );\r\n\t\t\t\t\timgurl = imgurl.replace(/%L/, sets.level);\r\n\t\t\t\t\timgurl = imgurl.replace(/%C/, col);\r\n\t\t\t\t\timgurl = imgurl.replace(/%X/, (i-firstInColumnLocation(col-1)));\r\n\t\t\t\t\timgurl = imgurl.replace(/%Y/, j);\r\n\t\t\t\t\timgurl = sets.image_dir + imgurl;\r\n\t\t\t\t\t$['mapsettings'].loaded[sets.zoom+\"-\"+col+\"-\"+i+\"-\"+j] = true;\r\n\t\t\t\t\tvar style = \"top: \" + j + \"px; left: \" + i + \"px;\"\r\n\t\t\t\t\tvar theClass = \"file\" + sets.zoom + \"-\" + col +\"-\" + i + \"-\" + j;\r\n\t\t\t\t\t$(\"<img/>\").attr(\"style\", style).attr('class',theClass).appendTo(\"#images\").hide();\r\n\t\t\t\t\t$(\"img.\" + theClass).load(function(e){ $(this).show(); }); // Only show the image once it is fully loaded\r\n\t\t\t\t\t$(\"img.\" + theClass).attr(\"src\", imgurl);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function loadImages(data) {\n $('.gif-wrapper').empty();\n var temp = JSON.parse(data);\n for (var i = 0; i < temp.length; i += 1) {\n $('.gif-wrapper').append('<img src=\"' + temp[i].url + '\">');\n }\n }", "function loadCarouselImages() \n{\n\n\tIMAGES = randomizeArray(IMAGES);\n\t\n\t//Imported IMAGES & CAPTIONS\n\t//From images.js\n\tSTART_INDEX = 0;\n\n\tfor(var i=0; i < IMAGES.length; i++)\n\t\taddImageWithCaption(IMAGES[i][1], IMAGES[i][2], IMAGES[i][0], START_INDEX == i);\n}", "function pageSetUp()\n\t{\n\t\tdocument.getElementById(\"Images\").src=\"Images/0.jpeg\";\n\t}", "function load_images(){\n enemy_img = new Image();\n enemy_img.src = \"assets/virus.png\"\n\n fighter_girl = new Image()\n fighter_girl.src = \"assets/girl.png\"\n\n fighter_boy = new Image()\n fighter_boy.src = \"assets/man.png\"\n\n mask_img = new Image();\n mask_img.src = \"assets/mask.png\"\n\n heart_img = new Image();\n heart_img.src = \"assets/heart.png\"\n}", "function simpleLoad(config){\n for (var i = 1; i < config.imgTotal + 1; i++){\n $('<img>').attr({\n id: \"image\" + i,\n src: config.imgDir + i + config.imgFormat,\n title: \"Image\" + i\n }).appendTo(\"#\" + config.imgContainer);\n }\n }", "function preloadImages() {\n\tidList.forEach(function(id) {\n\t\tlet $newImage = $('#image-preloader').clone();\n\t\t$newImage.attr('src', `${ART_URL}${id}.png`);\n\t\t$('#image-preloader-container').append();\n\t});\n}", "function loadImage() {\n var baseUrl = 'https://source.unsplash.com/category',\n cat = 'nature',\n size = '1920x1080';\n\n buildElement(`${baseUrl}/${cat}/${size}`).then(render);\n }", "function getImages() {\n alert(\"Page will reload once images are finished loading\");\n // runs 1540photo.py, which collects images from Gmail\n exec(\"python 1540photo.py\");\n loaded_images_from_tba = 0;\n // for each team, loads media\n for (let team_id in teams) {\n loadMediaFromTBA(teams[team_id]);\n }\n // gets local files\n let local_dir = fs.readdirSync(\"./data/images/\");\n for (let team_id in local_dir) {\n try {\n let file = local_dir[team_id];\n if (manifest_images.indexOf(file) < 0) {\n manifest_images.push(file);\n }\n } catch (_) {}\n }\n // checks to see if all images are loaded, and saves a manifest if true\n window.setInterval(saveImageManifest, 3000);\n}", "function renderImages() {\n imgElem.src = Actor.all[0].path;\n}", "function loadImages(atlas)\n\t\t{\n\t\t\tdataAtlas = atlas.tiles;\n\t\t\tplayerAtlas = atlas.player;\n\n\t\t\tlet images = [\"img/Tiles/sheet.png\", \"img/Player/p1_spritesheet.png\"];\n\t\t\tlet imgsPromises = images.map (function (url)\n\t\t\t{\n\t\t\t\treturn new Promise ( (ok, error) => {\n\t\t\t\t\tvar img = new Image();\n\t\t\t\t\timg.src = url;\n\t\t\t\t\timg.onload = () => ok(img);\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn (Promise.all(imgsPromises))\n\t\t}", "preloadImages(doload, callback) {\n\t\tconst paths = this.getImagePaths();\n\t\tfor (let i = 0; i < paths.length; i++) {\n\t\t\tgraphics.add(paths[i]);\n\t\t}\n\t\tif (doload) {\n\t\t\tgraphics.load(callback);\n\t\t}\n\t}", "function ImageController(){\n\t\tvar imageService = new ImageService()\n\t\t$.get(window.location.pathname + '-image-tag.html', function(data){\n\t\t\t$('.main-container').append(data)\n\t\t})\n\t\timageService.getImage(function(imageData){\n\t\t\t$('body').css('background-image', `url(\"${imageData.url}\")`);\n\t\t\tconsole.log(imageData.large_url)\n\t\t\t$('.image-link').attr('href', imageData.large_url!==null? imageData.large_url : imageData.url)\n\t\t})\n\t}", "function loadImg(){\n document.productImg.src = myImgSrc + myImg[i] + myImgEnd;\n}", "function loadImage() {\n\t\t$('div.thumbnail a img').on('click', function(){\n\t\t\tvar image = this.src;\n\t\t\t$('.image-load').html('<img src=\"' + image + '\">');\n\t\t});\n\t}", "function loadImage(imageName, imageLocation)\n{\nif (document.images) document.images[imageName].src = imageLocation;\nreturn true;\n}", "function Load_Page(CurrentImageID){\r\n\t\r\n\t\r\n\tvar Image_Number = Loaded_Images[CurrentImageID].number;\r\n\tvar Image_Page = Loaded_Images[CurrentImageID].page\r\n\t\r\n\t// Checks which page direction and if it's the end of the list.\r\n\t\r\n\t// Going towards the left\r\n\tvar backPaging = (Image_Number <= 1 && Image_Page > 1)\r\n\tvar FrontWall = (Image_Page == FirstPage)\r\n\t\r\n\t// Going towards the right\r\n\tvar forwardPaging = (Image_Number >= ImagesPerPage && Image_Page >= 1)\r\n\tvar RearWall = (Image_Number < ImagesPerPage && Image_Page == LastPage)\r\n\tif(backPaging && !FrontWall){\r\n\t\tvar PageSelect = Image_Page-1\r\n\t\t// console.debug('backpaging')\r\n\t}else if(forwardPaging && !RearWall){\r\n\t\tvar PageSelect = Image_Page+1\r\n\t\t// console.debug('forwardPaging')\r\n\t}else{\r\n\t\t// console.debug('wall')\r\n\t\tPageSelect = Image_Page\r\n\t};\r\n\r\n\t\r\n\t\r\n\t// Takes the requested page and converts into a URL string to load.\r\n\tif(backPaging || forwardPaging){\r\n\t$nav_thumb_img.show();\r\n\tPageSelect -= 1\r\n\tPageSelect = PageSelect*ImagesPerPage\r\n\t\r\n\tif(document.URL.indexOf('pid=') > -1){\r\n\t\tvar requestURL = document.URL.replace(/pid\\=[0-9]{1,}/,'pid='+PageSelect);\r\n\t}else{\r\n\t\tvar requestURL = document.URL+'&pid='+PageSelect;\r\n\t};\r\n\t// console.debug(requestURL+' Loading...')\r\n\tGM_xmlhttpRequest({\r\n\t\tmethod: \"GET\",\r\n\t\turl: requestURL,\r\n\t\tonload: function(retour) {\r\n\t\t\t// console.debug(retour)\r\n\t\t\t$nav_thumb_img.hide();\r\n\t\t\tResponseHTML = $(retour.responseText);\r\n\t\t\tvar ImageNumber = 0\r\n\t\t\t$('.content span.thumb', ResponseHTML).each(function(){\r\n\t\t\t\r\n\t\t\t\tvar $this_span = $(this)\r\n\t\t\t\tvar ImageID = $this_span.attr('id');\r\n\t\t\t\tvar ImageThumb = $('img.preview' ,$this_span).attr('src');\r\n\t\t\t\tvar ImageTags = $('img.preview' ,$this_span).attr('alt');\r\n\t\t\t\tvar ImagePage = parseInt($('#paginator .pagination b', ResponseHTML).text());\r\n\t\t\t\tvar ImageMain = ImageThumb.replace('thumbnail_','').replace(\"/r34/thumbnails/\",'//images/').replace(\"/rule34/thumbnails/\",'/rule34//images/')\r\n\t\t\t\tvar ImageLink = $('a[href^=\"'+Setting_ImageLinkBegins+'\"]',$this_span).attr('href');\r\n\t\t\t\t\r\n\t\t\t\t// console.debug(ImageMain);\r\n\t\t\t\t// http://cdn.rule34.xxx/r34/thumbnails/1354/thumbnail_23a69eecacb1cd8c36045e45657800e8f257e950.jpg?1411722\r\n\t\t\t\r\n\t\t\t\tImageNumber++\r\n\t\t\t\t\r\n\t\t\t\tAddImage(ImageID,ImageThumb,ImageMain,ImagePage,ImageNumber,ImageLink,ImageTags)\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tSort_images();\r\n\t\t\tvar Cur_Image_ID = $('.image_nav_content img.main_img').data('ImageId')\r\n\t\t\tvar Image_Number2 = Loaded_Images_array.indexOf(Cur_Image_ID);\r\n\t\t\tif(backPaging){\r\n\t\t\t\tImage_Number2--\r\n\t\t\t\t// console.debug('backPaging')\r\n\t\t\t}else if(forwardPaging){\r\n\t\t\t\tImage_Number2++\r\n\t\t\t\t// console.debug('forwardPaging')\r\n\t\t\t}\r\n\t\t\t// console.debug(Cur_Image_ID+' ID, Number: '+Image_Number2)\t\t\t\r\n\t\t\tNew_Image = Loaded_Images_array[Image_Number2]\r\n\t\t\t// console.debug(New_Image)\r\n\t\t\tLoadImage(New_Image);\r\n\t\t\t\r\n\t\t}\r\n\t});\r\n\t};\r\n \r\n}", "function preloader() {\n\tif (document.images) {\n\t\tvar img1 = new Image();\n\t\tvar img2 = new Image();\n\t\tvar img3 = new Image();\n\t\tvar img4 = new Image();\n\n\t\timg1.src = \"./imgs/sunny.jpg\";\n\t\timg2.src = \"./imgs/sunset.jpg\";\n\t\timg3.src = \"./imgs/stars.jpg\";\n\t\timg4.src = \"./imgs/downtown.jpg\";\n\t}\n}", "function preload() {\n println(\"loading images\")\n img = [loadImage(\"./assets/AmericaFirst.png\"), loadImage(\"./assets/AuditTheVote.png\"), loadImage(\"./assets/Hillary.png\"), loadImage(\"./assets/MAGA.png\"), loadImage(\"./assets/TrumpTrain.png\")];\n\n}", "function lazyLoad(){\n\tvar $images = $('.lazy_load');\n\n\t$images.each(function(){\n\t\tvar $img = $(this),\n\t\t\tsrc = $img.attr('data-img');\n\t\t$img.attr('src',src);\n\t});\n}", "function loadImageUrls() {\n fetch(\"https://api.imgflip.com/get_memes\")\n .then((result) => result.json())\n .then(({ data: { memes: loadedMemes } = {} }) => {\n memes = loadedMemes;\n showImage(0);\n });\n }", "function loadImages(imagesToLoad) {\n\timagesToLoad.forEach(lazyImage => {\n\t\tthis.fireLazyEvent(lazyImage.image);\n\t\tlazyImage.resolved = true;\n\t});\n}", "function displayPhotos() {\n loader.hidden = true;\n photos.forEach((photo) => {\n // Create Unspalsh page Link for the image\n const imageLink = document.createElement(\"a\");\n imageLink.setAttribute(\"href\", photo.links.html);\n imageLink.setAttribute(\"target\", \"_blank\");\n\n // Create image element\n const img = document.createElement(\"img\");\n img.setAttribute(\"src\", photo.urls.regular);\n img.setAttribute(\"alt\", photo.alt_description);\n img.setAttribute(\"title\", photo.alt_description);\n\n imageLink.appendChild(img);\n imageContainer.appendChild(imageLink);\n\n //event listner for image\n img.addEventListener(\"load\", imageLoaded);\n });\n}", "function getLoadedImages() {\r\n return images;\r\n }", "function preload(){\n images.forEach(function(elem) {\n im = new Image();\n im.src = elem;\n });\n}", "function preloadImages() {\n var images = [\n 'btn_action_active.png',\n\t'btn_focus_active.png',\n 'btn_up_active.png',\n 'btn_right_active.png',\n 'btn_left_active.png',\n 'btn_down_active.png',\n 'prybar.png',\n 'machete.png',\n 'sample_dna.png',\n 'pickaxe.png',\n 'fuel.png',\n 'fire_extinguisher.png',\n 'dynamite.png',\n 'dna_sampler.png'\n ];\n $(images).each(function() {\n $('<img/>')[0].src = this;\n (new Image()).src = this;\n });\n}", "function LoadSliderImages(sublist) {\n\t\t\tvar numImages = sublist.find('.item > a > .src').length;\n\t\t\tsublist.find('.item > a > .src').each(function(i) {\n\t\t\t\tvar img = new Image();\n\t\t\t\tvar imgSrc = $(this).html();\n\t\t\t\tvar imgAlt = $(this).parent().find('.alt').html();\n\t\n\t\t\t\t$(this).parent().append(img);\n\t\t\t \n\t\t\t\t// wrap our new image in jQuery, then:\n\t\t\t\t$(img).load(function () {\n\t\t\t\t\tnumImages--;\n\t\t\t\t\tif (numImages == 0) {\n\t\t\t\t\t\tSetSublist(sublist);\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\tif (i == sublist.find('.item > a > .src').size() - 1) {\n\t\t\t\t\t\tSetSublist(sublist);\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t})\n\t\t\t\t.error(function () {\n\t\t\t\t// notify the user that the image could not be loaded\n\t\t\t\t})\n\t\t\t\t.attr('src', imgSrc).attr('alt', imgAlt);\n\t\t\t});\n\t\t}", "function preloadImages() {\n\tif (document.images) {\n\t\tfor (var i = 0; i < preloadImages.arguments.length; i++) {\n\t\t\t(new Image()).src = preloadImages.arguments[i];\t\n\t\t}\n\t}\n} // end image preloader", "function preload(){\r\n img=loadImage('https://upload.wikimedia.org/wikipedia/commons/8/81/Dalai_Lama_%2814566605561%29.jpg')\r\n\r\n img1=loadImage('https://upload.wikimedia.org/wikipedia/commons/0/02/Nelson_Mandela_1994.jpg')\r\n\r\n img2=loadImage('https://upload.wikimedia.org/wikipedia/commons/0/00/Bill_Clinton_1999_Presidential_Medal_of_Freedom_%281%29.jpg')\r\n\r\nimg3=loadImage('https://live.staticflickr.com/65535/49245065008_a7082b2a41_b.jpg')\r\n}", "loadImages(): void {\n let self = this;\n let items = this.getState().items;\n for (let i = 0; i < items.length; i++) {\n let item: ItemType = items[i];\n // Copy item config\n let config: ImageViewerConfigType = {...item.viewerConfig};\n if (_.isEmpty(config)) {\n config = makeImageViewerConfig();\n }\n let url = item.url;\n let image = new Image();\n image.crossOrigin = 'Anonymous';\n self.images.push(image);\n image.onload = function() {\n config.imageHeight = this.height;\n config.imageWidth = this.width;\n self.store.dispatch({type: types.LOAD_ITEM, index: item.index,\n config: config});\n };\n image.onerror = function() {\n alert(sprintf('Image %s was not found.', url));\n };\n image.src = url;\n }\n }", "function _onImageLoaded() {\n _imagesToLoad = _imagesToLoad - 1;\n if (!_imagesToLoad) {\n $$log(\"All images loaded, rendering again.\");\n PP64.renderer.render();\n }\n }", "function fnLoadPngs(){\n var rslt = navigator.appVersion.match(/MSIE (\\d+\\.\\d+)/, '');\n var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);\n \n for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--){\n if (itsAllGood && img.src.match(/\\.png$/i) != null) {\n var src = img.src;\n var div = document.createElement(\"DIV\");\n \n div.style.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\" + src + \"', sizing='scale')\"\n div.style.width = img.width + \"px\";\n div.style.height = img.height + \"px\";\n img.replaceNode(div);\n }\n \n img.style.visibility = \"visible\";\n }\n}", "function pilau_preload_images() {\n\tvar args_len, i, cache_image;\n\targs_len = arguments.length;\n\tfor ( i = args_len; i--;) {\n\t\tcache_image = document.createElement('img');\n\t\tcache_image.src = arguments[i];\n\t\tcache.push( cache_image );\n\t}\n}", "function addImages() {\n var images = ['heroImage', 'legacyLogo'];\n var img = null;\n for (var i = 0; i < images.length; i++) {\n var key = companyInfo['key'];\n if (companyInfo[images[i]].length > 0) {\n var url = 'https://media.licdn.com/media' + companyInfo[images[i]];\n img = $('<img class=\"recruiting-token-image\" id=\"' + images[i] + '-' + key + '\">');\n $(img).attr('src', url);\n img.data('file', null);\n img.data('name', images[i] + '-' + key);\n img.data('saved', false);\n img.data('scraped', true);\n createThumbnail(img, 'company-image-container');\n }\n }\n}", "function loadCarousel() {\n var carousel_images = [\n \"/Content/icons/png/1.jpg\",\n \"/Content/icons/png/2.jpg\",\n \"/Content/icons/png/3.jpg\",\n \"/Content/icons/png/4.jpg\",\n \"/Content/icons/png/5.jpg\",\n \"/Content/icons/png/6.jpg\",\n \"/Content/icons/png/7.jpg\",\n \"/Content/icons/png/8.jpg\"];\n\n $(window).load(function () {\n $(\"#photo_container\").isc({\n imgArray: carousel_images\n });\n });\n }", "function showLoadedImages(elem) {\r\n var i, span, reader, file;\r\n document.getElementById(elem).style.display = \"inline\";\r\n document.getElementById(elem).innerHTML = [];\r\n for (i = 0; i < images.length; i = i + 1) {\r\n file = images[i];\r\n reader = new FileReader();\r\n reader.onload = (function (file) {\r\n var j = i;\r\n return function (e) {\r\n span = document.createElement('span');\r\n span.className = \"tile\";\r\n span.onclick = function () {\r\n showImage(j, elem);\r\n };\r\n span.innerHTML = ['<div class=\"caption\"><em>', file.name, '</em><br><small>', file.name, '</small></div><img src=\"', e.target.result, '\" title=\"', escape(file.name), '\">'].join('');\r\n document.getElementById(elem).insertBefore(span, null);\r\n };\r\n })(file);\r\n reader.readAsDataURL(file);\r\n }\r\n }", "function beginLoadingImage(arrayIndex, fileName, isGamePic) {\n if (isGamePic) {\n gamePics[arrayIndex] = document.createElement(\"img\");\n gamePics[arrayIndex].onload = countLoadedImageAndLaunchIfReady;\n gamePics[arrayIndex].src = \"images/\" + fileName;\n } else {\n worldPics[arrayIndex] = document.createElement(\"img\");\n worldPics[arrayIndex].onload = countLoadedImageAndLaunchIfReady;\n worldPics[arrayIndex].src = \"images/\" + fileName;\n }\n}", "function preload()\n{\n dogImage=loadImage(\"images/dogImg.png\")\n happyDog=loadImage(\"images/Happy.png\")\n //bedroomImg=loadImage(\"images/Bed Room.png\")\n//gardenImg=loadImage(\"images/Garden.png\")\n//washroomImg=loadImage(\"images/Wash Room.png\")\n\t//load images here\n}", "function preloadImages () {\n\tif (document.images)\n\t\t{\n\t\t\tclosed_img = new Image(11,11);\n\t\t\tclosed_img.src = \"images/closed.gif\";\n\t\t\t\n\t\t\topened_img = new Image(11,11);\n\t\t\topened_img.src = \"images/opened.gif\";\n\t\t}\n\telse {\n\t\talert (\"document.images not found!\")\n\t}\n}", "function loadImages(elem) {\n if (!elem) {\n return;\n }\n\n var images = elem.getElementsByTagName('img');\n\n var n = images.length;\n for (var i = 0; i < n; i++) {\n var image = images[i];\n\n if (image.getAttribute('data-src')) {\n image.src = image.getAttribute('data-src');\n image.removeAttribute('data-src');\n }\n }\n }", "function LoadContactRefs() {\n var imageObjects = $(\"img\").get();\n\n for (var i = 0; i < imageObjects.length; i++) {\n var img = imageObjects[i];\n var imageSource = $(img).attr('src');\n var sourceEnd = imageSource.substring(14, imageSource.length)\n\n switch (sourceEnd) {\n case \"github.png\": $(img).parent().attr(\"href\", \"https://github.com/captainsalt\"); break;\n case \"linkedin.png\": $(img).parent().attr(\"href\", \"https://www.linkedin.com/in/david-wright-659006144/\"); break;\n case \"stack.png\": $(img).parent().attr(\"href\", \"https://stackoverflow.com/users/7107832/captainsalt\"); break;\n }\n }\n}", "function preloadImages() {\n for (var i = 0; i < numberOfGifsToPreload; i++) {\n popThenAddImage(fileNamesArray);\n }\n }", "loadImages() {\n let loadCount = 0;\n let loadTotal = this.images.length;\n\n if (WP.shuffle) {\n this.images = this.shuffle(this.images);\n }\n\n const imageLoaded = (() => {\n loadCount++;\n\n if (loadCount >= loadTotal) {\n // All images loaded!\n this.setupCanvases();\n this.bindShake();\n this.loadingComplete();\n }\n }).bind(this);\n\n for (let image of this.images) {\n // Create img elements for each image\n // and save it on the object\n const size = this.getBestImageSize(image.src);\n image.img = document.createElement('img'); // image is global\n image.img.addEventListener('load', imageLoaded, false);\n image.img.src = image.src[size][0];\n }\n }", "function lazyload(){\n var scrollTop = $(\"html, body\").scrollTop();\n $(\"img[data-src]\").each(function(){\n var top = $(this).offset().top - 800;\n var left = $(this).offset().left;\n\n\n if(scrollTop >= top && left >= 0 && left < $(window).width() && $(this).is(\":visible\") ){\n $(this).attr(\"src\", $(this).attr(\"data-src\"));\n }\n });\n\n $(\"[data-background-src]\").each(function(){\n var top = $(this).offset().top - 800;\n var left = $(this).offset().left;\n if($(this).hasClass(\"main-kb-bg\")){\n if(scrollTop >= top){\n $(this).css(\"background-image\", \"url(\"+$(this).attr(\"data-background-src\")+\")\");\n }\n } else {\n if(scrollTop >= top && left >= 0 && left < $(window).width() && $(this).is(\":visible\")){\n $(this).css(\"background-image\", \"url(\"+$(this).attr(\"data-background-src\")+\")\");\n }\n }\n\n });\n }", "function loadImages(sources, callback) {    \n\t\tfor(var src in sources) {         \t// get num of sources\n        numImages++;\n        }\n    for(var src in sources) {\n        images[src] = new Image();\n\t\t\timages[src].onload = function() {\n\t\t\t\tif(++loadedImages >= numImages) {\n\t\t\t\tcallback(images);\n\t\t\t\t}\n\t\t\t};\n        images[src].src = sources[src];\n        }\n    }", "function loadImages() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var urls = opts.urls,\n _opts$onProgress3 = opts.onProgress,\n onProgress = _opts$onProgress3 === undefined ? noop : _opts$onProgress3;\n\n (0, _assert2.default)(urls.every(function (url) {\n return typeof url === 'string';\n }), 'loadImages: {urls} must be array of strings');\n var count = 0;\n return Promise.all(urls.map(function (url) {\n var promise = (0, _browserLoad.loadImage)(url, opts);\n promise.then(function (file) {\n return onProgress({\n progress: ++count / urls.length,\n count: count,\n total: urls.length,\n url: url\n });\n });\n return promise;\n }));\n}", "function createImages()\n{\n\tlargeImg.src = imgArray[0];\n\t\n\tfor (var i = 0; i < imgArray.length; i++)\n\t{\n\t\tfourImgsDiv.innerHTML += \"<img src='\" + imgArray[i] + \"'>\";\n\t}\n}", "loadImages() {\n if (this._queue.length > 0) {\n let img = new Image();\n let src = this._queue.pop();\n\n let name = src.slice(src.lastIndexOf('/') + 1);\n img.src = src;\n img.onload = (function() {\n this.loadImages();\n }).bind(this);\n this.images[name] = img;\n } else {\n this._callback();\n }\n }", "function loadImages(images, string) {\n images.forEach((image, index) => {\n image.style.backgroundImage = \"url(./css/img/\" + string + (index + 1) + \".jpg)\";\n image.style.backgroundSize = \"contain\";\n })\n}", "function renderImages() {\n //if ( viewSkins ) { renderSkins(); } // disabled here so plants can be rendered sequentially in plants.js\n if ( viewSpans ) { renderSpans(); }\n if ( viewPoints ) { renderPoints(); }\n if ( viewScaffolding ) { renderScaffolding(); }\n}", "function getDirectoryImages() {\n\t\t\t// show image previews?\n\t\t\tif (opts.showImgPreview) {\n\t\t\t\tdoLoadDirectoryImage($('#browser ul li.GIF, #browser ul li.JPG, #browser ul li.PNG'), 0, sys.currentPathIdx);\n\t\t\t}\n\t\t}", "function init() {\n cacheDom();\n loadImage();\n }", "async function loadImages() {\n let data = arg.splice(1, arg.length - 1);\n let promise = [];\n data.forEach(img => {\n if(typeof img === \"string\") {\n let image = Canva2D.API.Preloader(\"singleImageOnly\", img);\n promise.push(image);\n } else if(img.hasOwnProperty(\"img\") && img.hasOwnProperty(\"src\")) {\n let image = Canva2D.API.Preloader(\"singleImageOnly\", img[\"img\"], img[\"src\"]);\n promise.push(image);\n } else {\n let image = Canva2D.API.Preloader(\"singleImageOnly\", img);\n promise.push(image);\n }\n });\n return await Promise.all(promise).then(e => {\n for(const img of e) \n _IMAGES_STACK.push(img);\n return _IMAGES_STACK;\n }).then(e => getImage);\n }", "function load_images () {\n console.log(\"load images\");\n\n GM_addStyle(\"#display_img {position: fixed; left: 0px; top: 50px; opacity: 0.6; background-color: #000; width: 100%; height: calc(100% - 50px); display: none;} .postright img {cursor: zoom-in;}\");\n //adds the faded background\n let div = element(\"div\").a(\"id\", \"display_img\").apthis(document.getElementById(\"pagewrapper\"));\n //div that holds the image\n let div1 = document.createElement(\"div\");\n div1.setAttribute(\"style\", \"position: fixed; left: 0px; top: 50px; width: 100%; height: calc(100% - 50px); text-align: center; display: none; cursor: zoom-out;\");\n //the img element that will display the image\n let img = document.createElement(\"img\");\n img.setAttribute(\"src\", \"\");\n img.setAttribute(\"id\", \"display_img_img\");\n div1.appendChild(img);\n //this causes the faded background and image to disappear\n document.getElementById(\"pagewrapper\").appendChild(div1);\n div1.addEventListener(\"click\", (event) => {\n div.style.display = \"none\";\n div1.style.display = \"none\";\n });\n\n let posts = document.getElementsByClassName(\"postright\");\n for (let a of posts) {\n let imgs = a.getElementsByTagName(\"img\");\n for (let b of imgs) {\n b.addEventListener(\"click\", (event) => {\n img.setAttribute(\"src\", event.currentTarget.src);\n //gets current image size\n let img_width = event.currentTarget.clientWidth;\n let img_height = event.currentTarget.clientHeight;\n //going to be used for the dialation\n let scale_factor = 1.5;//this is the maximun a small image can be scalled up\n const display_width = window.innerWidth;\n const display_height = window.innerHeight - 50;\n let final_height = 0, final_width = 0;\n\n final_height = img_height * scale_factor;\n final_width = img_width * scale_factor;\n\n //this is the best solution to deal with all different screen sizes and images sizes\n //It have tried making multilayer if/else statemanets but they don't work well for this\n while (final_height > display_height || final_width > display_width) {\n scale_factor -= 0.1;\n final_height = img_height * scale_factor;\n final_width = img_width * scale_factor;\n }\n //makes it cerntered vertically and makes sure it has right hieght and width\n img.setAttribute(\"style\", \"width:\" + final_width + \"px; height:\" + final_height + \"px; position: relative; top:\" + (((display_height) / 2) - (final_height / 2)) + \"px;\");\n\n div.style.display = \"block\";\n div1.style.display = \"block\";\n });\n }\n }\n }", "function showImages() {\r\n const images = document.querySelectorAll('[data-src]');\r\n const clientHeight = document.documentElement.clientHeight;\r\n for (let img of images) {\r\n const coord = img.getBoundingClientRect();\r\n let realSrc = img.dataset.src;\r\n if (!realSrc) continue;\r\n if (coord.top > -clientHeight &&\r\n coord.top < clientHeight * 2 ||\r\n coord.bottom > -clientHeight &&\r\n coord.bottom < clientHeight * 2) {\r\n img.src = realSrc;\r\n img.dataset.src = '';\r\n }\r\n }\r\n }", "loadImg() {\n let loadedCount = 0\n function onLoad() {\n loadedCount++\n if (loadedCount >= this.imgPaths.length) {\n this.flowStart()\n }\n }\n this.baseImages = this.imgPaths.map(path => {\n const image = new Image()\n image.onload = onLoad.bind(this)\n image.src = path\n return image\n })\n }", "function loadImage(){\n $(\".image-box\").attr(\"src\", displayedImg.download_url);\n}", "function loadImage() {\n\t\t\tthis.loading = 'eager';\n\t\t\tif( this.src )\n\t\t\t\tthis.src = this.src;\n\t\t\tif( this.srcset )\n\t\t\t\tthis.srcset = this.srcset;\n\t\t}", "function preloadImages(urls) {\n urls.forEach(url => {\n const image = new Image();\n image.src = url;\n });\n}", "function loadImages(element) {\n const images = element.querySelectorAll(\".menu__slide--image img\");\n images.forEach(image => (image.src = image.dataset.src || image.src));\n}", "function preLoad(onLoadAll) {\n \n var finished = false;\n \n var progressBar = {\n max : 0,\n loaded : 0\n };\n \n var updateBar = function() {\n \n var percnt = ((progressBar.loaded * 100) / progressBar.max) >> 0;\n $(\"#progress-bar\").width(percnt + '%');\n };\n \n var loadImage = function(img) {\n \n var e = document.createElement('img');\n\n e.onload = function() {\n\n progressBar.loaded++;\n updateBar();\n\n if(progressBar.loaded >= progressBar.max) {\n // once we get here, we are pretty much done, so redirect to the actual page\n if(!finished) {\n finished = true;\n helper.hide('progress-bar', 1000, false);\n onLoadAll();\n }\n }\n };\n \n e.onerror = e.onload;\n \n // this will trigger your browser loading the image (and caching it)\n e.src = img;\n };\n \n //Preload images\n $.ajax({\n url: \"./json/images.json\",\n success: function(images) {\n 'use strict';\n\n progressBar.max = images.length;\n\n var i = 0;\n\n while(i < images.length) {\n loadImage(images[i]);\n i++;\n }\n }\n });\n \n //Preload fonts\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n ctx.font = '12px Canaro';\n ctx.fillText('.', 0, 0);\n}", "function showImages() {\n const images = document.querySelectorAll('[data-src]');\n const clientHeight = document.documentElement.clientHeight;\n for (let img of images) {\n const coord = img.getBoundingClientRect();\n let realSrc = img.dataset.src;\n if (!realSrc) continue;\n if (coord.top > -clientHeight &&\n coord.top < clientHeight * 2 ||\n coord.bottom > -clientHeight &&\n coord.bottom < clientHeight * 2) {\n img.src = realSrc;\n img.dataset.src = '';\n }\n }\n }", "function loadImagesSeq() {\n\t\t const button = document.querySelector('#loadImagesSeq');\n\t\t const container = document.querySelector('#image-container');\n\t\t const promises = [];\n\t\t button.addEventListener(\"click\", (event) => {\n\n\t\t const images = imageNames();\n\n\t\t images.forEach((image) => {\n\t\t promises.push(requestInSeq(image, container));\n\t\t });\n\t\t console.log(promises);\n\t\t // when all promises are resolved then this promise is resolved.\n\t\t Promise.all(promises).then((imageDataObjs) => {\n\t\t console.log(imageDataObjs);\n\t\t imageDataObjs.forEach((imageData) => {\n\t\t const imageElement = imageData.imageElement;\n\t\t const imageSrc = imageData.objectURL;\n\t\t imageElement.src = imageSrc;\n\t\t });\n\n\t\t });\n\t\t });\n\n\n\t\t}", "LoadImage(){\n var images=[]\n // hard coded for convenienceproxy to a static serving end point\n if(this.state.images!=undefined){\n this.state.images.map(i =>{\n images.push(\n this.request.getStamp()+'-' + i\n )\n })\n return images; \n }\n else{\n \n return null\n }\n }", "function fetch_video_html_images() { \n var path = window.location.pathname;\n var page = path.split(\"/\").pop();\n\n if(page === 'video.html') {\n // Create element\n const div = document.createElement(\"div\");\n div.className = 'video-items';\n\n let output = '';\n const datas = Object.entries(countries);\n // console.log(datas);\n\n datas.forEach(d=> {\n // console.log(d[1][0]);\n output += `\n <a href=\"videoContent.html?video_name=${d[0]}\" class=\"item\">\n <img src=\"${d[1].video_image}\" alt=\"\">\n <span>${d[0]}</span>\n </a>\n `;\n });\n\n div.innerHTML= output;\n\n document.querySelector(\".video-container\").insertAdjacentElement(\"beforeend\", div);\n\n // console.log(output);\n }\n }", "function loadImages(sources, callback) {\n \tvar images = {};\n\n for(var src in sources) {\n \timages[src] = new Image();\n \timages[src].onload = callback;\n \timages[src].src = sources[src];\n }\n return images;\n }", "function load_imdb_images () {\n return new Promise (resolve => {\n $.spinnerWait (true);\n userLog (\"Det här kan ta några minuter ...\", true, 5000)\n let cmd = '$( pwd )/ld_imdb.js -e ' + $(\"#imdbPath\").text (); // pwd = present working dir\n execute (cmd).then ( () => {\n // $ (\"button.updText\").css (\"float\", \"right\");\n // $ (\"button.updText\").hide ();\n resolve (\"Done\")\n });\n });\n}", "function lazyLoad() {\n lazyImages.forEach(image => {\n if (image.offsetTop < window.scrollY + 150) {\n image.style.backgroundImage =\n `url(${image.getAttribute('data-src')})`;\n image.classList.add('loaded')\n }\n })\n}", "function init() {\n cacheDom();\n loadImage();\n }", "function preloadImages(images) {\n imagesAmount = images.length;\n for (var i = 0; i < images.length; i++) {\n var img = new Image();\n img.addEventListener('load', imageLoadedCallback, false);\n img.src = basePath + 'images/' + images[i];\n }\n }", "function displayPages() {\r\n // Retrieve the the pages div element.\r\n var $pageDiv = $(\"#pageDiv\");\r\n \r\n // Clear the page div.\r\n while ($pageDiv[0].firstChild)\r\n $pageDiv[0].removeChild($pageDiv[0].firstChild);\r\n \r\n // Iterate through all of the pages in the pagesList.\r\n for (var i = 0; i < pageList.length; i++) {\r\n var page = pageList[i];\r\n \r\n // Create a new image element to represent the page.\r\n var img = document.createElement(\"IMG\");\r\n img.onload = function() {\r\n $(this).hide().pageToggle();\r\n };\r\n img.src = \"/ShowAndTellProject/\" + page.audio;\r\n img.id = \"pageThumbnail\";\r\n \r\n // Add highlight functionality to the image element.\r\n highlight(img);\r\n \r\n // Add the image to the pages div.\r\n $pageDiv.append(img); \r\n }\r\n}", "function showImages() {\n var\n last = imgs.length,\n current,\n allImagesDone = true;\n\n for (current = 0; current < last; current++) {\n var img = imgs[current];\n // if showIfVisible is false, it means we have some waiting images to be\n // shown\n if(img !== null && !showIfVisible(img, current)) {\n allImagesDone = false;\n }\n }\n\n if (allImagesDone && pageHasLoaded) {\n }\n }", "function LoadImage(ImageID){\r\n\tLoaded_Images_array_current = Loaded_Images_array.indexOf(ImageID);\r\n\t// console.debug(Loaded_Images);\r\n\t\r\n\tvar ImageThumb = Loaded_Images[ImageID].thumb\r\n\tvar ImageMain = Loaded_Images[ImageID].main\r\n\tvar LoadingImage = true;\r\n\r\n\t\r\n\t// Sets the link on the image to the image page\r\n\t$nav_content_img.parent().attr('href',Loaded_Images[ImageID].link)\r\n\t\r\n\t// Formats all the tags into a list of links\r\n\tvar ImageTagsFormatted = [];\r\n\tvar ImageTags = Loaded_Images[ImageID].tags.split(\" \");\r\n\t$.each(ImageTags, function(index, value) {\r\n\t\tImageTagsFormatted.push('<a href=\"http://rule34.xxx/index.php?page=post&s=list&tags='+value+'\">'+value+'</a>');\r\n\t})\r\n\t\r\n\t$('.image_nav_background').show();\r\n\t$image_nav_overlay.show();\r\n\t$nav_thumb_img.show();\r\n\t$text_overlay.empty().append('<a href=\"'+Loaded_Images[ImageID].link+'\" class=\"main_image_direct_link\">'+Loaded_Images[ImageID].filename+'</a> | Page '+Loaded_Images[ImageID].page+' | Image '+Loaded_Images[ImageID].number+'<br>'+ImageTagsFormatted.join(' | '))\r\n\t\r\n\t$nav_content_img\r\n\t.data('ImageId',ImageID)\r\n\t\r\n\tvar current_status = Loaded_Images[ImageID].status;\r\n\t\r\n\t// Loads the image if it's already been verified previously.\r\n\tif(current_status == 'loaded' || current_status == 'error'){\r\n\t\t$nav_content_img.attr('src',ImageMain)\r\n\t\tif(current_status != 'loading')$nav_thumb_img.hide();\r\n\t\t$('.main_image_direct_link',$text_overlay).attr('href',ImageMain)\r\n\t\t\r\n\t\tRepositionMainImage();\r\n\t\r\n\t// Checks each image extension until it finds a working one\r\n\t}else if(current_status == 'waiting'){\r\n\t\tLoaded_Images[ImageID].status = 'loading';\r\n\t\tGM_xmlhttpRequest({\r\n\t\t\tmethod: \"GET\",\r\n\t\t\turl: '/'+Loaded_Images[ImageID].link,\r\n\t\t\tonload: function(retour) {\r\n\t\t\t\tLoaded_Images[ImageID].verified = true\r\n\t\t\t\tvar image;\r\n\t\t\t\tvar ResponseHTML = $(retour.responseText);\r\n\t\t\t\tvar ImageServer = $('div.content script:contains(\"image\"):contains(\"domain\"):contains(\"base_dir\")',ResponseHTML).text();\r\n\t\t\t\teval(ImageServer)\r\n\t\t\t\tvar new_image_url = image.domain+\"/\"+image.base_dir+\"/\"+image.dir+\"/\"+image.img;\r\n\t\t\t\tLoaded_Images[ImageID].main = new_image_url\r\n\t\t\t\t$(\"<img/>\")\r\n\t\t\t\t\t.attr(\"src\", new_image_url)\t\r\n\t\t\t\t\t.one('load',function(){\r\n\t\t\t\t\t\tLoaded_Images[ImageID].status = 'loaded';\r\n\t\t\t\t\t// Checks to make sure the successfully loading image actually is the one selected, since the load function for a previous image might be called after the user has switched to another.\r\n\t\t\t\t\t\tif($nav_content_img.data('ImageId') == ImageID){\r\n\t\t\t\t\t\t\t$nav_content_img.attr('src',new_image_url);\r\n\t\t\t\t\t\t\t$nav_thumb_img.hide();\r\n\t\t\t\t\t\t\t$('.main_image_direct_link',$text_overlay).attr('href',new_image_url)\r\n\t\t\t\t\t\t\tRepositionMainImage();\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.one('error',function(){\r\n\t\t\t\t\t\tLoaded_Images[ImageID].status = 'error';\r\n\t\t\t\t\t\tif($nav_content_img.data('ImageId') == ImageID){\r\n\t\t\t\t\t\t\t$nav_content_img.attr('src','/images/404.gif').one('load',function(){RepositionMainImage();});\r\n\t\t\t\t\t\t\t$nav_thumb_img.hide();\r\n\t\t\t\t\t\t\t$('.main_image_direct_link',$text_overlay).attr('href',new_image_url)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t// Prevent left and right scrolling in background\r\n\t$('body').css({'overflow-x' : 'hidden', 'overflow-y': 'hidden'})\r\n}", "function findImages(){\n var parentDir = \"./desc/civic_2012\";\n \n console.log(parentDir);\n var fileCrowler = function(data){\n var titlestr = $(data).filter('title').text();\n // \"Directory listing for /Resource/materials/xxx\"\n var thisDirectory = titlestr.slice(titlestr.indexOf('/'), titlestr.length)\n\n //List all image file names in the page\n $(data).find(\"a\").attr(\"href\", function (i, filename) {\n if( filename.match(/\\.(jpe?g|png|gif)$/) ) { \n var fileNameWOExtension = filename.slice(0, filename.lastIndexOf('.'))\n // var img_html = \"<img src='{0}' id='{1}' alt='{2}' width='75' height='75' hspace='2' vspace='2' onclick='onImageSelection(this);'>\".format(thisDirectory + filename, fileNameWOExtension, fileNameWOExtension);\n // $(\"#sm_image\").append(img_html);\n $( \".templ\" ).appendTo( \"#sm_image\" );\n }\n else{ \n $.ajax({\n url: thisDirectory + filename,\n success: fileCrowler\n });\n }\n });}\n\n $.ajax({\n url: parentDir,\n success: fileCrowler\n });\n}", "function load_media()\n{\n bg_sprite = new Image();\n bg_sprite.src = \"images/Background-stadt_lang.png\";\n box_sprite = new Image();\n box_sprite.src = \"images/Stift.png\";\n main_sprite = new Image();\n main_sprite.src = \"images/IMG_2210_Mini.png\";\n}", "function startImgStatus(){\n var img = document.createElement('img'); // Hack to extract absolute url\n $jQ('img').each(function(){\n img.src=$jQ(this).attr('src');\n setLink($jQ(this),'src', img.src);\n });\n}" ]
[ "0.7676688", "0.731364", "0.73070186", "0.71697855", "0.7169777", "0.7163216", "0.7148358", "0.7096101", "0.70113856", "0.6933231", "0.6932604", "0.6905027", "0.6893312", "0.6842709", "0.68203217", "0.6815961", "0.68065524", "0.6800416", "0.6784943", "0.6782312", "0.6781785", "0.67740965", "0.67655426", "0.67486274", "0.6746114", "0.6744704", "0.67271554", "0.67201483", "0.66962916", "0.6683502", "0.66795224", "0.66738015", "0.66700095", "0.66521937", "0.6647351", "0.66462153", "0.663513", "0.6633545", "0.6631216", "0.65984666", "0.6582906", "0.65764487", "0.6570141", "0.6568608", "0.6567403", "0.65654916", "0.6552041", "0.65471315", "0.6530931", "0.6512293", "0.6509736", "0.64923954", "0.6491187", "0.6486816", "0.64857817", "0.6484542", "0.64781225", "0.6456162", "0.6448061", "0.64363563", "0.643174", "0.64248437", "0.64221454", "0.6409288", "0.6399283", "0.6396185", "0.6387334", "0.6387277", "0.63857067", "0.63850623", "0.6384308", "0.63661546", "0.63619304", "0.63554865", "0.6351606", "0.6350221", "0.634836", "0.63385725", "0.6332649", "0.63317084", "0.6329298", "0.63284594", "0.63280773", "0.63216704", "0.63143826", "0.6310112", "0.6308037", "0.6298355", "0.6297974", "0.62956744", "0.6295391", "0.628929", "0.6289254", "0.6287079", "0.628348", "0.6277684", "0.62660134", "0.6263837", "0.6256909", "0.6254528", "0.62508744" ]
0.0
-1
Event Handler for click on picture
function handleUserClick(event) { event.preventDefault(); if (event.target.id === 'left') { catalogArray[randomIndex1].tallyClicked += 1; } else if (event.target.id === 'center') { catalogArray[randomIndex2].tallyClicked += 1; } else if (event.target.id === 'right') { catalogArray[randomIndex3].tallyClicked += 1; } else { alert('Pick a product!'); return; } console.log('I clicked' + event.target.id); surveyLength += 1; localStorage.setItem('userResults', JSON.stringify(catalogArray)); loadImages(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onImageClick() {\n console.log('Clicked Image')\n }", "function imgClick(event) {\n\n}", "imageClickHandler() {\n\t\tconst {data} = this.props,\n\t\t\tlistOfPhotos = document.querySelector('.gallery__photo-list');\n\n\t\tlistOfPhotos.addEventListener('click', e => {\n\t\t\tconst {target} = e,\n\t\t\t\t{imageMinId: id} = target.dataset;\n\n\t\t\tif (target.tagName !== 'IMG') return;\n\t\t\tthis.props.currentPhoto = +id;\n\t\t\tthis.changeGeneralPhoto(+id);\n\t\t\tthis.selectImageHandler();\n\t\t});\n\t}", "function handleClick(event)\n{\n\t// Gets position of click\n\tvar rect = canvas.getBoundingClientRect();\n\tvar posx = event.clientX - rect.left;\n\tvar posy = event.clientY - rect.top;\n\t\n\t// Checks each object to see if it was clicked\n\tfor (var i = 0; i < clickable.length; i++)\n\t{\n\t\t// If image was clicked, runs specified function\n\t\tif (posx >= clickable[i].x && posx <= clickable[i].x + clickable[i].width &&\n\t\t\tposy >= clickable[i].y && posy <= clickable[i].y + clickable[i].height)\n\t\t{\n\t\t\tclickable[i].func();\n\t\t}\n\t}\n}", "function clickImage (data){\n\t\t\n\t\t/*click function on each image*/\n\t\tdelegate(\"body\",\"click\",\".clickMe\",(event) => {\n\t\t\t\n\t\t\tevent.preventDefault();\n\t\t\tvar dataCaptionId=getKeyFromClosestElement(event.delegateTarget);\n\t\t\tvar dataCaption = data.caption;\n\t\t\tdataCaption = dataCaption.replace(/\\s+/g, \"\");\n\t\t\t\n\t\t\t//match the id and render pop up with the data\n\t\t\tif (dataCaption == dataCaptionId){\n\t\t\t\trenderPopup(data, container) \n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t}", "function onImageClick(event) {\n var imageWrap = document.querySelector('.image_wrap');\n if(!imageWrap.classList.contains('image_displayed')) return;\n\n if(imageWrap.classList.contains('positioning')) {\n var posRel = getPositionRel(event, document.querySelector('.image_wrap .image_con'));\n\n if(posRel.x >= 0 && posRel.x <= 1\n && posRel.y >= 0 && posRel.y <= 1) {\n placePinSelection(posRel);\n event.stopPropagation();\n }\n }\n\n if(imageWrap.classList.contains('moving')) {\n // ignore moving click events, mouse/touch events do everything\n event.stopPropagation();\n event.preventDefault();\n }\n }", "function onImgClick () {\n $ ('.img-wrap').one ('click', function (e) {\n console.log ('image clicked');\n console.log (characters);\n attackSound.play ();\n $ ('#selected-character-id').css ('border', 'solid 5px greenyellow');\n $ (this).off (e);\n });\n }", "function imgClicked(e)\n{\n\tlargeImg.src = e.target.src;\n}", "function handleClick(e) {\n const src = e.currentTarget.querySelector('img').src;\n const href = this.childNodes[0].nextSibling.href;\n overlayLink.href = href;\n overlayLink.innerText = href;\n overlayImage.src = src;\n overlay.classList.add('open');\n }", "function clickOnImage(event)\n{\n\tif ($(\"#country_selected\").val() != '0')\n\t{\n\t\tvar e = event || window.event;\n\t\tvar pos = getRelativeCoordinates(event, $(\"#reference\").get(0));\n\t\tvar m = $(\"#marker\").get(0);\n\t\tdisplayMarker(pos.x, pos.y);\n\t}\n}", "function clickOnThumbnail() {\n\tgetPhotoUrl($(this));\n\t$container.append($photoviewer.append($photoBox).append($caption));\n\t$photoBox.after($leftClick);\n\t$photoBox.before($rightClick);\n\t$(\"html\").css(\"background\",\"gray\");\n\t//All other images are not visible\n\t$(\".thumbnail\").addClass(\"greyed-out\");\n\t$(\".small-img\").hide();\n\t$leftClick.on(\"click\",leftClick);\n\t$rightClick.on(\"click\",rightClick);\n}", "function handleImageClick(event) {\n if (isDragAndDropSupported || !instance) {\n return;\n }\n\n const target = event.target;\n\n fetch(target.src)\n .then((r) => r.blob())\n .then((blob) => {\n const pageIndex = instance.viewState.currentPageIndex;\n const pageInfo = instance.pageInfoForIndex(pageIndex);\n\n insertImageAnnotation(\n new PSPDFKit.Geometry.Rect({\n width: target.width,\n height: target.height,\n left: pageInfo.width / 2 - target.width / 2,\n top: pageInfo.height / 2 - target.height / 2,\n }),\n blob,\n pageIndex\n );\n });\n}", "function ChoosePhoto(e) {\n console.log(\"gggg\");\n getPhoto(pictureSource.PHOTOLIBRARY);\n }", "function imgClicked(imgId) {\n gMeme.selectedImgId = imgId;\n}", "function clickRegularViewFocusImg(e) {\n\n var clickedThing = e.target;\n\n // if clicked element is a single image or the focus img in a gallery\n if (clickedThing.classList.contains('clickme')) {\n\n // define imgToShow\n var imgToShow = clickedThing;\n\n // call NAMED lightbox function\n lightbox(imgToShow);\n\n // call NAMED function to populate lightbox dots\n populateLightboxDots(imgToShow);\n\n } // close if ('clickme')\n} // close function", "function handleClick(e) {\n\tSTATE.popupOpen = true\n\tconst elem = closest(e.target, '[data-type=image]')\n\tconst i = parseInt(elem.getAttribute('data-index'), 10)\n\tSTATE.popup.innerHTML = popupContent({ elem: content.parts[i], index: i })\n}", "function clickFunc(event) {\n\t//alert(event);\n\tvar e = event;\n\t//console.log(typeof e);\n\t\n\tif(event.target !== event.currentTarget) {\n\t\tvar clickedItem = event.target.id;\n\t\t//alert(\"this is the image id = \"+clickedItem);\n\t}\n \n}", "function addEventOpenImages() {\n document.addEventListener('click', function (evt) {\n if (evt.target.parentNode.classList.contains('picture')) {\n evt.preventDefault();\n showImage(evt.target.parentNode);\n }\n });\n }", "function clickHandler(event) {\n //take the path from the src attribute of the img node\n //that we clicked on. We get a reference to that node\n //from event.target\n var targetString = event.target.src;\n //take the relevant part of the path from the node\n var targetPath = targetString.split('assets')[1];\n var itemPath;\n\n //look through the ItemImage objects to find the one that\n //corresponds to the image we clicked on\n for (var i = 0; i < items.length; i++) {\n //get the relevant part from the path on the object\n itemPath = items[i].path.split('assets')[1];\n if (itemPath === targetPath) {\n //when we find the right object increment its clicked\n //property\n items[i].clicked += 1;\n }\n }\n\n changePicture();\n}", "imageClick(e) {\n e.preventDefault();\n\n if (this.item.link) {\n window.open(this.item.link, '_blank');\n } else {\n this.shadowRoot.querySelector('#image-dialog').open();\n\n HhAnalytics.trackDialogOpen(this.item.internalTitle);\n }\n }", "function imageSelect(){\n\tvar getPhoto = document.getElementById(\"userPhoto\");\n\tgetPhoto.click();\n}", "initiatePictureCapture(){this.imageInput.trigger('click')}", "function handleImgClick(event) {\n if (event.target.id === 'left') {\n allImages[leftImg].clicked += 1;\n console.log(allImages[leftImg].imgname + ' ' + allImages[leftImg].clicked);\n counter += 1;\n pick3();\n }\n if (event.target.id === 'center') {\n allImages[centerImg].clicked += 1;\n console.log(allImages[centerImg].imgname + ' ' + allImages[centerImg].clicked);\n counter += 1;\n pick3();\n }\n if (event.target.id === 'right') {\n allImages[rightImg].clicked += 1;\n console.log(allImages[rightImg].imgname + ' ' + allImages[rightImg].clicked);\n counter += 1;\n pick3();\n }\n if (event.target.id === 'imgContain') {\n alert('You need to click on an image!');\n pick3();\n }\n}", "function clickHandler(event) {\r\n console.log(event.target);\r\n var imageName = event.target.alt;\r\n for (var i = 0; i < pictures.length; i++) {\r\n if (pictures[i].name === imageName) {\r\n pictures[i].updateChosen();\r\n picked++;\r\n }\r\n }\r\n\r\n if (picked === 25) {\r\n removeListener();\r\n chartData();\r\n showResults();\r\n var dataAsString = JSON.stringify(pictureData);\r\n localStorage.setItem('data', dataAsString);\r\n var nameAsString = JSON.stringify(labels);\r\n localStorage.setItem('pictures', nameAsString);\r\n }\r\n\r\n previousSet = thisSet;\r\n thisSet = {};\r\n setupImageContainer();\r\n}", "function imgClick(event) {\n var clickTargetPath = $(event.target).attr('src'), // find the click target\n $lightbox = $('#image_show'),\n $boxImage = $('#image_show img');\n // check to see if lightbox is already displayed\n if ($lightbox.hasClass('display_img')) {\n closeLightbox();\n return\n }\n // attach a click listener for closing the lightbox\n $(window).click(closeLightbox);\n $boxImage.click(function(evt){\n evt.stopPropagation() // ignore clicks on the lightbox image\n })\n // change lightbox image targete\n $boxImage.attr('src', clickTargetPath);\n // display the lightbox\n $lightbox.addClass('display_img').removeClass('display_none');\n}", "function imageClick(){\n\t$('.pic').click(function() { \n\t\tmenuModal.style.display = \"block\";\n\t\twindow.onclick = function(event) {\n\t\t\tif (event.target == menuModal) {\n\t\t\t\tmenuModal.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t});\n}", "function mouseClicked(){\n if(current_img == null) current_img = flowers_img;\n if(mouseX>=0 && mouseX<width && mouseY>=0 && mouseY<height)\n image(current_img, mouseX - 37, mouseY - 50, 75, 100);\n}", "function onClick(event){\n event.preventDefault();\n clearInterval(interval);\n showImage(currentImageindex + event.data);\n }", "function photoHandler(e){\n //Backwards compatibility\n e = e || window.event\n\n var type = e.type;\n if(type == 'click' && photoCxt){ //Run only if canvas is supported\n\n //Look for clicked index\n for(var i = 0; i < photos.length; i++)\n if(photos[i] == this) break;\n\n //Update data for further display animation\n display.sideImgs = {\n prev: photos[(i - 1 + photos.length) % photos.length].getElementsByTagName('img')[0],\n next: photos[(i + 1 + photos.length) % photos.length].getElementsByTagName('img')[0]\n };\n display.thumbImg = this.getElementsByTagName('img')[0];\n display.initRect = this.getBoundingClientRect();\n\n //Load full size image of current selection\n display.loadFlag = false;\n display.largeImg.src = display.thumbImg.src.split('/thumbs').join('');\n\n //Commence animation\n display.transDir = 'in';\n display.tweenVal = 100;\n\n hovered = null; //Cancel current hover indicator\n photoCvs.style.display = 'block'; //Show canvas topmost\n photoCvs.style.zIndex = 1;\n\n return false; //Cancels default click behavior - old school\n };\n\n //Handle rollovers in the same function\n var thisHover = type == 'mouseover';\n if(thisHover)\n hovered = this;\n else if(hovered == this) //Cursor leaves element\n hovered = null;\n}", "function onImageClick (e) {\n\t// set boolean flag - did user click correct image?\n\tvar right = e.target.className === 'right';\n\t// on first click, this is null. but if user first clicked wrong image, mark old choice as well\n if (oldChoice) {\n oldChoice.style.border = \"solid\";\n };\n\t// define previous user's choice\n var div = e.target.parentNode.parentNode;\n\toldChoice = div;\n\t// mark image as selected\n div.style.border = \"5px solid yellow\";\n\t// if the \"noRightImage\" attack is active, user's wrong. else, define if \"right\" or \"wrong\"\n\timageChoice = settings['attack'] === 'noRightImage' ? 'wrong' : e.target.className;\n\t// forward user to wanted page\n onContinue();\n}", "function imageInfoListItemClick(event) {\n gImageInfoViewer.setImageInfo(event.currentTarget.imageInfo);\n}", "function imgClick(event) {\n modal.style.display = \"block\";\n modalImg.src = event.currentTarget.src;\n captionText.innerHTML = event.currentTarget.alt;\n}", "function click_event(evt) {\r\n var mousePos = getMousePos(canvas3, evt);\r\n var message = mousePos.x + ',' + mousePos.y;\r\n y = canvas3.width/2.0-220;\r\n x = canvas3.width/2.0;\r\n if (debug === 1) {\r\n console.log(message.slice(0, 3));\r\n console.log(message.slice(4, 8));\r\n }\r\n if (halfW <= mousePos.x && mousePos.x <= halfW + total_width && halfH <= mousePos.y && mousePos.y <= halfH + total_height) {\r\n canvas3.removeEventListener('click', click_event, false);\r\n if (debug === 1) {\r\n console.log(images[-1].src);\r\n }\r\n readyToStart = true;\r\n }\r\n }", "imageSelected() {\n this.props.displayCallback(this.state.imageURL, this.state.parentAlbum, this.state.editHistory);\n }", "function imageClickHandler(e) {\n var wordIndex;\n // get index that was stored in the img object\n wordIndex = e.currentTarget.getAttribute('data-word-index');\n console.log('image click ' + wordIndex);\n // collect the word clicked!\n game.wordsCollected[wordIndex] = true;\n // set a popup based on mouse position\n setPopupContent(wordIndex, e.clientX, e.clientY);\n // show mask\n jQuery('#mask').show();\n // show pop-up\n jQuery('#popup').show();\n // sound\n game.soundInstance = createjs.Sound.play(\"word_\" + wordIndex); // play using id. Could also use full sourcepath or event.src.\n //game.soundInstance.addEventListener(\"complete\", createjs.proxy(this.handleComplete, this));\n //game.soundInstance.volume = 0.5;\n // prevent other events\n e.stopPropagation();\n}", "function simulateclick(){\n\tdocument.getElementById('imagefiles').click();\n}", "function preparedEventHandlers() {\n\n var myImage = document.getElementById(\"mainImage\");\n\n myImage.onclick = function() {\n alert(\"You clicked somewhere on the main image!\");\n }\n \n}", "function onClick(evt) {\n var _this4 = this;\n\n var target = evt.target;\n\n // loop through images\n\n this.images.forEach(function (lazyImage) {\n var lazyProximityTrigger = lazyImage.lazyProximityTrigger,\n image = lazyImage.image,\n onClickCallback = lazyImage.onClickCallback;\n\n\n if (lazyProximityTrigger) {\n\n // match the clicked trigger with a saved trigger\n if (lazyProximityTrigger === target) {\n\n // and load that trigger's lazy element\n _this4.fireLazyEvent(image);\n lazyImage.resolved = true;\n lazyProximityTrigger.removeEventListener('click', onClickCallback);\n }\n }\n });\n}", "function loadImage(){\n console.log(\"Image clicked one\")\n // self.img.path = self.image.src;\n // console.log(\"Image clicked two\");\n }", "function picClickHandler (event) {\n if (userClicks > maxClicks) {\n imagesParent.removeEventListener ('click', picClickHandler);\n setUpList();\n displayChart();\n } else {\n for (var i = 0; i < currentImages.length; i++) {\n productObject[currentImages[i]].timesShown++;\n }\n\n previousImages = currentImages;\n currentImages = [];\n\n var clicked = event.target.getAttribute('id');\n productObject[clicked].timesClicked++;\n\n imagesParent.removeChild(imagesParent.lastChild);\n imagesParent.removeChild(imagesParent.lastChild);\n imagesParent.removeChild(imagesParent.lastChild);\n\n userClicks++;\n setProductState (productObject, currentImages, previousImages, userClicks);\n\n start();\n }\n}", "changeModalPicFromHomepage(clickedPhoto) {\n console.log('Target', event);\n console.log('changing pic', clickedPhoto);\n //set the state of the current photo to the photo that was clicked\n this.setState({\n modalCurrentPhoto: clickedPhoto\n });\n }", "function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }", "function changeImage(){\n\t\t$('#fileImagen').click();\n\t}", "function imgClick(evt){\n\treturn imgDerecha(evt) ? btnnext(evt) : btnback(evt);\n}", "handleClick( event ){ }", "function clickOnImageLink(e)\n{\n\t// http://pit.dirty.ru/dirty/1/2011/04/15/28284-142540-32deef3d70482f072b516ac3a723533d.gif\n\tvar imgPreview = document.createElement('img');\n\timgPreview.setAttribute('src', this.href );\n\tvar imgLink = document.createElement('a');\n\timgLink.setAttribute('href', '#');\n\t_$.addEvent( imgLink, 'click', function(e) { this.previousSibling.setAttribute('style', this.previousSibling.getAttribute('bkpstyle')); this.parentNode.removeChild(this ); e.preventDefault(); return false; });\n\timgLink.appendChild( imgPreview );\n\t_$.insertAfter(this, imgLink);\n\tthis.setAttribute('bkpstyle', this.getAttribute('style'));\n\tthis.setAttribute('style', 'display: none');\n\te.preventDefault();\n\treturn false;\n}", "function actualTakePhoto() {\n $(\"#capture\").click();\n}", "function onClick(e) {\n if (e.target.dataset.source === undefined) {\n return;\n }\n onClickModalOpener();\n imagePlacer(onClickUrl(e));\n if (modalEL.classList.contains(\"is-open\")) {\n window.addEventListener(\"keydown\", onEsc);\n document\n .querySelector(\"div.lightbox__overlay\")\n .addEventListener(\"click\", onCloseClick);\n }\n window.addEventListener(\"keydown\", horizontalSlider);\n}", "function imageClicked(eventData) {\n let clickInformation = eventData;\n if ( clickInformation.target.className = 'image') {\n if (clickInformation.target.alt === \"rock\") {\n let playerSelection = \"rock\";\n rockImage.classList.add('image','playerWeapon');\n outcome = playRound(playerSelection, computerPlay());\n \n if (playerScore != 5 && compScore != 5) {\n whoWon(outcome);\n \n }\n\n } else if (clickInformation.target.alt === \"paper\") {\n let playerSelection = \"paper\";\n paperImage.classList.add('image','playerWeapon');\n outcome = playRound(playerSelection, computerPlay());\n\n if (playerScore != 5 && compScore != 5) {\n whoWon(outcome);\n \n }\n \n } else if (clickInformation.target.alt === \"scissors\") {\n let playerSelection = \"scissors\";\n scissorsImage.classList.add('image','playerWeapon');\n outcome = playRound(playerSelection, computerPlay());\n\n if (playerScore != 5 && compScore != 5) {\n whoWon(outcome);\n \n }\n }\n }\n \n }", "function selectImage(e) {\r\n if(e.target.innerHTML === \"\") //ensures only images can be clicked\r\n removeClasses(e);\r\n\r\n }", "function imgOnclickEvt (img, data) {\n\t\treturn function () {\n\t\t\tshowImage (img, data);\n\t\t}\n\t}", "render () {\n return (\n <div>\n <img src={FacebookLogin} alt=\"Facebook Login\" onClick={this.handler} id=\"btnFacebookImage\"/>\n </div>\n )\n }", "function selectChoice(event){\n console.log(event.target.id);\n var k = event.target.id;\n console.log('yo', event.target);\n imgObjArr[k].numClicks++;\n console.log('hey', imgObjArr[k]);\n console.log('target clicks:', imgObjArr[k].numClicks);\n if (totalClicks < 25) {\n fillImages();\n } else {\n alert('Thank you for participating in our study!');\n save();\n buildTable();\n }\n}", "function clickImage(e){\n if( e.target.id === 'left_goat_img' || e.target.id === 'right_goat_img'){\n pickRandomImages();\n totalClicks++;\n }\n if(event.target.id === 'left_goat_img'){\n leftGoatThatIsOnThePage.likes++;\n }\n if(event.target.id === 'right_goat_img'){\n rightGoatThatIsOnThePage.likes++;\n }\n if(totalClicks === 6){\n //remove event listener\n groupImageSection.removeEventListener('click' , clickImage);\n rightGoatImage.remove();\n leftGoatImage.remove();\n renderChartResults();\n }\n}", "function pickedImg() { //the clicked img will be run every other time\n for ( var k = 0; k < imgShort.length; k +=2 ) {\n };\n function clicky(event) {\n var clicked1 = event.target.id;\n document.getElementById('img_box').addEventListener('click', clicky);\n }\n}", "function imgClick(e) {\n musicInfo = e.target.alt;\n splitInfo = musicInfo.split('_');\n DOMString.getCurrentMusicVideoTitle.textContent = splitInfo[0];\n DOMString.getCurrentMusicVideoArtist.textContent = splitInfo[1];\n DOMString.getCurrentMusicVideo.src = e.target.dataset.src;\n\n DOMString.getCurrentMusicVideoHeading.classList.add('fadeIn');\n setTimeout(() => DOMString.getCurrentMusicVideoHeading.classList.remove('fadeIn'), 500);\n }", "handleJDotterClick() {}", "function imgClick(img) {\n window.event.stopPropagation();\n document.querySelector(`#grey-screen`).classList.toggle(\"hide\");\n document.querySelector(`#zoom-img`).src = img;\n}", "function thumbnailClickHandler(evt) {\n var target = evt.target;\n if (!target || !target.classList.contains('thumbnail'))\n return;\n\n if (currentView === thumbnailListView || currentView === fullscreenView) {\n showFile(parseInt(target.dataset.index));\n }\n else if (currentView === thumbnailSelectView) {\n updateSelection(target);\n }\n else if (currentView === pickView) {\n cropPickedImage(files[parseInt(target.dataset.index)]);\n }\n}", "function img_click(i){\n i.onclick=function(){\n modal.style.display=\"block\";\n modalImg.src=this.src;\n }\n}", "function handleImgClick(e){\n modal.style.display = \"block\";\n console.log(e);\n let image=e.currentTarget.src;\n modalImg.src=image;\n captionText.innerHTML = e.currentTarget.getAttribute(\"alt\");\n}", "function load_click() {\n if ($('random_front_picture') != null) {\n Event.observe('random_front_picture', 'click', function(e) {\n e.stop()\n to = $('random_front_picture').href \n new Ajax.Request(to)\n })\n }\n}", "function choose_img(files_id) { // function choose img upload from file in your folder.\r\n $(\"#\" + files_id).click();\r\n}", "clicked(x, y) {}", "function clickImage(object){\n document.location = page.PRODUCT + '?id=' + object.id;\n}", "function handleImageClick(event) {\n console.log(event.target.alt);\n //iterate through array to check that event has been clicked\n for (var i = 0; i < allProducts.length; i++) {\n if (event.target.alt === allProducts[i].name) {\n allProducts[i].votes++;\n }\n }\n //in order to get a random image which allows new photos to be displayed call randomImage Function\n randomImage();\n}", "function uploadAvatar(){\n\t$('#avatarPhoto').click();\n}", "putImage(button){\n if(button.code == -1){//al ser clickeada la locación, se enrutará a la página de locaciones y su subbsección respectiva\n switch(this.easyFrame){\n case 0:\n window.location.href = \"location.html#cove\";\n return;\n case 1:\n window.location.href = \"location.html#darkest-dungeon\";\n return;\n case 2:\n window.location.href = \"location.html#ruins\";\n return;\n case 3:\n window.location.href = \"location.html#warrens\";\n return;\n case 4:\n window.location.href = \"location.html#weald\";\n return;\n case 5:\n window.location.href = \"location.html#courtyard\";\n return;\n case 6:\n window.location.href = \"location.html#farmstead\";\n return;\n default:\n return;\n }\n\n }\n //en caso que se clickee un botón, se ajusta el frame de la locación y se vuelve visible, además se le agrega su interactividad\n this.areaPicture.setFrame(button.code);\n this.easyFrame = button.code;\n this.areaPicture.setVisible(true);\n this.areaPicture.setInteractive();\n this.areaPicture.on('clicked', this.putImage, this);\n }", "function choiceClick(counter) {\n $('#picture .slick-next').trigger('click');\n $('.img-overlay').find('.click-overlay').parent().next().find('.overlay').addClass('click-overlay');\n $('#picture-array .slick-next').trigger('click');\n $('.image_number').html(counter + 1 + ' of 46');\n}", "_onClick({x,y,object}) {\n console.log(\"Clicked icon:\",object);\n }", "function on_click(e) {\n cloud.on_click(e.clientX, e.clientY);\n}", "function onImageClick(imageId) {\n setMemeImgId(imageId)\n drawImgFromlocal(imageId);\n setTimeout(function () {\n document.querySelector('.header2').style.display = 'none';\n document.querySelector('main').style.display = 'none';\n document.querySelector('.my-info').style.display = 'none';\n document.querySelector('.canvas-btn-container').style.display = 'flex';\n resizeCanvas();\n }, 10)\n}", "function handleClick(event)\n{\n}", "function clickHandler(theEvent) {\n//outerHTML repalces the whole html including the tags\n var theImage = theEvent.target.outerHTML;\n //changing the class of image_show from display_none to display_img\n imgDiv.className = \"display_img\";\n //changing the html in the image_show by inserting the html from the thumbnail\n imgDiv.innerHTML = theImage;\n}", "function handlePlanImage(id) {\n alert(id);\n }", "function selectImage(event) {\n\n const button = event.currentTarget\n const buttons = document.querySelectorAll('.images button')\n\n buttons.forEach((button) => {\n button.classList.remove('active')\n })\n //adicionar a classe active para o botão clicado\n button.classList.add('active')\n\n\n //selecionara a imagem clicada\n const image = button.children[0]\n const imageContainer = document.querySelector('.orphanage-details > img')\n //atualizar o container de imagem\n imageContainer.src = image.src\n\n}", "handleArrowClick(e) {\n e.preventDefault();\n this.changeMainImage(e.target.name);\n }", "function selectAvatar1(event)\n{\n selectAvatar(event, 1);\n}", "function canvasClick(e) {\n\tblockus.mouseClicked();\n}", "function exeOpenImage(e){ openImage(e.target) }", "onClick(event) {\n\t\t// console.log(\"mouse click\");\n\t\tthis.draw(event);\n\t}", "handleClick() {}", "function imgEvent(){\n alert('This is Void Link');\n}", "function setupEventListenersToBigImg() {\n bigImg.addEventListener('click', addClick);\n}", "function conduitEventClick(event) {\n var command = this.getMouseEventCommand( event );\n switch( command ) {\n case \"cancel\":\n this.close();\n break;\n case \"searchConduit\":\n this.searchConduit();\n break;\n case \"insertFromConduit\": \n var ids = this.list.getSelectedIDs();\n if( ids.length ) {\n // Actually, we only handle a single photo at a time\n // at this time.\n for (var i = 0; i < ids.length; i++) {\n var asset = {\n name: names[ids[i]],\n // TODO: bells & whistles for the IMG tag?\n body: \"<img src=\\\"\" + ids[i].replace(/-th./, \"-vi.\") + \"\\\">\"\n };\n app.c.createAssetFromEmbed( {\n asset: asset,\n callback: this._gIM( \"handleCreate\" )\n } );\n }\n }\n break;\n }\n}", "render() {\n return (\n <img className=\"img-fluid friend\" \n src={this.props.src} \n alt={this.props.alt}\n onClick={() => {this.props.handleClick(this.props.id)} }\n />\n )\n }", "function mouseClick(event) {\n const id = event.target.id;\n\n // Check if click was made on the background\n if (id === \"background\")\n return;\n\n // Update selector if it wasn't over the clicked card \n // (mixed controls behaviour bug)\n if (mouseOver !== selectorOver)\n updateSelector(mouseOver);\n\n pickCard();\n}", "function func(e) {\r\n // console.log(e.target.parentNode.getAttribute('class'));\r\n var p = e.target\r\n while (p.className !== \"music_image\") {\r\n p = p.parentNode\r\n }\r\n // var change = p.querySelector('img').src;\r\n\r\n changePreview(p.id);\r\n }", "function mediaClick(e, data) {\n page = 0;\n $('#imgs').load('/admin/mediaSelector', addImgClickHandler);\n\n $(data.popup).children(\"#next\").click(function(e) {\n $('#imgs').load('/admin/mediaSelector?page=' + ++page, addImgClickHandler);\n });\n\n // Wire up the submit button click event\n $(data.popup).children(\"#submit\")\n .unbind(\"click\")\n .bind(\"click\", function(e) {\n // Get the editor\n var editor = data.editor;\n\n // Get the full url of the image clicked\n var fullUrl = $(data.popup).find(\"#imgToInsert\").val();\n\n // Insert the img tag into the document\n var html = \"<img src='\" + fullUrl + \"'>\";\n editor.execCommand(data.command, html, null, data.button);\n\n // Hide the popup and set focus back to the editor\n editor.hidePopups();\n editor.focus();\n });\n }", "function handleClick(event) {\n var clickedPictures = event.target.alt;\n // var clickdDiv = event.target.id;\n if (clickedPictures) {\n clicked++;\n\n for (var i = 0; i < allPictures.length; i++) {\n if (clickedPictures === allPictures[i].name) {\n allPictures[i].votes++;\n }\n }\n // renderPictures(); // gives us the images after each click!!\n renderPictures();\n\n if (clicked === totalClickedAllowed) {\n\n pictureContener.removeEventListener('click', handleClick);\n\n renderMyChart();\n renderResults();\n\n // lab 13 save data begins\n\n var stringifiedResults = JSON.stringify(allPictures); // \"packs data away\" to be stored, we convert to JSON\n localStorage.setItem('pictureResults', stringifiedResults); // store the data - \"put the box on the shelf\"\n // lab 13 save data ends\n }\n } else {\n alert('please clicked picture ');\n }\n}", "function getClickHandler() {\n return function(info, tab) {\n\n // The srcUrl property is only available for image elements.\n var url = info.srcUrl;\n\n alert( url );\n };\n}", "function bindClickOnThumbnails(){\n $(\".changedCP\").on('click',function(){\n var pId = this.id;\n closeOverlay();\n closeChangeCoverCatMenu();\n saveSelectedImage(pId);\n removePreviousCatCss();\n });\n}", "function addThumbClickHandler(thumb) {\r\n 'use strict';\r\n thumb.addEventListener('click', function (event) {\r\n event.preventDefault();\r\n setDetailsFromThumb(thumb);\r\n\r\n // 7.1.4 - Showing the detail image again\r\n showDetails();\r\n });\r\n}", "handlePress(i) {\n\t\tif (i == 1) {\n\t\t\tthis.gotoPhoto();\n\t\t} else if (i == 2) {\n\t\t\tthis.gotoGallery();\n\t\t}\n\t}", "selectImage(imgSrc) {\n const {onImageSelected} = this.props;\n if (typeof onImageSelected === \"function\") {\n onImageSelected(imgSrc);\n }\n }", "function genericOnClick(info, tab, callback) {\n // Get url of image\n let srcUrl = info.srcUrl;\n console.log(srcUrl);\n\n // Google cloud vision api request body\n let body = {\n \"requests\": [\n {\n \"image\": {\n \"source\": {\n \"imageUri\": srcUrl\n }\n },\n \"features\": [\n {\n \"type\": \"LANDMARK_DETECTION\",\n \"maxResults\": 1\n }\n ]\n }\n ]\n }\n\n // Call Google cloud vision api on image for landmark detection\n fetch(API_URL + API_KEY, {\n method: 'post',\n body: JSON.stringify(body)\n }).then(function(response) {\n return response.json();\n }).then(function(response) {\n // strip landmark from response\n let location = response.responses[0].landmarkAnnotations[0].description;\n\n callback(location);\n })\n .catch((error) => {\n // let user know if could not determine landmark\n alert('Sorry, we could not figure out where this image was taken :(');\n });\n}", "function firstImgPastaClicked() {\n console.log(\"view recipe \");\n imageNum = 0;\n passMealId(imageNum);\n}", "click() {\n this.get('modal').showModal(this.get('photoFullUrl'));\n }", "function superbgimage_click(img) {\n\t\t\t\t\t\t$fullsize.nextSlide();\n\t\t\t\t\t\t$fullsizetimer.startTimer( 7000 );\n\t\t\t\t\t}", "function clickHandler(event){\n\t\t\tif(ignoreClick){\n\t\t\t\tignoreClick = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar offset = overlay.cumulativeOffset();\t\t\t\n\t\t\ttarget.fire('flotr:click', [{\n\t\t\t\tx: xaxis.min + (event.pageX - offset.left - plotOffset.left) / hozScale,\n\t\t\t\ty: yaxis.max - (event.pageY - offset.top - plotOffset.top) / vertScale\n\t\t\t}]);\n\t\t}", "handlePress(i) {\n if (i == 1) {\n this.gotoPhoto();\n } else if (i == 2) {\n this.gotoGallery();\n }\n }" ]
[ "0.793244", "0.7913272", "0.75001377", "0.72610736", "0.721918", "0.7161421", "0.71362853", "0.7103456", "0.7090242", "0.70852727", "0.70203173", "0.70005375", "0.6998707", "0.6914208", "0.69108677", "0.6900724", "0.6889584", "0.6857063", "0.68258864", "0.68070686", "0.680617", "0.6804444", "0.67902803", "0.6771649", "0.6767206", "0.6744571", "0.67265475", "0.66947025", "0.6666386", "0.6619777", "0.6583921", "0.6579494", "0.65726095", "0.65481764", "0.65460896", "0.6545399", "0.6538918", "0.6527891", "0.65266705", "0.6515239", "0.6506214", "0.64951426", "0.64866126", "0.64859486", "0.64675164", "0.64639205", "0.6430204", "0.6425853", "0.6423818", "0.64160573", "0.6412918", "0.64090186", "0.6407814", "0.6406657", "0.63945633", "0.6387182", "0.638589", "0.6377641", "0.63693595", "0.63538444", "0.634797", "0.63397104", "0.6336709", "0.63341415", "0.6323704", "0.63152874", "0.630035", "0.62993306", "0.6297846", "0.6292363", "0.6276482", "0.62634355", "0.6251904", "0.624599", "0.6238629", "0.623367", "0.6230152", "0.6214455", "0.6195432", "0.6190667", "0.6175799", "0.6175051", "0.6172225", "0.6169212", "0.61583227", "0.6154797", "0.61495316", "0.61490804", "0.6144586", "0.6140406", "0.61400604", "0.6137892", "0.61361504", "0.61258847", "0.6120286", "0.6119872", "0.61156636", "0.611211", "0.60905135", "0.6090047", "0.60857326" ]
0.0
-1
Function to Draw Chart
function drawChart() { var ctx = canvas.getContext('2d'); var myBarChart = new Chart(ctx, { type: 'bar', data: data, // options: { // responsive: false // } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_drawChart()\n {\n\n }", "function drawChart() {\n stroke(0);\n yAxis();\n xAxis();\n}", "function drawChart(arr) {\n drawSleepChart(arr);\n drawStepsChart(arr);\n drawCalorieChart(arr);\n drawHeartRateChart(arr);\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'X');\n data.addColumn('number', 'Price');\n \n data.addRows(graphData)\n\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n chart.draw(data, fullWidthOptions);\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(rendergrafica);\n\n // Set chart options\n var options = {\n 'title': 'Cantidad de laboratorios por categoria',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function drawCharts() {\n\tdrawRecommendedInvestmentChart();\n}", "function drawChart() {\r\n drawSentimentBreakdown();\r\n drawSentimentTimeline();\r\n drawPopularityTimeline();\r\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(render);\n\n // Set chart options\n var options = {\n 'title': 'Cantidad de laboratorios por sede',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(rendergrafica);\n\n // Set chart options\n var options = {\n 'title': 'cantidad de pruebas por laboratorio',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function drawChart() {\n\n\t\t// Get the dataGraphic array form PHP\n\t\tvar dataOptionsGraphic = JSON.parse(jsonDataGraphic);\n\n\t\tfor (col in dataOptionsGraphic) {\n\t\t\tdataOptionsGraphic[col][5] = strTooltipStart + dataOptionsGraphic[col][1] + strTooltipEnd;\n\t\t}\n\n\t\t// Header of the data Graphic\n\t\tvar headDataGraphic = [M.util.get_string('choice', 'evoting'), M.util.get_string('countvote', 'evoting'), {\n\t\t\ttype: 'string',\n\t\t\trole: 'style'\n\t\t}, {\n\t\t\ttype: 'string',\n\t\t\trole: 'annotation'\n\t\t}, 'id', {\n\t\t\t'type': 'string',\n\t\t\t'role': 'tooltip',\n\t\t\t'p': {\n\t\t\t\t'html': true\n\t\t\t}\n\t\t}, {\n\t\t\ttype: 'string'\n\t\t}];\n\t\t// Create the complete data of the Graphic by integrated header data\n\t\tdataOptionsGraphic.splice(0, 0, headDataGraphic);\n\t\toptionsGraph = {\n\t\t\ttitle: \"\",\n\t\t\tallowHtml: true,\n\t\t\theight: 450,\n\t\t\tlegend: {\n\t\t\t\tposition: 'none'\n\t\t\t},\n\t\t\tanimation: {\n\t\t\t\tduration: 500,\n\t\t\t\teasing: 'out'\n\t\t\t},\n\n\t\t\tvAxis: {\n\t\t\t\tgridlines: {\n\t\t\t\t\tcolor: '#000000'\n\t\t\t\t},\n\t\t\t\ttextPosition: 'out',\n\t\t\t\ttextStyle: {\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tfontName: 'Oswald, Times-Roman',\n\t\t\t\t\tbold: true,\n\t\t\t\t\titalic: false\n\t\t\t\t}\n\n\t\t\t},\n\t\t\thAxis: {\n\t\t\t\ttitle: M.util.get_string('totalvote', 'evoting') + \" : \" + sumVote,\n\t\t\t\tminValue: \"0\",\n\t\t\t\tmaxValue: max,\n\t\t\t\tgridlines: {\n\t\t\t\t\tcolor: '#e6e6e6'\n\t\t\t\t},\n\t\t\t\ttextStyle: {\n\t\t\t\t\tcolor: '#e6e6e6'\n\t\t\t\t},\n\t\t\t\ttitleTextStyle: {\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tfontName: 'Oswald, Times-Roman',\n\t\t\t\t\tbold: false,\n\t\t\t\t\titalic: false\n\t\t\t\t}\n\t\t\t},\n\t\t\tbaselineColor: '#007cb7',\n\t\t\ttooltip: {\n\t\t\t\tisHtml: true\n\t\t\t},\n\n\t\t\tannotations: {\n\t\t\t\ttextStyle: {\n\t\t\t\t\tfontName: 'Oswald,Helvetica,Arial,sans-serif',\n\t\t\t\t\tbold: false,\n\t\t\t\t\titalic: false,\n\t\t\t\t\tcolor: '#007cb7',\n\t\t\t\t\tauraColor: 'rgba(255,255,255,0)',\n\t\t\t\t\topacity: 1,\n\t\t\t\t\tx: 20\n\t\t\t\t},\n\t\t\t\talwaysOutside: false,\n\t\t\t\thighContrast: true,\n\t\t\t\tstemColor: '#000000'\n\t\t\t},\n\t\t\tbackgroundColor: '#f6f6f6',\n\t\t\tchartArea: {\n\t\t\t\tleft: '5%',\n\t\t\t\ttop: '5%',\n\t\t\t\theight: '75%',\n\t\t\t\twidth: '100%'\n\t\t\t}\n\t\t};\n\n\t\tdataGraph = google.visualization.arrayToDataTable(dataOptionsGraphic);\n\t\tdataGraph.setColumnProperty(0, {\n\t\t\tallowHtml: true\n\t\t});\n\t\tviewGraph = new google.visualization.DataView(dataGraph);\n\t\tviewGraph.setColumns([0, 1, 2, 3, 5]);\n\n\t\t// Create and draw the visualization.\n\t\tchart = new google.visualization.BarChart(document.getElementById('chartContainer'));\n\t\t$(\".answerCount\").each(function () {\n\t\t\tidOption = $(this).prop('id');\n\t\t});\n\t\tupdateOptionGraphicMax();\n\n\t\tmanageGoodAnswer();\n\t}", "function drawCharts() {\n drawPieChart()\n drawAxisTickColors()\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Acertos', acertos],\n ['Erros', erros]\n ]);\n\n // Set chart options\n var options = {'width':800,\n 'height':600,\n 'backgroundColor': 'none',\n 'fontSize': 15,\n 'is3D':true};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawCharts() {\n /*TOD0: Implement function;\n Un dato interesante del Webstorm es que al escribir tod0\n o TOD0 y vamos a TOD0 (6, parte de abajo) sale que en\n nuestro proyecto tenemos un TOD0 y automaticamente al\n darle click nos reidirecciona a donde se encuentra\n dicho TOD0. Es una manera de hacer una pausa en lo que\n estamos implementado y cuando regresamos al trabajo de\n frente nos ubicamos en la zona donde estabamos trabajando\n o donde queremos trabajar. Recordar que el TOD0 significa\n \"to do\" (por hacer).\n\n Este metodo (drawCharts) al invocar estas 2 metodos hara que se\n dibujen los 2 graficos. Este metodo drawCharts sera invocado en\n el main.js\n */\n drawPieChart()\n drawAxisTickColors()\n}", "drawChart () {\r\n\t\t\r\n\t\t// Converts color range value (eg. 'red', 'blue') into the appropriate color array\r\n\t\tthis.colorRange = this.convertColorRange(this.colorRange);\r\n\r\n\t\t// Set width and height of graph based on size of bounding element and margins\r\n\t\tvar width = document.getElementById(this.elementName).offsetWidth - this.marginLeft - this.marginRight;\r\n\t\tvar height = document.getElementById(this.elementName).offsetHeight - this.marginTop - this.marginBottom;\r\n\r\n\t\t// Create axis, streams etc.\t\t\r\n\t\tvar x = d3.time.scale()\r\n\t\t\t.range([0, width]);\r\n\r\n\t\tvar y = d3.scale.linear()\r\n\t\t\t.range([height - 10, 0]);\r\n\r\n\t\tvar z = d3.scale.ordinal()\r\n\t\t\t.range(this.colorRange);\r\n\r\n\t\tvar xAxis = d3.svg.axis()\r\n\t\t\t.scale(x)\r\n\t\t\t.orient('bottom')\r\n\t\t\t.ticks(d3.time.years);\r\n\r\n\t\tvar yAxis = d3.svg.axis()\r\n\t\t\t.scale(y);\r\n\r\n\t\tvar stack = d3.layout.stack()\r\n\t\t\t.offset('silhouette')\r\n\t\t\t.values(function (d) { return d.values; })\r\n\t\t\t.x(function (d) { return d.date; })\r\n\t\t\t.y(function (d) { return d.value; });\r\n\r\n\t\tvar nest = d3.nest()\r\n\t\t\t.key(function (d) { return d.key; });\r\n\r\n\t\tvar area = d3.svg.area()\r\n\t\t\t.interpolate('cardinal')\r\n\t\t\t.x(function (d) { return x(d.date); })\r\n\t\t\t.y0(function (d) { return y(d.y0); })\r\n\t\t\t.y1(function (d) { return y(d.y0 + d.y); });\r\n\t\r\n\t\t// Create SVG area of an appropriate size\r\n\t\tvar svg = d3.select(this.element).append('svg')\r\n\t\t\t.attr('width', width + this.marginLeft + this.marginRight)\r\n\t\t\t.attr('height', height + this.marginTop + this.marginBottom)\r\n\t\t\t.append('g')\r\n\t\t\t.attr('transform', 'translate(' + this.marginLeft + ',' + this.marginTop + ')');\r\n\r\n\t\t// Read CSV file\r\n\t\td3.csv(this.csvfile, function (data) {\r\n\t\t\tvar format = d3.time.format('%Y-%m-%d');\r\n\t\t\tdata.forEach(function (d) {\r\n\t\t\t\td.date = format.parse(d.date);\r\n\t\t\t\td.value = +d.value;\r\n\t\t\t});\r\n\r\n\t\t\tvar layers = stack(nest.entries(data));\r\n\r\n\t\t\tx.domain(d3.extent(data, function (d) { return d.date; }));\r\n\t\t\ty.domain([0, d3.max(data, function (d) { return d.y0 + d.y; })]);\r\n\r\n\t\t\t// Apply data to graph\r\n\t\t\tsvg.selectAll('.layer')\r\n\t\t\t\t.data(layers)\r\n\t\t\t\t.enter().append('path')\r\n\t\t\t\t.attr('class', 'layer')\r\n\t\t\t\t.attr('d', function (d) { return area(d.values); })\r\n\t\t\t\t.style('fill', function (d, i) { return z(i); });\r\n\r\n\t\t\t// Add a black outline to streams\r\n\t\t\tsvg.selectAll('.layer')\r\n\t\t\t\t.attr('stroke', 'black')\r\n\t\t\t\t.attr('stroke-width', '0.5px');\r\n\r\n\t\t\tsvg.append('g')\r\n\t\t\t\t.attr('class', 'x axis')\r\n\t\t\t\t.attr('transform', 'translate(0,' + height + ')')\r\n\t\t\t\t.call(xAxis);\r\n\r\n\t\t\tsvg.append('g')\r\n\t\t\t\t.attr('class', 'y axis')\r\n\t\t\t\t.attr('transform', 'translate(' + width + ', 0)')\r\n\t\t\t\t.call(yAxis.orient('right'));\r\n\r\n\t\t\tsvg.append('g')\r\n\t\t\t\t.attr('class', 'y axis')\r\n\t\t\t\t.call(yAxis.orient('left'));\r\n\r\n\t\t\t// Other streams fade when one stream is hovered over with the cursor\r\n\t\t\tsvg.selectAll('.layer')\r\n\t\t\t\t.attr('opacity', 1)\r\n\t\t\t\t.on('mouseover', function (d, i) {\r\n\t\t\t\t\tsvg.selectAll('.layer').transition()\r\n\t\t\t\t\t\t.duration(250)\r\n\t\t\t\t\t\t.attr('opacity', function (d, j) {\r\n\t\t\t\t\t\t\treturn j !== i ? 0.2 : 1;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t})\r\n\r\n\t\t\t\t// Move the label which appears next to the cursor.\r\n\t\t\t\t.on('mousemove', function (d, i) {\r\n\t\t\t\t\tvar mousePos = d3.mouse(this);\r\n\t\t\t\t\tvar mouseX = mousePos[0];\r\n\t\t\t\t\tvar mouseY = mousePos[1];\r\n\t\t\t\t\tvar mouseElem = document.getElementById('besideMouse');\r\n\t\t\t\t\tdocument.getElementById('besideMouse').style.left = mouseX + 50 + 'px';\r\n\t\t\t\t\tmouseElem.style.top = mouseY - 10 + 'px';\r\n\t\t\t\t\tmouseElem.innerHTML = d.key;\r\n\t\t\t\t})\r\n\t\t\t\r\n\t\t\t\t// Set opacity back to 1 when the cursor is no longer hovering over a stream.\r\n\t\t\t\t.on('mouseout', function (d, i) {\r\n\t\t\t\t\tsvg.selectAll('.layer')\r\n\t\t\t\t\t\t.transition()\r\n\t\t\t\t\t\t.duration(250)\r\n\t\t\t\t\t\t.attr('opacity', '1');\r\n\t\t\t\t\tdocument.getElementById('besideMouse').innerHTML = '';\r\n\t\t\t\t});\r\n\t\t});\r\n\t}", "function draw() {\n\t\t\tdrawGrid();\n\t\t\tdrawLabels();\n\t\t\tfor(var i = 0; i < series.length; i++){\n\t\t\t\tdrawSeries(series[i]);\n\t\t\t}\n\t\t}", "function drawChart() {\n\n // Create our data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ]);\n\n\n\t\t\t// Instantiate and draw our chart, passing in some options.\n\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n\t\t\tchart.draw(data, null);\n\t\t\t}", "function drawChart() {\r\n\r\n // Create our data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Task');\r\n data.addColumn('number', 'Hours per Day');\r\n data.addRows([\r\n ['Work', 11],\r\n ['Eat', 2],\r\n ['Commute', 2],\r\n ['Watch TV', 2],\r\n ['Sleep', 7]\r\n ]);\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\r\n chart.draw(data, {width: 400, height: 240, is3D: true, title: 'My Daily Activities'});\r\n }", "function drawChart() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(Object.entries(ar_chart));\n\n // Set chart options\n var options = {'title':'Percentage of file size',\n 'width':500,\n 'height':200};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function draw() {\n const data = getData();\n const svg = d3.select('body').append('svg');\n const plot = getPlotArea();\n const paddingGroup = chartUtils.setupSvgAndPaddingGroup(svg, plot);\n const scales = makeScales(data, plot);\n defineDashedLine(svg);\n appendYAxisDashedLines(paddingGroup, scales, plot);\n appendXAxis(paddingGroup, scales, plot);\n appendYAxis(paddingGroup, scales);\n appendBars(paddingGroup, data, scales, plot);\n appendScoreToday(paddingGroup, data, scales);\n appendScoreLastYear(paddingGroup, data, scales);\n appendChartTitle(svg, plot);\n appendYAxisTitle(svg, plot);\n appendFootnote(svg, plot);\n }", "function DrawCtrChart()\n{\n // create/delete rows \n if (ctrTable.getNumberOfRows() < contDataPoints.length)\n { \n var numRows = contDataPoints.length - ctrTable.getNumberOfRows();\n ctrTable.addRows(numRows);\n } else {\n for(var i=(ctrTable.getNumberOfRows()-1); i > contDataPoints.length; i--)\n {\n ctrTable.removeRow(i); \n }\n }\n\n // Populate data table with time/cost data points. \n for(var i=0; i < ctrTable.getNumberOfRows(); i++)\n {\n ctrTable.setCell(i, 0, new Date(parseInt(contDataPoints[i].timestamp)));\n ctrTable.setCell(i, 1, (parseInt(contDataPoints[i].clicks)/parseInt(contDataPoints[i].impressions))*100);\n }\n\n // Draw line chart.\n chartOptions.title = 'Ctr Chart';\n ctrChart.draw(ctrView, chartOptions); \n}", "function drawChart() {\n\n // Create the data table.\n var data = google.visualization.arrayToDataTable([\n ['Test Name', 'Passed', 'Failed', 'Skipped']\n ].concat(values));\n\n var options = {\n title: 'Last ' + values.length + ' Test Runs',\n legend: { position: 'bottom' },\n colors: ['green', 'red', 'yellow'],\n backgroundColor: bgColor,\n isStacked: true\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.SteppedAreaChart(document.getElementById('historyChart'));\n chart.draw(data, options);\n \n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Task');\n data.addColumn('number', '% of Time');\n data.addRows([\n ['Setup EEG', 30],\n ['Review EEG', 30],\n ['Troubleshoot Computer', 10],\n ['CME', 10],\n ['Other', 20]\n ]);\n\n // Set chart options\n var options = {'title':'Breakdown of Time at Work',\n 'width':300,\n 'height':300,\n is3D:true,\n 'backgroundColor': {fill:'transparent'}\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('work-chart'));\n chart.draw(data, options);\n }", "function drawChart() {\n // define chart to be drawn using DataTable object\n const data = new google.visualization.DataTable();\n\n // add date & time column\n data.addColumn(\"string\", \"Date & Time\");\n\n // add other category columns such as co2\n columns.forEach(column => {\n // find full text in relevent option for the current column\n const fullColumnName = $(`#cmbCategories option[value='${column}']`).text();\n data.addColumn(\"number\", fullColumnName);\n });\n\n // add rows created beforehand\n data.addRows(rows);\n\n // chart options\n const options = {\n hAxis: {\n title: \"Date & Time\"\n },\n vAxis: {\n title: \"Values\"\n },\n width: \"100%\",\n height: 700,\n };\n\n // instantiate and draw the chart\n const chart = new google.visualization.LineChart(document.getElementById(\"outputChart\"));\n\n // after chart is completely loaded and rendered\n google.visualization.events.addListener(chart, \"ready\", function () {\n // enable view chart button\n $(\"#btnViewChart\").attr(\"disabled\", false);\n\n // hide loading spinner\n $(\"#imgLoading\").hide();\n });\n\n chart.draw(data, options);\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'Ordua');\n data.addColumn('number', 'Barruko tenperatura');\n data.addColumn('number', 'Kanpoko tenperatura');\n\n data.addRows([\n [10, 14, 6],\n [11, 17, 7],\n [12, 18, 7],\n [13, 20, 8],\n [14, 21, 8],\n [15, 21, 8],\n [16, 21, 9],\n [17, 21, 9],\n [18, 19, 8],\n [19, 18, 7],\n [20, 17, 6],\n\n\n ]);\n\n // Set chart options\n var options = {\n chart: {\n title: 'Etxeko tenperatura',\n subtitle: 'Gradu zentigradutan'\n },\n width: 900,\n height: 300\n };\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.charts.Line(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "draw() {\n const selector = this.selector;\n let gradient;\n if (this.angles.length !== 1) {\n gradient = this.angles.reduce(\n (acc, curr, index) =>\n acc +\n `${this.getColor(index)} ${curr}deg, ${this.getColor(\n index + 1\n )} ${curr}deg, `,\n ''\n );\n let tempGradient = gradient.split(', ');\n tempGradient = tempGradient.slice(0, tempGradient.length - 2);\n gradient = tempGradient.join(', ');\n }\n else {\n gradient = `${this.getColor(0)} 0deg, ${this.getColor(0)} 360deg`;\n }\n\n const chart = document.createElement('DIV');\n const title = document.createElement('H2');\n const chartGraph = document.createElement('DIV');\n const chartData = document.createElement('DIV');\n const chartPercents = document.createElement('P');\n\n chart.setAttribute('class', 'chart');\n title.setAttribute('class', 'chart__title');\n title.textContent = this.title;\n chartGraph.setAttribute('class', `chart__graph chart__${this.chartType}`);\n chartGraph.style.backgroundImage = `conic-gradient(${gradient})`;\n chartData.setAttribute('class', 'chart__data');\n chartPercents.setAttribute('class', 'chart__percents');\n\n this.percents.forEach((percent, index) => {\n const chartPercent = document.createElement('SPAN');\n const chartPiece = document.createElement('I');\n chartPercent.textContent = `${percent}%`;\n chartPercent.setAttribute('class', 'chart__percent');\n chartPiece.setAttribute('class', 'chart__piece');\n chartPiece.style.backgroundColor = this.getColor(index);\n chartPercent.appendChild(chartPiece);\n chartPercents.appendChild(chartPercent);\n });\n chartData.appendChild(chartPercents);\n\n this.data.forEach((data, index) => {\n const chartDataRow = document.createElement('P');\n const chartDataName = document.createElement('SPAN');\n const chartDataValue = document.createElement('SPAN');\n const chartPiece = document.createElement('I');\n chartDataRow.setAttribute('class', 'chart__dataRow');\n chartDataName.setAttribute('class', 'chart__dataName');\n chartDataValue.setAttribute('class', 'chart__dataValue');\n chartDataName.textContent = Object.keys(data)[0];\n chartDataValue.textContent = Object.values(data)[0];\n chartPiece.setAttribute('class', 'chart__piece');\n chartPiece.style.backgroundColor = this.getColor(index);\n chartDataValue.appendChild(chartPiece);\n chartDataRow.appendChild(chartDataName);\n chartDataRow.appendChild(chartDataValue);\n chartData.appendChild(chartDataRow);\n });\n\n chart.appendChild(title);\n chart.appendChild(chartGraph);\n chart.appendChild(chartData);\n chart.dataset.chartId = this.id;\n\n const existId = document.querySelector(`[data-chart-id=\"${this.id}\"]`);\n if(existId){\n existId.parentNode.replaceChild(chart, existId);\n }\n else\n { \n document.querySelector(selector).appendChild(chart);\n }\n }", "function drawChart() \n {\n\n // Create our data table.\n var data = new google.visualization.DataTable();\n\n \t // Create and populate the data table.\n \t var yearData = google.visualization.arrayToDataTable(yearRowData);\n \t var yearTotalsData = google.visualization.arrayToDataTable(yearTotalsRowData);\n \t var monthData = google.visualization.arrayToDataTable(monthRowData);\n \t var monthTotalsData = google.visualization.arrayToDataTable(monthTotalsRowData);\n \t var weekData = google.visualization.arrayToDataTable(weekRowData);\n \t var weekTotalsData = google.visualization.arrayToDataTable(weekTotalsRowData);\n \t var dayData = google.visualization.arrayToDataTable(dayRowData);\n \t var dayTotalsData = google.visualization.arrayToDataTable(dayTotalsRowData);\n \n // Instantiate and draw our chart, passing in some options.\n \t var chartAreaSize = {width:\"90%\",height:\"80%\"};\n \t var dayChartAreaSize = {width:\"80%\",height:\"80%\"};\n \t var chartHeight = 300;\n \t var chartWidth = 710;\n \t var pieWidth = 370;\n \t var dayWidth = 400;\n \t var fontPxSize = 14;\n \t \n \t \n // day charts\n if(dayDataExist)\n {\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('dayPieChart'));\n\t pieChart.draw(dayTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('dayPieChart'));\n\t pieChart.draw(dayTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('dayStackChart'));\n\t \t columnChart.draw(dayData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('dayStackChart'));\n\t \t columnChart.draw(dayData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('dayBarChart'));\n\t \t columnChart.draw(dayData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('dayBarChart'));\n\t \t columnChart.draw(dayData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:dayWidth, height:chartHeight, legend:'none', chartArea: dayChartAreaSize, fontSize:fontPxSize });\n\t }\n }\n else\n {\n \t $('#dayPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 1 });\n \t $('#dayStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 1 });\n \t $('#dayBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 1 });\n }\n \n if(weekDataExist)\n {\n\t // weekCharts\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('weekPieChart'));\n\t pieChart.draw(weekTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('weekPieChart'));\n\t pieChart.draw(weekTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('weekStackChart'));\n\t \t columnChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('weekStackChart'));\n\t \t columnChart.draw(weekData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('weekBarChart'));\n\t \t columnChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('weekBarChart'));\n\t \t columnChart.draw(weekData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(weekRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('weekLineChart'));\n\t\t lineChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('weekLineChart'));\n\t\t lineChart.draw(weekData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('weekAreaChart'));\n\t\t \t areaChart.draw(weekData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('weekAreaChart'));\n\t\t \t areaChart.draw(weekData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t } \n\t }\n\t else\n\t {\n\t \t //$(\"#weekLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t //$(\"#weekAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $('#weekLineChartTab').hide();\n\t \t $( '#lineCharts' ).tabs({ selected: 1 });\n\t \t $('#weekAreaChartTab').hide();\n\t \t $( '#areaCharts' ).tabs({ selected: 1 });\n\t }\n }\n else\n {\n \t $('#weekPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 2 });\n \t $('#weekStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 2 });\n \t $('#weekBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 2 });\n \t $('#weekLineChartTab').hide();\n \t $( '#lineCharts' ).tabs({ selected: 1 });\n \t $('#weekAreaChartTab').hide();\n \t $( '#areaCharts' ).tabs({ selected: 1 });\n }\n \n if(monthDataExist)\n {\n\t // month charts\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('monthPieChart'));\n\t pieChart.draw(monthTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('monthPieChart'));\n\t pieChart.draw(monthTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('monthStackChart'));\n\t \t columnChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('monthStackChart'));\n\t \t columnChart.draw(monthData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('monthBarChart'));\n\t \t columnChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('monthBarChart'));\n\t \t columnChart.draw(monthData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(monthRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('monthLineChart'));\n\t\t lineChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('monthLineChart'));\n\t\t lineChart.draw(monthData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('monthAreaChart'));\n\t\t \t areaChart.draw(monthData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('monthAreaChart'));\n\t\t \t areaChart.draw(monthData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t }\n\t else\n\t {\n\t \t //$(\"#monthLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t //$(\"#monthAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $('#monthLineChartTab').hide();\n\t \t $( '#lineCharts' ).tabs({ selected: 2 });\n\t \t $('#monthAreaChartTab').hide();\n\t \t $( '#areaCharts' ).tabs({ selected: 2 });\n\t }\n }\n else\n {\n \t $('#monthPieChartTab').hide();\n \t $( '#pieCharts' ).tabs({ selected: 3 });\n \t $('#monthStackChartTab').hide();\n \t $( '#stackCharts' ).tabs({ selected: 3 });\n \t $('#monthBarChartTab').hide();\n \t $( '#barCharts' ).tabs({ selected: 3 });\n \t $('#monthLineChartTab').hide();\n \t $( '#lineCharts' ).tabs({ selected: 2 });\n \t $('#monthAreaChartTab').hide();\n \t $( '#areaCharts' ).tabs({ selected: 2 });\n }\n \n if(yearDataExist)\n {\n\t if(useNormalCharts)\n\t {\n\t \t var pieChart = new google.visualization.PieChart(document.getElementById('yearPieChart'));\n\t pieChart.draw(yearTotalsData, {enableInteractivity:false, colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var pieChart = new google.visualization.ImagePieChart(document.getElementById('yearPieChart'));\n\t pieChart.draw(yearTotalsData, {colors:chartColors, title:\"\", width:pieWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('yearStackChart'));\n\t \t columnChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('yearStackChart'));\n\t \t columnChart.draw(yearData, {colors:chartColors, title:\"\", isStacked:true, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t \n\t if(useNormalCharts)\n\t {\n\t \t var columnChart = new google.visualization.ColumnChart(document.getElementById('yearBarChart'));\n\t \t columnChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", isStacked:false, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t else\n\t {\n\t \t var columnChart = new google.visualization.ImageBarChart(document.getElementById('yearBarChart'));\n\t \t columnChart.draw(yearData, {colors:chartColors, title:\"\", isStacked:false, isVertical:true, width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t }\n\t\t \n\t if(yearRowData.length > 2)\n\t {\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var lineChart = new google.visualization.LineChart(document.getElementById('yearLineChart'));\n\t\t lineChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t else\n\t\t {\n\t\t \t var lineChart = new google.visualization.ImageLineChart(document.getElementById('yearLineChart'));\n\t\t lineChart.draw(yearData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize });\n\t\t }\n\t\t\n\t\t if(useNormalCharts)\n\t\t {\n\t\t \t var areaChart = new google.visualization.AreaChart(document.getElementById('yearAreaChart'));\n\t\t \t areaChart.draw(yearData, {enableInteractivity:false, colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t\t else\n\t\t {\n\t\t \t var areaChart = new google.visualization.ImageAreaChart(document.getElementById('yearAreaChart'));\n\t\t \t areaChart.draw(yearData, {colors:chartColors, title:\"\", width:chartWidth, height:chartHeight, legend:'none', chartArea: chartAreaSize, fontSize:fontPxSize }); \n\t\t }\n\t }\n\t else\n\t {\n\t \t $(\"#yearLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t \t $(\"#yearAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n\t }\n }\n else\n {\n \t $(\"#yearPieChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearStackChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearBarChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearLineChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n \t $(\"#yearAreaChart\").html('<div class=\"missingChart\">Chart Not Available</div>');\n }\n \n }", "function draw(){\n\n drawGrid();\n var seriesIndex;\n\n if(!graph.hasData) {\n return;\n }\n\n if(graph.options.axes.x1.show){\n if(!graph.options.axes.x1.labels || graph.options.axes.x1.labels.length === 0) {\n seriesIndex = graph.options.axes.x1.seriesIndex;\n graph.options.axes.x1.labels= getXLabels(graph.allSeries[seriesIndex].series[0], graph.options.labelDateFormat);\n }\n drawXLabels(graph.options.axes.x1);\n }\n if(graph.options.axes.x2.show && graph.hasData){\n if (!graph.options.axes.x2.labels || graph.options.axes.x2.labels.length === 0) {\n seriesIndex = graph.options.axes.x2.seriesIndex;\n graph.options.axes.x2.labels = getXLabels(graph.allSeries[seriesIndex].series[0], graph.options.labelDateFormat);\n }\n drawXLabels(graph.options.axes.x2);\n }\n\n if (graph.options.axes.y1.show) {\n drawYLabels(graph.maxVals[graph.options.axes.y1.seriesIndex], graph.minVals[graph.options.axes.y1.seriesIndex], graph.options.axes.y1);\n }\n if (graph.options.axes.y2.show) {\n drawYLabels(graph.maxVals[graph.options.axes.y2.seriesIndex], graph.minVals[graph.options.axes.y2.seriesIndex], graph.options.axes.y2);\n }\n }", "function DrawHDDChart()\n{\n // create/delete rows \n if (hddTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - hddTable.getNumberOfRows();\n hddTable.addRows(numRows);\n } else {\n for(var i=(hddTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n hddTable.removeRow(i); \n }\n }\n\n // Populate data table with time/hdd data points. \n for(var i=0; i < hddTable.getNumberOfRows(); i++)\n {\n hddTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n hddTable.setCell(i, 1, parseInt(aggrDataPoints[i].hdd));\n }\n\n // Draw line chart.\n chartOptions.title = 'HDD Usage (%)';\n hddChart.draw(hddView, chartOptions); \n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['activos', 5],\n ['inactivos', 5.8],\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Estado de las alumnas',\n 'width': 450,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "function drawChart() {\n \n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n \n // Set chart options\n var options = {'title':'How Much Pizza I Ate Last Night'};\n \n // Instantiate and draw our chart, passing in some options.\n var piechart = new google.visualization.PieChart(elements.piechart);\n var linechart = new google.charts.Line(elements.linechart);\n var barchart = new google.charts.Bar(elements.barchart);\n piechart.draw(data, options);\n linechart.draw(data, options);\n barchart.draw(data,options);\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {'title':'How Much Pizza I Ate Last Night'};\n\n // Instantiate and draw our chart, passing in some options.\n var piechart = new google.visualization.PieChart(elements.piechart);\n var linechart = new google.charts.Line(elements.linechart);\n var barchart = new google.charts.Bar(elements.barchart);\n piechart.draw(data, options);\n linechart.draw(data, options);\n barchart.draw(data,options);\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {'title':'Global Share',\n 'width':300,\n 'height':200,\n 'is3D': true,};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawChart() {\n 'use strict';\n // Define the chart to be drawn.\n var data = new google.visualization.DataTable();\n var points = [\n ['Nitrogen', 0.3],\n ['Oxygen', 0.21],\n ['Other', 0.01]\n ];\n addData(data, points); // by reference\n var chart = new google.visualization.PieChart(document.getElementById('chart_id'));\n chart.draw(data, null);\n }", "function drawChart4() {\n\n // Create the data table.\n var data4 = new google.visualization.DataTable();\n data4.addColumn('string', 'nombre');\n data4.addColumn('number', 'cantidad');\n data4.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de pruebas por escuela sede: '+escuela,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data4, options1);\n\n }", "function renderChart() {\n let datasets = [];\n\n if (funcionPoints.length > 0) {\n datasets.push({\n label: funcion,\n data: funcionPoints,\n borderColor: \"purple\",\n borderWidth: 2,\n fill: false,\n showLine: true,\n pointBackgroundColor: \"purple\",\n radius: 0,\n });\n } else {\n alert(\"No hay puntos para la funcion.\");\n }\n\n if (areaPoints.length > 0) {\n datasets.push({\n label: \"Area\",\n data: areaPoints,\n borderColor: \"blue\",\n borderWidth: 2,\n fill: true,\n showLine: true,\n pointBackgroundColor: \"blue\",\n tension: 0,\n radius: 0,\n });\n } else {\n alert(\"No hay puntos para el area.\");\n }\n\n if (insidePoints.length > 0) {\n datasets.push({\n label: \"Punto aleatorio por debajo de la función\",\n data: insidePoints,\n borderColor: \"green\",\n borderWidth: 2,\n fill: false,\n showLine: false,\n pointBackgroundColor: \"green\",\n });\n } else {\n alert(\"No hay puntos aleatorios.\");\n }\n\n if (outsidePoints.length > 0) {\n datasets.push({\n label: \"Punto aleatorio por arriba de la función\",\n data: outsidePoints,\n borderColor: \"red\",\n borderWidth: 2,\n fill: false,\n showLine: false,\n pointBackgroundColor: \"red\",\n });\n } else {\n alert(\"No hay puntos aleatorios.\");\n }\n\n data = { datasets };\n\n if (chart) {\n chart.data = data;\n chart.update();\n }\n }", "function draw() {\n\n var isGridDrawn = false;\n\n if(graph.options.errorMessage) {\n var $errorMsg = $('<div class=\"elroi-error\">' + graph.options.errorMessage + '</div>')\n .addClass('alert box');\n\n graph.$el.find('.paper').prepend($errorMsg);\n }\n\n if(!graph.allSeries.length) {\n elroi.fn.grid(graph).draw();\n }\n\n $(graph.allSeries).each(function(i) {\n\n if(!isGridDrawn && graph.seriesOptions[i].type != 'pie') {\n elroi.fn.grid(graph).draw();\n isGridDrawn = true;\n }\n\n var type = graph.seriesOptions[i].type;\n elroi.fn[type](graph, graph.allSeries[i].series, i).draw();\n\n });\n\n }", "function drawChart1() {\n\n // Create the data table.\n var data1 = new google.visualization.DataTable();\n data1.addColumn('string', 'nombre');\n data1.addColumn('number', 'cantidad');\n data1.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por escuela',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data1, options1);\n\n }", "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barChart.draw();\n // scatterplot\n // this.scatter.draw();\n }", "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['', 'Hours per Day'],\n ['', 8],\n ['', 2],\n ['', 4],\n ['', 2],\n ['', 8]\n ]);\n \n var options = { legend: 'none','width':50, 'height':40};\n \n // var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n // chart.draw(data,options);\n }", "function makeCharts() {\n issueChart();\n countChart();\n averageChart();\n}", "function drawChart() {\n\n // Create the data table.\n var data = google.visualization.arrayToDataTable([\n ['Scenario Name', 'Duration', {role: 'style'}]\n ].concat(values));\n\n var options = {\n title: 'Scenario Results',\n legend: { position: 'none' },\n vAxis: { title: 'Duration (seconds)'},\n backgroundColor: bgColor\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.ColumnChart(document.getElementById('resultChart'));\n chart.draw(data, options);\n\n }", "function drawChart() {\n\n // Crea la grafica a partir de la tabla\n var data = google.visualization.arrayToDataTable([\n ['Actividades', 'Actividades Esperadas', 'Actividades Presentes'],\n ['1', 33, 40],\n ['2', 117, 96],\n ['3', 166, 210],\n ['4', 117, 66],\n ['5', 66, 21],\n ['6', 33, 40],\n ['7', 117, 96],\n ['8', 150, 190],\n ['9', 103, 50],\n ['10', 200, 210]\n ]);\n\n // Opciones de la grafica\n var options = {\n chart: {\n title: 'Porcentaje de avance',\n subtitle: 'Cantidad',\n },\n bars: 'vertical',\n vAxis: {\n format: 'decimal'\n },\n height: 400,\n width: 1000,\n colors: ['#ffac19', '#63a537']\n };\n\n // Instancia de la grafica a nivel del html para dibujarla\n var chart = new google.charts.Bar(document.getElementById('chart_div'));\n chart.draw(data, google.charts.Bar.convertOptions(options));\n }", "function drawChart() {\n\t\t// get the data from the table\n\t\t$(\".pie-chartify\").each( function(i,e){\n\t\t\tvar id = \"chart-\" + i,\n\t\t\t\tdt = dataTableFromTable( e ),\n\t\t\t\topt = {\n\t\t\t\t\t'pieSliceText': 'none',\n\t\t\t\t\t'tooltip': {\n\t\t\t\t\t\t'text': 'percentage'\n\t\t\t\t\t},\n\t\t\t\t\t'chartArea': {\n\t\t\t\t\t'width': '90%',\n\t\t\t\t\t\t'height': '90%'\n\t\t\t\t\t},\n\t\t\t\t\t'width': 600,\n\t\t\t\t\t'height': 400,\n\t\t\t\t\t'legend': {\n\t\t\t\t\t\tposition: 'labeled'\n\t\t\t\t\t},\n\t\t\t\t\t'fontName': 'Helvetica',\n\t\t\t\t\t'fontSize': 14,\n\t\t\t\t\t\"is3D\": true\n\t\t\t\t},\n\t\t\t\tc;\n\t\t\t$(this).after(\"<div class='piechart' id='\" + id + \"'></div>\");\n\n\t\t\tc = new google.visualization.PieChart(\n\t\t\t\tdocument.getElementById(id)\n\t\t\t);\n\t\t\tc.draw(dt, opt);\n\t\t});\n\t}", "function drawChart(pItemSel, pItemHeight, pConfigData, pValuesData, pDefaultConfig) {\n\n apex.debug.info({\n \"fct\": util.featureDetails.name + \" - \" + \"drawChart\",\n \"pItemSel\": pItemSel,\n \"pItemHeight\": pItemHeight,\n \"pConfigData\": pConfigData,\n \"pValuesData\": pValuesData,\n \"pDefaultConfig\": pDefaultConfig,\n \"featureDetails\": util.featureDetails\n });\n\n var aTypeCharts = [\"pie\", \"donut\", \"gauge\"];\n var isGauge = false;\n var isPie = false;\n var isDonut = false;\n var specialStr = \"\\u200b\";\n\n // sort pValuesData by Time\n function sortArrByTime(pArr, pFormat) {\n\n function customeSort(pFirstValue, pSecondValue) {\n var parseTime = d3.timeParse(pFormat);\n var fD = parseTime(pFirstValue.x);\n var sD = parseTime(pSecondValue.x);\n return new Date(fD).getTime() - new Date(sD).getTime();\n }\n\n try {\n return pArr.sort(customeSort);\n }\n catch (e) {\n apex.debug.error({\n \"fct\": util.featureDetails.name + \" - \" + \"drawChart\",\n \"msg\": \"Error while try sort JSON Array by Time Value\",\n \"err\": e,\n \"featureDetails\": util.featureDetails\n });\n }\n }\n\n /* search link from data and set window.location.href */\n function executeLink(pData) {\n var key = specialStr + unescape(pData.id);\n var index = pData.index;\n\n if (seriesData[key]) {\n var seriesObj = seriesData[key];\n if (seriesObj.length === 1) {\n index = 0\n }\n\n if (seriesData[key][index] && seriesData[key][index].link) {\n util.link(seriesData[key][index].link);\n }\n }\n }\n\n try {\n var ownTooltip = false;\n\n var chartTitle = setObjectParameter(pConfigData.chartTitle, pDefaultConfig.d3chart.chartTitle || \"\").toString();\n var background = setObjectParameter(pConfigData.background, pDefaultConfig.d3chart.background);\n var backJSON = null;\n\n if (util.isDefinedAndNotNull(background)) {\n backJSON = {\n color: background\n };\n }\n\n /* line */\n var lineStep = setObjectParameter(pConfigData.lineStep, pDefaultConfig.d3chart.line.step);\n\n /* gauge */\n var gaugeMin = setObjectParameter(pConfigData.gaugeMin, pDefaultConfig.d3chart.gauge.min);\n var gaugeMax = setObjectParameter(pConfigData.gaugeMax, pDefaultConfig.d3chart.gauge.max);\n var gaugeType = setObjectParameter(pConfigData.gaugeType, pDefaultConfig.d3chart.gauge.type);\n var gaugeWidth = setObjectParameter(pConfigData.gaugeWidth, pDefaultConfig.d3chart.gauge.width);\n var gaugeArcMinWidth = setObjectParameter(pConfigData.gaugeArcMinWidth, pDefaultConfig.d3chart.gauge.arcMinWidth);\n var gaugeFullCircle = setObjectParameter(pConfigData.gaugeFullCircle, pDefaultConfig.d3chart.gauge.fullCircle, true);\n var gaugeTitle = setObjectParameter(pConfigData.gaugeTitle, pDefaultConfig.d3chart.gauge.title || \"\").toString();\n\n /* Grid */\n var gridX = setObjectParameter(pConfigData.gridX, pDefaultConfig.d3chart.grid.x, true);\n var gridY = setObjectParameter(pConfigData.gridY, pDefaultConfig.d3chart.grid.y, true);\n\n /* heights */\n var heightXAxis = setObjectParameter(pConfigData.xAxisHeight, pDefaultConfig.d3chart.x.axisHeight);\n\n /* Legend */\n var legendShow = setObjectParameter(pConfigData.legendShow, pDefaultConfig.d3chart.legend.show, true);\n var legendPosition = setObjectParameter(pConfigData.legendPosition, pDefaultConfig.d3chart.legend.position);\n\n /* padding */\n var chartPadding = util.jsonSaveExtend(null, pDefaultConfig.d3chart.padding);\n\n if (util.isDefinedAndNotNull(pConfigData.paddingBottom)) {\n chartPadding.bottom = pConfigData.paddingBottom;\n }\n\n if (util.isDefinedAndNotNull(pConfigData.paddingLeft)) {\n chartPadding.left = pConfigData.paddingLeft;\n }\n\n if (util.isDefinedAndNotNull(pConfigData.paddingRight)) {\n chartPadding.right = pConfigData.paddingRight;\n }\n\n if (util.isDefinedAndNotNull(pConfigData.paddingTop)) {\n chartPadding.top = pConfigData.paddingTop;\n }\n\n /* Axis */\n var rotateAxis = setObjectParameter(pConfigData.rotateAxis, pDefaultConfig.d3chart.rotateAxis, true);\n var axisLabelPosition = setObjectParameter(pConfigData.axisLabelPosition, pDefaultConfig.d3chart.axisLabelPosition);\n\n var xAxisLabelPosition = null;\n var yAxisLabelPosition = null;\n\n switch (axisLabelPosition) {\n case \"inner1\":\n xAxisLabelPosition = \"inner-left\";\n yAxisLabelPosition = \"inner-bottom\";\n break;\n case \"inner2\":\n xAxisLabelPosition = \"inner-center\";\n yAxisLabelPosition = \"inner-middle\";\n break;\n case \"inner3\":\n xAxisLabelPosition = \"inner-right\";\n yAxisLabelPosition = \"inner-top\";\n break;\n case \"outer1\":\n xAxisLabelPosition = \"outer-left\";\n yAxisLabelPosition = \"outer-bottom\";\n break;\n case \"outer2\":\n xAxisLabelPosition = \"outer-center\";\n yAxisLabelPosition = \"outer-middle\";\n break;\n case \"outer3\":\n xAxisLabelPosition = \"outer-right\";\n yAxisLabelPosition = \"outer-top\";\n break;\n default:\n break;\n }\n\n if (rotateAxis) {\n var xAxisLabelPositionTmp = xAxisLabelPosition;\n xAxisLabelPosition = yAxisLabelPosition;\n yAxisLabelPosition = xAxisLabelPositionTmp;\n }\n\n /* tooltip */\n var tooltipShow = setObjectParameter(pConfigData.tooltipShow, pDefaultConfig.d3chart.tooltip.show, true);\n var tooltipGrouped = setObjectParameter(pConfigData.tooltipGrouped, pDefaultConfig.d3chart.tooltip.grouped, true);\n\n /* Transition duration */\n var transitionDuration = setObjectParameter(pConfigData.transitionDuration || pDefaultConfig.d3chart.transitionDuration);\n\n /* x Axis */\n var xShow = setObjectParameter(pConfigData.xShow, pDefaultConfig.d3chart.x.show, true);\n var xLabel = setObjectParameter(pConfigData.xLabel, pDefaultConfig.d3chart.x.label || \"\").toString();\n var xType = setObjectParameter(pConfigData.xType, pDefaultConfig.d3chart.x.type);\n var xAxisTimeFormat = null;\n var xName = null;\n\n /* x ticks */\n var xTickCutAfter = setObjectParameter(pConfigData.xTickCutAfter, pDefaultConfig.d3chart.x.tick.cutAfter);\n var xTickMaxNumber = setObjectParameter(pConfigData.xTickMaxNumber, pDefaultConfig.d3chart.x.tick.maxNumber);\n var xTickRotation = setObjectParameter(pConfigData.xTickRotation, pDefaultConfig.d3chart.x.tick.rotation);\n var xTickMultiline = setObjectParameter(pConfigData.xTickMultiline, pDefaultConfig.d3chart.x.tick.multiline, true);\n var xTickFit = setObjectParameter(pConfigData.xTickFit, pDefaultConfig.d3chart.x.tick.fit, true);\n var xTickAutoRotate = setObjectParameter(pConfigData.xTickAutoRotate, pDefaultConfig.d3chart.x.tick.autoRotate, true);\n var xTickTimeFormat = null;\n\n if (xType == \"category\" || xType == \"timeseries\") {\n xName = \"x\";\n }\n\n if (xType == \"timeseries\") {\n xAxisTimeFormat = setObjectParameter(pConfigData.xTimeFormat, pDefaultConfig.d3chart.x.timeFormat);\n xTickTimeFormat = setObjectParameter(pConfigData.xTickTimeFormat, pDefaultConfig.d3chart.x.tick.timeFormat);\n // sort data because of tooltip index\n sortArrByTime(pValuesData, xAxisTimeFormat);\n }\n\n /* cut string if category names are to long */\n if (xType == \"category\") {\n xTickTimeFormat = function (index, categoryName) {\n return util.cutString(categoryName, xTickCutAfter);\n };\n }\n\n /* y Axis */\n var yLabel = setObjectParameter(pConfigData.yLabel, pDefaultConfig.d3chart.y.label || \"\").toString();\n var yLog = setObjectParameter(pConfigData.yLog, pDefaultConfig.d3chart.y.log, true);\n var yType = null;\n if (yLog) {\n yType = \"log\";\n }\n var yMin = pConfigData.yMin || pDefaultConfig.d3chart.y.min;\n var yMax = pConfigData.yMax || pDefaultConfig.d3chart.y.max;\n var yCulling = pConfigData.yTickMaxNumber || pDefaultConfig.d3chart.y.tick.maxNumber;\n var yUnit = pConfigData.yUnit || pDefaultConfig.d3chart.y.unit;\n\n /* y2 Axis */\n var y2Show = false;\n var y2Label = setObjectParameter(pConfigData.y2Label, pDefaultConfig.d3chart.y2.label || \"\").toString();\n var y2Log = setObjectParameter(pConfigData.y2Log, pDefaultConfig.d3chart.y2.log, true);\n var y2Type = null;\n if (y2Log) {\n y2Type = \"log\";\n }\n var y2Min = setObjectParameter(pConfigData.y2Min, pDefaultConfig.d3chart.y2.min);\n var y2Max = setObjectParameter(pConfigData.y2Max, pDefaultConfig.d3chart.y2.max);\n var y2Culling = setObjectParameter(pConfigData.y2TickMaxNumber, pDefaultConfig.d3chart.y2.tick.maxNumber);\n var y2Unit = setObjectParameter(pConfigData.y2Unit, pDefaultConfig.d3chart.y2.unit);\n\n /* Zoom and Subchart */\n var zoomEnabled = setObjectParameter(pConfigData.zoomEnabled, pDefaultConfig.d3chart.zoom.enabled, true);\n var zoomType = setObjectParameter(pConfigData.zoomType, pDefaultConfig.d3chart.zoom.type);\n var showSubChart = false;\n\n if (zoomEnabled) {\n if (zoomType == \"scroll\") {\n showSubChart = false;\n } else if (zoomType == \"subchart\") {\n showSubChart = true;\n zoomEnabled = false;\n } else if (zoomType == \"drag\") {\n zoomEnabled = true;\n showSubChart = false;\n }\n } else {\n showSubChart = false;\n }\n\n var zoomRescale = setObjectParameter(pConfigData.zoomRescale, pDefaultConfig.d3chart.zoom.rescale, true);\n\n /* Prepare Data for Render */\n var dataArr = [];\n var categoriesArr = [];\n var groupsArr = [];\n var colorsJSON = {};\n var typesJSON = {};\n var axesJSON = {};\n var namesJSON = {};\n var groupJSON = {};\n var seriesCnt = 0;\n var seriesData = util.groupObjectArray(pValuesData, 'seriesID');\n\n if (seriesData) {\n /* Add Categories or time values to x Axis when correct type is set */\n if (xType == \"category\" || xType == \"timeseries\") {\n categoriesArr.push(\"x\");\n var xCatObj = util.groupObjectArray(pValuesData, \"x\");\n var xCatArr = Object.keys(xCatObj);\n\n $.each(xCatArr, function (dIdx, dataValues) {\n categoriesArr.push((setObjectParameter(dataValues.replace(specialStr, \"\"), null)));\n });\n }\n\n dataArr.push(categoriesArr);\n\n /* Transform data for billboard.js */\n $.each(seriesData, function (idx, seriesData) {\n var series;\n seriesCnt++;\n if (seriesData[0] && seriesData[0].seriesID) {\n series = seriesData[0];\n var dataKey = escape(series.seriesID);\n colorsJSON[dataKey] = series.color;\n typesJSON[dataKey] = series.type;\n\n /* check if atypechart*/\n if (aTypeCharts.indexOf(series.type) >= 0) {\n zoomEnabled = false;\n }\n\n if (series.type === \"gauge\") {\n isGauge = true;\n }\n\n if (series.type === \"pie\") {\n isPie = true;\n }\n\n if (series.type === \"donut\") {\n isDonut = true;\n }\n\n if (util.isDefinedAndNotNull(series.tooltip)) {\n ownTooltip = true;\n }\n\n axesJSON[dataKey] = (series.yAxis || \"y\");\n if (util.isDefinedAndNotNull(series.groupID)) {\n var groupID = escape(series.groupID.toString());\n if (groupJSON[groupID]) {\n groupJSON[groupID].push(dataKey);\n } else {\n groupJSON[groupID] = [];\n groupJSON[groupID].push(dataKey);\n }\n }\n\n if (series.yAxis == \"y2\") {\n y2Show = true;\n }\n namesJSON[dataKey] = (setObjectParameter(series.label, dataKey));\n\n var arr = [];\n arr.push(dataKey);\n if (xType == \"category\" || xType == \"timeseries\") {\n $.each(xCatObj, function (dIdx, dataValues) {\n var setValueY = null;\n var setValueZ = null;\n $.each(dataValues, function (sIDx, sDataValues) {\n if (escape(sDataValues.seriesID) == dataKey) {\n setValueY = sDataValues.y;\n if (sDataValues.z) {\n setValueZ = sDataValues.z;\n }\n }\n });\n if (setValueZ !== null) {\n arr.push({\n \"y\": setValueY,\n \"z\": setValueZ\n });\n } else {\n arr.push(setValueY);\n }\n });\n } else {\n $.each(seriesData, function (dIdx, dataValues) {\n var setValueY = setObjectParameter(dataValues.y, null);\n if (dataValues.z) {\n var setValueZ = dataValues.z;\n arr.push({\n \"y\": setValueY,\n \"z\": setValueZ\n });\n } else {\n arr.push(setValueY);\n }\n });\n }\n\n dataArr.push(arr);\n\n } else {\n util.errorMessage.show(pItemSel, pDefaultConfig.errorMessage);\n apex.debug.error({\n \"fct\": util.featureDetails.name + \" - \" + \"drawChart\",\n \"msg\": \"No seriesID found in seriesID Cursor\",\n \"featureDetails\": util.featureDetails\n });\n }\n\n });\n\n /* Group JSON to Array */\n $.each(groupJSON, function (dIdx, jsonObj) {\n groupsArr.push(jsonObj);\n });\n\n /* Labels and Datapoints */\n var dataLabels = setObjectParameter(pConfigData.showDataLabels, pDefaultConfig.d3chart.showDataLabels, true);\n\n if (isPie || isDonut) {\n dataLabels = {\n colors: \"white\"\n };\n } else if (isGauge) {\n dataLabels = {\n colors: (gaugeType === \"single\" && seriesCnt > 1) ? \"white\" : \"inherit\"\n };\n }\n var showDataPoints = setObjectParameter(pConfigData.showDataPoints, pDefaultConfig.d3chart.showDataPoints, true);\n\n var showAbsoluteValues = setObjectParameter(pConfigData.showAbsoluteValues, pDefaultConfig.d3chart.showAbsoluteValues);\n var absoluteFormatting;\n\n if (showAbsoluteValues) {\n absoluteFormatting = function (value, ratio, id) {\n return value + yUnit;\n }\n }\n\n var ttContent;\n if (ownTooltip) {\n ttContent = function (d) {\n var div = $(\"<div></div>\");\n div.addClass(\"bb-tooltip\");\n div.addClass(\"bida-chart-tooltip-custome\");\n $.each(d, function (i, pData) {\n var key = specialStr + unescape(pData.id);\n var index = pData.index;\n\n if (seriesData[key]) {\n var seriesObj = seriesData[key];\n if (seriesObj.length === 1) {\n index = 0\n }\n if (seriesData[key][index] && util.isDefinedAndNotNull(seriesData[key][index].tooltip)) {\n var ttS = seriesData[key][index].tooltip;\n if (pRequireHTMLEscape !== false) {\n ttS = util.escapeHTML(ttS);\n }\n div.append(ttS);\n div.append(\"<br>\");\n }\n }\n });\n return div[0].outerHTML;\n }\n }\n\n try {\n var chartContIDSel = pItemSel + \"bbc\";\n var chartContID = chartContIDSel.replace(\"#\", \"\");\n var chartCont = $(\"<div></div>\");\n chartCont.attr(\"id\", chartContID);\n\n $(pItemSel).append(chartCont);\n\n var bbData = {\n bindto: chartContIDSel,\n background: backJSON,\n title: {\n text: chartTitle\n },\n size: {\n height: pItemHeight\n },\n data: {\n x: xName,\n xFormat: xAxisTimeFormat,\n columns: dataArr,\n types: typesJSON,\n groups: groupsArr,\n colors: colorsJSON,\n labels: dataLabels,\n axes: axesJSON,\n names: namesJSON,\n onclick: function (pData) {\n executeLink(pData);\n }\n },\n pie: {\n label: {\n format: absoluteFormatting,\n threshold: 0.05\n }\n },\n donut: {\n label: {\n format: absoluteFormatting,\n threshold: 0.05\n }\n },\n line: {\n step: {\n type: lineStep\n }\n },\n gauge: {\n label: {\n format: absoluteFormatting,\n threshold: (gaugeType === \"single\") ? 0.05 : null\n },\n fullCircle: gaugeFullCircle,\n min: gaugeMin,\n max: gaugeMax,\n type: gaugeType,\n width: gaugeWidth,\n title: gaugeTitle,\n arc: {\n minWidth: gaugeArcMinWidth\n }\n },\n radar: {\n direction: {\n clockwise: true\n }\n },\n subchart: {\n show: showSubChart\n },\n zoom: {\n type: zoomType,\n enabled: zoomEnabled,\n rescale: zoomRescale\n },\n transition: {\n duration: transitionDuration\n },\n legend: {\n show: legendShow,\n position: legendPosition\n },\n tooltip: {\n show: tooltipShow,\n grouped: tooltipGrouped,\n contents: ttContent\n },\n grid: {\n x: {\n show: gridX,\n },\n y: {\n show: gridY\n }\n },\n point: {\n show: showDataPoints\n },\n axis: {\n rotated: rotateAxis,\n x: {\n show: xShow,\n label: {\n text: xLabel,\n position: xAxisLabelPosition\n },\n type: xType,\n tick: {\n culling: {\n max: xTickMaxNumber\n },\n autorotate: xTickAutoRotate,\n rotate: xTickRotation,\n multiline: xTickMultiline,\n format: xTickTimeFormat,\n fit: xTickFit\n },\n height: heightXAxis\n },\n y: {\n label: {\n text: yLabel,\n position: yAxisLabelPosition\n },\n type: yType,\n max: yMax,\n min: yMin,\n tick: {\n culling: {\n max: yCulling\n },\n format: function (d) {\n return d + yUnit\n }\n }\n },\n y2: {\n show: y2Show,\n label: {\n text: y2Label,\n position: yAxisLabelPosition\n },\n type: y2Type,\n max: y2Max,\n min: y2Min,\n tick: {\n culling: {\n max: y2Culling\n },\n format: function (d) {\n return d + y2Unit\n }\n }\n }\n },\n padding: chartPadding\n };\n\n apex.debug.info({\n \"fct\": util.featureDetails.name + \" - \" + \"drawChart\",\n \"finalChartData\": bbData,\n \"featureDetails\": util.featureDetails\n });\n\n var chart = bb.generate(bbData);\n\n /* reset zoom on right click */\n if (zoomEnabled) {\n $(chartContIDSel).contextmenu(function (evt) {\n evt.preventDefault();\n chart.unzoom();\n });\n }\n\n /* execute resize */\n function resize() {\n if (!document.hidden && chartCont.is(\":visible\")) {\n chart.resize({\n height: pItemHeight\n });\n }\n }\n\n // bind resize events\n $(window).resize(function () {\n resize();\n });\n\n /* dirty workaround because in APEX sometimes chart renders in wrong size hope apexDev Team will bring us layout change events also for tabs, collapsible so on */\n function stopResizeWA() {\n if (timers.innerItemsIntervals && timers.innerItemsIntervals[pItemSel]) {\n clearInterval(timers.innerItemsIntervals[pItemSel]);\n }\n }\n\n function startResizeWA() {\n timers.innerItemsIntervals[pItemSel] = setInterval(function () {\n if ($(pItemSel).length === 0) {\n clearInterval(timers.innerItemsIntervals[pItemSel]);\n } else {\n if (chartCont.is(\":visible\")) {\n if (!util.isBetween(chartCont.width(), chartCont.find(\"svg\").width(), resizeRange)) {\n apex.debug.info({\n \"fct\": util.featureDetails.name + \" - \" + \"drawChart\",\n \"msg\": \"Chart has resize problem\",\n \"featureDetails\": util.featureDetails\n });\n resize();\n }\n\n }\n }\n }, timers.defTime);\n }\n\n stopResizeWA();\n startResizeWA();\n\n /* stop when tab is not active */\n document.addEventListener(\"visibilitychange\", function () {\n if (document.hidden) {\n stopResizeWA();\n } else {\n startResizeWA();\n }\n });\n\n } catch (e) {\n $(pItemSel).empty();\n util.errorMessage.show(pItemSel, pDefaultConfig.errorMessage);\n apex.debug.error({\n \"fct\": util.featureDetails.name + \" - \" + \"drawChart\",\n \"msg\": \"Error while try to render chart\",\n \"err\": e,\n \"featureDetails\": util.featureDetails\n });\n }\n } else {\n util.noDataMessage.show(pItemSel, pDefaultConfig.noDataMessage);\n }\n } catch (e) {\n $(pItemSel).empty();\n util.errorMessage.show(pItemSel, pDefaultConfig.errorMessage);\n apex.debug.error({\n \"fct\": util.featureDetails.name + \" - \" + \"drawChart\",\n \"msg\": \"Error while prepare data for chart\",\n \"err\": e,\n \"featureDetails\": util.featureDetails\n });\n }\n }", "function drawChart4() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'InstallationDate');\n data.addColumn('number', 'Number of Meters');\n data.addRows(installationsPerDate());\n\n // Set chart options\n var options = {\n 'title': 'Installations Per Date',\n 'width': 250,\n 'height': 200,\n };\n\n // Instantiate and draw our chart, passing in some options.\n // var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n var chart = new google.visualization.PieChart(document.getElementById('chart_div4'));\n chart.draw(data, options);\n}", "drawCanvas(arrData) {\n const W = +this.elements.$tags.contentWrap.getBoundingClientRect().width;\n const H = +this.panel.svgHeight;\n const dateFrom = this.range.from.clone();\n const dateTo = this.range.to.clone();\n\n // область визуализации с данными (график)\n const margin = this.elements.sizes.marginAreaVis;\n const widthAreaVis = W - margin.left - margin.right;\n const heightAreaVis = H - margin.top - margin.bottom;\n const heightRowBar = parseInt(heightAreaVis / arrData.length, 10);\n\n const xScaleDuration = d3.scaleTime()\n .domain([0, new Date(dateTo).getTime() - new Date(dateFrom).getTime()])\n .range([0, widthAreaVis]);\n\n const xScaleTime = d3.scaleTime()\n .domain([new Date(dateFrom).getTime(), new Date(dateTo).getTime()])\n .range([0, widthAreaVis]);\n\n const canvasElement = d3.select(document.createElement('canvas'))\n .datum(arrData) // data binding\n .attr('width', widthAreaVis)\n .attr('height', heightAreaVis);\n\n const context = canvasElement.node().getContext('2d');\n\n // clear canvas\n context.fillStyle = 'rgba(0,0,0, 0)';\n context.rect(0, 0, canvasElement.attr('width'), canvasElement.attr('height'));\n context.fill();\n\n let top = 0;\n const sizeDiv = 1; // dividing line\n\n _.forEach(arrData, (changes, i, arr) => {\n _.forEach(changes, (d) => {\n context.beginPath();\n context.fillStyle = d.color;\n context.rect(\n xScaleTime(d.start) < 0 ? 0 : xScaleTime(d.start),\n top, xScaleDuration(d.ms),\n arr.length - 1 !== i ? heightRowBar - sizeDiv : heightRowBar,\n );\n context.fill();\n context.closePath();\n });\n\n top += heightRowBar;\n });\n return canvasElement.node();\n }", "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Country');\r\n data.addColumn('number', 'Population');\r\n data.addColumn('number', 'Area');\r\n data.addColumn('number', 'Occupancy');\r\n data.addRows([\r\n [cdata.name, cdata.population,cdata.area,(cdata.area/cdata.population)]\r\n \r\n \r\n ]);\r\n\r\n // Set chart options\r\n var options = {'title':'Population Area Ratio of '+cdata.name,\r\n 'width':250,\r\n 'height':300};\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.BarChart(document.getElementById('bc1'));\r\n chart.draw(data, options);\r\n }", "function drawChart() {\n const canvas = document.createElement('canvas');\n let data = [];\n let min = Infinity;\n let max = 0;\n for (let i = 0; i < TIMINGS.length; i++) {\n let series = TIMINGS[i];\n min = Math.min(min, Math.min(...series));\n max = Math.max(max, Math.max(...series));\n }\n\n for (let i = 0; i < TIMINGS.length; i++) {\n let series = TIMINGS[i];\n data.push({\n data: bellCurvify(series, min, max),\n label: getFileName(PATHS[i]),\n\n borderColor: COLORS[i % COLORS.length],\n fill: false\n });\n }\n const context = canvas.getContext('2d');\n let labels = [];\n for (let i = min; i <= max; i++) {\n labels.push('' + i);\n }\n document.body.appendChild(canvas);\n new Chart(context, {\n type: 'line',\n data: {\n labels: labels,\n datasets: data\n },\n options: {}\n });\n}", "function drawChart() {\n ctx.beginPath();\n ctx.strokeStyle = \"blue\";\n var firstElement = true;\n ctx.font = \"10px sans-serif\";\n //plot each entry if it is in the range\n for (let entry of entries) {\n //check if entry is in the range of xmin and xmax, otherwise ignore it\n if (entry.date > xMin && entry.date < xMax) {\n //calculate location of pace coordinate\n let m = entry.getMin();\n let s = entry.getSec();\n let paceLocation = (m * 4) + (s / 15);\n\n //calculate location of date coordinate\n //plan - we have 60 blocks of usable space, can get date in ms with getTime()\n //range=xmax-min\n //value=date-xmin\n //value=value*60blocks\n let xRange = xMax.getTime() - xMin.getTime();\n let dateLocation = (entry.date.getTime() - xMin.getTime());\n dateLocation = ((dateLocation / xRange) * 60) + 5;//add 5 for axis offset\n ctx.strokeText(m + \":\" + s + \" \", blocks(dateLocation), blocks(40 - paceLocation - 1));\n \n //start at this first element\n if (firstElement) { ctx.moveTo(blocks(dateLocation), blocks(40 - paceLocation)); }\n\n //connect remaining data points\n ctx.lineTo(blocks(dateLocation), blocks(40 - paceLocation));\n ctx.arc(blocks(dateLocation), blocks(40 - paceLocation), 2, 0, Math.PI * 2, true);\n firstElement = false;\n }\n }\n ctx.font = \"12px sans-serif\";\n ctx.stroke();\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Color');\n data.addColumn('number', 'Ranking');\n\n data.addRows(graphData);\n\n // Set chart options\n var options = {\n title: 'T-Shirt Rankings',\n height: 600,\n legend: {position: 'none'},\n vAxis: {format:'#'}\n };\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawChart() {\n\n\t// Create the data table.\n\tvar data = new google.visualization.DataTable();\n\tdata.addColumn('string', 'Topping');\n\tdata.addColumn('number', 'Amt In Dollars');\n\tdata.addRows([\n\t [names.name1, values.expenseNameOne],\n\t [names.name2, values.expenseNameTwo],\n\t [names.name3, values.expenseNameThree],\n\t [names.name4, values.expenseNameFour],\n\t [names.name5, values.expenseNameFive]\n\t]);\n\n\t// Set chart options\n\tvar options = {'title':'MY EXPENSES',\n\t\t\t\t 'width':800,\n\t\t\t\t 'height':500};\n\n\t// Instantiate and draw our chart, passing in some options.\n\tvar chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n\tchart.draw(data, options);\n }", "function drawChart() {\r\n\r\n // Create the data table.\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Country');\r\n data.addColumn('number', 'Population');\r\n data.addColumn('number', 'Area');\r\n data.addColumn('number', 'Occupancy');\r\n data.addRows([\r\n [countrydata.name, countrydata.population,countrydata.area,(countrydata.area/countrydata.population)]\r\n \r\n \r\n ]);\r\n\r\n // Set chart options\r\n var options = {'title':'Population Area Ratio of '+countrydata.name,\r\n 'width':250,\r\n 'height':300};\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.ColumnChart(document.getElementById('bc2'));\r\n chart.draw(data, options);\r\n }", "function drawChart1() {\n\n // Create the data table.\n var data1 = new google.visualization.DataTable();\n data1.addColumn('string', 'nombre');\n data1.addColumn('number', 'cantidad');\n data1.addRows(render);\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por escuela sede: '+sede,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data1, options1);\n\n }", "function drawChart(x1, y1, x2, y2, x3, y3) {\n var data1 = google.visualization.arrayToDataTable([\n ['Attendance', 'Count'],\n ['Present', x1],\n ['Absent', y1],\n ]);\n var data2 = google.visualization.arrayToDataTable([\n ['Attendance', 'Count'],\n ['Present', x2],\n ['Absent', y2],\n ]);\n var data3 = google.visualization.arrayToDataTable([\n ['Attendance', 'Count'],\n ['Present', x3],\n ['Absent', y3],\n ]);\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart1 = new google.visualization.PieChart(document.getElementById('piechart1'));\n var chart2 = new google.visualization.PieChart(document.getElementById('piechart2'));\n var chart3 = new google.visualization.PieChart(document.getElementById('piechart3'));\n chart1.draw(data1);\n chart2.draw(data2);\n chart3.draw(data3);\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Category');\n data.addColumn('number', 'Amount');\n data.addRows(myData);\n\n // Set chart options\n var options = {'width':500,\n 'height':400};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "function DrawClicksChart()\n{\n // create/delete rows \n if (clicksTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - clicksTable.getNumberOfRows();\n clicksTable.addRows(numRows);\n } else {\n for(var i=(clicksTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n clicksTable.removeRow(i); \n }\n }\n\n // Populate data table with time/clicks data points. \n for(var i=0; i < clicksTable.getNumberOfRows(); i++)\n {\n clicksTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n clicksTable.setCell(i, 1, parseInt(aggrDataPoints[i].clicks));\n }\n\n // Draw line chart.\n chartOptions.title = 'Clicks Chart';\n clicksChart.draw(clicksView, chartOptions); \n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Day');\n data.addColumn('number', 'Hours');\n data.addRows([\n ['Sunday', 166860],\n ['Monday', 91133.5],\n ['Tuesday', 91133.5],\n ['Wednesday', 91133.5],\n ['Thursday', 91133.5],\n ['Friday', 91133.5],\n ['Saturday', 94222],\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Hours of free parking per day of the week',\n 'width': 300,\n 'height': 150,\n pieHole: .4\n };\n\n // Instantiate and draw our chart, passing in some options.\n // var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "function drawChart(data,Container,width,height,arrBuckets,props) {\n\n// alert(\"Drawing chart\");\n\n var csvfile = arrBuckets.timeline.title + \",\" + arrBuckets.value.title + '\\n';\n \n var dataValues = d3.map(data, function(d,i) {csvfile += d.timeline+ \",\" + d.value + '\\n';\n return d.timeline + \",\" + d.value;});\n \n var chartDiv = document.getElementById(Container[0][0].id);\n var win = window\n , doc = document\n , ele = doc.documentElement\n , bdy = doc.getElementsByTagName(\"body\")[0]\n , screenWidth = screen.width;\n\n var main_margin = {top: 15, right: 15, bottom: 15, left: 15};\n\n chartDiv.style.top = main_margin.top + \"px\";\n chartDiv.style.left = main_margin.left + \"px\";\n chartDiv.style.width = width - main_margin.left - main_margin.right + \"px\";\n chartDiv.style.height = height - main_margin.top - main_margin.bottom + \"px\";\n\n mygraph = new Dygraph(\n chartDiv,\n csvfile, // CSV file\n props\n );\n\n}", "function DrawRevenueChart()\n{\n // create/delete rows \n if (revenueTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - revenueTable.getNumberOfRows();\n revenueTable.addRows(numRows);\n } else {\n for(var i=(revenueTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n revenueTable.removeRow(i); \n }\n }\n\n // Populate data table with time/revenue data points. \n for(var i=0; i < revenueTable.getNumberOfRows(); i++)\n {\n revenueTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n revenueTable.setCell(i, 1, parseFloat(aggrDataPoints[i].revenue));\n }\n\n // Draw line chart.\n chartOptions.title = 'Revenue Chart';\n revenueChart.draw(revenueView, chartOptions); \n}", "function drawChart() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Weather Element');\n data.addColumn('number', 'Dec');\n data.addColumn('number', 'Feb');\n data.addColumn('number', 'Jan');\n data.addColumn('number', 'Nov');\n data.addColumn('number', 'Oct');\n data.addColumn('number', 'Sep');\n\n data.addRows([\n ['Snow - Heavy', 6,0,2,2,0,0],\n ['Snow - Light', 2,0,0,0,0,0],\n ['Snow - Normal', 4,0,2,0,0,0]\n ]);\n\n var options = {\n 'title': 'Snowy Weather by Months',\n 'width': 500,\n 'height': 600,\n 'isStacked': true};\n \n var chart = new google.visualization.ColumnChart(document.getElementById('chart_div2'));\n chart.draw(data, options);\n }", "function drawChart() { \n var data =window.google.visualization.arrayToDataTable([\n ['Location', 'Pending Request','Approved Request'],\n ['Bangalore', 8,10],\n ['Gurgaon', 2,12],\n ['Chennai', 4,2],\n ['UK', 2,8],\n ]);\n var options = {'width':500, 'height':300};\n var chart = new window.google.visualization.PieChart(document.getElementById(self.props.id));\n chart.draw(data, options); \n }", "function DrawRAMChart()\n{\n // create/delete rows \n if (ramTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - ramTable.getNumberOfRows();\n ramTable.addRows(numRows);\n } else {\n for(var i=(ramTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n ramTable.removeRow(i); \n }\n }\n\n // Populate data table with time/ram data points. \n for(var i=0; i < ramTable.getNumberOfRows(); i++)\n {\n ramTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n ramTable.setCell(i, 1, parseFloat(aggrDataPoints[i].ram));\n }\n\n // Draw line chart.\n chartOptions.title = 'RAM Usage (%)';\n ramChart.draw(ramView, chartOptions); \n}", "function DrawCostChart()\n{\n // create/delete rows \n if (costTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - costTable.getNumberOfRows();\n costTable.addRows(numRows);\n } else {\n for(var i=(costTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n costTable.removeRow(i); \n }\n }\n \n // Populate data table with time/cost data points. \n for(var i=0; i < costTable.getNumberOfRows(); i++)\n {\n //if(parseFloat(aggrDataPoints[i].cost) < 500) continue;\n costTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n costTable.setCell(i, 1, parseFloat(aggrDataPoints[i].cost));\n }\n\n // Draw line chart.\n chartOptions.title = 'Cost Chart';\n costChart.draw(costView, chartOptions); \n}", "function drawChart() {\n console.log(\"drawChart ran\");\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Day');\n data.addColumn('number', 'Temperature');\n var i = 0;\n /*Loops through the days of the week and for each\n day there is weather info it adds a row */\n for (i = 0; i < days_of_the_week.length; i++) {\n if (day_and_temp_map.has(days_of_the_week[i])) {\n data.addRow([days_of_the_week[i], day_and_temp_map.get(days_of_the_week[i])]);\n }\n }\n\n // Set chart options\n var options = {\n 'title': 'Weather forecast chart',\n 'width': 500,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function DrawMarginChart()\n{\n // create/delete rows \n if (marginTable.getNumberOfRows() < contDataPoints.length)\n { \n var numRows = contDataPoints.length - marginTable.getNumberOfRows();\n marginTable.addRows(numRows);\n } else {\n for(var i=(marginTable.getNumberOfRows()-1); i > contDataPoints.length; i--)\n {\n marginTable.removeRow(i); \n }\n }\n\n // Populate data table with time/cost data points. \n for(var i=0; i < marginTable.getNumberOfRows(); i++)\n {\n marginTable.setCell(i, 0, new Date(parseInt(contDataPoints[i].timestamp)));\n marginTable.setCell(i, 1, (parseFloat(contDataPoints[i].cost)-parseFloat(contDataPoints[i].revenue))/parseFloat(contDataPoints[i].revenue));\n }\n\n // Draw line chart.\n chartOptions.title = 'Margin Chart';\n marginChart.draw(marginView, chartOptions); \n}", "function drawChart() {\n details.html('');\n wrap.html('');\n\n svg = wrap.append('svg')\n .attr('width', width + margin.left + margin.right)\n .attr('height', height + margin.top + margin.bottom);\n\n change = details.append('div').attr('class', 'change');\n range = details.append('div').attr('class', 'range');\n showHigh = range.append('span').attr('class', 'high');\n showLow = range.append('span').attr('class', 'low');\n volume = details.append('div').attr('class', 'volume');\n\n bg = svg.append('rect')\n .attr('width', width + margin.left + margin.right)\n .attr('height', height + margin.top + margin.bottom)\n .style({opacity: 0});\n\n pointer = svg.append('path')\n .attr('class', 'pointer')\n .attr('d', 'M 0 0 L 7 -7 L 40 -7 L 40 7 L 7 7 L 0 0')\n .attr('transform', 'translate(' +\n (width + margin.left) + ',' +\n (height + margin.top) + ')');\n\n svg.append('rect').attr('width', width + margin.left + margin.right)\n .attr('class', 'timeBackground')\n .attr('height', margin.bottom)\n .attr('transform', 'translate(0,' + (height + margin.top) + ')');\n\n gEnter = svg.append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n gEnter.append('g').attr('class', 'grid');\n gEnter.append('path').attr('class', 'line');\n\n gEnter.append('g').attr('class', 'x axis');\n gEnter.append('g').attr('class', 'price axis')\n .attr('transform', 'translate(' + width + ', 0)');\n\n flipping = false;\n flip = svg.append('g').attr('class', 'flip')\n .attr('width', margin.right)\n .attr('height', margin.bottom)\n .attr('transform', 'translate(' +\n (width + margin.left) + ',' +\n (height + margin.top) + ')')\n .on('click', function() {\n d3.event.stopPropagation();\n flipping = true;\n\n dropdownA.selected(self.counter);\n dropdownB.selected(self.base);\n dropdowns.selectAll('div').remove();\n\n dropdowns.append('div')\n .attr('class', 'base dropdowns')\n .attr('id', 'base' + self.index)\n .call(dropdownA);\n\n dropdowns.append('div')\n .attr('class', 'counter dropdowns')\n .attr('id', 'quote' + self.index)\n .call(dropdownB);\n\n self.load();\n\n flipping = false;\n\n if (markets.options.fixed) {\n header.html('<small title=\"' +\n self.base.issuer + '\">' +\n getName(self.base.issuer, self.base.currency) +\n '</small><span>' + baseCurrency + '/' +\n counterCurrency + '</span><small title=\"' +\n self.counter.issuer + '\">' +\n getName(self.counter.issuer, self.counter.currency) +\n '</small>');\n }\n });\n\n flip.append('rect')\n .attr({\n width: margin.right,\n height: margin.bottom\n });\n\n flip.append('text').text('Flip')\n .attr({\n 'text-anchor': 'middle',\n y: margin.bottom * 4 / 5,\n x: margin.right / 2\n });\n\n horizontal = gEnter.append('line')\n .attr('class', 'horizontal')\n .attr({x1: 0, x2: width})\n .attr('transform', 'translate(0,' + height + ')');\n lastPrice = gEnter.append('text')\n .attr('class', 'lastPrice')\n .style('text-anchor', 'middle')\n .attr('x', (width + margin.left) / 2);\n }", "function drawChart(percentagesByDay) {\n // Load the Visualization API and the appropriate packages, setting a callback\n // to run when the API is loaded.\n google.load('visualization', '1.0', {'packages':['corechart']});\n google.setOnLoadCallback(function() {\n drawChartCallback(percentagesByDay);\n });\n}", "function DrawCPUChart()\n{\n // create/delete rows \n if (cpuTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - cpuTable.getNumberOfRows();\n cpuTable.addRows(numRows);\n } else {\n for(var i=(cpuTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n cpuTable.removeRow(i); \n }\n }\n \n // Populate data table with time/cpu data points. \n for(var i=0; i < cpuTable.getNumberOfRows(); i++)\n {\n //if(parseFloat(aggrDataPoints[i].cpu) < 500) continue;\n cpuTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n cpuTable.setCell(i, 1, parseFloat(aggrDataPoints[i].cpu));\n }\n\n // Draw line chart.\n chartOptions.title = 'CPU Usage (%)';\n cpuChart.draw(cpuView, chartOptions); \n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Tricipital', parseInt(document.getElementById('tricipital').value, 10)],\n ['subescapular', parseInt(document.getElementById('subescapular').value, 10)],\n ['suprailiaca', parseInt(document.getElementById('suprailiaca').value, 10)],\n ['abdominal', parseInt(document.getElementById('abdominal').value, 10)],\n ['quadriceps', parseInt(document.getElementById('quadriceps').value, 10)]\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Percentual de dobras cutâneas em mm³',\n 'margin': 0,\n 'padding': 0,\n 'width': 450,\n 'height': 350\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawchart() {\r\n const filters = getFilters();\r\n const drawData = filterData(\r\n filters[\"startDate\"],\r\n filters[\"endDate\"],\r\n filters[\"provincesFilter\"]\r\n );\r\n timeLapseChart = new TimeLapseChart(\"timelapse-chart\");\r\n timeLapseChart\r\n .setTitle(\"COVID-19 ARGENTINA - EVOLUCIÓN EN EL TIEMPO\")\r\n .setColumnsStyles(columnNames)\r\n .addDatasets(drawData)\r\n .render();\r\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Activity');\n data.addColumn('number', 'Completed');\n data.addRows([\n ['Courses', 3],\n ['Posts', 1],\n ['Job Offers', 1],\n ['Tutorials', 1],\n ['Projects', 2]\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Your activity on Udabuddy',\n 'width': '100%',\n 'height': '100%'\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.ColumnChart(document.getElementById(\n 'chart_div'));\n chart.draw(data, options);\n }", "function drawChart() {\n\t var data = google.visualization.arrayToDataTable([\n\t ['Tool', 'Rating'],\n\t ['Visual Studio', 5],\n\t ['Eclipse', 3],\n\t ['Notepad++', 2],\n\t \n\t \n\t]);\n\n\t // Optional; add a title and set the width and height of the chart\n\t var options = { 'width':'94%', 'height':250,\n\t\tcolors: ['#e81e68', '#999999','#efefef'],\n\t\tis3D: true,\n\t\tbackgroundColor: 'rgb(24,27,46)',\n\t\tlegend: {textStyle: {color: 'white'},position:'bottom'}\n\t\t};\n\n\t // Display the chart inside the <div> element with id=\"piechart\"\n\t var chart = new google.visualization.PieChart(document.getElementById('codetool'));\n\t chart.draw(data, options);\n\t}", "function drawChart(idgraph) {\n\n \tvar myData;\n \t\n \t// Create the data table.\n\tvar typeChart = $('#type-select').children(':selected').attr('id');\n\tvar options;\n\tvar chart;\n\tswitch(typeChart) {\n\t\tcase \"scatter\" :\n\t\t\toptions = {\n\t\t\t\ttitle: X + ' vs. ' + Y,\n\t\t\t\twidth: 800,\n\t\t\t\theight: 480,\n\t\t\t\ttitleX: X,\n\t\t\t\ttitleY: Y,\n\t\t\t\tlegend: 'none',\n\t\t\t\tpointSize: 5\n\t\t\t};\n\t\t\tmyData = JSONextractNumber(X,Y,activeData);\n\t\t\tchart = new google.visualization.ScatterChart(document.getElementById(idgraph));\t\t\t\n\t\t\tbreak;\n\t\tcase \"bar\" : \n\t\t\toptions = {\n\t\t\t title: X + ' vs. ' + Y,\n\t\t\t vAxis: {title: X, titleTextStyle: {color: 'red'}},\n\t\t\t hAxis: {title: Y, titleTextStyle: {color: 'red'}},\n\t\t\t width: 800,\n\t\t\t height: 480\n\t\t\t};\n\t\t\tmyData = JSONextractString(X,Y,activeData);\n\t\t\tchart = new google.visualization.BarChart(document.getElementById(idgraph));\n\t\t\tbreak;\n\t\tcase \"column\" : \n\t\t\toptions = {\n\t\t\t title: X + ' vs. ' + Y,\n\t\t\t vAxis: {title: Y, titleTextStyle: {color: 'red'}},\n\t\t\t hAxis: {title: X, titleTextStyle: {color: 'red'}},\n\t\t\t width: 800,\n\t\t\t height: 480\n\t\t\t};\n\t\t\tmyData = JSONextractSort(X,Y,activeData);\n\t\t\tchart = new google.visualization.ColumnChart(document.getElementById(idgraph));\n\t\t\tbreak;\n\t\tcase \"line\" : \n\t\t\toptions = {\n\t\t\t title: X + ' vs. ' + Y,\n\t\t\t vAxis: {title: Y, titleTextStyle: {color: 'red'}},\n\t\t\t hAxis: {title: X, titleTextStyle: {color: 'red'}},\n\t\t\t width: 800,\n\t\t\t height: 480\n\t\t\t};\n\t\t\tmyData = JSONextractSort(X,Y,activeData);\n\t\t\tchart = new google.visualization.LineChart(document.getElementById(idgraph));\n\t\t\tbreak;\n\t\tcase \"pie\" :\n\t\t\toptions = {\n\t\t\t title: X + ' vs. ' + Y,\n\t\t\t vAxis: {title: X, titleTextStyle: {color: 'red'}},\n\t\t\t hAxis: {title: Y, titleTextStyle: {color: 'red'}},\n\t\t\t width: 800,\n\t\t\t height: 480\n\t\t\t};\n\t\t\tmyData = JSONextractCount(X,activeData);\n\t\t\tchart = new google.visualization.PieChart(document.getElementById(idgraph));\n\t\t\tbreak;\n\t\tdefault : \n\t\t\tbreak;\n\t}\n\n var data = google.visualization.arrayToDataTable(myData);\n chart.draw(data, options);\n\n}", "function ChartsBarchart() {\n}", "function drawChart(){\n\n\tdataTable = new google.visualization.DataTable(data);\n\toptions.hAxis.ticks = dataTable.getDistinctValues(0);\n\n\tview = new google.visualization.DataView(dataTable);\n\t\n\toptions['series'] = Series();\n options['selectionMode'] = 'multiple';\n options['tooltip'] = {\n 'isHtml': true,\n trigger: 'both'\n }\n\n\tchart = new google.visualization.LineChart(document.getElementById(containerId));\n\n\tchart.draw(view, options);\n\n\t//google.visualization.drawChart({\n\t//\t\"containerId\": containerId,\n\t//\t\"chartType\": chartType,\n\t//\t\"options\": options,\n\t//\t\"dataTable\": data,\n\t//\t\"view\": view\n\t//})\n}", "function drawChart() {\n\t\n\n\t// Create our data table.\n\tjQuery.getJSON('/data/stats.json', function(stat_data) {\n\t\t\n\t\tjQuery.each(stat_data.entries, function(num, chart_info){\n\t\t\t\n\t\t\tvar data = new google.visualization.DataTable();\n\t\t\t\n\t\t\tif (chart_info.chart_type == \"Pie chart\"){\n\n\t\t\t\tdata.addColumn('string', chart_info.column_label);\n\t\t\t\tdata.addColumn('number', chart_info.numeric_label);\n\t\t\t\n\t\t\t\tdata.addRows(chart_info.stats.length);\n\t\t\t\n\t\t\t\tfor (var i=0; i < chart_info.stats.length; i++){\n\t\t\t\t\tfor(var j=0; j < chart_info.stats[i].length; j++){\n\t\t\t\t\t\tdata.setValue(i, j, chart_info.stats[i][j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\tvar chart = new google.visualization.PieChart(document.getElementById(chart_info.chart_div));\n\t\t\t\tchart.draw(data, {width: 750, height: 500, title: chart_info.chart_title});\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tdata.addColumn('string', 'Sectors');\n\t\t\t for (var i = 0; i < chart_info.stats.length; ++i) {\n\t\t\t data.addColumn('number', chart_info.stats[i][0]); \n\t\t\t }\n\n\n\t\t\t data.addRows(chart_info.axis_labels.length);\n\n\t\t\t for (var j = 0; j < chart_info.axis_labels.length; ++j) { \n\t\t\t data.setValue(j, 0, chart_info.axis_labels[j]); \n\t\t\t }\n\t\t\t\n\t\t\t for (var i = 0; i < chart_info.stats.length; ++i) {\n\t\t\t for (var j = 1; j < chart_info.stats[i].length; ++j) {\n\t\t\t data.setValue(j-1, i+1, chart_info.stats[i][j]); \n\t\t\t }\n\t\t\t }\n\t\t\t\n\t\t\t\t\n\t\t\t\tif (chart_info.chart_type == \"Vertical bar chart\"){\n\t\t\t\t\tvar chart = new google.visualization.ColumnChart(document.getElementById(chart_info.chart_div));\n\t\t\t\t\tchart.draw(data,{width: \"100%\", height: 700, title: chart_info.chart_title, vAxis: {title: \"NGOs\"}, hAxis: {title: \"Sectors\"}});\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tvar chart = new google.visualization.BarChart(document.getElementById(chart_info.chart_div));\n\t\t\t\t\tchart.draw(data,{width: \"100%\", height: 700, title: chart_info.chart_title, vAxis: {title: \"Sectors\"}, hAxis: {title: \"NGOs\"}});\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\n\t\t});\n\t\t\n\t\t\n\t});\n\t\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Value');\n data.addRows([\n ['', 3],\n ]);\n\n // Set chart options\n var options = {'title':'Parameter #1',\n 'width':'100%',\n 'height': 105,\n 'backgroundColor': { fill:'transparent' }};\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.BarChart(document.getElementById('chart1'));\n chart1.draw(data, options);\n var chart2 = new google.visualization.BarChart(document.getElementById('chart2'));\n chart2.draw(data, options);\n var chart3 = new google.visualization.BarChart(document.getElementById('chart3'));\n chart3.draw(data, options);\n var chart4 = new google.visualization.BarChart(document.getElementById('chart4'));\n chart4.draw(data, options);\n var chart5 = new google.visualization.BarChart(document.getElementById('chart5'));\n chart5.draw(data, options);\n var chart6 = new google.visualization.BarChart(document.getElementById('chart6'));\n chart6.draw(data, options);\n var chart7 = new google.visualization.BarChart(document.getElementById('chart7'));\n chart7.draw(data, options);\n var chart8 = new google.visualization.BarChart(document.getElementById('chart8'));\n chart8.draw(data, options);\n var chart9 = new google.visualization.BarChart(document.getElementById('chart9'));\n chart9.draw(data, options);\n var chart10 = new google.visualization.BarChart(document.getElementById('chart10'));\n chart10.draw(data, options);\n }", "function drawChart() {\n\t\t\t\t\tvar data = google.visualization.arrayToDataTable(\n\t\t\t\t\tInventArray, false);\n\t\t\t\t\tconsole.log(data);\n\n\t\t\t\t\t // Optional; add a title and set the width and height of the chart\n\t\t\t\t\tvar options = {'title':'Average Stock', 'width':350, 'height':300, 'chartArea': {'width': '100%', 'height': '80%'}, pieSliceText:'value-and-percentage'};\n\n\t\t\t\t\t// Display the chart inside the <div> element with id=\"piechart\"\n\t\t\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('piechart'));\n\t\t\t\t\tchart.draw(data, options);\n\t\t\t\t}", "function drawChart() {\r\n var data = google.visualization.arrayToDataTable([\r\n ['Task', 'Hours per Day'],\r\n ['windows', 8],\r\n ['MacOS', 4],\r\n ['Android', 1],\r\n ['iOS', 2],\r\n ['その他', 2]\r\n]);\r\n\r\n // Optional; add a title and set the width and height of the chart\r\n var options = {'width':400, 'height':260};\r\n\r\n // Display the chart inside the <div> element with id=\"piechart\"\r\n var chart = new google.visualization.PieChart(document.getElementById('checkOs'));\r\n chart.draw(data, options);\r\n}", "function drawChart() {\n\t var data = google.visualization.arrayToDataTable([\n\t ['Task', 'Hours per Day'],\n\t ['Work', 8],\n\t ['Eat', 2],\n\t ['TV', 4],\n\t ['Gym', 2],\n\t ['Sleep', 8]\n\t]);\n\n\t // Optional; add a title and set the width and height of the chart\n\t var options = {'title':'My Average Day', 'width':300, 'height':340};\n\n\t // Display the chart inside the <div> element with id=\"piechart\"\n\t var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n\t chart.draw(data, options);\n\t}", "function drawChart( pItemSel, pItemHeight, pConfigData, pValuesData, pDefaultConfig, pContainer ) {\n\n apex.debug.info( {\n \"fct\": `${util.featureDetails.name} - drawChart`,\n \"pItemSel\": pItemSel,\n \"pItemHeight\": pItemHeight,\n \"pConfigData\": pConfigData,\n \"pValuesData\": pValuesData,\n \"pDefaultConfig\": pDefaultConfig,\n \"featureDetails\": util.featureDetails\n } );\n\n // eslint-disable-next-line no-undef\n const d3JS = d3;\n\n const aTypeCharts = [\"pie\", \"donut\", \"gauge\"],\n specialStr = \"\\u200b\",\n seriesData = util.groupObjectArray( pValuesData, 'seriesID' );\n\n let isGauge = false,\n isPie = false,\n isDonut = false;\n\n // sort pValuesData by Time\n function sortArrByTime( pArr, pFormat ) {\n\n function customeSort( pFirstValue, pSecondValue ) {\n const parseTime = d3JS.timeParse( pFormat ),\n fD = parseTime( pFirstValue.x ),\n sD = parseTime( pSecondValue.x );\n return new Date( fD ).getTime() - new Date( sD ).getTime();\n }\n\n try {\n return pArr.sort( customeSort );\n }\n catch ( e ) {\n apex.debug.error( {\n \"fct\": `${util.featureDetails.name} - drawChart`,\n \"msg\": \"Error while try sort JSON Array by Time Value\",\n \"err\": e,\n \"featureDetails\": util.featureDetails\n } );\n }\n }\n\n /* search link from data and set window.location.href */\n function executeLink( pData ) {\n const key = specialStr + unescape( pData.id );\n let index = pData.index;\n\n if ( seriesData[key] ) {\n const seriesObj = seriesData[key];\n if ( seriesObj.length === 1 ) {\n index = 0;\n }\n\n if ( seriesData[key][index] && seriesData[key][index].link ) {\n util.link( seriesData[key][index].link, seriesData[key][index].linkTarget );\n }\n }\n }\n\n try {\n const chartTitle = setObjectParameter( pConfigData.chartTitle, pDefaultConfig.d3JSchart.chartTitle || \"\" ).toString(),\n background = setObjectParameter( pConfigData.background, pDefaultConfig.d3JSchart.background );\n let backJSON = null,\n ownTooltip = false;\n\n if ( util.isDefinedAndNotNull( background ) ) {\n backJSON = {\n color: background\n };\n }\n\n /* line */\n const lineStep = setObjectParameter( pConfigData.lineStep, pDefaultConfig.d3JSchart.line.step );\n\n /* gauge */\n const gaugeMin = setObjectParameter( pConfigData.gaugeMin, pDefaultConfig.d3JSchart.gauge.min ),\n gaugeMax = setObjectParameter( pConfigData.gaugeMax, pDefaultConfig.d3JSchart.gauge.max ),\n gaugeType = setObjectParameter( pConfigData.gaugeType, pDefaultConfig.d3JSchart.gauge.type ),\n gaugeWidth = setObjectParameter( pConfigData.gaugeWidth, pDefaultConfig.d3JSchart.gauge.width ),\n gaugeArcMinWidth = setObjectParameter( pConfigData.gaugeArcMinWidth, pDefaultConfig.d3JSchart.gauge.arcMinWidth ),\n gaugeFullCircle = setObjectParameter( pConfigData.gaugeFullCircle, pDefaultConfig.d3JSchart.gauge.fullCircle, true ),\n gaugeTitle = setObjectParameter( pConfigData.gaugeTitle, pDefaultConfig.d3JSchart.gauge.title || \"\" ).toString();\n\n /* Grid */\n const gridX = setObjectParameter( pConfigData.gridX, pDefaultConfig.d3JSchart.grid.x, true ),\n gridY = setObjectParameter( pConfigData.gridY, pDefaultConfig.d3JSchart.grid.y, true );\n\n /* heights */\n const heightXAxis = setObjectParameter( pConfigData.xAxisHeight, pDefaultConfig.d3JSchart.x.axisHeight );\n\n /* Legend */\n const legendShow = setObjectParameter( pConfigData.legendShow, pDefaultConfig.d3JSchart.legend.show, true ),\n legendPosition = setObjectParameter( pConfigData.legendPosition, pDefaultConfig.d3JSchart.legend.position );\n\n /* padding */\n const chartPadding = util.jsonSaveExtend( null, pDefaultConfig.d3JSchart.padding );\n\n if ( util.isDefinedAndNotNull( pConfigData.paddingBottom ) ) {\n chartPadding.bottom = pConfigData.paddingBottom;\n }\n\n if ( util.isDefinedAndNotNull( pConfigData.paddingLeft ) ) {\n chartPadding.left = pConfigData.paddingLeft;\n }\n\n if ( util.isDefinedAndNotNull( pConfigData.paddingRight ) ) {\n chartPadding.right = pConfigData.paddingRight;\n }\n\n if ( util.isDefinedAndNotNull( pConfigData.paddingTop ) ) {\n chartPadding.top = pConfigData.paddingTop;\n }\n\n /* Axis */\n const rotateAxis = setObjectParameter( pConfigData.rotateAxis, pDefaultConfig.d3JSchart.rotateAxis, true ),\n axisLabelPosition = setObjectParameter( pConfigData.axisLabelPosition, pDefaultConfig.d3JSchart.axisLabelPosition );\n\n let xAxisLabelPosition = null,\n yAxisLabelPosition = null;\n\n switch ( axisLabelPosition ) {\n case \"inner1\":\n xAxisLabelPosition = \"inner-left\";\n yAxisLabelPosition = \"inner-bottom\";\n break;\n case \"inner2\":\n xAxisLabelPosition = \"inner-center\";\n yAxisLabelPosition = \"inner-middle\";\n break;\n case \"inner3\":\n xAxisLabelPosition = \"inner-right\";\n yAxisLabelPosition = \"inner-top\";\n break;\n case \"outer1\":\n xAxisLabelPosition = \"outer-left\";\n yAxisLabelPosition = \"outer-bottom\";\n break;\n case \"outer2\":\n xAxisLabelPosition = \"outer-center\";\n yAxisLabelPosition = \"outer-middle\";\n break;\n case \"outer3\":\n xAxisLabelPosition = \"outer-right\";\n yAxisLabelPosition = \"outer-top\";\n break;\n default:\n break;\n }\n\n if ( rotateAxis ) {\n const xAxisLabelPositionTmp = xAxisLabelPosition;\n xAxisLabelPosition = yAxisLabelPosition;\n yAxisLabelPosition = xAxisLabelPositionTmp;\n }\n\n /* tooltip */\n const tooltipShow = setObjectParameter( pConfigData.tooltipShow, pDefaultConfig.d3JSchart.tooltip.show, true ),\n tooltipGrouped = setObjectParameter( pConfigData.tooltipGrouped, pDefaultConfig.d3JSchart.tooltip.grouped, true );\n\n /* Transition duration */\n const transitionDuration = setObjectParameter( pConfigData.transitionDuration || pDefaultConfig.d3JSchart.transitionDuration );\n\n /* x Axis */\n const xShow = setObjectParameter( pConfigData.xShow, pDefaultConfig.d3JSchart.x.show, true ),\n xLabel = setObjectParameter( pConfigData.xLabel, pDefaultConfig.d3JSchart.x.label || \"\" ).toString();\n let xType = setObjectParameter( pConfigData.xType, pDefaultConfig.d3JSchart.x.type ),\n xAxisTimeFormat = null,\n xName = null;\n\n /* x ticks */\n const xTickCutAfter = setObjectParameter( pConfigData.xTickCutAfter, pDefaultConfig.d3JSchart.x.tick.cutAfter ),\n xTickMaxNumber = setObjectParameter( pConfigData.xTickMaxNumber, pDefaultConfig.d3JSchart.x.tick.maxNumber ),\n xTickRotation = setObjectParameter( pConfigData.xTickRotation, pDefaultConfig.d3JSchart.x.tick.rotation ),\n xTickMultiline = setObjectParameter( pConfigData.xTickMultiline, pDefaultConfig.d3JSchart.x.tick.multiline, true ),\n xTickFit = setObjectParameter( pConfigData.xTickFit, pDefaultConfig.d3JSchart.x.tick.fit, true ),\n xTickAutoRotate = setObjectParameter( pConfigData.xTickAutoRotate, pDefaultConfig.d3JSchart.x.tick.autoRotate, true );\n let xTickTimeFormat = null;\n\n if ( xType === \"category\" || xType === \"timeseries\" ) {\n xName = \"x\";\n }\n\n if ( xType === \"timeseries\" ) {\n xAxisTimeFormat = setObjectParameter( pConfigData.xTimeFormat, pDefaultConfig.d3JSchart.x.timeFormat );\n xTickTimeFormat = setObjectParameter( pConfigData.xTickTimeFormat, pDefaultConfig.d3JSchart.x.tick.timeFormat );\n // sort data because of tooltip index\n sortArrByTime( pValuesData, xAxisTimeFormat );\n }\n\n /* cut string if category names are to long */\n if ( xType === \"category\" ) {\n xTickTimeFormat = function ( index, categoryName ) {\n return util.cutString( categoryName, xTickCutAfter );\n };\n }\n\n /* y Axis */\n const yLabel = setObjectParameter( pConfigData.yLabel, pDefaultConfig.d3JSchart.y.label || \"\" ).toString(),\n yLog = setObjectParameter( pConfigData.yLog, pDefaultConfig.d3JSchart.y.log, true );\n let yType = null;\n if ( yLog ) {\n yType = \"log\";\n }\n const yMin = pConfigData.yMin || pDefaultConfig.d3JSchart.y.min,\n yMax = pConfigData.yMax || pDefaultConfig.d3JSchart.y.max,\n yCulling = pConfigData.yTickMaxNumber || pDefaultConfig.d3JSchart.y.tick.maxNumber,\n yUnit = pConfigData.yUnit || pDefaultConfig.d3JSchart.y.unit;\n\n /* y2 Axis */\n const y2Label = setObjectParameter( pConfigData.y2Label, pDefaultConfig.d3JSchart.y2.label || \"\" ).toString(),\n y2Log = setObjectParameter( pConfigData.y2Log, pDefaultConfig.d3JSchart.y2.log, true );\n let y2Type = null,\n y2Show = false;\n if ( y2Log ) {\n y2Type = \"log\";\n }\n const y2Min = setObjectParameter( pConfigData.y2Min, pDefaultConfig.d3JSchart.y2.min ),\n y2Max = setObjectParameter( pConfigData.y2Max, pDefaultConfig.d3JSchart.y2.max ),\n y2Culling = setObjectParameter( pConfigData.y2TickMaxNumber, pDefaultConfig.d3JSchart.y2.tick.maxNumber ),\n y2Unit = setObjectParameter( pConfigData.y2Unit, pDefaultConfig.d3JSchart.y2.unit );\n\n /* Zoom and Subchart */\n const zoomType = setObjectParameter( pConfigData.zoomType, pDefaultConfig.d3JSchart.zoom.type );\n let showSubChart = false,\n zoomEnabled = setObjectParameter( pConfigData.zoomEnabled, pDefaultConfig.d3JSchart.zoom.enabled, true );\n\n const charThreshold = setObjectParameter( pConfigData.threshold, pDefaultConfig.d3JSchart.threshold );\n\n if ( zoomEnabled ) {\n if ( zoomType === \"scroll\" ) {\n showSubChart = false;\n } else if ( zoomType === \"subchart\" ) {\n showSubChart = true;\n zoomEnabled = false;\n } else if ( zoomType === \"drag\" ) {\n zoomEnabled = true;\n showSubChart = false;\n }\n } else {\n showSubChart = false;\n }\n\n const zoomRescale = setObjectParameter( pConfigData.zoomRescale, pDefaultConfig.d3JSchart.zoom.rescale, true );\n\n /* Prepare Data for Render */\n const dataArr = [],\n categoriesArr = [],\n groupsArr = [],\n colorsJSON = {},\n typesJSON = {},\n axesJSON = {},\n namesJSON = {},\n groupJSON = {},\n xCatObj = util.groupObjectArray( pValuesData, \"x\" );\n\n let seriesCnt = 0;\n\n if ( seriesData ) {\n /* Add Categories or time values to x Axis when correct type is set */\n if ( xType === \"category\" || xType === \"timeseries\" ) {\n categoriesArr.push( \"x\" );\n const xCatArr = Object.keys( xCatObj );\n\n $.each( xCatArr, function ( dIdx, dataValues ) {\n categoriesArr.push( ( setObjectParameter( dataValues.replace( specialStr, \"\" ), null ) ) );\n } );\n }\n\n dataArr.push( categoriesArr );\n\n /* Transform data for billboard.js */\n $.each( seriesData, function ( idx, seriesData ) {\n let series;\n seriesCnt += 1;\n if ( seriesData[0] && seriesData[0].seriesID ) {\n series = seriesData[0];\n const dataKey = escape( series.seriesID );\n colorsJSON[dataKey] = series.color;\n typesJSON[dataKey] = series.type;\n\n /* check if atypechart*/\n if ( aTypeCharts.indexOf( series.type ) >= 0 ) {\n zoomEnabled = false;\n }\n\n if ( series.type === \"gauge\" ) {\n isGauge = true;\n }\n\n if ( series.type === \"pie\" ) {\n isPie = true;\n }\n\n if ( series.type === \"donut\" ) {\n isDonut = true;\n }\n\n if ( util.isDefinedAndNotNull( series.tooltip ) ) {\n ownTooltip = true;\n }\n\n axesJSON[dataKey] = ( series.yAxis || \"y\" );\n if ( util.isDefinedAndNotNull( series.groupID ) ) {\n const groupID = escape( series.groupID.toString() );\n if ( groupJSON[groupID] ) {\n groupJSON[groupID].push( dataKey );\n } else {\n groupJSON[groupID] = [];\n groupJSON[groupID].push( dataKey );\n }\n }\n\n if ( series.yAxis === \"y2\" ) {\n y2Show = true;\n }\n namesJSON[dataKey] = ( setObjectParameter( series.label, dataKey ) );\n\n const arr = [];\n arr.push( dataKey );\n if ( xType === \"category\" || xType === \"timeseries\" ) {\n $.each( xCatObj, function ( dIdx, dataValues ) {\n let setValueY = null,\n setValueZ = null;\n $.each( dataValues, function ( sIDx, sDataValues ) {\n if ( escape( sDataValues.seriesID ) === dataKey ) {\n setValueY = sDataValues.y;\n if ( sDataValues.z ) {\n setValueZ = sDataValues.z;\n }\n }\n } );\n if ( setValueZ !== null ) {\n arr.push( {\n \"y\": setValueY,\n \"z\": setValueZ\n } );\n } else {\n arr.push( setValueY );\n }\n } );\n } else {\n $.each( seriesData, function ( dIdx, dataValues ) {\n const setValueY = setObjectParameter( dataValues.y, null );\n if ( dataValues.z ) {\n const setValueZ = dataValues.z;\n arr.push( {\n \"y\": setValueY,\n \"z\": setValueZ\n } );\n } else {\n arr.push( setValueY );\n }\n } );\n }\n\n dataArr.push( arr );\n\n } else {\n util.errorMessage.show( pItemSel, pDefaultConfig.errorMessage );\n apex.debug.error( {\n \"fct\": `${util.featureDetails.name} - drawChart`,\n \"msg\": \"No seriesID found in seriesID Cursor\",\n \"featureDetails\": util.featureDetails\n } );\n }\n\n } );\n\n /* Group JSON to Array */\n $.each( groupJSON, function ( dIdx, jsonObj ) {\n groupsArr.push( jsonObj );\n } );\n\n /* Labels and Datapoints */\n let dataLabels = setObjectParameter( pConfigData.showDataLabels, pDefaultConfig.d3JSchart.showDataLabels, true );\n\n if ( isPie || isDonut ) {\n dataLabels = {\n colors: \"white\"\n };\n } else if ( isGauge ) {\n dataLabels = {\n colors: ( gaugeType === \"single\" && seriesCnt > 1 ) ? \"white\" : \"inherit\"\n };\n }\n const showDataPoints = setObjectParameter( pConfigData.showDataPoints, pDefaultConfig.d3JSchart.showDataPoints, true ),\n showAbsoluteValues = setObjectParameter( pConfigData.showAbsoluteValues, pDefaultConfig.d3JSchart.showAbsoluteValues );\n let absoluteFormatting;\n\n if ( showAbsoluteValues ) {\n absoluteFormatting = function ( value ) {\n return value + yUnit;\n };\n }\n\n let ttContent;\n if ( ownTooltip ) {\n ttContent = function ( d ) {\n const div = $( \"<div></div>\" );\n div.addClass( \"bb-tooltip\" );\n div.addClass( \"bida-chart-tooltip-custome\" );\n $.each( d, function ( i, pData ) {\n const key = specialStr + unescape( pData.id ),\n seriesObj = seriesData[key],\n index = pData.index;\n \n if ( seriesObj && seriesObj[index] && util.isDefinedAndNotNull( seriesObj[index].tooltip ) && util.isDefinedAndNotNull( pData.value ) ) {\n const subDiv = $( \"<div>\" );\n\n let ttS = seriesObj[index].tooltip;\n if ( pRequireHTMLEscape !== false ) {\n ttS = util.escapeHTML( ttS );\n }\n subDiv.append( ttS );\n div.append( subDiv );\n }\n } );\n return div[0].outerHTML;\n };\n }\n\n try {\n const chartContIDSel = pItemSel + \"bbc\",\n chartContID = chartContIDSel.replace( \"#\", \"\" ),\n chartCont = $( \"<div></div>\" );\n chartCont.attr( \"id\", chartContID );\n\n $( pItemSel ).append( chartCont );\n\n const bbData = {\n bindto: chartContIDSel,\n background: backJSON,\n title: {\n text: chartTitle\n },\n size: {\n height: pItemHeight\n },\n data: {\n x: xName,\n xFormat: xAxisTimeFormat,\n columns: dataArr,\n types: typesJSON,\n groups: groupsArr,\n colors: colorsJSON,\n labels: dataLabels,\n axes: axesJSON,\n names: namesJSON,\n onclick: function ( pData ) {\n executeLink( pData );\n }\n },\n pie: {\n label: {\n format: absoluteFormatting,\n threshold: charThreshold\n }\n },\n donut: {\n label: {\n format: absoluteFormatting,\n threshold: charThreshold\n }\n },\n line: {\n step: {\n type: lineStep\n }\n },\n gauge: {\n label: {\n format: absoluteFormatting,\n threshold: charThreshold\n },\n fullCircle: gaugeFullCircle,\n min: gaugeMin,\n max: gaugeMax,\n type: gaugeType,\n width: gaugeWidth,\n title: gaugeTitle,\n arc: {\n minWidth: gaugeArcMinWidth\n }\n },\n radar: {\n direction: {\n clockwise: true\n }\n },\n subchart: {\n show: showSubChart\n },\n zoom: {\n type: zoomType,\n enabled: zoomEnabled,\n rescale: zoomRescale\n },\n transition: {\n duration: transitionDuration\n },\n legend: {\n show: legendShow,\n position: legendPosition\n },\n tooltip: {\n show: tooltipShow,\n grouped: tooltipGrouped,\n contents: ttContent\n },\n grid: {\n x: {\n show: gridX,\n },\n y: {\n show: gridY\n }\n },\n point: {\n show: showDataPoints\n },\n axis: {\n rotated: rotateAxis,\n x: {\n show: xShow,\n label: {\n text: xLabel,\n position: xAxisLabelPosition\n },\n type: xType,\n tick: {\n culling: {\n max: xTickMaxNumber\n },\n autorotate: xTickAutoRotate,\n rotate: xTickRotation,\n multiline: xTickMultiline,\n format: xTickTimeFormat,\n fit: xTickFit\n },\n height: heightXAxis\n },\n y: {\n label: {\n text: yLabel,\n position: yAxisLabelPosition\n },\n type: yType,\n max: yMax,\n min: yMin,\n tick: {\n culling: {\n max: yCulling\n },\n format: function ( d ) {\n return d + yUnit;\n }\n }\n },\n y2: {\n show: y2Show,\n label: {\n text: y2Label,\n position: yAxisLabelPosition\n },\n type: y2Type,\n max: y2Max,\n min: y2Min,\n tick: {\n culling: {\n max: y2Culling\n },\n format: function ( d ) {\n return d + y2Unit;\n }\n }\n }\n },\n padding: chartPadding\n };\n\n apex.debug.info( {\n \"fct\": `${util.featureDetails.name} - drawChart`,\n \"finalChartData\": bbData,\n \"featureDetails\": util.featureDetails\n } );\n\n // eslint-disable-next-line no-undef\n const chart = bb.generate( bbData );\n\n /* reset zoom on right click */\n if ( zoomEnabled ) {\n $( chartContIDSel ).contextmenu( function ( evt ) {\n evt.preventDefault();\n chart.unzoom();\n } );\n }\n\n /* execute resize */\n pContainer.on( \"resize\", function() {\n chart.resize( {\n height: pItemHeight\n } );\n } );\n\n } catch ( e ) {\n $( pItemSel ).empty();\n util.errorMessage.show( pItemSel, pDefaultConfig.errorMessage );\n apex.debug.error( {\n \"fct\": `${util.featureDetails.name} - drawChart`,\n \"msg\": \"Error while try to render chart\",\n \"err\": e,\n \"featureDetails\": util.featureDetails\n } );\n }\n } else {\n util.noDataMessage.show( pItemSel, pDefaultConfig.noDataMessage );\n }\n } catch ( e ) {\n $( pItemSel ).empty();\n util.errorMessage.show( pItemSel, pDefaultConfig.errorMessage );\n apex.debug.error( {\n \"fct\": `${util.featureDetails.name} - drawChart`,\n \"msg\": \"Error while prepare data for chart\",\n \"err\": e,\n \"featureDetails\": util.featureDetails\n } );\n }\n }", "function winInit() {\n myDIV = document.getElementById(\"myDIV\");\n myCanvas = document.getElementById('myCanvas');\n ctx = myCanvas.getContext(\"2d\");\n\n exampleCanvas = document.getElementById('exampleCanvas');\n ctx2 = exampleCanvas.getContext(\"2d\");\n\n drawColumnChart({\n ctx: ctx,\n canvas: myCanvas,\n xData: [1,2,3,4,5,6],\n yData: [10,30,20,10,20,60],\n cvx: myCanvas.width/6, // canvas.width / antall kolonner (6)\n cvy: 500,\n number: 6,\n widthPx: 50,\n yScale: 7,\n barColor: \"Green\",\n textColor: \"Pink\"\n });\n\n drawHtmlTable(myDIV, [\"nice\", \"verynice\", \"reallynice\"], [\"1\", \"13231231212\", \"38218942\", \"1\", \"2\", \"3\"]);\n\n drawPieChart(ctx2, exampleCanvas, [1,2,3], [\"Red\", \"blue\", \"yellow\"]);\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'FIO');\n data.addColumn('number', 'Count');\n i = 0; \n\n names = document.querySelectorAll('.DName');\n values = document.querySelectorAll('.DCount');\n\n while (i + 1 <= names.length) {\n data.addRows([\n [names[i].innerText, +values[i].innerText]\n ]);\n i++;\n }\n\n // Set chart options\n var options = {\n 'title': 'Кругова діаграма',\n 'width': 500,\n 'height': 500\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "draw() {\n this.plot = this.svg.append('g')\n .classed(\"plot\", true)\n .attr('transform', `translate(${this.margin.left},${this.margin.top})`);\n\n // Add the background\n this.plot.append(\"rect\")\n .attrs({\n fill: \"white\",\n x: 0,\n y: 0,\n height: this.innerHeight,\n width: this.innerWidth\n });\n\n if ( this.opts.nav !== false ) {\n this.drawNav();\n }\n\n // Add the title\n this.svg.append('text')\n .attr('transform', `translate(${this.width / 2},${this.margin.top / 2})`)\n .attr(\"class\", \"chart-title\")\n .attr('x', 0)\n .attr('y', 0)\n .text(this.title);\n }", "function drawChart(){\n canvas = d3.select(\"#chart\").append(\"svg\")\n .attr(\"class\",\"variationChart\")\n .attr(\"width\", width)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n}", "function drawChart(reactionData) {\n var reactionDataTable = new google.visualization.DataTable();\n reactionDataTable.addColumn('number', 'Time');\n reactionDataTable.addColumn('number', 'Reaction');\n reactionDataTable.addRows(reactionData);\n\n var options = {\n title: 'Reactions over Time',\n curveType: 'function',\n width: 900,\n height: 500,\n legend: 'none',\n hAxis: {title: 'Time'},\n vAxis: {title: 'Reaction'}\n };\n // set the chart handle\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n\n //var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));\n chart.draw(reactionDataTable, options);\n }", "function drawChart() {\n\t//creates x and y axis and names them\n\tvar data = new google.visualization.DataTable();\n\tdata.addColumn('number', 'Num of itarations');\n\tdata.addColumn('number', 'Cost');\n\n\tdata.addRows(loss);//add the loss array which holds how the network is preforming\n\t \n\t//gives the chart a name and changes its size\n\tvar options = {\n\t\tchart: {\n\t\t\ttitle: 'The Cost of the network',\n\t\t},\n\t\twidth: window.innerWidth*0.4,\n\t\theight: window.innerHeight*0.2\n\t};\n\t\n\t//crates the chart\n\tvar chart = new google.charts.Line(document.getElementById('line_top_x'));\n\t\n\t//remove goggles error when the loss array is empty\n\tgoogle.visualization.events.addListener(chart, 'error', function (googleError) {\n\t\tgoogle.visualization.errors.removeError(googleError.id);\n\t});\n\t//shows the chart\n\tchart.draw(data, google.charts.Line.convertOptions(options));\n }", "function draw(count1, count2, id){\n \n google.charts.setOnLoadCallback(drawChart(count1, count2, id));\n }", "function draw_chart(c){\n c.beginPath();\n c.strokeStyle = \"red\";\n c.moveTo(count_block(5),count_block(40));\n\n var xplot = 10;\n for(let j=0; j < data.length; j++){\n var data_in_blocks = data[j]/100; \n \n \n c.strokeText(data[j].toString(), count_block(xplot), count_block(40-data_in_blocks)-10);\n c.lineTo(count_block(xplot), count_block(40-data_in_blocks));\n c.arc(count_block(xplot), count_block(40-data_in_blocks), 3,0, Math.PI*2, true);\n xplot+=5;\n \n }\n c.stroke();\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Budget');\n data.addColumn('number', 'Amount');\n data.addRows([\n ['Income', total_income],\n ['Expense', total_expense]\n ]);\n\n // Set chart options\n var options = {'title':'Income/Expense Pie Chart',\n 'width':400,\n 'height':300};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "function drawChart() {\n\n// n.b. need all these retrieved;\n var chart5_ovs = parseFloat(document.getElementById('chart5_ovs').value);\n var chart5_hormo = parseFloat(document.getElementById('chart5_hormo').value);\n var chart5_chemo_add = parseFloat(document.getElementById('chart5_chemo_add').value);\n var chart5_tram_add = parseFloat(document.getElementById('chart5_tram_add').value);\n var chart10_ovs = parseFloat(document.getElementById('chart10_ovs').value);\n var chart10_hormo = parseFloat(document.getElementById('chart10_hormo').value);\n var chart10_chemo_add = parseFloat(document.getElementById('chart10_chemo_add').value);\n var chart10_tram_add = parseFloat(document.getElementById('chart10_tram_add').value);\n var types=['Year','Survival with no Adjuvant treatment',\n 'Benefit of Adjuvant Hormone therapy'];\n if ( chart5_chemo_add > 0.0001 ) {\n types[types.length]='Additional benefit of Adjuvant Chemotherapy';\n }\n if ( chart5_tram_add > 0.0001 ) {\n types[types.length]='Additional benefit of Trastuzumab';\n }\n types[types.length]= { role: 'annotation' };\n var yr5 = ['Five years', chart5_ovs, chart5_hormo];\n var yr10 = ['Ten years', chart10_ovs, chart10_hormo];\n if ( chart5_chemo_add > 0.0001 ) {\n yr5[yr5.length]= chart5_chemo_add;\n yr10[yr10.length]= chart10_chemo_add;\n }\n if ( chart5_tram_add > 0.0001 ) {\n yr5[yr5.length]= chart5_tram_add;\n yr10[yr10.length]= chart10_tram_add;\n }\n yr5[yr5.length]= '';\n yr10[yr10.length]= '';\n var data = google.visualization.arrayToDataTable([types,yr5,yr10]);\n\n// alternate construction - cant get this to work\n// var data = google.visualization.DataTable();\n// data.addColumn({ type: 'number', label: 'Five years', id: 'year5', role: 'annotation' });\n// data.addColumn({ type: 'number', label: 'Ten years', id: 'year10', role: 'annotation' });\n// data.addRow([10, 24]);\n// data.addRow([16, 22]);\n\n var view = new google.visualization.DataView(data);\n// n.b. view.setColumns() Specifies which columns are visible in this view. Any columns not specified will be hidden\n var setcols=[0,1,{ calc: \"stringify\",sourceColumn: 1,type: \"string\",role: \"annotation\" }];\n// only set the hormo benefit value (column 2) to be displayed if it's > 0.0\n// n.b. hormo value is always in the data array so always index 2\n if ( chart5_hormo > 0.0001 ) {\n setcols[setcols.length]= 2;\n setcols[setcols.length]= { calc: \"stringify\",sourceColumn: 2,type: \"string\",role: \"annotation\" };\n } else {\n// setcols[setcols.length]= 2; # not needed as not displaying ??\n }\n// n.b. if present chemo is always index 3 and traz always index 4 (no traz without chemo)\n if ( chart5_chemo_add > 0.0001 ) {\n setcols[setcols.length]= 3;\n setcols[setcols.length]= { calc: \"stringify\",sourceColumn: 3,type: \"string\",role: \"annotation\" };\n } else {\n// setcols[setcols.length]= 3;\n }\n if ( chart5_tram_add > 0.0001 ) {\n setcols[setcols.length]= 4;\n setcols[setcols.length]= { calc: \"stringify\",sourceColumn: 4,type: \"string\",role: \"annotation\" };\n// setcols[setcols.length]= 5;\n }\n setcols[setcols.length]= types.length - 1;\n view.setColumns(setcols);\n// view.setColumns([0, // this example for labelling of 2 data regimes in bar chart\n// 1,{ calc: \"stringify\",sourceColumn: 1,type: \"string\",role: \"annotation\" },\n// 2,{ calc: \"stringify\",sourceColumn: 2,type: \"string\",role: \"annotation\" },3]);\n\n// n.b. height & width are set as same as in img block\n// legend:{ alignment: 'bottom', textStyle: { fontSize: getFontSize(), overflow: 'auto'} }\n// legend: {position: 'bottom', alignment: 'center', maxLines: 4, textStyle: { overflow: 'none'}},\n// legend is uncontrolable - especially for long labels like we have! so don't use and replace with static png\n// n.b. give chart max y-axis of 105 so top category value label has enough room to display\n// tooltips: {isHtml: true, showColorCode: true},\n// colors: ['#666699','#00ff00','#ff9900','#00aa99'],\n// n.b. since new release of google charts on 23/2/15 for ER -ve (0 hormo) we now need to remove the green\n// from the colours vector as it's being used for the chemo i.e. zero hormo is not being interpretted\n// properly seemingly a bug - corrected 17/3/15 by emd\n var cols = ['#666699'];\n if ( chart5_hormo > 0.001 ) {\n cols[cols.length]= '#00ff00';\n }\n cols[cols.length]= '#ff9900';\n cols[cols.length]= '#00aa99';\n var options = {\n title: 'Overall Survival at 5 and 10 years (percent)',\n colors: cols,\n vAxis: {maxValue: 105, ticks: [0,10,20,30,40,50,60,70,80,90,100]},\n chartArea: {left:40, top:30, width:'70%', height:'65%'},\n legend: {position: 'none'},\n bar: {groupWidth: \"50%\"},\n isStacked: true,\n width: 360,\n height: 460\n };\n\n var chart_div = document.getElementById('chart1');\n var chart = new google.visualization.ColumnChart(chart_div);\n\n// n.b. currently turned off as causes tooltips NOT to be displayed on mouseover -must have tooltips!\n // Wait for the chart to finish drawing before calling the getImageURI() method.\n// google.visualization.events.addListener(chart, 'ready', function () {\n// chart_div.innerHTML = '<img src=\"' + chart.getImageURI() + '\">';\n// console.log(chart_div.innerHTML);\n// });\n\n// chart.draw(data, options); // use this form if not using the view object for labelling\n chart.draw(view, options);\n\n }", "function chartEmergingNow_Draw(ele, dataset) {\n // Variables\n ele = \"#\" + ele;\n $(ele +\" svg\").remove();\n\n // Data\n var data = null;\n if(dataset === \"InterestsPassions\"){\n data = appData[activeAudience].psychographics.categoriesData[activeInterestsPassionsCategory].analyses[0].emergingNow;\n }\n if(dataset === \"InsightsTrends\"){\n data = appData[activeAudience].insightstrends.categoriesData[activeInsightsTrendsCategory].emergingNow;\n }\n\n // Dimensions\n w = $(ele).width();\n var h = 110;\n\n var radius = 10;\n var max_n = 0;\n for (var d in data) {\n max_n = Math.max(data[d].value, max_n);\n }\n var dx = w / max_n;\n var dy = 30;\n\n // Draw\n var svg = d3.select(ele)\n .append(\"svg\")\n .attr(\"width\", w)\n .attr(\"height\", h);\n \n // Bars\n var bars = svg.selectAll(\".bar\")\n .data(data)\n .enter()\n .append(\"rect\")\n .attr(\"class\", function(d, i) { return \"bar\"; })\n .attr(\"x\", function(d, i) { return 0; })\n .attr(\"y\", function(d, i) { return (dy + 10) * i; })\n .attr(\"width\", function(d, i) { return (d.value / max_n) * 100 + '%'; })\n .attr(\"height\", dy)\n .attr(\"rx\", radius)\n .attr(\"ry\", radius)\n .attr( \"fill\", function( d, i ) { return chartEmergingNow_ColorSeries( i ); });\n\n // Labels\n var text = svg.selectAll(\"text\")\n .data(data)\n .enter()\n .append(\"text\")\n .attr(\"class\", function(d, i) { return \"label\";} )\n .attr(\"x\", 10)\n .attr(\"y\", function(d, i) { return ((dy + 10) * i) + 20;} )\n .attr(\"font-size\", \"12px\")\n .attr(\"font-weight\", \"bold\")\n .attr(\"fill\", \"#ffffff\")\n .text( function(d) { return d.insight; } );\n\n}", "function drawEmployeeChart() {\r\n\r\n\t\t// ----- first chart ---------\r\n\t\t// Create the data table.\r\n\t\tvar dataTable = google.visualization.arrayToDataTable([\r\n\t\t\t['Type', 'Count'],\r\n\t\t\t['Masked', data['total_employee'] - data['total_result_employee']],\r\n\t\t\t['Unmasked', data['total_result_employee']]\r\n\t\t]);\r\n\r\n\t\t// Set chart options\r\n\t\tvar options = {\r\n\t\t\t'width': 500,\r\n\t\t\t'height': 400,\r\n\t\t\tbackgroundColor: 'transparent',colors: ['#809cb5', '#34485c'],\r\n\t\t\tlegend:{textStyle:{fontSize:'14', fontName: 'Montserrat'}}\r\n\t\t};\r\n\t\tvar title = { 'title': 'Employee Ratio' , \r\n\t\t\t\t\t titleTextStyle: {fontSize:'16', fontName: 'Montserrat'}\r\n\r\n\t\t\t\t};\r\n\r\n\t\t// Instantiate and draw our chart, passing in some options.\r\n\t\tvar chart = new google.visualization.PieChart(document.getElementById('chart1_div'));\r\n\t\tchart.draw(dataTable, { ...title, ...options });\r\n\r\n\r\n\t\t// ----- second chart ---------\r\n\t\tdataTable = google.visualization.arrayToDataTable([\r\n\t\t\t['Type', 'Count'],\r\n\t\t\t['Visitor', data['total_result'] - data['total_result_employee_occurance']],\r\n\t\t\t['Employee', data['total_result_employee_occurance']]\r\n\t\t]);\r\n\t\ttitle = { 'title': 'Unmasked Occurance Ratio' ,\r\n\t\t\t\ttitleTextStyle: {fontSize:'16', fontName: 'Montserrat'}};\r\n\t\tchart = new google.visualization.PieChart(document.getElementById('chart2_div'));\r\n\t\tchart.draw(dataTable, { ...title, ...options });\r\n\t}", "function drawChart3() {\n var data3\n // Create the data table.\n data3 = new google.visualization.DataTable();\n data3.addColumn('string', 'nombre');\n data3.addColumn('number', 'cantidad');\n data3.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por actividad escuela: '+escuela,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data3, options1);\n\n }", "function DrawImpressionsChart()\n{\n // create/delete rows \n if (impressionsTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - impressionsTable.getNumberOfRows();\n impressionsTable.addRows(numRows);\n } else {\n for(var i=(impressionsTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n impressionsTable.removeRow(i); \n }\n }\n\n // Populate data table with time/impressions data points. \n for(var i=0; i < impressionsTable.getNumberOfRows(); i++)\n {\n impressionsTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n impressionsTable.setCell(i, 1, parseInt(aggrDataPoints[i].impressions));\n }\n\n // Draw line chart.\n chartOptions.title = 'Impressions Chart';\n impressionsChart.draw(impressionsView, chartOptions); \n}", "function drawChart() {\n const data = new google.visualization.DataTable();\n data.addColumn('string', 'Animal');\n data.addColumn('number', 'Count');\n data.addRows([\n ['2001', 23],\n ['2002', 22],\n ['2003', 23],\n ['2004', 23],\n ['2005', 28],\n ['2006', 28],\n ['2007', 25],\n ['2008', 28],\n ['2009', 27],\n ['2010', 6],\n ['2015', 18],\n ['2016', 18]\n ]);\n\n const options = {\n 'title': 'Distribution of BIONICLE sets per year (2001-2010; 2015-2016)',\n 'width':600,\n 'height':600\n };\n\n const chart = new google.visualization.PieChart(\n document.getElementById('chart-container'));\n chart.draw(data, options);\n}", "function renderPieChart() {\n var i, x, y, r, a1, a2, set, sum;\n\n x = width / 2;\n y = height / 2;\n r = Math.min(x, y) - 2;\n a1 = 1.5 * Math.PI;\n a2 = 0;\n set = sets[0];\n sum = sumSet(set);\n\n for (i = 0; i < set.length; i++) {\n ctx.fillStyle = colorOf(i);\n ctx.beginPath();\n a2 = a1 + (set[i] / sum) * (2 * Math.PI);\n\n // TODO opts.wedge\n ctx.arc(x, y, r, a1, a2, false);\n ctx.lineTo(x, y);\n ctx.fill();\n a1 = a2;\n }\n }", "function draw(datatable) {\n // Define look and feel parameters using options object to override defaults.\n var width = options.width || 300;\n var backgroundColor = options.backgroundColor;\n var globalStyle = options.globalStyle || {fontFamily:'sans-serif'};\n var titleStyle = options.titleStyle || {fontWeight:'bold'};\n var captionStyle = options.captionStyle || {fontSize:'0.70em'};\n var powerRange = options.powerRange || 6000;\n var title = options.title || source;\n\n // Create a datatable with this source's data and baseline.\n datatable = addBaseline(datatable);\n\n // Get the top-level div where this visualization should go.\n element = document.getElementById(viz_id);\n\n // Now add the elements.\n addGlobalStyle(element, backgroundColor, width, globalStyle);\n addTitleDiv(element, viz_id, title, titleStyle);\n addMeterDiv(element, viz_id, datatable, backgroundColor, width, powerRange);\n addCaptionDiv(element, viz_id, captionStyle, datatable);\n }", "function drawChart() {\n\n\t// empty the container to generate chart with updated width\n\tdocument.getElementById(\"value-chart\").innerHTML = \"\";\n\n\t// get the new width of the container that will hold the chart\n\tlet chartContainerWidth = document.getElementById('chart-container').clientWidth;\n\tlet chartWidth = chartContainerWidth - 20;\n\n\t// obtain the height of the table\n\tlet tableHeight = document.getElementById('table-data').clientHeight;\n\t// assign the height of the chart to be equal to the height of the table \n\t// remove 30px to account for the chart title\n\tlet chartHeight = tableHeight - 30; // height of svg container for chart \n\t\n\t// define chart data\n\tlet dataChart = d3.zip(arrayIds, arrayNames, arrayValue2);\n\n\t// define y scale\n\tlet yScale = d3.scaleBand()\n\t\t\t\t\t.domain(d3.range(arrayIds.length))\n\t\t\t\t\t.rangeRound([0, chartHeight])\n\t\t\t\t\t.round(true)\n\t\t\t\t\t.paddingInner(0.05);\n\n\t// define x scale\n\tlet xScale = d3.scaleLinear()\n\t\t\t\t\t.domain([0, d3.max(arrayValue2)]) // +10 to show labels above\n\t\t\t\t\t.range([40, chartWidth]);\t\t\n\n\t// create SVG element\n\tlet svgSales = d3.select(\"#value-chart\") // select by id\n\t\t\t\t.append(\"svg\") // insert the <svg> inside the selected <div>\n\t\t\t\t.attr(\"width\", chartWidth) // assign width\n\t\t\t\t.attr(\"height\", chartHeight) // assign height\n\t\t\t\t.attr(\"id\", \"value-chart-svg\"); // assign id\t\n\n\t// create <g> for each month\n\tlet sales = svgSales.selectAll('g.value-judet')\n\t\t.data(dataChart);\n\tlet salesEnter = sales.enter()\n\t .append('g')\n\t .classed('value-judet', true);\n\t\n\t// create the <rect> elements\n\tsalesEnter.append(\"rect\")\n\t .attr(\"y\", function(d, i) {\n\t \t\treturn yScale(i);\n\t })\n\t .attr(\"x\", function(d) {\n\t \t\treturn 0; // bars aligned to left\n\t })\n\t .attr(\"height\", \"26px\")\n\t .attr(\"width\", function(d) {\n\t \t\treturn xScale(d[2]); // -70 to position labels below chart\n\t })\n\t .attr(\"fill\", function(d) {\n\t \t\treturn chooseColor2(d[2]); // fill bars according to sales\n\t });\n\n\n\t// labels for sales\n\tsalesEnter.append(\"text\")\n\t .attr(\"class\", \"labels-value\") // assign a CSS class\n\t .text(function(d) {\n\t \t\treturn thousandsSeparator(d[2]);\n\t })\n\t .attr(\"text-anchor\", \"middle\")\n\t .attr(\"x\", 35)\n\t .attr(\"y\", function(d, i) {\n\t \t\treturn yScale(i) + 17;\n\t });\n\n\t// tooltips\n\tsalesEnter.append(\"title\")\n\t\t.text(function(d, i) {\n\t\t\treturn thousandsSeparator(d[2]);\n\t\t});\n\n\t// sort chart bars by value\n\tfunction sortBarsValue() {\n\n\t\t// flip value of sortOrder\n\t \t// sortOrder = !sortOrder;\n\n\t\t// sort the rectangles (bars) of the bar chart \n\t\tsvgSales.selectAll(\"rect\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[2], b[2]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[2], b[2]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000)\n\t\t .attr(\"y\", function(d, i) {\n\t\t \t\treturn yScale(i);\n\t\t })\n\n \t\t// sort the text labels of the bar chart\n \t\tsvgSales.selectAll(\"text\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[2], b[2]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[2], b[2]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000)\n\t\t .attr(\"y\", function(d, i) {\n\t\t \t\treturn yScale(i) + 17;\n\t\t });\n\n \t\t// sort the tooltips of the bar chart\n \t\tsvgSales.selectAll(\"title\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[2], b[2]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[2], b[2]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000);\n\n\t\t// !!! very important to change sort order for next function to sort\n\t\tsortOrder = !sortOrder;\n\t};\t\t\n\n\t// sort chart bars by county\n\tfunction sortBarsJudet() {\n\n\t\t// sort the rectangles (bars) of the bar chart \n\t\tsvgSales.selectAll(\"rect\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[1], b[1]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[1], b[1]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000)\n\t\t .attr(\"y\", function(d, i) {\n\t\t \t\treturn yScale(i);\n\t\t })\n\n \t\t// sort the text labels of the bar chart\n \t\tsvgSales.selectAll(\"text\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[1], b[1]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[1], b[1]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000)\n\t\t .attr(\"y\", function(d, i) {\n\t\t \t\treturn yScale(i) + 17;\n\t\t });\n\n \t\t// sort the tooltips of the bar chart\n \t\tsvgSales.selectAll(\"title\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[1], b[1]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[1], b[1]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000);\n\n\t\t// !!! very important to change sort order for next function to sort\n\t\tsortOrder = !sortOrder; \n\t};\t\n\n\t// sort chart bars by ids\n\tfunction sortBarsId() {\n\n\t\t// sort the rectangles (bars) of the bar chart \n\t\tsvgSales.selectAll(\"rect\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[0], b[0]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[0], b[0]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000)\n\t\t .attr(\"y\", function(d, i) {\n\t\t \t\treturn yScale(i);\n\t\t })\n\n \t\t// sort the text labels of the bar chart\n \t\tsvgSales.selectAll(\"text\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[0], b[0]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[0], b[0]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000)\n\t\t .attr(\"y\", function(d, i) {\n\t\t \t\treturn yScale(i) + 17;\n\t\t });\n\n \t\t// sort the tooltips of the bar chart\n \t\tsvgSales.selectAll(\"title\")\n\t\t .sort(function(a, b) {\n\t\t \t\tif (sortOrder) {\n\t\t\t \t\treturn d3.ascending(a[0], b[0]);\n\t\t \t\t} else {\n\t\t\t \t\treturn d3.descending(a[0], b[0]);\n\t\t \t\t}\n\t\t \t})\n\t\t .transition()\n\t\t .duration(1000);\n\n\t\t// !!! very important to change sort order for next function to sort\n\t\tsortOrder = !sortOrder;\n\t};\t\n\n\t// select HTML elements using D3 to assign the sort functions\n\t// select the chart header using d3\n\tlet chartHeader = d3.select(\"#chart-title\");\n\t// select the second of the headers (for id sort)\n\tlet tableHeaderIds= d3.selectAll(\"th\").filter(\":first-child\");\n\t// select the second of the headers (for zip code sort)\n\tlet tableHeaderJudet = d3.selectAll(\"th\").filter(\":nth-child(2)\");\n\t// select the last of the headers (for sales sort)\n\tlet tableHeaderValue2 = d3.selectAll(\"th\").filter(\":last-child\");\n\n\t// assign the sorting function to the table ids header\n\ttableHeaderIds.on(\"click\", function() {\n\t\tsortBarsId();\n\t})\t\n\n\t// assign the sorting function to the table zips header\n\ttableHeaderJudet.on(\"click\", function() {\n\t\tsortBarsJudet();\n\t})\t\n\n\t// assign the sorting function to the table sales header\n\ttableHeaderValue2.on(\"click\", function() {\n\t\tsortBarsValue();\n\t})\t\n\n}", "function drawChart() \n{\n\tvar data = google.visualization.arrayToDataTable(dataPointsPos);\n\n\tvar options = \n\t{\n\t\ttitle: 'Comments about ' + entity + ' on Twitter during ' + year + '-' + month,\n\t\tchartArea: \n\t\t{\n\t\t\twidth: '60%', \n\t\t\theight: '90%', \n\t\t\tbackgroundColor: \n\t\t\t{\n\t\t\t\t'fill': '#F4F4F4',\n\t\t\t\t'opacity': 100\n\t\t\t}\n\t\t},\n\t\thAxis: \n\t\t{\n\t\t\ttitle: 'Number of Comments',\n\t\t\tminValue: 0,\n\t\t},\n\t\tvAxis: \n\t\t{\n\t\t\ttitle: 'Date'\n\t\t}\n\t\t \n\t};\n\n\tvar chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n\n\tfunction selectHandler() \n\t{\n\t\tvar selectedItem = chart.getSelection()[0];\n\t\tconsole.log(selectedItem);\n\t\t\n\t\tif (selectedItem) \n\t\t{\n\t\t\tvar date = data.getValue(selectedItem.row, 0);\n\n\t\t\tvar comments = getComments(entity, date);\n\n\t\t\t$('#tbodyid').empty();\n\t\t\tfor (var i = 0; i < 10; i++) \n\t\t\t{\n\t\t\t\t$('#tbodyid').append('<tr><td>'+comments[\"pos\"][i]+'</td><td>'+comments[\"neg\"][i]+'</td></tr>');\n\t\t\t}\n\t\t}\n\t}\n\n\tgoogle.visualization.events.addListener(chart, 'select', selectHandler); \n\tchart.draw(data, options);\n}", "function SVGRowChart() {\r\n }" ]
[ "0.7766029", "0.74025255", "0.7394388", "0.7315559", "0.7298981", "0.7275957", "0.72704506", "0.7261915", "0.7242139", "0.7208406", "0.7186227", "0.7163451", "0.7124008", "0.7106811", "0.7092066", "0.7067875", "0.7059014", "0.703996", "0.7032495", "0.7031648", "0.7017393", "0.7007765", "0.6981468", "0.6979154", "0.69718236", "0.6963266", "0.6957576", "0.69288033", "0.6924782", "0.6905275", "0.69036657", "0.6900881", "0.6899509", "0.68969584", "0.6882052", "0.6875325", "0.68676186", "0.6866549", "0.68665326", "0.68647856", "0.6851795", "0.6845039", "0.68356013", "0.68153095", "0.6769386", "0.6766873", "0.67667735", "0.67664206", "0.6759274", "0.6753273", "0.6736576", "0.67323476", "0.67261976", "0.6725546", "0.6722018", "0.6720712", "0.6720665", "0.67152506", "0.6710682", "0.670828", "0.67044073", "0.6703489", "0.669132", "0.66909134", "0.66836524", "0.6682707", "0.6678788", "0.6661635", "0.666045", "0.6643772", "0.66401654", "0.6639271", "0.6628581", "0.6624819", "0.6623863", "0.66237634", "0.66208076", "0.66137373", "0.66082", "0.6608179", "0.660426", "0.6591206", "0.6581942", "0.6575264", "0.65703726", "0.656948", "0.656863", "0.65566766", "0.6556503", "0.65497863", "0.65338564", "0.65313375", "0.6523803", "0.6516289", "0.65055233", "0.6495282", "0.6485945", "0.64841616", "0.6483439", "0.6482651", "0.64799875" ]
0.0
-1
setup pagination if amount of merchants is greater than per page value
setupPaginator(newProps) { if (this.state.filteredRows.length) { return this.state.filteredRows.length > this.state.perPage; } return newProps.merchants ? newProps.merchants.length > this.state.perPage : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handlePageClick(data) {\n const selected = data.selected;\n const offset = Math.ceil(selected * this.state.perPage);\n\n this.setState({\n offset,\n currentPage: selected + 1,\n merchants: this.state.totalRows.slice(offset, offset + this.state.perPage),\n filteredRowsPaged: this.state.filteredRows.slice(offset, offset + this.state.perPage),\n }, () => {\n if (this.state.filteredRowsPaged.length > 0) {\n this.globalSelectorGroup(this.state.filteredRowsPaged);\n } else {\n this.globalSelectorGroup(this.state.merchants);\n }\n });\n }", "get paginator() {\n if (this.pagination && this.props.globalSelector.orgIds.length > 0) {\n const pageCount = this.state.filterText !== '' ? this.state.filteredPageCount : this.state.pageCount;\n\n return (\n <Pagination\n handlePageClick={this.handlePageClick}\n pageCount={pageCount}\n currentPage={this.state.currentPage}\n />\n );\n }\n return false;\n }", "changePerPage(value) {\n this.perPage = value;\n if (this.page*value > this.data.meta.total) {\n this.page = Math.floor(this.data.meta.total / value) + 1;\n }\n this.fetch();\n }", "updateItemsPerPage(pagination) {\n this.loadLeads();\n }", "function _admins_list(page){\n _loading(1);\n $.post('/api/v1/ams/admin',{\n 'id': userData['id'],\n 'token': userData['token'],\n 'status': 0,\n 'page': page,\n 'sector_id': $('#sector_id').val(),\n }, function (e) {\n let i;\n if(e['status'] === '00'){\n _total_data = e.count_admin.total_admins;\n $('.small_data').text((_page*_limit)+1)\n let _big_data = (_page+1)*_limit;\n console.log('test');\n\n let _max = parseInt(_total_data/_limit);\n if(_big_data >= _total_data){\n console.log('test');\n _big_data = _total_data;\n }\n _check_arrow(_max);\n $('.big_data').text(_big_data);\n $('#total_admins, .total_data').text(_total_data);\n $('#total_active_admins').text(e.count_admin.active_admins);\n $('#total_passive_admins').text(e.count_admin.passive_admins);\n $('#total_wallet').text('Rp ' + e.total_wallet);\n $('#data_body').empty();\n if(e.data.length > 0){\n for(i=0; i < e.data.length; i++){\n _admins_append(e.data[i], i+1);\n }\n }else{\n $('#data_body').append(\n '<div class=\"_notif_menu\"><i class=\"fa fa-exclamation-triangle\"></i>admin dari sektor ini belum tersedia.</div>'\n )\n }\n }else{\n notif('danger', 'System Error!', e.message);\n }\n console.log(e.data.length)\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n}", "function initPagination() {\n _initSearchablePagination(\n $list,\n $('#search_form'),\n $('#pagination'), \n {\n url: '/appraisal_companies/_manager_list',\n afterLoad: function (content) {\n $list.html(content);\n initDelete();\n }\n }\n );\n }", "function _outlet_list(page){\n _loading(1);\n $.post('/api/v1/ams/outlet',{\n 'id': userData['id'],\n 'token': userData['token'],\n 'status': 0,\n 'page': page,\n 'user_id': 0,\n 'sector_id': $('#sector_id').val(),\n }, function (e) {\n let i;\n if(e['status'] === '00'){\n _total_data = e.count_user.total_outlet;\n $('.small_data').text((_page*_limit)+1)\n let _big_data = (_page+1)*_limit;\n console.log('test');\n let _max = parseInt(_total_data/_limit);\n if(_big_data >= _total_data){\n console.log('test');\n _big_data = _total_data;\n }\n _check_arrow(_max);\n $('.big_data').text(_big_data);\n $('#total_users, .total_data').text(_total_data);\n $('#data_body').empty();\n if(e.data.length > 0){\n for(i=0; i < e.data.length; i++){\n _outlet_append(e.data[i], i+1);\n // console.log(e.data);\n }\n }else{\n $('#data_body').append(\n '<div class=\"_notif_menu\"><i class=\"fa fa-exclamation-triangle\"></i>User dari sektor ini belum tersedia.</div>'\n )\n }\n }else{\n notif('danger', 'System Error!', e.message);\n }\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n });\n}", "function showMoreItemsPerPage(params) {\n var numberOfItems;\n numberOfItems = '' + (settings.numberOfItems || 50);\n params = (params || '?Grid-page=1&Grid-orderBy=~&Grid-filter=~&Grid-size=50').replace(/50/g, numberOfItems);\n location.replace(href + params);\n }", "changePerPage(event) {\n const {params, accounting, setProp} = this.props;\n const perPage = parseInt(event.target.value, 10);\n setProp(Immutable.fromJS({\n paid: 1,\n unpaid: 1\n }), 'page');\n this.setState({\n perPage\n });\n const tab = accounting.get('tab');\n // Revert to page one, update search\n const search = this.updateBeforeRetrieval(tab);\n // Get records\n this.retrieveRecords(params.type, search, 1, perPage);\n }", "async paginate(per_page = null, page = null) {\r\n if (!_.isNil(per_page)) {\r\n per_page = parseInt(per_page);\r\n } else {\r\n if (Request.has('per_page')) {\r\n per_page = parseInt(Request.get('per_page'));\r\n } else {\r\n per_page = 20;\r\n }\r\n }\r\n if (!_.isNil(page)) {\r\n page = parseInt(page);\r\n } else {\r\n if (Request.has('page')) {\r\n page = parseInt(Request.get('page'));\r\n } else {\r\n page = 1;\r\n }\r\n }\r\n let params = {\r\n offset: (page - 1) * per_page,\r\n limit: per_page,\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n distinct: true\r\n };\r\n\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findAndCountAll(params);\r\n\r\n const paginator = new LengthAwarePaginator(result.rows, result.count, per_page, page);\r\n return paginator;\r\n }", "function limitPagination() {\n let active = +document.querySelector('.active').innerHTML;\n let pagination = document.querySelector('.pagination .limit ul');\n let paginationItems = pagination.children;\n if (active + 1 > 5) {\n m += 50;\n pagination.style.marginLeft = -m + 'px';\n }\n else if (active <= 5) {\n m = 0;\n pagination.style.marginLeft = m;\n }\n m = 0;\n}", "isMoreToProcess(info, data) {\n if (!info || !data || !data[0]) {\n return false;\n }\n let perPage = bpu.ebayInt(data[0], \"paginationOutput/entriesPerPage\");\n if (!perPage) {\n return false;\n }\n // adding additional search returns\n info.processed += perPage;\n if (info.processed >= info.bp.max_results) {\n return false;\n }\n let totalPages = bpu.ebayInt(data[0], \"paginationOutput/totalPages\");\n if (!totalPages || info.ebay.pageNumber >= totalPages) {\n return false;\n }\n info.ebay.pageNumber += 1;\n return true;\n }", "function PagingInfo(totalCount)\n {\n $scope.totalCount = totalCount;\n $scope.totalPage = Math.ceil( $scope.totalCount / $scope.pageRecord)\n $scope.totalOption=[{}];\n for(var i = 0 ;i< $scope.totalPage;i++)\n {\n $scope.totalOption[i]={size:i+1};\n }\n }", "function PagingInfo(totalCount)\n {\n $scope.totalCount = totalCount;\n $scope.totalPage = Math.ceil( $scope.totalCount / $scope.pageRecord)\n $scope.totalOption=[{}];\n for(var i = 0 ;i< $scope.totalPage;i++)\n {\n $scope.totalOption[i]={size:i+1};\n }\n }", "function buildPager() {\n vm.pagedItems = [];\n vm.itemsPerPage = 7;\n vm.currentPage = 1;\n vm.figureOutItemsToDisplay();\n }", "function _paginator( offset ) {\n let arrayPages = [];\n let from = currentPage - offset;\n let to = from + (offset * 2);\n if(from < 1) from = 0;\n if(to >= totalPages) to = totalPages - 1;\n\n while(from <= to){\n arrayPages.push(from + 1);\n from ++;\n }\n return{\n backDisabled:currentPage <= 1 ? true : false,\n showFirstItem: currentPage > offset ? true : false,\n nextDisabled: currentPage >= totalPages ? true : false,\n showLastItem: currentPage < totalPages - offset - 1 ? true : false,\n items:arrayPages,\n totalPages,\n offset,\n totalItems\n }\n }", "static get PAGE_ITEMS() {\n return 50;\n }", "SET_PAGINATION(state, data) {\n state.pagination = data;\n }", "function numPages(){\n let no_pages = Math.ceil(all_participants.length/per_page);\n return parseInt(no_pages);\n }", "if (currentPage <= 6) {\n startPage = 1;\n endPage = totalPages;\n }", "function initItemPagination(num_entries) {\n \n // Create pagination element\n $(\".items_pagination\").pagination(num_entries, {\n \tnum_display_entries:7,\n num_edge_entries: 1,\n callback: itemsselectCallback,\n load_first_page:false,\n items_per_page:itemlimit\n });\n }", "_setupPagingAndFiltering() {\r\n const that = this;\r\n\r\n that.$.pager.$.pageSizeSelector.classList.add('underlined');\r\n that.$.pager.$.pageSizeSelector.dropDownAppendTo = 'body';\r\n\r\n that._filterInfo = { query: '' };\r\n that._applyFilterTemplate();\r\n that.$.header.classList.toggle('smart-hidden', that.filterRow && !that.filterTemplate);\r\n }", "function listPages(total_plants, on_page_num, isSearched) {\n\n const total_pages = Math.floor(total_plants / 20),\n subtracted = total_pages - on_page_num;\n\n let num_pages = [],\n limit_bounds = [-1, 4];\n let old_pages = document.querySelectorAll('button');\n let switched = false;\n\n // hide all the detail-related elements\n plant_detail.style.display = 'none';\n plant_detail_wrapper.style.display = 'none';\n\n // check for any old buttons before loading new ones\n if (old_pages.length > 0) {\n\n // remove them\n removeElements(old_pages);\n } \n\n // current page number is less than 20321\n if (on_page_num <= total_pages) {\n\n // change the currently selected page to one\n // so that the for loop below won't start with a negative number\n if (on_page_num === 0) {\n on_page_num = 1;\n switched = true;\n }\n\n // check if the current page reaches the 4 ending pages (upper limit)\n if (on_page_num > total_pages - 4) {\n\n // both limits will drop\n // upper limit should always be negative\n limit_bounds[0] = subtracted - 5;\n\n // lower limit should always be positive\n limit_bounds[1] = subtracted;\n }\n \n // create pages section at the bottom of a page\n // the loop starts with a page before the currently selected page\n // as the page progresses to the 4 ending pages, the index will start doing the calculation\n // so that, there is less numbers left on the right hand side and more on the left hand side of the selected page\n for (let i = on_page_num + limit_bounds[0]; i < on_page_num + limit_bounds[1]; i++) {\n\n // show the number of pages\n num_pages[i] = document.createElement('button');\n num_pages[i].innerHTML = i + 1;\n num_pages[i].className = 'page_number';\n pages.appendChild(num_pages[i]);\n\n // listen for a click event on one of the page numbers\n num_pages[i].addEventListener('click', async function () {\n\n // if the workflow chain starts with a search\n if (isSearched) {\n\n // re-start the workflow, with a selected page index passed in \n // to get started from there instead of going back from scratch \n await searchPlants(i + 1, i); \n\n // otherwise\n } else {\n\n // same logic\n await getPlants(i + 1, i);\n } \n \n // scroll the page to the top again\n window.scrollTo({ top: 0, behavior: 'smooth' });\n });\n\n // wait till the loop gets to the last element of the array\n if (i === on_page_num + limit_bounds[1] - 1) {\n\n const index = getModifiedIndexNumber(on_page_num, switched);\n \n // change the style of the currently selected button\n num_pages[index].style.backgroundColor = 'rgba(176, 245, 48, 0.699)';\n num_pages[index].style.fontSize = '10px';\n }\n }\n }\n}", "function renderPaginator(amount) {\n let totalPages = Math.ceil(amount / per_page_number);\n paginator.innerHTML = \"\";\n for (let page = 1; page <= totalPages; page++) {\n paginator.innerHTML += `<li class=\"page-item\"><a class=\"page-link\" href=\"#\" data-page=\"${page}\">${page}</a></li>`;\n }\n}", "function smallerpagination() {\r\n var maxPerPage = 5;\r\n\r\n var lastPageNumber = $('#move_left').data('count');\r\n // shows dots or no if more pages than maxPerPage\r\n if (lastPageNumber > maxPerPage) {\r\n // \r\n for (let el of document.querySelectorAll('.pagination_page'))\r\n el.style.display = 'none';\r\n // \r\n document.getElementsByClassName('morePages')[0].style.display = 'block';\r\n document.getElementsByClassName('morePages')[1].style.display = 'block';\r\n document.getElementsByClassName('morePages2')[0].style.display =\r\n 'block';\r\n document.getElementsByClassName('morePages2')[1].style.display =\r\n 'block';\r\n document.getElementsByClassName('pageba1')[0].style.display = 'block';\r\n document.getElementsByClassName('pageba1')[1].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + lastPageNumber,\r\n )[0].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + lastPageNumber,\r\n )[1].style.display = 'block';\r\n //\r\n\r\n // pulka maxima pagination an strance pro zobrazeni pulky predchozich a pulky nadchazejicih\r\n var howMuch = Math.floor(maxPerPage / 2);\r\n // kdyz mensi stranky nez maximum tak to zobrazi na strane else if zobrazi posledni else zobrazi na konci\r\n if (page <= maxPerPage - howMuch) {\r\n for (let index = 1; index <= maxPerPage; index++) {\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[0].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[1].style.display = 'block';\r\n }\r\n document.getElementsByClassName('morePages')[0].style.display =\r\n 'none';\r\n document.getElementsByClassName('morePages')[1].style.display =\r\n 'none';\r\n } else if (page > lastPageNumber - maxPerPage + howMuch) {\r\n for (\r\n let index = lastPageNumber - maxPerPage + 1; index <= lastPageNumber; index++\r\n ) {\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[0].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[1].style.display = 'block';\r\n }\r\n document.getElementsByClassName('morePages2')[0].style.display =\r\n 'none';\r\n document.getElementsByClassName('morePages2')[1].style.display =\r\n 'none';\r\n } else {\r\n for (\r\n let index = page - howMuch; index < page - howMuch + maxPerPage; index++\r\n ) {\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[0].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[1].style.display = 'block';\r\n }\r\n }\r\n } else {\r\n document.getElementsByClassName('morePages')[0].style.display = 'none';\r\n document.getElementsByClassName('morePages')[1].style.display = 'none';\r\n document.getElementsByClassName('morePages2')[0].style.display =\r\n 'none';\r\n document.getElementsByClassName('morePages2')[1].style.display =\r\n 'none';\r\n //\r\n }\r\n}", "function numberOfPages()\n{\n if(isSearched){\n return Math.ceil(searchResult.length / recordsPerPage);\n } else {\n return Math.ceil(data.length / recordsPerPage);\n }\n \n}", "function pagination() {\r\n\t\t\t\t$scope.pageSize = $scope.shownoofrec;\r\n\t\t\t\t\r\n\t\t\t\t$scope.currentPage = 0;\r\n\t\t\t\t$scope.totalPages = 0;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$scope.nextDisabled = false;\r\n\t\t\t\t$scope.previousDisabled = true;\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length <= 10 ) {\r\n\t\t\t\t\t$scope.nextDisabled = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length < 100) {\r\n\t\t\t\t\t$scope.totalnoof_records = self.Filtervehicles.length;\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfindrecord_count();\r\n\t\t\t\t}\r\n\t\t\t}", "get pageSizeOptions() { return this._pageSizeOptions; }", "initPagination(){\n this.getPagination().initPagination();\n }", "setPageSize(size) {\n\t\tthis.fetchExternalData(\n\t\t\t\tthis.state.filter, \n\t\t\t\tthis.state.currentPage, \n\t\t\t\tsize,\n\t\t\t\tthis.state.externalSortColumn,\n\t\t\t\tthis.state.externalSortAscending);\n }", "function showPage(listOfStudents, paginationPageSelected) {\r\n //if the first paginatinon button is selected the last index = 9, if the second pagination button is selected the last index = 19 etc\r\n const lastIndexToDisplay = (paginationPageSelected*10)-1;\r\n const firstIndexToDisplay = lastIndexToDisplay - 9;\r\n //make list items are hidden\r\n for(let i=0; i < list.length; i+=1) {\r\n document.querySelector('ul.student-list').children[i].style.display = 'none'//hides all\r\n }\r\n // of the matchedList, make sure that the onces within the selected index are revealed\r\n for(let i=0; i < listOfStudents.length; i+=1) {\r\n if(i >= firstIndexToDisplay && i <= lastIndexToDisplay) {\r\n // if the index of the matchedList is in the required range, reveal it!!!\r\n listOfStudents[i].style.display= '';\r\n }\r\n }\r\n}", "function amountOfPages() {\r\n let pages = Math.ceil(eachStudent.length / studentsPerPage);\r\n return pages;\r\n}", "function pagination(tableID) {\n var table = tableID;\n var trnum = 0;\n var maxRows = 15;\n var totalRows = $(table + \" tbody tr[class*='inList']\").length;\n $(table + \" tbody tr[class*='inList']\").each(function () {\n trnum++;\n if (trnum > maxRows) {\n $(this).hide();\n } if (trnum <= maxRows) {\n $(this).show();\n }\n });\n\n if (totalRows > maxRows) {\n var pagenu = Math.ceil(totalRows / maxRows);\n for (var i = 1; i <= pagenu && tableID == \"#custb\";) {\n $('#customer .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n for (var i = 1; i <= pagenu && tableID == \"#frtb\";) {\n $('#freelancer .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n for (var i = 1; i <= pagenu && tableID == \"#cattb\";) {\n $('#categoryValue .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n }\n\n $('.pagination li:first-child').addClass('active');\n $('.pagination li').on('click', function () {\n var pagenum = $(this).attr('data-page');\n var trIndex = 0;\n $('.pagination li').removeClass('active')\n $(this).addClass('active');\n $(table + \" tbody tr[class*='inList']\").each(function () {\n trIndex++;\n if (trIndex > (maxRows * pagenum) || trIndex <= ((maxRows * pagenum) - maxRows)) {\n $(this).hide();\n } else {\n $(this).show();\n }\n });\n });\n}", "function pagePagination(size){\n try{\n var optInit = {\n items_per_page: items_per_page,\n num_display_entries : items_per_page,\n prev_text: $(\"#previous\").val(),\n next_text: $(\"#next\").val(),\n callback: pageSelectCallback\n };\n $(\"#Pagination\").pagination(size, optInit);\n }catch (ex){\n }\n }", "function refreshPagination(projectCount){\n $('.light-pagination').pagination({\n items: projectCount,\n itemsOnPage: 20,\n cssStyle: 'compact-theme',\n onPageClick: function(pageNumber,event){\n pagedOipaLink = oipaLink + '&page='+ pageNumber;\n //$('.modal').show();\n $('#showResults').animate({opacity: 0.4},500,function(){\n $('.modal').show();\n });\n $.getJSON(pagedOipaLink,{\n format: \"json\"\n }).done(function(json){\n $('#showResults').animate({opacity: 1},500,function(){\n $('.modal').hide();\n });\n if(window.searchType == 'F'){\n $('#showResults').html('<div class=\"govuk-inset-text\" style=\"font-size: 14px;\">Default filter shows currently active projects. To see projects at other stages, either use the status filters or select the checkbox to search for completed projects.</div>');\n json = json.output;\n }\n else{\n $('#showResults').html('<div class=\"govuk-inset-text\" style=\"font-size: 14px;\">Default filter shows currently active projects. To see projects at other stages, use the status filters.</div>');\n }\n \n if (!isEmpty(json.next)){\n var tmpStr = '<div>Now showing projects <span name=\"afterFilteringAmount\" style=\"display:inline;\"></span><span id=\"numberofResults\" value=\"\" style=\"display:inline;\">'+(1+(20*(pageNumber-1)))+' - '+(20*pageNumber)+'</span> of '+projectCount+'</div>';\n $('#showResults').append(tmpStr);\n }\n else{\n var tmpStr = '<div>Now showing projects '+(1+(20*(pageNumber-1)))+' - '+projectCount+' of '+projectCount+'</div>';\n $('#showResults').append(tmpStr);\n }\n $.each(json.results,function(i,result){\n var validResults = {};\n validResults['iati_identifier'] = !isEmpty(result.iati_identifier) ? result.iati_identifier : \"\";\n validResults['id'] = !isEmpty(result.id) ? result.id : \"\";\n console.log(validResults['iati_identifier'])\n //Check title\n if(!isEmpty(result.title.narratives)){\n if(!isEmpty(result.title.narratives[0].text)){\n validResults['title'] = result.title.narratives[0].text;\n }\n else {\n validResults['title'] = \"\"; \n }\n }\n else{\n validResults['title'] = \"\";\n }\n //validResults['title'] = !isEmpty(result.title.narratives[0]) ? result.title.narratives[0].text : \"\";\n validResults['total_plus_child_budget_value'] = !isEmpty(result.activity_plus_child_aggregation.activity_children.budget_value) ? result.activity_plus_child_aggregation.activity_children.budget_value : 0;\n validResults['total_plus_child_budget_currency'] = !isEmpty(result.activity_plus_child_aggregation.activity_children.budget_currency) ? result.activity_plus_child_aggregation.activity_children.budget_currency : !isEmpty(result.activity_plus_child_aggregation.activity_children.incoming_funds_currency)? result.activity_plus_child_aggregation.activity_children.incoming_funds_currency: !isEmpty(result.activity_plus_child_aggregation.activity_children.expenditure_currency)? result.activity_plus_child_aggregation.activity_children.expenditure_currency: !isEmpty(result.activity_plus_child_aggregation.activity_children.disbursement_currency)? result.activity_plus_child_aggregation.activity_children.disbursement_currency: !isEmpty(result.activity_plus_child_aggregation.activity_children.commitment_currency)? result.activity_plus_child_aggregation.activity_children.commitment_currency: \"GBP\";\n validResults['total_plus_child_budget_currency_value'] = '';\n //$.getJSON(currencyLink,{amount: validResults['total_plus_child_budget_value'], currency: validResults['total_plus_child_budget_currency']}).done(function(json){validResults['total_plus_child_budget_currency_value'] = json.output});\n validResults['activity_status'] = !isEmpty(result.activity_status.name) ? result.activity_status.name : \"\";\n //Check reporting organization\n if(!isEmpty(result.reporting_organisation)){\n if(!isEmpty(result.reporting_organisation.narratives)){\n if(result.reporting_organisation.narratives[0].text == 'UK Department for International Development' || result.reporting_organisation.narratives[0].text == 'UK - Foreign & Commonwealth Office'){\n validResults['reporting_organisations'] = 'UK - Foreign, Commonwealth and Development Office';\n }\n else{\n validResults['reporting_organisations'] = result.reporting_organisation.narratives[0].text;\n }\n }\n else {\n validResults['reporting_organisations'] = \"\"; \n }\n }\n else{\n validResults['reporting_organisations'] = \"\";\n }\n //validResults['reporting_organisations'] = !isEmpty(result.reporting_organisations[0].narratives[0]) ? result.reporting_organisations[0].narratives[0].text : \"\";\n //check description's existence\n if(!isEmpty(result.descriptions)){\n if(!isEmpty(result.descriptions[0].narratives)){\n validResults['description'] = result.descriptions[0].narratives[0].text;\n }\n else {\n validResults['description'] = \"\"; \n }\n }\n else{\n validResults['description'] = \"\";\n }\n //validResults['description'] = !isEmpty(result.description[0].narratives[0]) ? result.description[0].narratives[0].text : \"\";\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['id']+'\">'+validResults['title']+' <small>['+ validResults['iati_identifier'] +']</small></a></h3><span class=\"budget\">Budget: <em> '+addCommas(validResults['total_plus_child_budget_value'],'B')+'</em></span><span>Status: <em>'+validResults['activity_status']+'</em></span><span>Reporting Org: <em>'+validResults['reporting_organisations']+'</em></span><p class=\"description\">'+validResults['description']+'</p></div>';\n if(window.searchType == 'F'){\n console.log(result.activity_plus_child_aggregation.totalBudget);\n if(validResults['title'].length == 0){\n validResults['title'] = 'Project Title Unavailable';\n }\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span>Reporting Organisation: <em>'+validResults['reporting_organisations']+'</em></span><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span><span>Activity Status: <em>'+validResults['activity_status']+'</em></span><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+result.activity_plus_child_aggregation.totalBudget+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div>'+'</em></span><p class=\"description\">'+validResults['description']+'</p></div>';\n var actualStartDate = '';\n var plannedStartDate = '';\n validResults['activity_dates'] = result.activity_dates;\n for(var i = 0; i < validResults['activity_dates'].length; i++){\n if(validResults['activity_dates'][i]['type']['code'] == 1){\n plannedStartDate = new Date(validResults['activity_dates'][i]['iso_date']).customFormat('#DD#-#MM#-#YYYY#');\n }\n if(validResults['activity_dates'][i]['type']['code'] == 2){\n actualStartDate = new Date(validResults['activity_dates'][i]['iso_date']).customFormat('#DD#-#MM#-#YYYY#');\n }\n }\n if(actualStartDate.length > 0){\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +actualStartDate\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +result.activity_plus_child_aggregation.totalBudget\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>'+actualStartDate+'</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+result.activity_plus_child_aggregation.totalBudget+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>'; \n }\n else if(plannedStartDate.length > 0){\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +plannedStartDate\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +result.activity_plus_child_aggregation.totalBudget\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>'+plannedStartDate+'</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+result.activity_plus_child_aggregation.totalBudget+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>';\n }\n else{\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +'N/A'\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +result.activity_plus_child_aggregation.totalBudget\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>N/A</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+result.activity_plus_child_aggregation.totalBudget+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>';\n }\n }\n else{\n var actualStartDate = '';\n var plannedStartDate = '';\n validResults['activity_dates'] = result.activity_dates;\n for(var i = 0; i < validResults['activity_dates'].length; i++){\n if(validResults['activity_dates'][i]['type']['code'] == 1){\n plannedStartDate = new Date(validResults['activity_dates'][i]['iso_date']).customFormat('#DD#-#MM#-#YYYY#');\n }\n if(validResults['activity_dates'][i]['type']['code'] == 2){\n actualStartDate = new Date(validResults['activity_dates'][i]['iso_date']).customFormat('#DD#-#MM#-#YYYY#');\n }\n }\n if(actualStartDate.length > 0){\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +actualStartDate\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +validResults['total_plus_child_budget_value']\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>'+actualStartDate+'</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+validResults['total_plus_child_budget_value']+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>'; \n }\n else if(plannedStartDate.length > 0){\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +plannedStartDate\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +validResults['total_plus_child_budget_value']\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>'+plannedStartDate+'</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+validResults['total_plus_child_budget_value']+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>';\n }\n else{\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +'N/A'\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +validResults['total_plus_child_budget_value']\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>N/A</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+validResults['total_plus_child_budget_value']+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>';\n } \n }\n // else{\n // var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span>Reporting Organisation: <em>'+validResults['reporting_organisations']+'</em></span><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span><span>Activity Status: <em>'+validResults['activity_status']+'</em></span><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+validResults['total_plus_child_budget_value']+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div>'+'</em></span><p class=\"description\">'+validResults['description']+'</p></div>';\n // }\n //$('.modal').hide();\n $('#showResults').append(tempString);\n });\n })\n .fail(function(error){\n $('#showResults').text(error.toSource());\n console.log(\"AJAX error in request: \" + JSON.stringify(error, null, 2));\n })\n .complete(function(){\n generateBudgetValues();\n });\n }\n });\n // $('.search-result h3 a small[class^=\"GB-\"]').parent().parent().parent().show();\n // $('.search-result h3 a small[class^=\"XM-DAC-12-\"]').parent().parent().parent().show();\n }", "function setPagination(newsCount) {\n var numbers, number;\n if (newsCount > 5) {\n \t/*jshint multistr: true */\n numbers = $('<div class=\"pagination\"><ul>\\\n <li id=\"prev\" class=\"prevnext current\">«</li>\\\n <li class=\"pageNumber current\" id=\"page1\">1<li>\\\n <li class=\"pageNumber\" id=\"page2\">2<li>\\\n <li id=\"next\" class=\"prevnext\">»</li>\\\n </ul></div>');\n if (newsCount > 10) {\n for (var i = 3; i <= pagesCount; ++i) {\n number = '<li class=\"pageNumber\" id=\"page' + i + '\">' + i + '<li>';\n numbers.find('#next').before(number);\n }\n }\n }\n return numbers;\n}", "function generatePagination(data, totalResults, numResultsToShow) {\n\n $('#custom-pagination').twbsPagination('destroy');\n\n var numPages = totalResults / numResultsToShow;\n if (numPages < 1) {\n numPages = 1;\n }\n\n $('#custom-pagination').twbsPagination({\n totalPages: numPages,\n visiblePages: 5,\n onPageClick: function (event, page) {\n var fromResult = Number(page-1) + \"0\";\n var toResult = page + \"0\";\n generateTable(data, fromResult, toResult);\n }\n });\n\n}", "function getPeople(pageNum){\n\tlet newPage = pageNum +1;\n\tif(newPage<11){\n\t\treturn{\n\t\t\ttype: FETCHING_PEOPLE,\n\t\t\tnewPage\n\t\t}\n\t}else{\n\t\talert(\"No more records available\")\n\t}\n}", "function paginateListBy(groupBy) {\n var arr = document.querySelectorAll('li.student-item');\n var paginationHTML = '';\n if (arr.length > groupBy) {\n for (var i = 0; i < arr.length / groupBy; i++) {\n paginationHTML += `<li><a href=\"#\">${i + 1}</a></li>`;\n };\n pagination.innerHTML = `<ul>${paginationHTML}</ul>`;\n pagination.querySelector('a').classList.add('active');\n } else {\n pagination.innerHTML = '';\n };\n}", "getLimitAndOffsetByPageAndContentPerPage() {\n const offset = this.currentPage() * this.perPage() - this.perPage();\n const limit = this.perPage();\n\n return {\n offset,\n limit,\n };\n }", "_applyPagination() {\n let page = Math.ceil(this.page / this.maxSize) - 1;\n let start = page * this.maxSize;\n let end = start + this.maxSize;\n return [start, end];\n }", "get pageSize() { return this._pageSize; }", "generatePaginations(activePage, paginationStart, maxViewPageNum) {\n const paginationItems = [];\n for (let number = paginationStart; number <= maxViewPageNum; number++) {\n paginationItems.push(\n <Pagination.Item key={number} active={number === activePage} onClick={() => { return this.getRecentCreatedList(number) }}>{number}</Pagination.Item>,\n );\n }\n return paginationItems;\n }", "function initPagination() {\n ctrl.page = {\n number: ctrl.page.number || 0,\n size: 10\n };\n }", "getPublishsByCampaignIdPagination(data){\nreturn this.post(Config.API_URL + Constant.PUBLISH_GETPUBLISHSBYCAMPAIGNIDPAGINATION, data);\n}", "function changePageSize(value) {\n gridOptions.api.paginationSetPageSize(Number(value));\n }", "function buildPaginationHelper(response) {\n //Building the pagination helper just if pagination object was provided\n if (\"pagination\" in vm.actions['LIST']) {\n //Pagination helper initialization\n vm.paginationHelper = {\n totalPages: null, //Number\n actualPage: null, //Number\n previousPage: null, //URL returned from API\n nextPage: null, //URL returned from API\n previousPageQueries: [],\n nextPageQueries: []\n };\n //Next page pagination kind is going to be used.\n if (vm.actions['LIST'].pagination['next']) {\n vm.paginationHelper['nextPage'] = response[vm.actions['LIST'].pagination['next']];\n }\n //Query building pagination is going to be used\n else {\n //Errors management\n if (!vm.actions['LIST'].pagination['total']) {\n $log.error(\"@CatalogManager, function @buildPaginationHelper << @list, parameter 'total' was not found on actions.pagination object\");\n return;\n }\n if (!vm.actions['LIST'].pagination['limit']) {\n $log.error(\"@CatalogManager, function @buildPaginationHelper << @list, parameter 'limit' was not found on actions.pagination object\");\n return;\n }\n if (!vm.actions['LIST'].pagination['offset']) {\n $log.error(\"@CatalogManager, function @buildPaginationHelper << @list, parameter 'offset' was not found on actions.pagination object\");\n return;\n }\n if (!vm.actions['LIST'].pagination['pageSize']) {\n $log.error(\"@CatalogManager, function @buildPaginationHelper << @list, parameter 'pageSize' was not found on actions.pagination object\");\n return;\n }\n\n //If the remainder it's not zero, it means that an aditional page should be added to the count,so the Math.ceil function was used for that\n vm.paginationHelper['totalPages'] = Math.ceil(response[vm.actions['LIST'].pagination['total']] / vm.actions['LIST'].pagination['pageSize']);\n\n vm.paginationHelper['actualPage'] = 1;\n\n //Initial nextPageQueries building\n if (vm.paginationHelper['totalPages'] > vm.paginationHelper['actualPage']) {\n vm.paginationHelper['nextPageQueries'].push('limit=' + vm.actions['LIST'].pagination['pageSize']);\n vm.paginationHelper['nextPageQueries'].push('offset=' + vm.actions['LIST'].pagination['pageSize']);\n //vm.paginationHelper['nextPage'] = vm.url\n // + '?limit=' + vm.actions['LIST'].pagination['pageSize']\n // + '&offset=' + vm.actions['LIST'].pagination['pageSize'];\n }\n }\n }\n }", "renderPagination() {\n if (!_.isEmpty(this.props.pageMeta)) {\n const lastRecord = this.props.pageMeta.current_items_count + this.props.pageMeta.offset;\n const firstRecord = this.props.pageMeta.offset + 1;\n const totalItemsCount = this.props.pageMeta.total_items_count;\n\n return (\n <div className=\"row\">\n <b> {firstRecord}-{lastRecord}/{totalItemsCount}</b> <br/>\n <nav aria-label=\"Page navigation example\">\n\n <ul className=\"pagination\">\n {this.renderFirstPaginationButton()}\n {this.props.pageMeta.has_prev_page &&\n (<li className=\"page-item\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous page\">\n <span className=\"page-link\"\n onClick={e => this.props.loadMore(this.props.location.pathname, this.props.pageMeta.prev_page_number, this.props.pageMeta.page_size)}>\n {this.props.pageMeta.prev_page_number}\n </span>\n </li>)}\n\n <li className=\"page-item active\">\n <a className=\"page-link page-ite\">\n {this.props.pageMeta.current_page_number}\n </a>\n </li>\n {this.props.pageMeta.has_next_page &&\n <li className=\"page-item\">\n <a className=\"page-link\"\n onClick={e => this.props.loadMore(this.props.location.pathname, this.props.pageMeta.next_page_number, this.props.pageMeta.requested_page_size)}>\n {this.props.pageMeta.next_page_number}\n </a>\n </li>}\n {this.renderLastPaginationButton()}\n </ul>\n </nav>\n </div>\n )\n }\n }", "render(pages = this.getTotalPages()) {\n this.newTotalPages(pages);\n const { container, currentPage, totalPages } = this;\n let links = ``;\n\n const ellipsis = `<span class=\"pagination__link pagination__link--ellipsis\">...</span>`;\n\n if (totalPages <= 7) {\n for (let page = 0; page < pages; page += 1) {\n links += `<a class=\"pagination__link ${\n page === Number(currentPage) - 1 ? \"pagination__link--active\" : \"\"\n }\" href=\"#\">${page + 1}</a>`;\n }\n }\n\n if (Number(currentPage) < 5 && totalPages > 7) {\n for (let page = 0; page < 5; page += 1) {\n links += `<a class=\"pagination__link ${\n page === Number(currentPage) - 1 ? \"pagination__link--active\" : \"\"\n }\" href=\"#\">${page + 1}</a>`;\n }\n links += `${ellipsis}<a class=\"pagination__link\" href=\"#\">${totalPages}</a>`;\n }\n\n if (\n Number(currentPage) >= 5 &&\n Number(currentPage) < Number(totalPages) - 3\n ) {\n links += `<a class=\"pagination__link\" href=\"#\">1</a>${ellipsis}`;\n\n for (let i = 3; i > 1; i -= 1) {\n links += `<a class=\"pagination__link\" href=\"#\">${\n Number(currentPage) - i + 1\n }</a>`;\n }\n\n links += `<a class=\"pagination__link pagination__link--active\" href=\"#\">${currentPage}</a>`;\n\n for (let i = 1; i < 3; i += 1) {\n links += `<a class=\"pagination__link\" href=\"#\">${\n Number(currentPage) + i\n }</a>`;\n }\n\n links += `${ellipsis}<a class=\"pagination__link\" href=\"#\">${totalPages}</a>`;\n }\n\n if (\n Number(totalPages) > 7 &&\n Number(currentPage) >= Number(totalPages) - 3\n ) {\n links += `<a class=\"pagination__link\" href=\"#\">1</a>${ellipsis}`;\n for (let page = Number(totalPages) - 5; page < totalPages; page += 1) {\n links += `<a class=\"pagination__link ${\n page === Number(currentPage) - 1 ? \"pagination__link--active\" : \"\"\n }\" href=\"#\">${page + 1}</a>`;\n }\n }\n\n container.innerHTML = links;\n }", "if(props.listLength > this.props.listLength) {\n this.setState({\n // list has more items now\n didEndReached: false,\n // set page number to next value\n page: this.state.page + 1,\n // BUG: endReachedThreshold only triggers once\n // so chaing this values for a small amount, endReachedThreshold\n // will always be fired when list did end reached\n endReachedThreshold: Math.random() * 1e-5,\n });\n }", "function calcPagination(initialMode) {\n if (initialMode) {\n tp = parseInt(resp_data.length / page_capacity);\n if (resp_data.length % page_capacity === 0) {\n if (tp != 0) {\n tp = tp - 1;\n }\n }\n $(\"#total-page\").html(tp + 1);\n }\n $(\"#cur-page\").html(cp + 1);\n}", "function paginate(jqXHR){\n\n // get the pagination ul\n var paginate = $('#pagination ul.pager');\n paginate.empty();\n var info = $('#info');\n info.empty();\n\n // set the content range info\n var rangeHeader = jqXHR.getResponseHeader('Content-Range');\n var total = rangeHeader.split('/')[1];\n var range = rangeHeader.split('/')[0].split(' ')[1];\n info.append('<span>Displaying ' + range + ' of ' + total + ' results');\n\n // check if we have a link header\n var a, b;\n var link = jqXHR.getResponseHeader('Link');\n if (link) {\n var links = link.split(',');\n a = links[0];\n b = links[1];\n }\n else {\n // no link header so only one page of results returned\n return;\n }\n\n /*\n * Configure next/prev links for pagination\n * and handle pagination events\n */\n if (b) {\n var url = b.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = b.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/> Prev</a></li>&nbsp;');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n\n if (a) {\n var url = a.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = a.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n if (rel == 'prev') {\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/> Prev</a></li>');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n else {\n paginate.append('<li id=\"next\" data-url=\"' + url + '\"><a href=\"#\">Next <span class=\"glyphicon glyphicon-chevron-right\"/></a></li>');\n $('li#next').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n }\n }", "function pagination(max = 4) {\n\n let paginations = document.querySelectorAll('.pagination');\n\n for (let i = 0, n = paginations.length; i < n; i++) {\n \n let pageItems = paginations[i].querySelectorAll('.page-item');\n \n if (pageItems.length - 2 >= max) {\n for (let j = 0, m = pageItems.length; j < m; j++) {\n\n if (pageItems[j].classList.contains('active') || j === 0 || j === m-1) {\n continue;\n //console.log(pageItems[j]);\n }\n //createEllipsis(pageItems[j]);\n pageItems[j].style.display = 'none';\n\n }\n }\n }\n\n function createEllipsis(el) {\n let ellipsisA = document.createElement('a');\n ellipsisA.href = '#';\n ellipsisA.innerHTML = 'of';\n ellipsisA.classList.add('page-link');\n\n let ellipsisLI = document.createElement('li');\n ellipsisLI.classList.add('page-item');\n ellipsisLI.classList.add('disabled');\n\n ellipsisLI.appendChild(ellipsisA);\n\n el.parentNode.insertBefore(ellipsisLI, el.nextElementSibling);\n }\n}", "_applyShowPagination(value, old) {\n if (value) {\n if (this.__pages.length > 1) {\n this.__pagination.show();\n }\n } else {\n this.__pagination.hide();\n }\n }", "function initPagination() {\n\t\tfind = _initPagination({\n\t\t\turl: '/investors/_manage_list',\n\t\t\tlist: $list,\n\t\t\tpagination: $('#pagination'),\n\t\t\tdone: function (content) {\n\t\t\t\t$list.html(content);\n\t\t\t\tinitItem();\n\t\t\t\tinitDelete();\n\t\t\t}\n\t\t});\n\n\t\tvar searchForm = document.getElementById('search_form');\n\t\tinitForm($(searchForm), {\n\t\t\tsubmit: function () {\n\t\t\t\tfind({\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tkeyword: searchForm.elements['keyword'].value\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "table(req, res) {\n\n let { filter, page, limit } = req.query\n\n page = page || 1\n limit = limit || 3\n let offset = limit * (page - 1)\n\n const params = {\n filter,\n limit,\n page,\n offset,\n callback(instructors){\n const pagination = {\n total: Math.ceil(instructors[0].total / limit),\n page,\n }\n\n return res.render(\"instructors/index\", { instructors, pagination,filter })\n }\n }\n\n Instructor.paginate(params)\n }", "pageCount() {\n return Math.round(this.itemCount() / this.itemsPerPage)\n }", "getPageSize() {\n return this.paginator.pageSize\n }", "function buildPages(callback) {\n // our pagination page numbering\n $scope.pagesOption = [];\n // build our pages for pagination\n for(var i = 1; i <= $scope.pages; i++) {\n if(i==1)\n $scope.pagesOption.push({\n number: i,\n active: true\n })\n else\n $scope.pagesOption.push({\n number: i,\n active: false\n })\n }\n // initially set selected page to the first page\n $scope.selectedPage = $scope.pagesOption[0].number.toString()\n // run callback if available\n if( callback ) callback()\n }", "function handlePagination() {\n\n var numResults = rowsParent.childElementCount;\n\n //disable and enable buttons based on row count\n if (numResults <= 5){\n //do nothing\n }else if(numResults <= 10){\n createPaginationListElement(2);\n } else if(numResults <= 15){\n createPaginationListElement(2);\n createPaginationListElement(3);\n } else { //over 20\n createPaginationListElement(2);\n createPaginationListElement(3);\n createPaginationListElement(4);\n }\n\n //store all rows in an array\n tableContent = rowsParent.innerHTML;\n\n showSelectedChildren(0, 4)\n\n\n}", "updatePagination(newPage, pageSize) {\n this._currentPagination = {\n pageNumber: newPage,\n pageSize,\n };\n // unless user specifically set \"enablePagination\" to False, we'll update pagination options in every other cases\n if (this._gridOptions && (this._gridOptions.enablePagination || !this._gridOptions.hasOwnProperty('enablePagination'))) {\n this._odataService.updateOptions({\n top: pageSize,\n skip: (newPage - 1) * pageSize\n });\n }\n }", "updatePagination(newPage, pageSize) {\n this._currentPagination = {\n pageNumber: newPage,\n pageSize,\n };\n // unless user specifically set \"enablePagination\" to False, we'll update pagination options in every other cases\n if (this._gridOptions && (this._gridOptions.enablePagination || !this._gridOptions.hasOwnProperty('enablePagination'))) {\n this._odataService.updateOptions({\n top: pageSize,\n skip: (newPage - 1) * pageSize\n });\n }\n }", "function numPages()\n{\n return Math.ceil(objJson.length / records_per_page);\n}", "static get PAGE_ITEMS() {\n return 10;\n }", "function paginate(jqXHR){\n\n // get the pagination ul\n var paginate = $('ul.pager');\n paginate.empty();\n var info = $('#info');\n info.empty();\n\n // set the content range info\n var rangeHeader = jqXHR.getResponseHeader('Content-Range');\n var total = rangeHeader.split('/')[1];\n var range = rangeHeader.split('/')[0].split(' ')[1];\n info.append('<span>Displaying ' + range + ' of ' + total + ' results');\n\n // check if we have a link header\n var a, b;\n var link = jqXHR.getResponseHeader('Link');\n if (link) {\n var links = link.split(',');\n a = links[0];\n b = links[1];\n }\n else {\n // no link header so only one page of results returned\n return;\n }\n\n /*\n * Configure next/prev links for pagination\n * and handle pagination events\n */\n if (b) {\n var url = b.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = b.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/>' + gettext(' Prev') + '</a></li>&nbsp;');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n\n if (a) {\n var url = a.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = a.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n if (rel == 'prev') {\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/>' + gettext('Prev') + '</a></li>');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n else {\n paginate.append('<li id=\"next\" data-url=\"' + url + '\"><a href=\"#\">Next <span class=\"glyphicon glyphicon-chevron-right\"/></a></li>');\n $('li#next').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n }\n }", "function showTen (page, filtered, filterResult) {\n // Hide all the items in Student list from HTML index\n for (let i = 0; i < liStudents.length; i +=1) {\n liStudents[i].style.display = 'none';\n }\n \n // set page to equal the upper limit of what needs to be displayed based on what page link was clicked\n page = parseInt(page) * 10;\n\n // if filtered is false it displays the 10 values on the current page link clicked\n // else the below will determine the number of pages for searched value and reset/recreate the pagination links\n // and display the list values the search results array wit the ability to navigate back/forth between pages \n if (! filtered) {\n for (let i = page - 10; i < page; i +=1) {\n if (i === liStudents.length) {\n break;\n } else {\n liStudents[i].style.display ='block';\n } \n }\n } else { \n numPages = Math.ceil(filterResult.length / 10);\n paginationUl.innerHTML = '';\n createPageEle('li','a', numPages);\n pageA[pageNum-1].className = 'active';\n for (let i = page - 10; i < page; i += 1) {\n if (i === filterResult.length) {\n break;\n } else {\n filterResult[i].style.display = \"block\";\n } \n \n } \n }\n}", "function getPageCount(){\n\tlet studentCount = 0;\n\n\t//Loops through all students and for each which isn't deselected the loops adds one to the student counter.\n\tfor (var i = 0; i < studentList.length; i++) {\n\t\tif ($(studentList[i]).hasClass(\"deselected\") === false) {\n\t\t\tstudentCount++;\n\t\t}\n\t}\n\n\t//Calculates how many pages by taking the student count and divdeds it with studentsPerPage.\n\tpageCount = Math.ceil(studentCount / studentsPerPage);\n\n}", "_paginate (entities, page, pageSize) {\n\t\treturn entities.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize)\n\t}", "onPageSize () {\n if (this.isAllPageSize()) {\n this.pageStart = 0\n this.pageSize = 0\n }\n this.doRefreshDataPage()\n }", "function paginate(req, res, next) {\n\n // declare variable called perPage. it has 9 items per page\n var perPage = 9;\n var page = req.params.page;\n\n Product\n .find()\n .skip ( perPage * page ) // 9 * 6 = 18\n .limit( perPage )\n .populate('category')\n .exec(function(err, products) {\n if (err) return next(err);\n Product.count().exec(function(err, count) {\n if (err) return next(err);\n res.render('main/product-main', {\n products: products,\n pages: count / perPage\n });\n });\n });\n\n}", "function _pagination_setPageData() {\r\n var _pagination = _data['pagination'];\r\n\r\n var _startIdx = _pagination['currentPage'] * _pagination['numElementsPerPage'];\r\n\r\n _pagination['current']['elyos'].empty().pushAll(_data['elyos'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n _pagination['current']['asmodians'].empty().pushAll(_data['asmodians'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n _pagination['current']['versus'].empty().pushAll(_data['versus'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n }", "function initPagination() {\r\n\tvar num_entries = jQuery('#customerreviewhidden div.reviews').length;\r\n // Create content inside pagination element\r\n jQuery(\".paginationblock\").pagination(num_entries, {\r\n \titems_per_page: 1, // Show only one item block per page\r\n \tcallback: function (page_index, jq){\r\n\t var new_content = jQuery('#customerreviewhidden div.reviews:eq('+page_index+')').clone();\r\n\t $('#viewresult').empty().append(new_content);\r\n\t return false;\r\n\t },\r\n\t prev_text:\"Previous &#8249;\",\r\n\t\tnext_text:\"\t&#8250; More\"\r\n });\r\n }", "function showPagination(block) {\n\t const total = block.length ? maxPage(block) + 1 : 0;\n\t const pagination = [];\n\t let i, min;\n\t // Less than 2 pages\n\t if (total < 2) {\n\t return pagination;\n\t }\n\t // Show all pages\n\t // 3 first + total+-2 + 3 last + 2 spacers = 13\n\t if (total < 14) {\n\t for (i = 0; i < total; i++) {\n\t pagination.push(i);\n\t }\n\t return pagination;\n\t }\n\t // First 3 pages\n\t for (i = 0; i < Math.min(total, 3); i++) {\n\t pagination.push(i);\n\t }\n\t if ((min = i) >= total) {\n\t return pagination;\n\t }\n\t // Current +- 2 (or - 3 if only 1 page is skipped)\n\t for (i = min === block.page - 3 ? min : Math.max(block.page - 2, min); i < Math.min(block.page + 3, total); i++) {\n\t pagination.push(i);\n\t }\n\t if ((min = i) >= total) {\n\t return pagination;\n\t }\n\t // Last 3 (or 4 if only 1 page is skipped)\n\t for (i = min === total - 4 ? total - 4 : Math.max(total - 3, min); i < total; i++) {\n\t pagination.push(i);\n\t }\n\t return pagination;\n\t}", "function pageing() {\r\n opts.actualPage = $(\"#ddPaging\").val();\r\n bindDatasource();\r\n }", "function groupPages(){\n\t\t\tvar pageSet = $scope.pages\n\t\t\t, activePg = $scope.activePage\n\t\t\t, newSet = [];\n\t\t\t\n\t\t\t// Checks if the number of pages is more than set limit (5)\n\t\t\t// If true, the following will be executed.\n\t\t\t// The newSet array length should be equal to the set limit (5) value\n\t\t\tif($scope.numOfPages >= $scope.setLimit){\n\t\t\t\tif(activePg === 1){\n\t\t\t\t\tnewSet = [activePg, activePg1, activePg2, activePg3, activePg4];\n\t\t\t\t\t$scope.pages = newSet;\n\t\t\t\t}else if(activePg >= 3 && activePg < $scope.numOfPages-1){\n\t\t\t\t\tnewSet = [activePg-2, activePg-1, activePg, activePg1, activePg2];\n\t\t\t\t\t$scope.pages = newSet;\n\t\t\t\t}else if(activePg === $scope.numOfPages){\n\t\t\t\t\tnewSet = [activePg-4, activePg-3, activePg-2, activePg-1, activePg];\n\t\t\t\t\t$scope.pages = newSet;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}", "pagesNumber () {\n return Math.max(\n 1,\n Math.ceil(this.filteredIcons.length / this.computedPagination.itemsPerPage)\n )\n }", "function numPages(){\n let no_pages = Math.ceil(all_projects.length/per_page);\n return parseInt(no_pages);\n }", "function create_pagination_for(publication_list, show_per_page){\n\n // clear old pagination\n for (let i = pagination.children.length - 2; i > 1; i--){\n pagination.children[i].remove();\n }\n\n // create new pagination\n var num_publications = publication_list.length;\n\n for (let i = 2; i < (num_publications / show_per_page) + 1; i++){\n var a = document.createElement('a');\n a.appendChild(document.createTextNode(i));\n a.href = \"#publications\";\n pagination.insertBefore(a, pagination.children[i]);\n }\n\n // register onclick events\n pagination.children[0].onclick = function(){\n prev_page(publication_list, show_per_page);\n };\n for (let i = 1; i < pagination.children.length - 1; i++){\n pagination.children[i].onclick = function(){\n //console.log('page', i);\n show_page_of(publication_list, i, show_per_page);\n };\n }\n pagination.children[pagination.children.length - 1].onclick = function(){\n next_page (publication_list, show_per_page, pagination.children.length - 2);\n };\n}", "function changePage(n) {\n currentPage = Math.min(Math.max(1, n), totalPages);\n displayVenueList();\n}", "_updatePaginator(filteredDataLength) {\n Promise.resolve().then(() => {\n const paginator = this.paginator;\n if (!paginator) {\n return;\n }\n paginator.length = filteredDataLength;\n // If the page index is set beyond the page, reduce it to the last page.\n if (paginator.pageIndex > 0) {\n const lastPageIndex = Math.ceil(paginator.length / paginator.pageSize) - 1 || 0;\n const newPageIndex = Math.min(paginator.pageIndex, lastPageIndex);\n if (newPageIndex !== paginator.pageIndex) {\n paginator.pageIndex = newPageIndex;\n // Since the paginator only emits after user-generated changes,\n // we need our own stream so we know to should re-render the data.\n this._internalPageChanges.next();\n }\n }\n });\n }", "function changeBookingListPropertyFilter(event)\n{\n event.preventDefault();\n page = 1;\n\n getBookingListLimited();\n}", "function annuairePagination(dataToPaginate){\n $(\"#listGrpsPagination\").pagination({\n dataSource: dataToPaginate,\n pageSize: 5,\n className: 'paginationjs-big custom-paginationjs',\n callback: function(data, pagination){\n let html = userCardTemplate(data);\n $('#listGrps').html(html);\n },\n beforePageOnClick: function(){\n $('#send-message-contact').off('click', 'a');\n },\n beforePreviousOnClick: function(){\n $('#send-message-contact').off('click', 'a');\n },\n beforeNextOnClick: function(){\n $('#send-message-contact').off('click', 'a');\n },\n afterIsFirstPage: function(){\n pageGestion();\n },\n afterPreviousOnClick: function(){\n pageGestion();\n },\n afterNextOnClick: function(){\n pageGestion();\n },\n afterPageOnClick: function(){\n pageGestion();\n }\n })\n }", "function paginate(req, res, next) {\r\n\tvar perPage = 8;\r\n\tvar page = req.params.page || 1;\r\n\tvar output = {\r\n\t\tdata: null,\r\n\t\tpages: {\r\n\t\t\tcurrent: page,\r\n\t\t\tprev: 0,\r\n\t\t\thasPrev: false,\r\n\t\t\tnext: 0,\r\n\t\t\thasNext: false,\r\n\t\t\ttotal: 0\r\n\t\t},\r\n\t\titems: {\r\n \tbegin: ((page * perPage) - perPage) + 1,\r\n \tend: page * perPage,\r\n \ttotal: 0\r\n \t}\r\n\t};\r\n\tCampground\r\n\t.find()\r\n\t.skip((page - 1) * perPage)\r\n .limit(perPage)\r\n .populate('location')\t\r\n .exec(function(err, allCampgrounds) {\r\n \tif(err) return next(err);\r\n \tCampground.count().exec(function(err, count) {\r\n \t\tif(err) return next(err);\r\n \t\toutput.items.total = count;\r\n \t\toutput.data = allCampgrounds;\r\n \toutput.pages.total = Math.ceil(output.items.total / perPage);\r\n \t\tif(output.pages.current < output.pages.total) {\r\n \t\t\toutput.pages.next = Number(output.pages.current) + 1;\r\n \t\t} else {\r\n \t\t\toutput.pages.next = 0;\r\n \t\t} \r\n \t\toutput.pages.hasNext = (output.pages.next !== 0);\r\n \t\toutput.pages.prev = output.pages.current - 1;\r\n \t \toutput.pages.hasPrev = (output.pages.prev !== 0);\r\n \t\tif (output.items.end > output.items.total) {\r\n \t\toutput.items.end = output.items.total;\r\n \t\t}\r\n \t\tres.render('campgrounds/index', {\r\n \t\t\tcampgrounds: allCampgrounds,\r\n \t\t\toutput: output\r\n \t\t});\r\n \t});\r\n });\r\n}", "loadNextArtistsOrAlbums() {\n this.page++;\n this.loadArtistsOrAlbums(this.page * 6);\n }", "get paginator() { return this._paginator; }", "preparePagination() {\n let currentPage = this.props.pagination.currentPage;\n let totalPages = this.props.pagination.totalPages;\n return this.props.pagination !== undefined ?\n totalPages > 1 ?\n (\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n callback={this.handlePagination}\n />\n ) : ('')\n : ('')\n }", "updateRowsPerPage(rowsPerPage) {\n this.setState({\n rowsPerPage: rowsPerPage,\n currentPage: 1\n })\n this.props.numberOfRows && rowsPerPage ? this._fetchAndSetStateExperimentDesign(this.state.currentPage, rowsPerPage) :\n this._fetchAndSetStateExperimentDesign(this.state.currentPage, this.props.numberOfRows)\n }", "function paginate_lessons()\n {\n \t\t$.ajax(\n \t\t{\n \t\t\t\"type\":\"GET\",\n \t\t\t\"async\":true,\n \t\t\t\"dataType\":\"json\",\n \t\t\t\"url\":\"../api/lessons?pages=true&pageCount=10&pagesize=10\",\n \t\t\tsuccess : function(res)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\t$.each(res,function(idx,val)\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tvar el=$('<div class=\"pagination\">');\n \t\t\t\t\t\t\t\tel.attr('value',val);\n \t\t\t\t\t\t\t\tel.html(idx+1);\n \t\t\t\t\t\t\t\tel.appendTo($(\"#less_page\"));\n \t\t\t\t\t\t\t});\n\n \t\t\t\t\t\t\tgetAllLessons(res[0]);\n\n \t\t\t\t\t\t\t$(\".pagination\").click(function()\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tgetAllLessons($(this).attr('value'));\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t}\n \t\t})\n }", "function makePaginate() {\n let node = fetchNode('ul');\n node.insertAdjacentHTML('afterend', '<ul class=\"pagination\"></ul>');\n node = fetchNode('.pagination');\n for(let i = studentGroups.length; i > 0; i--){\n node.insertAdjacentHTML('afterbegin', `<li><a href=\"#\">${i}</a></li>`);\n }\n fetchNode('ul a').classList.add('active');\n}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function numPages() {\n\t\t\treturn Math.ceil(maxentries/opts.items_per_page);\n\t\t}", "function changePaginationSize(size) {\r\n // Resets the page numbers\r\n $(\"li.pageNumber\").each(function(i,value){\r\n $(this).remove();\r\n });\r\n // Resets the pagination array\r\n pagList = [];\r\n // For loop to push the current numbers into the array\r\n for (let i = 1;i<=size;i++) {\r\n pagList.push(i);\r\n }\r\n // To append the numbers in the pagination\r\n for (let i of pagList) {\r\n var insertHTML = `\r\n <li data-value=\"${i}\" class=\"page-item pageNumber\">\r\n <a class=\"page-link\">${i}</a>\r\n </li>\r\n `;\r\n $(insertHTML).insertBefore($(\"li#nextBtn\"));\r\n }\r\n updatePagination();\r\n}", "function getRequestNumber(total, pageSize){\n return Math.floor(total / pageSize);\n }", "function getPage(start, number, params) {\n\n var result;\n var totalRows;\n\n getRandomsItems(function cb(randomsItems) {\n var filtered = params.search.predicateObject ? $filter('customFilter')(randomsItems, params.search.predicateObject) : randomsItems;\n console.log(\"Filtro:\" + JSON.stringify(params.search.predicateObject));\n\n if (params.sort.predicate) {\n filtered = $filter('orderBy')(filtered, params.sort.predicate, params.sort.reverse);\n }\n\n result = filtered.slice(start, start + number);\n totalRows = randomsItems.length;\n\n /*console.log(\"Result : \" + JSON.stringify(result));\n console.log(\"Total Rows : \" + JSON.stringify(totalRows));*/\n });\n\n\n var deferred = $q.defer();\n\n $timeout(function () {\n\n deferred.resolve({\n data: result,\n numberOfPages: Math.ceil(totalRows / number)\n });\n\n }, 1500);\n\n return deferred.promise;\n\n }", "function showPagination(count,current_page,offset,baseUrl, queryString,visibleNumbers,el,prefix,noHref) {\n let output=\"\";\n let fullUrl;\n if(el===undefined) el=\".pagination\";\n if(prefix === undefined || prefix === false) prefix=\"\";\n noHref=noHref===undefined ? false:noHref;\n if(queryString){\n fullUrl=baseUrl+\"?\"+queryString+\"&\"+prefix+\"page=%page%\";\n }else{\n fullUrl=baseUrl+\"?\"+prefix+\"page=%page%\";\n }\n if(count > offset){\n let lastPage=Math.ceil(count/offset);\n let endIndex,startIndex;\n if (current_page > 1){\n output+= noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"1\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li><li class=\"page-item\"><a class=\"page-link\" data-page=\"'+(current_page-1)+'\" aria-label=\"Previous\">قبلی</a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+baseUrl+'\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li><li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":current_page-1})+'\" aria-label=\"Previous\">قبلی</a></li>';\n }\n if((current_page+(visibleNumbers-1)) > lastPage){\n endIndex=lastPage;\n startIndex=current_page-(visibleNumbers-(lastPage-current_page));\n }else{\n\n startIndex=current_page - (visibleNumbers-1);\n endIndex=current_page+ (visibleNumbers-1);\n }\n startIndex= startIndex<=0 ? 1:startIndex;\n for(pageNumber=startIndex;pageNumber<=endIndex;pageNumber++){\n output+= pageNumber==current_page ? \"<li class='page-item active'>\":\"<li class='page-item'>\";\n output+=noHref ? \"<a class='page-link' data-page='\"+pageNumber+\"'>\"+pageNumber+\"</a>\":\"<a class='page-link' href='\"+substitute(fullUrl,{\"%page%\":pageNumber})+\"'>\"+pageNumber+\"</a>\";\n }\n if(current_page != lastPage){\n output+=noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"'+(current_page+1)+'\" aria-label=\"Previous\">بعدی</a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":current_page+1})+'\" aria-label=\"Previous\">بعدی</a></li>';\n output+=noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"'+lastPage+'\" aria-label=\"Next\"><span aria-hidden=\"true\">&raquo;</span></a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":lastPage})+'\" aria-label=\"Next\"><span aria-hidden=\"true\">&raquo;</span></a></li>';\n }\n }\n $(el).html(output);\n}", "function setupGridPagination(p_total) {\r\n var p_name = 'status_report_grid_' + id;\r\n //\tstatus_report_pager_DSC_0_center\r\n var l_int_object = jQuery(\"#status_report_pager_\" + id + \"_center\").find('td:last').find('select');\r\n\r\n var l_page = (grid_current_pages) ? grid_current_pages : 1;\r\n var l_interval = grid_intervals[p_name];\r\n if (grid_intervals[p_name] === undefined) {\r\n l_interval = l_int_object.val();\r\n grid_intervals[p_name] = l_interval;\r\n }\r\n l_int_object.val(l_interval);\r\n setupPagingNavigationEvents(p_name);\r\n\r\n grid_current_pages = l_page;\r\n grid_page_totals[p_name] = Math.ceil(p_total / l_interval);\r\n\r\n setupPagingNavigationButtons(p_name, grid_page_totals[p_name], l_page);\r\n setupPagingDisplayText(p_name, l_page, l_interval, p_total);\r\n\r\n }", "function pagination(totalReturn, returnArr){\n const pagesRequired = Math.ceil(totalReturn.totalResults / returnArr.length);\n for (let i = 1; i <= pagesRequired; i++){\n const button = document.createElement(\"button\");\n button.className = \"page__button\";\n button.textContent = i;\n pageButtonContainer.appendChild(button);\n }\n}" ]
[ "0.6467618", "0.633153", "0.6129411", "0.6013692", "0.5927074", "0.585987", "0.5831542", "0.58012784", "0.57862914", "0.5755217", "0.57505757", "0.57426834", "0.5725534", "0.5725534", "0.56920147", "0.5682638", "0.5668438", "0.5666397", "0.56599253", "0.5656082", "0.56547046", "0.5653191", "0.56503993", "0.56361824", "0.56358314", "0.5623464", "0.56092423", "0.558905", "0.55310386", "0.5503839", "0.5503071", "0.5501971", "0.54981124", "0.5498089", "0.54962903", "0.5492922", "0.54877955", "0.54845417", "0.5478231", "0.5474436", "0.54650915", "0.546036", "0.54598194", "0.5458749", "0.544906", "0.54454064", "0.5443694", "0.5438121", "0.54317397", "0.5411127", "0.54103243", "0.5409213", "0.53949004", "0.53929585", "0.53892493", "0.5386375", "0.5378637", "0.53733206", "0.5370695", "0.535966", "0.53584373", "0.53584373", "0.5356012", "0.53558266", "0.53550607", "0.5347066", "0.53411746", "0.5340661", "0.53393567", "0.53353035", "0.5326681", "0.5325681", "0.53183544", "0.53148717", "0.5305739", "0.5305654", "0.5305398", "0.53025", "0.52996945", "0.5296021", "0.5295603", "0.5293646", "0.52924085", "0.5291276", "0.5288728", "0.5287748", "0.52806395", "0.5276883", "0.5268387", "0.5267398", "0.5267398", "0.5267398", "0.5267398", "0.5267398", "0.52671516", "0.52635485", "0.52476096", "0.52432215", "0.52423006", "0.52407104" ]
0.7424281
0
Handle pagination for complex merchant table
handlePageClick(data) { const selected = data.selected; const offset = Math.ceil(selected * this.state.perPage); this.setState({ offset, currentPage: selected + 1, merchants: this.state.totalRows.slice(offset, offset + this.state.perPage), filteredRowsPaged: this.state.filteredRows.slice(offset, offset + this.state.perPage), }, () => { if (this.state.filteredRowsPaged.length > 0) { this.globalSelectorGroup(this.state.filteredRowsPaged); } else { this.globalSelectorGroup(this.state.merchants); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pagination(tableID) {\n var table = tableID;\n var trnum = 0;\n var maxRows = 15;\n var totalRows = $(table + \" tbody tr[class*='inList']\").length;\n $(table + \" tbody tr[class*='inList']\").each(function () {\n trnum++;\n if (trnum > maxRows) {\n $(this).hide();\n } if (trnum <= maxRows) {\n $(this).show();\n }\n });\n\n if (totalRows > maxRows) {\n var pagenu = Math.ceil(totalRows / maxRows);\n for (var i = 1; i <= pagenu && tableID == \"#custb\";) {\n $('#customer .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n for (var i = 1; i <= pagenu && tableID == \"#frtb\";) {\n $('#freelancer .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n for (var i = 1; i <= pagenu && tableID == \"#cattb\";) {\n $('#categoryValue .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n }\n\n $('.pagination li:first-child').addClass('active');\n $('.pagination li').on('click', function () {\n var pagenum = $(this).attr('data-page');\n var trIndex = 0;\n $('.pagination li').removeClass('active')\n $(this).addClass('active');\n $(table + \" tbody tr[class*='inList']\").each(function () {\n trIndex++;\n if (trIndex > (maxRows * pagenum) || trIndex <= ((maxRows * pagenum) - maxRows)) {\n $(this).hide();\n } else {\n $(this).show();\n }\n });\n });\n}", "function changePage(page)\n{\n var btn_next = document.getElementById(\"btn_next\");\n var btn_prev = document.getElementById(\"btn_prev\");\n var listing_table = document.getElementById(\"listingTable\");\n var page_span = document.getElementById(\"page\");\n\n if (page < 1) page = 1;\n if (page > numPages()) page = numPages();\n\n listing_table.innerHTML =\"\";\n\n for (var i = (page-1) * records_per_page; i < (page * records_per_page) && i < objJson.length; i++) {\n listing_table.innerHTML += objJson[i].PaymentId + \"<br>\" + objJson[i].OrderDate + \"<br>\" + objJson[i].MerchantId + \"<br>\" + objJson[i].CustomerEmail + \"<br>\" + objJson[i].Amount + \"<br>\" + objJson[i].PaymentStatus + \"<br><br><br><br>\";\n }\n page_span.innerHTML = page;\n\n if (page == 1) {\n btn_prev.style.visibility = \"hidden\";\n } else {\n btn_prev.style.visibility = \"visible\";\n }\n\n if (page == numPages()) {\n btn_next.style.visibility = \"hidden\";\n } else {\n btn_next.style.visibility = \"visible\";\n }\n}", "getPublishsByCampaignIdPagination(data){\nreturn this.post(Config.API_URL + Constant.PUBLISH_GETPUBLISHSBYCAMPAIGNIDPAGINATION, data);\n}", "*queryTableFirstPage(_, { put }) {\n yield put({\n type: 'queryTable',\n payload: {\n pagination: {\n current: 1,\n },\n },\n });\n }", "function _pagination_setPageData() {\r\n var _pagination = _data['pagination'];\r\n\r\n var _startIdx = _pagination['currentPage'] * _pagination['numElementsPerPage'];\r\n\r\n _pagination['current']['elyos'].empty().pushAll(_data['elyos'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n _pagination['current']['asmodians'].empty().pushAll(_data['asmodians'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n _pagination['current']['versus'].empty().pushAll(_data['versus'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n }", "handlePaging() {\n if (!this.settings.paging) {\n return;\n }\n\n this.element.addClass('paginated');\n this.tableBody.pager({\n componentAPI: this,\n dataset: this.settings.dataset,\n hideOnOnePage: this.settings.hidePagerOnOnePage,\n source: this.settings.source,\n pagesize: this.settings.pagesize,\n indeterminate: this.settings.indeterminate,\n rowTemplate: this.settings.rowTemplate,\n pagesizes: this.settings.pagesizes,\n pageSizeSelectorText: this.settings.groupable ? 'GroupsPerPage' : 'RecordsPerPage',\n showPageSizeSelector: this.settings.showPageSizeSelector,\n activePage: this.restoreActivePage ? parseInt(this.savedActivePage, 10) : 1\n });\n\n if (this.restoreActivePage) {\n this.savedActivePage = null;\n this.restoreActivePage = false;\n }\n }", "function handlePagination() {\n\n var numResults = rowsParent.childElementCount;\n\n //disable and enable buttons based on row count\n if (numResults <= 5){\n //do nothing\n }else if(numResults <= 10){\n createPaginationListElement(2);\n } else if(numResults <= 15){\n createPaginationListElement(2);\n createPaginationListElement(3);\n } else { //over 20\n createPaginationListElement(2);\n createPaginationListElement(3);\n createPaginationListElement(4);\n }\n\n //store all rows in an array\n tableContent = rowsParent.innerHTML;\n\n showSelectedChildren(0, 4)\n\n\n}", "function loadPagination(pageData,page,rows,isLoadButton){\n\n // 0th index = 1st position\n let firstRecord = (page - 1) * rows;\n\n // 10th index = 11th position\n let lastRecord = page * rows;\n\n //slice will return 1st to 10th position and store in customerData\n let customerData = pageData.slice(firstRecord,lastRecord);\n\n //call function to load table \n loadTable(customerData);\n\n //if true then call function to load button passing the datas length by num of rows\n if(isLoadButton){\n \n loadButton(pageData.length/rows);\n }\n}", "function getPage(tableState) {\n vm.data.isLoading = true;\n if (tableState) {\n _tableState = tableState;\n }\n else if (_tableState) {\n tableState = _tableState;\n }\n else {\n tableState = utility.initTableState(tableState);\n _tableState = tableState;\n }\n\n tableState.draw = tableState.draw + 1 || 1;\n\n var draw = tableState.draw;\n var start = tableState.pagination.start || 0; // This is NOT the page number, but the index of item in the list that you want to use to display the table.\n var number = tableState.pagination.number || 10; // Number of entries showed per page.\n var sortName = tableState.sort.predicate || 'NgayHopDong';\n var sortDir = tableState.sort.reverse ? 'desc' : 'asc';\n var searchString = vm.data.searchString;\n var searchLoaiHopDongId = vm.data.searchLoaiHopDongId || 0;\n var tuNgay = vm.data.startDate;\n var denNgay = vm.data.endDate;\n\n var fields = \"\";\n BaoCaoDoanhThuService.getPage(draw, start, number, searchString, searchLoaiHopDongId, tuNgay, denNgay, sortName, sortDir, fields, vm.data.userInfo.UserId, vm.data.userInfo.NhanVienId)\n .then(function (success) {\n console.log(success);\n if (success.data.data) {\n vm.data.listBaoCaoDoanhThu = success.data.data;\n \n tableState.pagination.numberOfPages = Math.ceil(success.data.metaData.total / number);\n }\n vm.data.isLoading = false;\n }, function (error) {\n vm.data.isLoading = false;\n if (error.data.error != null) {\n alert(error.data.error.message);\n } else {\n alert(error.data.Message);\n }\n });\n }", "function renderTable(page=0) {\r\n $tbody.innerHTML = \"\";\r\n var start =page * $maxresults;\r\n var end=start + $maxresults;\r\n for (var i = 0; i < $maxresults; i++) {\r\n // Get get the current address object and its fields\r\n console.log(start, i);\r\n var alien = filterdata[start + i];\r\n console.log(alien);\r\n var fields = Object.keys(alien);\r\n // Create a new row in the tbody, set the index to be i + startingIndex\r\n var $row = $tbody.insertRow(i);\r\n for (var j = 0; j < fields.length; j++) {\r\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\r\n var field = fields[j];\r\n var $cell = $row.insertCell(j);\r\n $cell.innerText = alien[field];\r\n }\r\n }\r\n // show pagination\r\nvar Numberofpages=filterdata.length/$maxresults;\r\n$pagination.innerHTML=\"\";\r\nfor(let i=0; i < Numberofpages; i++){\r\n var li=document.createElement(\"Li\");\r\n var a=document.createElement(\"a\");\r\n li.classList.add(\"page-item\");\r\n a.classList.add(\"page-Link\");\r\n a.text=i+1;\r\n a.addEventListener(\"click\",function(){\r\n renderTable(i);\r\n });\r\n li.appendChild(a);\r\n $pagination.appendChild(li);\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n}", "renderPagination() {\n if (!_.isEmpty(this.props.pageMeta)) {\n const lastRecord = this.props.pageMeta.current_items_count + this.props.pageMeta.offset;\n const firstRecord = this.props.pageMeta.offset + 1;\n const totalItemsCount = this.props.pageMeta.total_items_count;\n\n return (\n <div className=\"row\">\n <b> {firstRecord}-{lastRecord}/{totalItemsCount}</b> <br/>\n <nav aria-label=\"Page navigation example\">\n\n <ul className=\"pagination\">\n {this.renderFirstPaginationButton()}\n {this.props.pageMeta.has_prev_page &&\n (<li className=\"page-item\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous page\">\n <span className=\"page-link\"\n onClick={e => this.props.loadMore(this.props.location.pathname, this.props.pageMeta.prev_page_number, this.props.pageMeta.page_size)}>\n {this.props.pageMeta.prev_page_number}\n </span>\n </li>)}\n\n <li className=\"page-item active\">\n <a className=\"page-link page-ite\">\n {this.props.pageMeta.current_page_number}\n </a>\n </li>\n {this.props.pageMeta.has_next_page &&\n <li className=\"page-item\">\n <a className=\"page-link\"\n onClick={e => this.props.loadMore(this.props.location.pathname, this.props.pageMeta.next_page_number, this.props.pageMeta.requested_page_size)}>\n {this.props.pageMeta.next_page_number}\n </a>\n </li>}\n {this.renderLastPaginationButton()}\n </ul>\n </nav>\n </div>\n )\n }\n }", "function paginateProducts(page) {\n const productsPerPage = 10\n const offset = productsPerPage * (page - 1)\n knexInstance\n .select('product_id', 'name', 'price', 'category')\n .from('amazong_products')\n .limit(productsPerPage)\n .offset(offset)\n .then(result => {\n console.log(result)\n })\n}", "function pagination() {\r\n\t\t\t\t$scope.pageSize = $scope.shownoofrec;\r\n\t\t\t\t\r\n\t\t\t\t$scope.currentPage = 0;\r\n\t\t\t\t$scope.totalPages = 0;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$scope.nextDisabled = false;\r\n\t\t\t\t$scope.previousDisabled = true;\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length <= 10 ) {\r\n\t\t\t\t\t$scope.nextDisabled = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length < 100) {\r\n\t\t\t\t\t$scope.totalnoof_records = self.Filtervehicles.length;\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfindrecord_count();\r\n\t\t\t\t}\r\n\t\t\t}", "function searchPageNum(pageNumber){\n const itemsPerPage = 6\n const offset = itemsPerPage * (pageNumber - 1)\n knexInstance\n .select('*')\n .from('shopping_list')\n .limit(pageNumber)\n .offset(offset)\n .then(result => {\n console.log('Drill 2:', result)\n })\n}", "function paginatedResults(model) {\r\n return (req, res, next) => {\r\n\r\n //get the page an the limit query to a variable\r\n const page = parseInt(req.query.page)\r\n const limit = parseInt(req.query.limit)\r\n \r\n //convert the limit and page for a zero based array\r\n const startIndex = (page - 1) * limit\r\n const endIndex = page* limit\r\n \r\n //make an result object\r\n const results = {}\r\n \r\n //clac next result\r\n if (endIndex < model.length) {\r\n results.next = {\r\n page: page + 1,\r\n limit: limit\r\n }\r\n }\r\n \r\n //clac previous result\r\n if (startIndex > 0){\r\n results.previous = {\r\n page: page - 1,\r\n limit: limit\r\n }\r\n \r\n }\r\n \r\n //slice the array from start to end index\r\n results.results = model.slice(startIndex, endIndex)\r\n \r\n //set the paginated object to a variable in the response\r\n res.paginatedResults = results\r\n next()\r\n \r\n }\r\n}", "changePerPage(event) {\n const {params, accounting, setProp} = this.props;\n const perPage = parseInt(event.target.value, 10);\n setProp(Immutable.fromJS({\n paid: 1,\n unpaid: 1\n }), 'page');\n this.setState({\n perPage\n });\n const tab = accounting.get('tab');\n // Revert to page one, update search\n const search = this.updateBeforeRetrieval(tab);\n // Get records\n this.retrieveRecords(params.type, search, 1, perPage);\n }", "_paginate (entities, page, pageSize) {\n\t\treturn entities.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize)\n\t}", "displayRecordPerPage(page) {\n /*let's say for 2nd page, it will be => \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n page = 2; pageSize = 5; startingRecord = 5, endingRecord = 10\n so, slice(5,10) will give 5th to 9th records.\n */\n this.startingRecord = (page - 1) * this.pageSize;\n this.endingRecord = this.pageSize * page;\n\n this.endingRecord =\n this.endingRecord > this.totalRecountCount\n ? this.totalRecountCount\n : this.endingRecord;\n\n this.data = this.items.slice(this.startingRecord, this.endingRecord);\n\n //increment by 1 to display the startingRecord count,\n //so for 2nd page, it will show \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n this.startingRecord = this.startingRecord + 1;\n }", "function pagfun() {\n if ($scope.currentPage != $scope.paging.current) {\n $scope.currentPage = $scope.paging.current;\n $scope.receiptFilter.Page = $scope.currentPage;\n getpagedPagedReceipts();\n }\n }", "pagination() {\n //Convert the data into Int using parseInt(string, base value)\n // || 1 is used in case user does not specify any page value similarly for limit default is 10\n const page = parseInt(this.queryStr.page, 10) || 1;\n const limit = parseInt(this.queryStr.limit, 10) || 10;\n // to get the data on pages rather than page 1\n const skipResults = (page - 1) * limit;\n\n //skip method is used to skip through the specified number of data\n //limit method is used to limit the no of data returned at a time.\n this.query = this.query.skip(skipResults).limit(limit);\n\n return this;\n }", "getListbyPaging(currPage, currLimit) {\n var url = api.url_tampildataOutlet(currPage, currLimit);\n this.isLoading = true;\n fetch(url)\n .then(response => response.json())\n .then(data =>\n this.setState({\n result: data.content,\n isLoading: false,\n totalPage: data.totalPages,\n }),\n );\n }", "function getPage(tableState) {\n vm.data.isLoading = true;\n if (tableState) {\n _tableState = tableState;\n }\n else if (_tableState) {\n tableState = _tableState;\n }\n else {\n tableState = utility.initTableState(tableState);\n _tableState = tableState;\n }\n\n tableState.draw = tableState.draw + 1 || 1;\n\n var draw = tableState.draw;\n var start = tableState.pagination.start || 0; // This is NOT the page number, but the index of item in the list that you want to use to display the table.\n var number = tableState.pagination.number || 10; // Number of entries showed per page.\n var sortName = tableState.sort.predicate || 'BaoGiaId';\n var sortDir = tableState.sort.reverse ? 'desc' : 'asc';\n var searchString = vm.data.searchString;\n var searchKhachHangId = vm.data.searchKhachHangId || 0;\n var tuNgay = vm.data.startDate;\n var denNgay = vm.data.endDate;\n\n var fields = \"\";\n BaoGiaService.getPage(draw, start, number, searchString, searchKhachHangId, tuNgay, denNgay, sortName, sortDir, fields, vm.data.userInfo.UserId, vm.data.userInfo.NhanVienId)\n .then(function (success) {\n console.log(success);\n if (success.data.data) {\n vm.data.listBaoGia = success.data.data;\n vm.data.BaoGiaChiTietListDisplay = [];\n tableState.pagination.numberOfPages = Math.ceil(success.data.metaData.total / number);\n }\n vm.data.isLoading = false;\n }, function (error) {\n vm.data.isLoading = false;\n if (error.data.error != null) {\n alert(error.data.error.message);\n } else {\n alert(error.data.Message);\n }\n });\n }", "async paginate(per_page = null, page = null) {\r\n if (!_.isNil(per_page)) {\r\n per_page = parseInt(per_page);\r\n } else {\r\n if (Request.has('per_page')) {\r\n per_page = parseInt(Request.get('per_page'));\r\n } else {\r\n per_page = 20;\r\n }\r\n }\r\n if (!_.isNil(page)) {\r\n page = parseInt(page);\r\n } else {\r\n if (Request.has('page')) {\r\n page = parseInt(Request.get('page'));\r\n } else {\r\n page = 1;\r\n }\r\n }\r\n let params = {\r\n offset: (page - 1) * per_page,\r\n limit: per_page,\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n distinct: true\r\n };\r\n\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findAndCountAll(params);\r\n\r\n const paginator = new LengthAwarePaginator(result.rows, result.count, per_page, page);\r\n return paginator;\r\n }", "function paginatedResults() {\n return async (req, res, next) => {\n let query = {};\n const results = {};\n const { page, limit, title, minPoints, maxPoints, sortOption } = req.query;\n const fields = { Title1: 1, Title2: 1, issn: 1, 'Points.Value': 1, e_issn: 1 };\n const startIndex = (page - 1) * limit;\n const endIndex = page * limit;\n let sortCriteria = {};\n if (typeof title !== 'undefined') {\n const reg = new RegExp(`${title}`);\n query.$or = [{ Title1: reg }, { Title2: reg }];\n }\n const points = {};\n if (typeof minPoints !== 'undefined') {\n points['$gte'] = minPoints;\n }\n if (typeof maxPoints !== 'undefined') {\n points['$lte'] = maxPoints;\n }\n if (Object.keys(points).length > 0) {\n query = { ...query, 'Points.Value': { ...points } };\n }\n if (typeof sortOption !== 'undefined') {\n if (sortOption === 'NameASC') {\n sortCriteria.Title1 = 1;\n }\n if (sortOption === 'NameDESC') {\n sortCriteria.Title1 = -1;\n }\n if (sortOption === 'PointsASC') {\n sortCriteria['Points.Value'] = 1;\n }\n if (sortOption === 'PointsDESC') {\n sortCriteria['Points.Value'] = -1;\n }\n } else {\n sortCriteria.Title1 = 1;\n }\n try {\n const magazines = await magazine\n .find(query, fields)\n .sort(sortCriteria)\n .exec();\n if (endIndex < magazines.length) {\n results.next = {\n page: parseInt(page, 10) + 1,\n limit: limit\n };\n }\n\n if (startIndex > 0) {\n results.previous = {\n page: page - 1,\n limit: limit\n };\n }\n\n results.magazines = magazines.slice(startIndex, endIndex);\n res.paginatedResults = results;\n next();\n // await res.send({ Len: magazines.length });\n } catch (err) {\n console.error(err);\n res.status(500).json({ message: 'Error with fetching list of magazines' });\n }\n };\n}", "table(req, res) {\n\n let { filter, page, limit } = req.query\n\n page = page || 1\n limit = limit || 3\n let offset = limit * (page - 1)\n\n const params = {\n filter,\n limit,\n page,\n offset,\n callback(instructors){\n const pagination = {\n total: Math.ceil(instructors[0].total / limit),\n page,\n }\n\n return res.render(\"instructors/index\", { instructors, pagination,filter })\n }\n }\n\n Instructor.paginate(params)\n }", "updateItemsPerPage(pagination) {\n this.loadLeads();\n }", "function pagination(page,aksix,subaksi){ \n var aksi ='aksi='+aksix+'&subaksi='+subaksi+'&starting='+page;\n var cari ='';\n var el,el2;\n\n if(subaksi!=''){ // multi paging \n el = '.'+subaksi+'_cari';\n el2 = '#'+subaksi+'_tbody';\n }else{ // single paging\n el = '.cari';\n el2 = '#tbody';\n }\n\n $(el).each(function(){\n var p = $(this).attr('id');\n var v = $(this).val();\n cari+='&'+p+'='+v;\n });\n\n $.ajax({\n url:dir,\n type:\"post\",\n data: aksi+cari,\n beforeSend:function(){\n $(el2).html('<tr><td align=\"center\" colspan=\"8\"><img src=\"img/w8loader.gif\"></td></tr></center>');\n },success:function(dt){\n setTimeout(function(){\n $(el2).html(dt).fadeIn();\n },1000);\n }\n });\n }", "if (nextState.pageSize === rowCount && nextState.currentPage === 1) {\n return null;\n }", "function pages(pageNumber) {\n const itemLimit = 6;\n let page = pageNumber * itemLimit - itemLimit;\n\n const query = knexInstance\n .select(\"*\")\n .from(\"shopping_list\")\n .limit(itemLimit)\n .offset(page);\n let results = query.then(results => console.log(results));\n let sql = query.toString();\n console.log(sql);\n}", "function manageDataCustomer() {\n $.ajax({\n dataType: 'json',\n url: '/customer/show',\n data:{page:page}\n }).done(function(data){\n manageRow(data.data);\n });\n }", "SET_PAGINATION(state, data) {\n state.pagination = data;\n }", "changePage(tab, retrieveRecord, pagination) {\n const {setProp, accounting} = this.props;\n const nextPage = pagination.selected + 1;\n // Set page\n setProp(nextPage, 'page', tab);\n\n if (retrieveRecord) {\n // Remove unused search params, update search params\n const search = accounting.get('search').map(type => type.filter(param => param)).toJS();\n this.retrieveRecords(tab, search, nextPage, this.state.perPage);\n }\n }", "function generatePagination(data, totalResults, numResultsToShow) {\n\n $('#custom-pagination').twbsPagination('destroy');\n\n var numPages = totalResults / numResultsToShow;\n if (numPages < 1) {\n numPages = 1;\n }\n\n $('#custom-pagination').twbsPagination({\n totalPages: numPages,\n visiblePages: 5,\n onPageClick: function (event, page) {\n var fromResult = Number(page-1) + \"0\";\n var toResult = page + \"0\";\n generateTable(data, fromResult, toResult);\n }\n });\n\n}", "nextHandler() {\n if (this.page < this.totalPage && this.page !== this.totalPage) {\n this.page = this.page + 1; //increase page by 1\n this.displayRecordPerPage(this.page);\n }\n }", "function pagination (table) {\n var limit = 10; \n var page = Number($(\"#current_page\").val());\n var Search = $(\"#Search\").val();\n\n if (!Search) {\n var source = \"row_count.php\";\n } \n else {\n var source = \"search_row_count.php\";\n }\n\n getData(table);\n\n $.post(\"includes/\" + source, { \n Table: table,\n Search: Search\n }, function (data) {\n var numRows = data;\n //calculating number of pages\n var totalPages = Math.ceil(numRows / limit);\n // var totalPages = 25; DUMMY to test pagination\n \n if (page == 1) {\n var page1 = Number(page);\n var page2 = Number(page + 1);\n var page3 = Number(page + 2);\n var page4 = Number(page + 3);\n var page5 = Number(page + 4);\n var page6 = Number(page + 5);\n //hiding previous button\n $(\"#previous\").hide();\n }\n\n else {\n var page1 = Number(page - 1);\n var page2 = Number(page);\n var page3 = Number(page + 1);\n var page4 = Number(page + 2);\n var page5 = Number(page + 3);\n var page6 = Number(page + 4); \n // showing previous button\n $(\"#previous\").show(); \n } \n\n if (page == totalPages) {\n //hiding next button\n $(\"#next\").hide();\n }\n else {\n //showing next button\n $(\"#next\").show();\n }\n\n // setting up the page numbers\n $(\"#page1\").val(page1);\n $(\"#page2\").val(page2);\n $(\"#page3\").val(page3);\n $(\"#page4\").val(page4);\n $(\"#page5\").val(page5);\n $(\"#page6\").val(page6);\n\n var i = 1;\n while (i <= 6) {\n var page_num = $(\"#page\" + i).val();\n if (page_num > totalPages) {\n $(\"#page\" + i).hide();\n }\n else {\n $(\"#page\" + i).show(); \n }\n if (page_num == page) {\n $(\"#page\" + i).css({\"background\": \"#FFFFFF\", \"color\": \"rgba(0, 104, 255, 1)\"}); \n }\n else {\n $(\"#page\" + i).css({\"background\": \"rgba(0, 104, 255, 1)\", \"color\": \"#FFFFFF\"});\n }\n i++;\n } \n } \n );\n //getting data\n}", "generatePaginations(activePage, paginationStart, maxViewPageNum) {\n const paginationItems = [];\n for (let number = paginationStart; number <= maxViewPageNum; number++) {\n paginationItems.push(\n <Pagination.Item key={number} active={number === activePage} onClick={() => { return this.getRecentCreatedList(number) }}>{number}</Pagination.Item>,\n );\n }\n return paginationItems;\n }", "renderPaginate(self, pagContainer) {\n\t\tpagContainer.pagination({\n\t\t\tdataSource: this.dataSource, // total ads from filtered request\n\t\t\tpageSize: this.limit, // num max ads per page\n\t\t\tshowGoInput: this.showGoInput,\n\t\t\tshowGoButton: this.showGoButton,\n\t\t\tshowBeginingOnOmit: this.showBeginingOnOmit,\n\t\t\tshowEndingOnOmit: this.showEndingOnOmit,\n\t\t\thideWhenLessThanOnePage: this.hideWhenLessThanOnePage,\n\t\t\tpageRange: this.pageRange,\n\t\t\tprevText: this.prevText,\n\t\t\tnextText: this.nextText,\n\t\t\tcallback: (data, pagination) => {\n\t\t\t\tconst currentBtn = pagination.pageNumber;\n\t\t\t\tthis.generateCurrentSkip(currentBtn);\n\t\t\t\tself.dataService.createData({ skip: this.skip, limit: this.limit });\n\t\t\t\tself.commonManager.loadAdsPag(self.dataService.getData());\n\t\t\t}\n\t\t});\n\t}", "function buildPagination(data) {\n var paginationContainer = '#'+self.settings().containers.pagination;\n $.Casper.pagination(paginationContainer, data.data, function(page) {\n self.onPaging(page);\n });\n }", "display(){\ndata.then(data=>{\n // console.log(data.length)\n // navigation i.e showing current and total page number\n \n totalPage.innerHTML = data.length/5;\n currentPage.innerHTML = (this.firstIndex/5)+1\n \n //display table\n tbody.innerHTML = ''\n for(let i = this.firstIndex ; i < this.firstIndex+5; i++){\n \n // console.log(data[i].id)\n var row = tr()\n var rowData = [td(), td(), td()]\n rowData[0].innerHTML = data[i].id\n rowData[1].innerHTML = data[i].name\n rowData[2].innerHTML = data[i].email\n row.append(...rowData)\n tbody.append(row)\n }\n \n}).catch(err => console.log(err))\nthis.buttons()\n}", "fnPrepareData() {\n const { perpage, currPage } = this.state;\n let end = perpage * currPage;\n let start = end - perpage;\n let data = this.state.data.slice(start, end);\n this.setState({\n tableData: data,\n });\n }", "getAll(initialData) {\n const { \n totalCount, \n page,\n transactions\n } = initialData;\n\n const transactionsPerPage = transactions.length;\n const totalPages = _.ceil(totalCount/transactionsPerPage)\n\n const pagesToFetch = (totalPages > MAX_PAGE_FETCH) \n ? MAX_PAGE_FETCH\n : totalPages;\n\n return this.getTransactionsInPageRange(page + 1, pagesToFetch)\n .then(rangeData => _.concat(transactions, rangeData.transactions))\n .then(this.normalizeTransactions);\n }", "function paginate(jqXHR){\n\n // get the pagination ul\n var paginate = $('#pagination ul.pager');\n paginate.empty();\n var info = $('#info');\n info.empty();\n\n // set the content range info\n var rangeHeader = jqXHR.getResponseHeader('Content-Range');\n var total = rangeHeader.split('/')[1];\n var range = rangeHeader.split('/')[0].split(' ')[1];\n info.append('<span>Displaying ' + range + ' of ' + total + ' results');\n\n // check if we have a link header\n var a, b;\n var link = jqXHR.getResponseHeader('Link');\n if (link) {\n var links = link.split(',');\n a = links[0];\n b = links[1];\n }\n else {\n // no link header so only one page of results returned\n return;\n }\n\n /*\n * Configure next/prev links for pagination\n * and handle pagination events\n */\n if (b) {\n var url = b.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = b.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/> Prev</a></li>&nbsp;');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n\n if (a) {\n var url = a.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = a.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n if (rel == 'prev') {\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/> Prev</a></li>');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n else {\n paginate.append('<li id=\"next\" data-url=\"' + url + '\"><a href=\"#\">Next <span class=\"glyphicon glyphicon-chevron-right\"/></a></li>');\n $('li#next').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n }\n }", "function _currentPageData() {\n let first = rows.length > 0 ? (currentPage - 1) * rowsPerPage + 1 : 0;\n let last = rows.length < rowsPerPage ? totalItems : (currentPage - 1) * rowsPerPage + rowsPerPage;\n \n return {\n first,\n last,\n current:currentPage,\n totalItems,\n } \n }", "function CarryoutOrdersListPagination(status, carryoutpagesize, carryoutcurrentPage, divId) {\n //Shorting\n var sortValue = \"DESC\";\n var sortByValue = \"\";\n var filterStatus = \"\";\n var orderNoFrom = \"\";\n var orderNoTo = \"\";\n var phone = \"\";\n var orderDateFrom = \"\";\n var orderDateTo = \"\";\n //Shorting\n\n var customerId = 0;\n var storeId = 0;\n var status = $('#hdnCurrentState').val();\n if (status == \"New\") {\n divId = 'dvNewList';\n }\n else if (status == \"Processing\") {\n divId = 'dvNewList';\n }\n else {\n divId = 'dvAllList';\n sortValue = $(\"input[name='radioCarryoutSort']:checked\").val();\n sortByValue = $(\"input[name='radioCarryoutSortBy']:checked\").val();\n\n filterStatus = $(\"#ddlFilterCarryoutStatus\").val();\n orderNoFrom = $(\"#txtFilterOrderNumberFrom\").val();\n orderNoTo = $(\"#txtFilterOrderNumberTo\").val();\n phone = $(\"#txtFilterPhone\").val();\n orderDateFrom = $(\"#txtFilterOrderDateFrom\").val();\n orderDateTo = $(\"#txtFilterOrderDateTo\").val();\n\n //console.log(\"Sort: \"+ sortValue + \" By: \" + sortByValue + \" filter: \" + filterStatus + \" orderNofrom: \" + orderNoFrom + \" orderNoTo: \" + orderNoTo + \" phone: \" + phone + \" orderDateFrom: \"+ orderDateFrom + \" dateTo: \" + orderDateTo);\n if (sortValue == undefined) {\n sortValue = \"\";\n }\n if (sortByValue == undefined) {\n sortByValue = \"\";\n }\n if (filterStatus == undefined) {\n filterStatus = \"\";\n }\n if (orderNoFrom == undefined) {\n orderNoFrom = \"\";\n }\n if (orderNoTo == undefined) {\n orderNoTo = \"\";\n }\n if (phone == undefined) {\n phone = \"\";\n }\n if (orderDateFrom == undefined) {\n orderDateFrom = \"\";\n }\n if (orderDateTo == undefined) {\n orderDateTo = \"\";\n }\n }\n\n storeId = SetStoreId();\n customerId = SetCustomerId();\n if (Number(storeId) > 0) {\n\n carryoutcurrentPage = Number(carryoutcurrentPage) * Number(carryoutpagesize);\n url = global + \"/GetAllCarryOutOrdersTemp?storeid=\" + storeId + \"&status=\" + status + \"&pagesize=\" + carryoutpagesize + \"&currentPage=\" + carryoutcurrentPage + \"&sortValue=\" + sortValue + \"&sortByValue=\" + sortByValue +\n \"&filterStatus=\" + filterStatus + \"&orderNoFrom=\" + orderNoFrom + \"&orderNoTo=\" + orderNoTo + \"&phone=\" + phone + \"&orderDateFrom=\" + orderDateFrom + \"&orderDateTo=\" + orderDateTo;\n if (status.toLowerCase().trim() == \"new\") {\n\n $(\"#carryout #dvNewList\").attr(\"class\", \"active\");\n //$(\"#dvPending\").removeAttr(\"class\");\n $(\"#carryout #dvAllList\").removeAttr(\"class\");\n\n\n }\n else if (status.toLowerCase().trim() == \"processing\") {\n\n //$(\"#dvPending\").attr(\"class\", \"active\");\n $(\"#carryout #dvNewList\").attr(\"class\", \"active\");\n $(\"#carryout #dvAllList\").removeAttr(\"class\");\n }\n else {\n\n $(\"#carryout #dvAllList\").attr(\"class\", \"active\");\n //$(\"#dvPending\").removeAttr(\"class\");\n $(\"#carryout #dvNewList\").removeAttr(\"class\");\n\n }\n try {\n\n $.getJSON(url, function (data) {\n var obj = JSON.parse(data);\n var length = Object.keys(obj).length;\n\n\n $('#loader_msg').html(\"\");\n if (JSON.parse(data).indexOf(\"No order(s) found\") < 0) {\n localStorage.setItem(\"OrderAvailable\", \"1\");\n var count = 0;\n $.each(JSON.parse(data), function (index, value) {\n \n var orderDate = \"\";\n var orderTime = \"\";\n var firstName = \"\";\n var lastName = \"\";\n var email = \"\";\n var phone = \"\";\n var paymentMethod = \"\";\n var cardNumber = \"\";\n var ordertotal = \"\";\n var buttonHTML = \"\";\n var subTotal = 0.00;\n var grandTotal = 0.00;\n var discount = 0.00;\n var ordertype = \"\";\n if (value.ORDERTYPE != \"\") {\n ordertype = value.ORDERTYPE;\n }\n if (value.SUBTOTAL != \"\") {\n subTotal = value.SUBTOTAL;\n }\n if (value.ORDERDISCOUNT != \"\") {\n discount = value.ORDERDISCOUNT;\n }\n\n grandTotal = value.ORDERTOTAL;\n\n if (Number(grandTotal) != Number(subTotal)) {\n ordertotal = FormatDecimal(Number(subTotal) - Number(discount));\n }\n else {\n ordertotal = FormatDecimal(grandTotal);\n }\n if (value.CREATEDONUTC != null && value.CREATEDONUTC != undefined) {\n var arrDateTime = value.CREATEDONUTC.split('~');\n var orderDate = arrDateTime[0];\n var orderTime = arrDateTime[1];\n }\n if (value.FIRSTNAME != \"\") {\n firstName = value.FIRSTNAME;\n }\n else {\n firstName = value.BILLINGFIRSTNAME;\n }\n\n if (value.LASTNAME != \"\") {\n lastName = value.LASTNAME;\n }\n else {\n lastName = value.BILLINGLASTNAME;\n }\n\n if (value.EMAIL != \"\" && value.EMAIL != undefined) {\n email = value.EMAIL;\n }\n else {\n email = value.BILLINGEMAIL;\n }\n\n if (value.PHONE != \"\") {\n phone = value.PHONE;\n }\n else {\n phone = value.BILLINGPHONE;\n }\n if (phone.length == 10)\n phone = FormatPhoneNumber(phone);\n if (value.PAYMENTMETHOD != \"\" && value.PAYMENTMETHOD != undefined) {\n paymentMethod = value.PAYMENTMETHOD;\n }\n if (value.CardNumber != \"\" && value.CardNumber != undefined) {\n cardNumber = value.CardNumber;\n }\n /*------------------Order Area-----------------------*/\n\n var html = \"<div class=\\\"order-container\\\" id='li_\" + value.ID + \"' style=\\\"height:75px;\\\">\";\n\n\n /*------------------Order Row-----------------------*/\n\n html += \"<div id=\\\"dvOrderInner_\" + value.ID + \"\\\" class=\\\"order-list-carryout\\\" data-popup=\\\".popup-details\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">\";\n\n /*------------------Column 1-----------------------*/\n\n ////////html += \"<div class=\\\"order-column-one\\\" >\";\n /*------------------Status Icon--------------------*/\n ////if (status == '' || status == \"All\") {\n //// if (value.ORDERSTATUSID.toLowerCase() == \"new\") {\n //// //html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/new.png\\\" alt=\\\"\\\"/></div>\";\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" onclick=\\\"myFunction(\" + value.ID + \")\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/new.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"<div id=\\\"myDropdown_\" + value.ID + \"\\\" class=\\\"dropdown-content\\\"><div onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\" id =\\\"close_status_dropdown\\\" class=\\\"close_status_dropdown\\\">X</div>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Processing',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Processing</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Complete',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Complete</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('PickedUp',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/><span class=\\\"custom-dropdown-span\\\"> Picked Up</span></a>\";\n //// html += \"</div>\";\n //// html += \"</div>\";\n //// }\n //// else if (value.ORDERSTATUSID.toLowerCase() == \"processing\") {\n //// // html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/></div>\";\n\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" onclick=\\\"myFunction(\" + value.ID + \")\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"<div id=\\\"myDropdown_\" + value.ID + \"\\\" class=\\\"dropdown-content\\\"><div onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\" id =\\\"close_status_dropdown\\\" class=\\\"close_status_dropdown\\\">X</div>\";\n //// html += \"<a class=\\\"status-disabled\\\" onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Processing</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Complete',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Complete</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('PickedUp',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/><span class=\\\"custom-dropdown-span\\\"> Picked Up</span></a>\";\n //// html += \"</div>\";\n //// html += \"</div>\";\n //// }\n //// else if (value.ORDERSTATUSID.toLowerCase() == \"complete\") {\n //// // html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/></div>\";\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" onclick=\\\"myFunction(\" + value.ID + \")\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"<div id=\\\"myDropdown_\" + value.ID + \"\\\" class=\\\"dropdown-content\\\"><div onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\" id =\\\"close_status_dropdown\\\" class=\\\"close_status_dropdown\\\">X</div>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Processing',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Processing</span></a>\";\n //// html += \"<a class=\\\"status-disabled\\\" onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Complete</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('PickedUp',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/><span class=\\\"custom-dropdown-span\\\"> Picked Up</span></a>\";\n //// html += \"</div>\";\n //// html += \"</div>\";\n //// }\n //// else if (value.ORDERSTATUSID.toLowerCase() == \"pickedup\") {\n //// //html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/></div>\";\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" onclick=\\\"myFunction(\" + value.ID + \")\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"<div id=\\\"myDropdown_\" + value.ID + \"\\\" class=\\\"dropdown-content\\\"><div onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\" id =\\\"close_status_dropdown\\\" class=\\\"close_status_dropdown\\\">X</div>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Processing',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Processing</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Complete',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Complete</span></a>\";\n //// html += \"<a class=\\\"status-disabled\\\" onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/><span class=\\\"custom-dropdown-span\\\"> Picked Up</span></a>\";\n //// html += \"</div>\";\n //// html += \"</div>\";\n //// }\n //// else if (value.ORDERSTATUSID.toLowerCase() == \"cancelled\") {\n //// //html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/></div>\";\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/cancel.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"</div>\";\n //// }\n ////}\n\n /*-----------------Status Icon End----------------*/\n\n //html += \"<div class=\\\"order-number-carryout panel-open\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">#\" + value.ID + \"<span></div>\";\n html += \"<div class=\\\"order-number-carryout\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\" style=\\\"white-space: wrap;\\\">\" + firstName + \" \" + lastName + \"</div>\";\n\n if (value.PICKUPTIME != undefined) {\n var pickupdatetime = value.PICKUPTIME;\n\n if (ordertype == \"Carry Out\") {\n ////if (status == '' || status == \"All\")\n html += \"<div class=\\\"order-pickup-new\\\">\" + pickupdatetime + \"</div>\";\n ////else\n //// html += \"<div class=\\\"order-pickup order-pickup-margin-top\\\" style=\\\"margin-top:22px;\\\">\" + pickupdatetime + \"</div>\";\n }\n //For Delivery Orders - Start//\n else if (ordertype == \"Delivery\") {\n ////if (status == '' || status == \"All\")\n html += \"<div class=\\\"order-pickup-new\\\" style=\\\"color: #e95861;\\\">\" + pickupdatetime + \"</div>\";\n ////else\n //// html += \"<div class=\\\"order-pickup order-pickup-margin-top\\\" style=\\\"margin-top:22px; color: #e95861;\\\">\" + pickupdatetime + \"</div>\";\n }//For Delivery Orders - End//\n else {\n if (pickupdatetime.indexOf(\"@\") > -1) {\n var pickupDate = pickupdatetime.split('@')[0].trim();\n var pickupTime = pickupdatetime.split('@')[1].trim();\n if (status == '' || status == \"All\")\n html += \"<div class=\\\"order-pickup-new\\\"><div>\" + pickupTime + \"</div><div class=\\\"order-pickup-time\\\">\" + pickupDate + \"</div></div>\";\n else\n html += \"<div class=\\\"order-pickup-new order-pickup-margin-top\\\" style=\\\"margin-top:4px;\\\"><div>\" + pickupTime + \"</div><div class=\\\"order-pickup-time\\\">\" + pickupDate + \"</div></div>\";\n }\n else {\n ////if (status == '' || status == \"All\")\n html += \"<div class=\\\"order-pickup-new\\\">\" + pickupdatetime + \"</div>\";\n ////else\n //// html += \"<div class=\\\"order-pickup order-pickup-margin-top\\\" style=\\\"margin-top:22px;\\\">\" + pickupdatetime + \"</div>\";\n }\n }\n\n }\n //else {\n // if (status == '' || status == \"All\")\n // html += \"<div class=\\\"order-pickup\\\"></div>\";\n // else\n\n // html += \"<div class=\\\"order-pickup order-pickup-margin-top\\\"></div>\";\n // }\n\n\n ////////html += \"</div>\";\n /*------------------Column 1-----------------------*/\n /*------------------Column 2-----------------------*/\n ////////html += \"<div class=\\\"order-column-two\\\">\";\n /*------------------1st Row-----------------------*/\n ////////html += \"<div class=\\\"order-row-container\\\">\";\n ////html += \"<div class=\\\"order-number panel-open\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">#\" + value.ID + \"<span> on </span><span>\" + orderDate + \" @ \" + orderTime + \"</span></div>\";\n ////html += \"<div class=\\\"order-number-carryout panel-open\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">#\" + value.ID + \"<span></div>\";\n /*------------------Button Row-----------------------*/\n ////if (status == '' || status == \"All\") {\n\n ////if (value.ORDERSTATUSID != \"New\" && value.ORDERSTATUSID != \"Cancelled\" ) {\n //// //console.log('value.ORDERPICKUPSMSSENTON: ' + value.ORDERPICKUPSMSSENTON)\n //// if (value.ORDERPICKUPSMSSENTON != undefined && value.ORDERPICKUPSMSSENTON != null && value.ORDERPICKUPSMSSENTON.trim()!= \"\") {\n //// // console.log('value.ORDERPICKUPSMSSENTON: '+value.ORDERPICKUPSMSSENTON)\n //// buttonHTML += \"<a><img src=\\\"./img/icons/pickup_sms_button_active.png\\\" class=\\\"grid-small-icon\\\"/></a>\";\n\n //// }\n //// else {\n //// buttonHTML += \"<a onclick=\\\"ConfirmationPickUpSMSSend(\" + value.ID + \",'\" + phone + \"','Grid','\" + ordertotal + \"')\\\" id=\\\"btnPickUpSMS_\" + value.ID + \"\\\"><img id=\\\"imgPickUpSMS_\" + value.ID + \"\\\" src=\\\"./img/icons/pickup_sms_button.png\\\" class=\\\"grid-small-icon\\\" /></a>\";\n //// }\n //// } \n ////else if (value.ORDERSTATUSID == \"New\")\n ////{\n //// buttonHTML += \"<a onclick=\\\"ChangeOrderStatusNew('Processing',\" + value.ID + \",\" + storeId + \")\\\" id=\\\"btnAccept\\\"><img src=\\\"./img/icons/accept_button.png\\\" style=\\\"width:41%;float: right;margin-right:23px;\\\" /></a>\";\n //// }\n //// html += \"<div class=\\\"order-buttons\\\" id=\\\"dvCarryOutButtons_\" + value.ID + \"\\\">\";\n //// html += buttonHTML;\n //// html += \"</div>\";\n ////}\n ////else if (status=='New') {\n //// buttonHTML += \"<a onclick=\\\"ChangeOrderStatusNew('Processing',\" + value.ID + \",\" + storeId + \")\\\" id=\\\"btnAccept\\\"><img src=\\\"./img/icons/accept_button.png\\\" style=\\\"width:41%;float: right;margin-right:23px;\\\" /></a>\";\n //// buttonHTML += \"<a style=\\\"display:none;\\\" onclick=\\\"ConfirmationPickUpSMSSend(\" + value.ID + \",'\" + phone + \"','Grid','\" + ordertotal + \"')\\\" id=\\\"btnPickUpSMS_\" + value.ID + \"\\\"><img id=\\\"imgPickUpSMS_\" + value.ID + \"\\\" src=\\\"./img/icons/pickup_sms_button.png\\\" class=\\\"grid-small-icon\\\" /></a>\";\n //// html += \"<div class=\\\"order-buttons\\\" id=\\\"dvCarryOutButtons_\" + value.ID + \"\\\">\";\n //// html += buttonHTML;\n //// html += \"</div>\";\n ////}\n /*------------------Button Row-----------------------*/\n ////////html += \"</div>\";\n /*------------------1st Row-----------------------*/\n\n /*------------------2nd Row-----------------------*/\n ////////html += \"<div class=\\\"order-row-container\\\" >\";\n\n /*------------------Customer Info-----------------------*/\n ////html += \"<div class=\\\"order-date order-payment-info\\\">\";\n ////html += \"<div class=\\\"customer-detail-container panel-open\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">\";\n ////html += \"<div class=\\\"customer-name\\\">\" + firstName + \" \" + lastName + \"</div>\";\n ////html += \"<div id=\\\"customerphone_\" + value.ID + \"\\\">\" + phone + \"</div>\";\n //////html += \"<div class=\\\"display-label-wrap\\\">\" + email + \"</div>\";\n ////html += \"</div>\";\n ////html += \"</div>\";\n /*------------------Customer Info-----------------------*/\n /*------------------Order Info-----------------------*/\n ////html += \"<div class=\\\"order-items-count\\\" style=\\\"width:25%;\\\">\";\n\n ////html += \"<div class=\\\"customer-detail-container\\\" id=\\\"dvPickUpSMSGrid_\" + value.ID + \"\\\">\";\n\n ////html += \"<div class=\\\"order-price\\\" id=\\\"orderprice_\" + value.ID + \"\\\">\" + ordertotal + \"</div>\";\n ////if (value.NOOFITEMS == 1) {\n //// html += \"<div>1 item \";\n ////}\n ////else {\n //// html += \"<div>\" + value.NOOFITEMS + \" items \";\n ////}\n ////if (paymentMethod == \"Cash On Delivery\") {\n //// html += \"<span class=\\\"cc-number\\\">Due on Pickup</span>\";\n ////}\n ////else {\n //// html += \"<span class=\\\"cc-number\\\">PAID</span>\";\n ////}\n ////html += \"</div>\";\n\n ////html += \"</div>\";//end customer-detail-container div\n ////html += \"</div>\";//end order-items-count div\n /*------------------Order Info-----------------------*/\n\n\n ////////html += \"</div>\";\n /*------------------2nd Row-----------------------*/\n html += \"</div>\";\n /*------------------Column 2-----------------------*/\n\n html += \"</div>\";\n /*------------------Order Row-----------------------*/\n\n\n\n html += \"</div>\";\n /*------------------Order Area-----------------------*/\n\n count++;\n\n $(\"#carryout #\" + divId).append(html);\n \n if (value.ORDERSTATUSID.toLowerCase() == \"new\") {\n //$(\"#li_\" + value.ID).css(\"background-color\", \"#ffecf2\");\n }\n else if (value.ORDERSTATUSID.toLowerCase() == \"processing\") {\n if (status == \"New\" || status == \"Processing\") {\n $(\"#dvNewList #li_\" + value.ID).css(\"border-left\", \"#2cbcf2 10px solid\");\n }\n else {\n $(\"#dvAllList #li_\" + value.ID).css(\"border-left\", \"#2cbcf2 10px solid\");\n }\n\n }\n else if (value.ORDERSTATUSID.toLowerCase() == \"complete\") {\n if (status == \"New\" || status == \"Processing\") {\n $(\"#dvNewList #li_\" + value.ID).css(\"border-left\", \"#5cb95a 10px solid\");\n }\n else {\n $(\"#dvAllList #li_\" + value.ID).css(\"border-left\", \"#5cb95a 10px solid\");\n }\n }\n else if (value.ORDERSTATUSID.toLowerCase() == \"pickedup\") {\n if (status == \"New\" || status == \"Processing\") {\n $(\"#dvNewList #li_\" + value.ID).css(\"border-left\", \"#f7952c 10px solid\");\n }\n else {\n $(\"#dvAllList #li_\" + value.ID).css(\"border-left\", \"#f7952c 10px solid\");\n }\n }\n else if (value.ORDERSTATUSID.toLowerCase() == \"cancelled\") {\n if (status == \"New\" || status == \"Processing\") {\n $(\"#dvNewList #li_\" + value.ID).css(\"border-left\", \"#e95861 10px solid\");\n }\n else {\n $(\"#dvAllList #li_\" + value.ID).css(\"border-left\", \"#e95861 10px solid\");\n }\n }\n else if (value.ORDERSTATUSID.toLowerCase() == \"refunded\") {\n if (status == \"New\" || status == \"Processing\") {\n $(\"#dvNewList #li_\" + value.ID).css(\"border-left\", \"#9C1B8C 10px solid\");\n }\n else {\n $(\"#dvAllList #li_\" + value.ID).css(\"border-left\", \"#9C1B8C 10px solid\");\n }\n }\n\n });\n\n\n }\n else {\n localStorage.setItem(\"OrderAvailable\", \"0\");\n //var html = \"<div class=\\\"order-list list-empty-label-text\\\" style=\\\"font-size: 30px; z-index: 999999; left: 38%; position: fixed;\\\">No Orders</div>\";\n\n //$(\"#\" + divId).html(html);\n }\n\n\n\n });\n\n }\n catch (e) {\n }\n }\n else {\n self.app.router.navigate('/login_new/', { reloadCurrent: false });\n }\n\n}", "function paginate(jqXHR){\n\n // get the pagination ul\n var paginate = $('ul.pager');\n paginate.empty();\n var info = $('#info');\n info.empty();\n\n // set the content range info\n var rangeHeader = jqXHR.getResponseHeader('Content-Range');\n var total = rangeHeader.split('/')[1];\n var range = rangeHeader.split('/')[0].split(' ')[1];\n info.append('<span>Displaying ' + range + ' of ' + total + ' results');\n\n // check if we have a link header\n var a, b;\n var link = jqXHR.getResponseHeader('Link');\n if (link) {\n var links = link.split(',');\n a = links[0];\n b = links[1];\n }\n else {\n // no link header so only one page of results returned\n return;\n }\n\n /*\n * Configure next/prev links for pagination\n * and handle pagination events\n */\n if (b) {\n var url = b.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = b.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/>' + gettext(' Prev') + '</a></li>&nbsp;');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n\n if (a) {\n var url = a.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = a.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n if (rel == 'prev') {\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/>' + gettext('Prev') + '</a></li>');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n else {\n paginate.append('<li id=\"next\" data-url=\"' + url + '\"><a href=\"#\">Next <span class=\"glyphicon glyphicon-chevron-right\"/></a></li>');\n $('li#next').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n }\n }", "onPageChange(page, sizePerPage) {\n const currentIndex = (page - 1) * sizePerPage;\n this.setState({\n data: this.props.targets.slice(currentIndex, currentIndex + sizePerPage),\n currentPage: page\n });\n }", "function buildPaginationHelper(response) {\n //Building the pagination helper just if pagination object was provided\n if (\"pagination\" in vm.actions['LIST']) {\n //Pagination helper initialization\n vm.paginationHelper = {\n totalPages: null, //Number\n actualPage: null, //Number\n previousPage: null, //URL returned from API\n nextPage: null, //URL returned from API\n previousPageQueries: [],\n nextPageQueries: []\n };\n //Next page pagination kind is going to be used.\n if (vm.actions['LIST'].pagination['next']) {\n vm.paginationHelper['nextPage'] = response[vm.actions['LIST'].pagination['next']];\n }\n //Query building pagination is going to be used\n else {\n //Errors management\n if (!vm.actions['LIST'].pagination['total']) {\n $log.error(\"@CatalogManager, function @buildPaginationHelper << @list, parameter 'total' was not found on actions.pagination object\");\n return;\n }\n if (!vm.actions['LIST'].pagination['limit']) {\n $log.error(\"@CatalogManager, function @buildPaginationHelper << @list, parameter 'limit' was not found on actions.pagination object\");\n return;\n }\n if (!vm.actions['LIST'].pagination['offset']) {\n $log.error(\"@CatalogManager, function @buildPaginationHelper << @list, parameter 'offset' was not found on actions.pagination object\");\n return;\n }\n if (!vm.actions['LIST'].pagination['pageSize']) {\n $log.error(\"@CatalogManager, function @buildPaginationHelper << @list, parameter 'pageSize' was not found on actions.pagination object\");\n return;\n }\n\n //If the remainder it's not zero, it means that an aditional page should be added to the count,so the Math.ceil function was used for that\n vm.paginationHelper['totalPages'] = Math.ceil(response[vm.actions['LIST'].pagination['total']] / vm.actions['LIST'].pagination['pageSize']);\n\n vm.paginationHelper['actualPage'] = 1;\n\n //Initial nextPageQueries building\n if (vm.paginationHelper['totalPages'] > vm.paginationHelper['actualPage']) {\n vm.paginationHelper['nextPageQueries'].push('limit=' + vm.actions['LIST'].pagination['pageSize']);\n vm.paginationHelper['nextPageQueries'].push('offset=' + vm.actions['LIST'].pagination['pageSize']);\n //vm.paginationHelper['nextPage'] = vm.url\n // + '?limit=' + vm.actions['LIST'].pagination['pageSize']\n // + '&offset=' + vm.actions['LIST'].pagination['pageSize'];\n }\n }\n }\n }", "initPagination(){\n this.getPagination().initPagination();\n }", "function paginate(req, res, next) {\n\n // declare variable called perPage. it has 9 items per page\n var perPage = 9;\n var page = req.params.page;\n\n Product\n .find()\n .skip ( perPage * page ) // 9 * 6 = 18\n .limit( perPage )\n .populate('category')\n .exec(function(err, products) {\n if (err) return next(err);\n Product.count().exec(function(err, count) {\n if (err) return next(err);\n res.render('main/product-main', {\n products: products,\n pages: count / perPage\n });\n });\n });\n\n}", "paginateNext(boundThis) {\n\n\n this.settings.offset = this.settings.offset + this.settings.show;\n const dataSet = this.run();\n\n // console.log(dataSet)\n // console.log(dataSet.data)\n\n boundThis.setState({dataToShow: dataSet.data})\n\n return dataSet\n\n }", "function displayPaginationResult(data) {\n var book = '',\n books = data.books,\n count = 0,\n page = data.page,\n url;\n\n if (books.length) {\n var tbody = $('.list-table').find('tbody'),\n content = '';\n tbody.empty();\n $('.list-table').removeClass('hidden');\n $('.no-result').remove();\n $('.pagination').find('li.active').removeClass('active');\n\n for (var i = 0; i < books.length; i++) {\n book = books[i];\n url = $('tbody').data('url');\n\n content +=\"<tr id='book-\" + i + \"' data-img=\" + url + book.photo +\" class='book-row'>\";\n content +=\"<td class='td-title'><span class='book-content'>\" + book.title +\n \"</span><a class='edit-book' style='display: none;' href='\" + url + \"edit/\" + book.id + \"'>\" +\n \"<span class='glyphicon glyphicon-pencil'></span></a></td>\";\n content += \"<td class='td-author'><span class='book-content'>\" + book.author.name + \"</span></td>\";\n content += \"<td class='td-genre'><span class='book-content'>\" + book.genre.name + \"</span></td>\";\n content += \"<td class='td-language'><span class='book-content'>\" + book.language + \"</span></td>\";\n content += \"<td class='td-year'><span class='book-content'>\" + book.year + \"</span></td>\";\n content += \"<td class='td-code'><span class='book-content'>\" + book.code + \"</span></td></tr>\";\n }\n tbody.append(content);\n\n\n } else {\n $('.list-table').addClass('hidden').after('<h2 class=\"no-result\">Bookshelf is empty!</h2>');\n }\n}", "index({ query, profile }, res) {\n\t\tconst { filter, skip, limit, sort, projection } = aqp(query, {\n\t\t\tskipKey: 'page',\n\t\t});\n\n\t\tconst page = (skip) ? skip : 1;\n\t\tconst perPage = (limit && limit <= 100) ? limit : 50;\n\n\t\tMedia.paginate(filter, { select: projection, sort:sort , page: page, limit: perPage, }).then((result) => {\n\t\t\tres.status(200).json(result)\n\t\t}).catch((err) => {\n\t\t\tres.status(500).json(err)\n\t\t})\n\t}", "function CarryoutOrdersListPaginationCurrent(status, carryoutpagesize, carryoutcurrentPage, divId) {\n //Shorting\n var sortValue = \"DESC\";\n var sortByValue = \"\";\n var filterStatus = \"\";\n var orderNoFrom = \"\";\n var orderNoTo = \"\";\n var phone = \"\";\n var orderDateFrom = \"\";\n var orderDateTo = \"\";\n //Shorting\n\n var customerId = 0;\n var storeId = 0;\n var status = $('#hdnCurrentState').val();\n if (status == \"New\") {\n divId = 'dvNewList';\n }\n else if (status == \"Processing\") {\n divId = 'dvNewList';\n }\n else {\n divId = 'dvAllList';\n sortValue = $(\"input[name='radioCarryoutSort']:checked\").val();\n sortByValue = $(\"input[name='radioCarryoutSortBy']:checked\").val();\n\n filterStatus = $(\"#ddlFilterCarryoutStatus\").val();\n orderNoFrom = $(\"#txtFilterOrderNumberFrom\").val();\n orderNoTo = $(\"#txtFilterOrderNumberTo\").val();\n phone = $(\"#txtFilterPhone\").val();\n orderDateFrom = $(\"#txtFilterOrderDateFrom\").val();\n orderDateTo = $(\"#txtFilterOrderDateTo\").val();\n\n //console.log(\"Sort: \"+ sortValue + \" By: \" + sortByValue + \" filter: \" + filterStatus + \" orderNofrom: \" + orderNoFrom + \" orderNoTo: \" + orderNoTo + \" phone: \" + phone + \" orderDateFrom: \"+ orderDateFrom + \" dateTo: \" + orderDateTo);\n if (sortValue == undefined) {\n sortValue = \"\";\n }\n if (sortByValue == undefined) {\n sortByValue = \"\";\n }\n if (filterStatus == undefined) {\n filterStatus = \"\";\n }\n if (orderNoFrom == undefined) {\n orderNoFrom = \"\";\n }\n if (orderNoTo == undefined) {\n orderNoTo = \"\";\n }\n if (phone == undefined) {\n phone = \"\";\n }\n if (orderDateFrom == undefined) {\n orderDateFrom = \"\";\n }\n if (orderDateTo == undefined) {\n orderDateTo = \"\";\n }\n }\n\n storeId = SetStoreId();\n customerId = SetCustomerId();\n if (Number(storeId) > 0) {\n\n carryoutcurrentPage = Number(carryoutcurrentPage) * Number(carryoutpagesize);\n url = global + \"/GetAllCarryOutOrdersTempCurrent?storeid=\" + storeId + \"&status=\" + status + \"&pagesize=\" + carryoutpagesize + \"&currentPage=\" + carryoutcurrentPage + \"&sortValue=\" + sortValue + \"&sortByValue=\" + sortByValue +\n \"&filterStatus=\" + filterStatus + \"&orderNoFrom=\" + orderNoFrom + \"&orderNoTo=\" + orderNoTo + \"&phone=\" + phone + \"&orderDateFrom=\" + orderDateFrom + \"&orderDateTo=\" + orderDateTo;\n if (status.toLowerCase().trim() == \"new\") {\n\n $(\"#dvNewList\").attr(\"class\", \"active\");\n //$(\"#dvPending\").removeAttr(\"class\");\n $(\"#dvAllList\").removeAttr(\"class\");\n\n\n }\n else if (status.toLowerCase().trim() == \"processing\") {\n\n //$(\"#dvPending\").attr(\"class\", \"active\");\n $(\"#dvNewList\").attr(\"class\", \"active\");\n $(\"#dvAllList\").removeAttr(\"class\");\n }\n else {\n\n $(\"#dvAllList\").attr(\"class\", \"active\");\n //$(\"#dvPending\").removeAttr(\"class\");\n $(\"#dvNewList\").removeAttr(\"class\");\n\n }\n try {\n\n $.getJSON(url, function (data) {\n var obj = JSON.parse(data);\n var length = Object.keys(obj).length;\n\n\n $('#loader_msg').html(\"\");\n if (JSON.parse(data).indexOf(\"No order(s) found\") < 0) {\n localStorage.setItem(\"OrderAvailable\", \"1\");\n var count = 0;\n $.each(JSON.parse(data), function (index, value) {\n\n var orderDate = \"\";\n var orderTime = \"\";\n var firstName = \"\";\n var lastName = \"\";\n var email = \"\";\n var phone = \"\";\n var paymentMethod = \"\";\n var cardNumber = \"\";\n var ordertotal = \"\";\n var buttonHTML = \"\";\n var subTotal = 0.00;\n var grandTotal = 0.00;\n var discount = 0.00;\n var ordertype = \"\";\n if (value.ORDERTYPE != \"\") {\n ordertype = value.ORDERTYPE;\n }\n if (value.SUBTOTAL != \"\") {\n subTotal = value.SUBTOTAL;\n }\n if (value.ORDERDISCOUNT != \"\") {\n discount = value.ORDERDISCOUNT;\n }\n\n grandTotal = value.ORDERTOTAL;\n\n if (Number(grandTotal) != Number(subTotal)) {\n ordertotal = FormatDecimal(Number(subTotal) - Number(discount));\n }\n else {\n ordertotal = FormatDecimal(grandTotal);\n }\n if (value.CREATEDONUTC != null && value.CREATEDONUTC != undefined) {\n var arrDateTime = value.CREATEDONUTC.split('~');\n var orderDate = arrDateTime[0];\n var orderTime = arrDateTime[1];\n }\n if (value.FIRSTNAME != \"\") {\n firstName = value.FIRSTNAME;\n }\n else {\n firstName = value.BILLINGFIRSTNAME;\n }\n\n if (value.LASTNAME != \"\") {\n lastName = value.LASTNAME;\n }\n else {\n lastName = value.BILLINGLASTNAME;\n }\n\n if (value.EMAIL != \"\" && value.EMAIL != undefined) {\n email = value.EMAIL;\n }\n else {\n email = value.BILLINGEMAIL;\n }\n\n if (value.PHONE != \"\") {\n phone = value.PHONE;\n }\n else {\n phone = value.BILLINGPHONE;\n }\n if (phone.length == 10)\n phone = FormatPhoneNumber(phone);\n if (value.PAYMENTMETHOD != \"\" && value.PAYMENTMETHOD != undefined) {\n paymentMethod = value.PAYMENTMETHOD;\n }\n if (value.CardNumber != \"\" && value.CardNumber != undefined) {\n cardNumber = value.CardNumber;\n }\n /*------------------Order Area-----------------------*/\n\n var html = \"<div class=\\\"order-container\\\" id='li_\" + value.ID + \"' style=\\\"height:75px;\\\">\";\n\n\n /*------------------Order Row-----------------------*/\n\n html += \"<div id=\\\"dvOrderInner_\" + value.ID + \"\\\" class=\\\"order-list-carryout\\\" data-popup=\\\".popup-details\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">\";\n\n /*------------------Column 1-----------------------*/\n\n ////////html += \"<div class=\\\"order-column-one\\\" >\";\n /*------------------Status Icon--------------------*/\n ////if (status == '' || status == \"All\") {\n //// if (value.ORDERSTATUSID.toLowerCase() == \"new\") {\n //// //html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/new.png\\\" alt=\\\"\\\"/></div>\";\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" onclick=\\\"myFunction(\" + value.ID + \")\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/new.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"<div id=\\\"myDropdown_\" + value.ID + \"\\\" class=\\\"dropdown-content\\\"><div onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\" id =\\\"close_status_dropdown\\\" class=\\\"close_status_dropdown\\\">X</div>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Processing',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Processing</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Complete',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Complete</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('PickedUp',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/><span class=\\\"custom-dropdown-span\\\"> Picked Up</span></a>\";\n //// html += \"</div>\";\n //// html += \"</div>\";\n //// }\n //// else if (value.ORDERSTATUSID.toLowerCase() == \"processing\") {\n //// // html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/></div>\";\n\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" onclick=\\\"myFunction(\" + value.ID + \")\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"<div id=\\\"myDropdown_\" + value.ID + \"\\\" class=\\\"dropdown-content\\\"><div onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\" id =\\\"close_status_dropdown\\\" class=\\\"close_status_dropdown\\\">X</div>\";\n //// html += \"<a class=\\\"status-disabled\\\" onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Processing</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Complete',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Complete</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('PickedUp',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/><span class=\\\"custom-dropdown-span\\\"> Picked Up</span></a>\";\n //// html += \"</div>\";\n //// html += \"</div>\";\n //// }\n //// else if (value.ORDERSTATUSID.toLowerCase() == \"complete\") {\n //// // html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/></div>\";\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" onclick=\\\"myFunction(\" + value.ID + \")\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"<div id=\\\"myDropdown_\" + value.ID + \"\\\" class=\\\"dropdown-content\\\"><div onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\" id =\\\"close_status_dropdown\\\" class=\\\"close_status_dropdown\\\">X</div>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Processing',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Processing</span></a>\";\n //// html += \"<a class=\\\"status-disabled\\\" onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Complete</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('PickedUp',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/><span class=\\\"custom-dropdown-span\\\"> Picked Up</span></a>\";\n //// html += \"</div>\";\n //// html += \"</div>\";\n //// }\n //// else if (value.ORDERSTATUSID.toLowerCase() == \"pickedup\") {\n //// //html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/></div>\";\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" onclick=\\\"myFunction(\" + value.ID + \")\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"<div id=\\\"myDropdown_\" + value.ID + \"\\\" class=\\\"dropdown-content\\\"><div onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\" id =\\\"close_status_dropdown\\\" class=\\\"close_status_dropdown\\\">X</div>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Processing',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/pending.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Processing</span></a>\";\n //// html += \"<a onclick=\\\"ChangeOrderStatusDropdown('Complete',\" + value.ID + \",\" + storeId + \")\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Complete-Icon.png\\\" alt=\\\"\\\"/> <span class=\\\"custom-dropdown-span\\\">Complete</span></a>\";\n //// html += \"<a class=\\\"status-disabled\\\" onclick=\\\"HideStatusChangeDropdown(\" + value.ID + \");\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/><span class=\\\"custom-dropdown-span\\\"> Picked Up</span></a>\";\n //// html += \"</div>\";\n //// html += \"</div>\";\n //// }\n //// else if (value.ORDERSTATUSID.toLowerCase() == \"cancelled\") {\n //// //html += \"<div class=\\\"order-status-icon\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/Picked-Up-Icon.png\\\" alt=\\\"\\\"/></div>\";\n //// html += \"<div class=\\\"dropdown\\\" id=\\\"carryoutstatus_\" + value.ID + \"\\\">\";\n //// html += \"<button id=\\\"btnStatusChange\\\" class=\\\"dropbtn\\\"><img class=\\\"list-icon\\\" src=\\\"img/icons/cancel.png\\\" alt=\\\"\\\"/></button>\";\n //// html += \"</div>\";\n //// }\n ////}\n\n /*-----------------Status Icon End----------------*/\n\n //html += \"<div class=\\\"order-number-carryout panel-open\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">#\" + value.ID + \"<span></div>\";\n html += \"<div class=\\\"order-number-carryout\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\" style=\\\"white-space: nowrap;\\\">\" + firstName + \" \" + lastName + \"</div>\";\n\n if (value.PICKUPTIME != undefined) {\n var pickupdatetime = value.PICKUPTIME;\n\n if (ordertype == \"Carry Out\") {\n ////if (status == '' || status == \"All\")\n html += \"<div class=\\\"order-pickup-new\\\">\" + pickupdatetime + \"</div>\";\n ////else\n //// html += \"<div class=\\\"order-pickup order-pickup-margin-top\\\" style=\\\"margin-top:22px;\\\">\" + pickupdatetime + \"</div>\";\n }\n //For Delivery Orders - Start//\n else if (ordertype == \"Delivery\") {\n ////if (status == '' || status == \"All\")\n html += \"<div class=\\\"order-pickup-new\\\" style=\\\"color: #e95861;\\\">\" + pickupdatetime + \"</div>\";\n ////else\n //// html += \"<div class=\\\"order-pickup order-pickup-margin-top\\\" style=\\\"margin-top:22px; color: #e95861;\\\">\" + pickupdatetime + \"</div>\";\n }//For Delivery Orders - End//\n else {\n if (pickupdatetime.indexOf(\"@\") > -1) {\n var pickupDate = pickupdatetime.split('@')[0].trim();\n var pickupTime = pickupdatetime.split('@')[1].trim();\n if (status == '' || status == \"All\")\n html += \"<div class=\\\"order-pickup-new\\\"><div>\" + pickupTime + \"</div><div class=\\\"order-pickup-time\\\">\" + pickupDate + \"</div></div>\";\n else\n html += \"<div class=\\\"order-pickup-new order-pickup-margin-top\\\" style=\\\"margin-top:4px;\\\"><div>\" + pickupTime + \"</div><div class=\\\"order-pickup-time\\\">\" + pickupDate + \"</div></div>\";\n }\n else {\n ////if (status == '' || status == \"All\")\n html += \"<div class=\\\"order-pickup-new\\\">\" + pickupdatetime + \"</div>\";\n ////else\n //// html += \"<div class=\\\"order-pickup order-pickup-margin-top\\\" style=\\\"margin-top:22px;\\\">\" + pickupdatetime + \"</div>\";\n }\n }\n\n }\n //else {\n // if (status == '' || status == \"All\")\n // html += \"<div class=\\\"order-pickup\\\"></div>\";\n // else\n\n // html += \"<div class=\\\"order-pickup order-pickup-margin-top\\\"></div>\";\n // }\n\n\n ////////html += \"</div>\";\n /*------------------Column 1-----------------------*/\n /*------------------Column 2-----------------------*/\n ////////html += \"<div class=\\\"order-column-two\\\">\";\n /*------------------1st Row-----------------------*/\n ////////html += \"<div class=\\\"order-row-container\\\">\";\n ////html += \"<div class=\\\"order-number panel-open\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">#\" + value.ID + \"<span> on </span><span>\" + orderDate + \" @ \" + orderTime + \"</span></div>\";\n ////html += \"<div class=\\\"order-number-carryout panel-open\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">#\" + value.ID + \"<span></div>\";\n /*------------------Button Row-----------------------*/\n ////if (status == '' || status == \"All\") {\n\n ////if (value.ORDERSTATUSID != \"New\" && value.ORDERSTATUSID != \"Cancelled\" ) {\n //// //console.log('value.ORDERPICKUPSMSSENTON: ' + value.ORDERPICKUPSMSSENTON)\n //// if (value.ORDERPICKUPSMSSENTON != undefined && value.ORDERPICKUPSMSSENTON != null && value.ORDERPICKUPSMSSENTON.trim()!= \"\") {\n //// // console.log('value.ORDERPICKUPSMSSENTON: '+value.ORDERPICKUPSMSSENTON)\n //// buttonHTML += \"<a><img src=\\\"./img/icons/pickup_sms_button_active.png\\\" class=\\\"grid-small-icon\\\"/></a>\";\n\n //// }\n //// else {\n //// buttonHTML += \"<a onclick=\\\"ConfirmationPickUpSMSSend(\" + value.ID + \",'\" + phone + \"','Grid','\" + ordertotal + \"')\\\" id=\\\"btnPickUpSMS_\" + value.ID + \"\\\"><img id=\\\"imgPickUpSMS_\" + value.ID + \"\\\" src=\\\"./img/icons/pickup_sms_button.png\\\" class=\\\"grid-small-icon\\\" /></a>\";\n //// }\n //// } \n ////else if (value.ORDERSTATUSID == \"New\")\n ////{\n //// buttonHTML += \"<a onclick=\\\"ChangeOrderStatusNew('Processing',\" + value.ID + \",\" + storeId + \")\\\" id=\\\"btnAccept\\\"><img src=\\\"./img/icons/accept_button.png\\\" style=\\\"width:41%;float: right;margin-right:23px;\\\" /></a>\";\n //// }\n //// html += \"<div class=\\\"order-buttons\\\" id=\\\"dvCarryOutButtons_\" + value.ID + \"\\\">\";\n //// html += buttonHTML;\n //// html += \"</div>\";\n ////}\n ////else if (status=='New') {\n //// buttonHTML += \"<a onclick=\\\"ChangeOrderStatusNew('Processing',\" + value.ID + \",\" + storeId + \")\\\" id=\\\"btnAccept\\\"><img src=\\\"./img/icons/accept_button.png\\\" style=\\\"width:41%;float: right;margin-right:23px;\\\" /></a>\";\n //// buttonHTML += \"<a style=\\\"display:none;\\\" onclick=\\\"ConfirmationPickUpSMSSend(\" + value.ID + \",'\" + phone + \"','Grid','\" + ordertotal + \"')\\\" id=\\\"btnPickUpSMS_\" + value.ID + \"\\\"><img id=\\\"imgPickUpSMS_\" + value.ID + \"\\\" src=\\\"./img/icons/pickup_sms_button.png\\\" class=\\\"grid-small-icon\\\" /></a>\";\n //// html += \"<div class=\\\"order-buttons\\\" id=\\\"dvCarryOutButtons_\" + value.ID + \"\\\">\";\n //// html += buttonHTML;\n //// html += \"</div>\";\n ////}\n /*------------------Button Row-----------------------*/\n ////////html += \"</div>\";\n /*------------------1st Row-----------------------*/\n\n /*------------------2nd Row-----------------------*/\n ////////html += \"<div class=\\\"order-row-container\\\" >\";\n\n /*------------------Customer Info-----------------------*/\n ////html += \"<div class=\\\"order-date order-payment-info\\\">\";\n ////html += \"<div class=\\\"customer-detail-container panel-open\\\" onclick=\\\"OpenCarryoutDetails(\" + value.ID + \");\\\">\";\n ////html += \"<div class=\\\"customer-name\\\">\" + firstName + \" \" + lastName + \"</div>\";\n ////html += \"<div id=\\\"customerphone_\" + value.ID + \"\\\">\" + phone + \"</div>\";\n //////html += \"<div class=\\\"display-label-wrap\\\">\" + email + \"</div>\";\n ////html += \"</div>\";\n ////html += \"</div>\";\n /*------------------Customer Info-----------------------*/\n /*------------------Order Info-----------------------*/\n ////html += \"<div class=\\\"order-items-count\\\" style=\\\"width:25%;\\\">\";\n\n ////html += \"<div class=\\\"customer-detail-container\\\" id=\\\"dvPickUpSMSGrid_\" + value.ID + \"\\\">\";\n\n ////html += \"<div class=\\\"order-price\\\" id=\\\"orderprice_\" + value.ID + \"\\\">\" + ordertotal + \"</div>\";\n ////if (value.NOOFITEMS == 1) {\n //// html += \"<div>1 item \";\n ////}\n ////else {\n //// html += \"<div>\" + value.NOOFITEMS + \" items \";\n ////}\n ////if (paymentMethod == \"Cash On Delivery\") {\n //// html += \"<span class=\\\"cc-number\\\">Due on Pickup</span>\";\n ////}\n ////else {\n //// html += \"<span class=\\\"cc-number\\\">PAID</span>\";\n ////}\n ////html += \"</div>\";\n\n ////html += \"</div>\";//end customer-detail-container div\n ////html += \"</div>\";//end order-items-count div\n /*------------------Order Info-----------------------*/\n\n\n ////////html += \"</div>\";\n /*------------------2nd Row-----------------------*/\n html += \"</div>\";\n /*------------------Column 2-----------------------*/\n\n html += \"</div>\";\n /*------------------Order Row-----------------------*/\n\n\n\n html += \"</div>\";\n /*------------------Order Area-----------------------*/\n\n count++;\n\n $(\"#carryout #\" + divId).append(html);\n\n\n });\n\n\n }\n else {\n localStorage.setItem(\"OrderAvailable\", \"0\");\n\n }\n\n\n\n });\n\n }\n catch (e) {\n }\n }\n else {\n self.app.router.navigate('/login_new/', { reloadCurrent: false });\n }\n\n}", "function paginationResults(model,filter){\r\n return async (req, res, next) => {\r\n \r\n const page = parseInt(req.query.page)\r\n const limit = parseInt(req.query.limit)\r\n \r\n const startIndex = (page - 1) * limit;\r\n const endIndex = page * limit;\r\n \r\n const results = {}\r\n \r\n \r\n if (endIndex < await model.countDocuments().exec()){\r\n results.next = {\r\n page: page + 1,\r\n limit: limit\r\n }\r\n }\r\n \r\n if (startIndex > 0){\r\n results.previous = {\r\n page: page - 1,\r\n limit: limit\r\n }\r\n }\r\n \r\n if (filter==\"newIn\"){\r\n \r\n try{\r\n results.results = await model.find().limit(limit).skip(startIndex).exec()\r\n res.paginationResults = results;\r\n next();\r\n } catch(err){\r\n res.status(500).json({message : err})\r\n }\r\n\r\n } else if(filter==\"highLow\"){\r\n\r\n try{\r\n results.results = await model.find().sort({\"price\" : -1}).limit(limit).skip(startIndex).exec()\r\n res.paginationResults = results;\r\n next();\r\n } catch(err){\r\n res.status(500).json({message : err})\r\n }\r\n\r\n } else if(filter==\"lowHigh\"){\r\n\r\n try{\r\n results.results = await model.find().sort({\"price\" : 1}).limit(limit).skip(startIndex).exec()\r\n res.paginationResults = results;\r\n next();\r\n } catch(err){\r\n res.status(500).json({message : err})\r\n }\r\n\r\n }\r\n\r\n \r\n }\r\n}", "function buildTableRows() {\r\n\tconsole.log('buildTableRows');\r\n\r\n\t// Initialise row count\r\n\tvar bodyHtml = [];\r\n\tvar numRowsMatched = 0;\r\n\tvar numRowsDisplayed = 0;\r\n\tvar startRowNo = pageNo == Infinity ? 1 : maxTableRows * (pageNo - 1) + 1;\r\n\tvar endRowNo = pageNo == Infinity ? Infinity : startRowNo + maxTableRows;\r\n\tconsole.log('buildTableRows', pageNo, maxTableRows, startRowNo, endRowNo);\r\n\t\r\n\t// Loop through all data rows\r\n\t$.each(data, function(index, record) {\r\n\t\t\r\n\t\t// Check if this row passes all the filters\r\n\t\tif (record[0] && !record[0].__filters.every(value => value)) return;\r\n\t\tif (record[1] && !record[1].__filters.every(value => value)) return;\r\n\t\tnumRowsMatched++;\r\n\t\t\r\n\t\t// Show only selected page\r\n\t\tif (numRowsMatched >= startRowNo && numRowsMatched < endRowNo) {\r\n\t\t\t\r\n\t\t\t// Add row to table body\r\n\t\t\tbodyHtml.push('<tr' + (record[0] && record[0].elected ? ' class=\"sjo-api-row-elected\"' : '') + '>' + buildTableRowCells(record).join('') + '</tr>');\r\n\t\t\tnumRowsDisplayed++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t});\r\n\t\r\n\t// Calculate actual end row\r\n\tendRowNo = startRowNo + numRowsDisplayed;\r\n\t\r\n\t// Return values as an object\r\n\treturn {\r\n\t\t'bodyHtml': \t\tbodyHtml,\r\n\t\t'numRowsMatched': \tnumRowsMatched,\r\n\t\t'numRowsDisplayed': numRowsDisplayed,\r\n\t\t'startRowNo': \t\tstartRowNo,\r\n\t\t'endRowNo': \t\tendRowNo,\r\n\t};\r\n\t\r\n}", "_pageData(data) {\n if (!this.paginator) {\n return data;\n }\n const startIndex = this.paginator.pageIndex * this.paginator.pageSize;\n return data.slice(startIndex, startIndex + this.paginator.pageSize);\n }", "function getPage(page) {\n var size = 10;\n var offset = (page - 1) * size;\n $.get(\"/get_total\", function (result) {\n var totalCount = result.count;\n if ($('#checkNameDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=name&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkNameAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=name&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkCategoryDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=category&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkCategoryAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=category&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkRatingDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=rating&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkRatingAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=rating&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkPriceDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=price&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkPriceAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=price&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else {\n $.get('/get_table?size=' + size + '&offset=' + offset, function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n }\n });\n}", "function paginate(arr, perPage, pageNumber = 1) {\n perPage = perPage;\n const start = perPage * (pageNumber - 1);\n let nr = arr.slice(start, (start + perPage));\n tableData(tbody, nr);\n }", "renderPagination(maxPage, currentPage, index) {\n var lastPageThreeDots = maxPage - 3;\n var firstPageThreeDots = 3;\n var numberOfNextPage = 1;\n if (maxPage <= 6) {\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else {\n\n // }\n // console.log(\"currentPage: \" + currentPage)\n //3 case: \n //currentPage in first 9 pages\n //currentPage in last 9 pages\n //currentPage in middle of last and first 9 pages\n\n //currentPage in first 9 pages\n if (currentPage <= firstPageThreeDots) {\n // 3 case:\n //index [0, currentPage + 3]\n //index [maxPage -3, maxPage]\n // render component ...\n if (index <= currentPage + numberOfNextPage) {\n //index in [currentPage, currentPage + 3]\n //example index: 2, currentPage = 1 \n //-> this block code will render the paginationItem\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index >= maxPage - numberOfNextPage) {\n //index in last 3 pages\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index === currentPage + numberOfNextPage + 1) {\n // render component ...\n return (<PaginationItem onClick={(e) => e.preventDefault()} key=\"...\">\n <PaginationLink>\n ...\n </PaginationLink>\n </PaginationItem>);\n\n } else {\n // do nothing \n }\n } else if (currentPage >= lastPageThreeDots) {\n //current Page in last 9 pages\n if (index <= numberOfNextPage + 2) { // <= 3\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index >= currentPage - numberOfNextPage) {\n //render currentPage and the 3 previous pages\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index === currentPage - numberOfNextPage - 1) {\n //render component ...\n return (<PaginationItem onClick={(e) => e.preventDefault()} key=\"...\">\n <PaginationLink>\n ...\n </PaginationLink>\n </PaginationItem>);\n\n } else {\n // do nothing \n }\n } else {\n // currentPage in the middle\n if (index <= numberOfNextPage + 2) { // <= 3\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);;\n } else if (index <= currentPage + numberOfNextPage && index >= currentPage - numberOfNextPage) {\n //index in [currentPage-3, currentPage, currentPage +3]\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index >= maxPage - numberOfNextPage) {\n //index in [maxPage-3, maxPage]\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index === currentPage + numberOfNextPage + 1) {\n //render component ...\n return (<PaginationItem onClick={(e) => e.preventDefault()} key=\"...\">\n <PaginationLink>\n ...\n </PaginationLink>\n </PaginationItem>);\n } else if (index === currentPage - numberOfNextPage - 1) {\n //render component ...\n return (<PaginationItem onClick={(e) => e.preventDefault()} key=\"...2\">\n <PaginationLink>\n ...\n </PaginationLink>\n </PaginationItem>);\n\n } else {\n // do nothing\n }\n }\n }\n }", "function renderPagination(currentPage) {\n let changeCategories = sessionStorage.getItem(\"changeCategories\");\n let changePrice = sessionStorage.getItem(\"change\");\n changePrice ? changePrice : \"\";\n let changeLimit = parseInt(sessionStorage.getItem(\"changeLimit\"));\n if (!changeLimit) {\n changeLimit = 10;\n } else {\n changeLimit = changeLimit;\n }\n let str = \"\";\n let data = 50;\n let pages = parseInt(data / changeLimit);\n\n for (let i = 1; i <= pages; i++) {\n str += `<li class=\"page-item${\n i === currentPage ? \" active\" : \"\"\n }\"><button class=\"page-link\" onclick=\"getProductList({page: ${i},limit:${changeLimit},categories:${changeCategories},softPrice:'${changePrice}'})\">${i}</button></li>`;\n }\n\n let pagination = document.getElementById(\"pagination\");\n pagination.innerHTML = `<ul class=\"pagination justify-content-end pagination-custom\">\n <li onclick =\"onscrollTop(event)\" class=\"page-item${\n currentPage === 1 ? \" disabled\" : \"\"\n }\"><button class=\"page-link\" onclick=\"getProductList({page: ${\n currentPage - 1\n },limit:${changeLimit},categories:${changeCategories},softPrice:'${changePrice}'})\">Trang trước</button></li>\n ${str}\n <li class=\"page-item${\n currentPage === pages ? \" disabled\" : \"\"\n }\"><button class=\"page-link\" onclick=\"getProductList({page:${pages},limit:${changeLimit},categories:${changeCategories},softPrice:'${changePrice}'})\">Trang cuối</button></li>\n </ul>`;\n}", "function nextResultSet()\n{\n //console.log('I am in nextResultSet'+startIndex) ;\n const settings =\n {\n url: 'https://developers.zomato.com/api/v2.1/search',\n /*url: 'https://developers.zomato.com/api/v2.1/collections',*/\n headers:\n {\n \"user-key\":'cba9c1eb99c74720b299dc97c499bacd'\n },\n data:\n {\n entity_id: `${cityId}`,\n entity_type:`${entity}`,\n count: 6,\n start:startIndex\n },\n dataType: 'json',\n type: 'GET',\n success: displayData\n }\n $.ajax(settings);\n }", "createPaging() {\n var result = [];\n for (let i = 1; i <= this.state.totalPage; i++) {\n result.push(\n <MDBPageNav href={\"/product/\" + i} >\n <span aria-hidden=\"true\">{i}</span>\n </MDBPageNav >\n )\n }\n return result;\n }", "setRowPage(){\n var table = document.getElementById(`${this.state.config.tableId}_Body`);\n var tr = table.getElementsByTagName(\"tr\");\n for (var i = 0; i < tr.length; i++) {\n let page = parseInt(tr[i].getAttribute(\"page\"));\n if (page === this.state.currentPage){\n tr[i].classList.add(\"showIt\");\n tr[i].classList.remove(\"hideIt\");\n }else {\n tr[i].classList.add(\"hideIt\");\n tr[i].classList.remove(\"showIt\");\n }\n }\n }", "function load_page(p) {\r\n const all_btn = document.getElementsByClassName(\"page\");\r\n if (all_btn.length > 0) {\r\n for (let i = 0; i < (Math.ceil(arr.length / page_size)); i++) {\r\n all_btn[i].classList.remove(\"btn-active\");\r\n }\r\n const btn = document.getElementById(`page-${p}`);\r\n btn.classList.add(\"btn-active\");\r\n }\r\n\r\n const min = (p - 1) * page_size;\r\n const max = min + 5;\r\n\r\n var load_data = '';\r\n if (max > arr.length) {\r\n for (let i = min; i < arr.length; i++) {\r\n load_data += `<tr>\r\n <td>${arr[i].id}</td>\r\n <td>${arr[i].device}</td>\r\n <td>${arr[i].action}</td>\r\n <td>${arr[i].date}</td>\r\n </tr>`;\r\n }\r\n } else {\r\n for (let i = min; i < max; i++) {\r\n load_data += `<tr>\r\n <td>${arr[i].id}</td>\r\n <td>${arr[i].device}</td>\r\n <td>${arr[i].action}</td>\r\n <td>${arr[i].date}</td>\r\n </tr>`;\r\n }\r\n }\r\n\r\n let total = arr.length;\r\n const data = load_data + `\r\n <tr style=\"background-color: #FAFBFB;\">\r\n <th scope=\"row\">Total</th>\r\n <td colspan=\"2\"></td>\r\n <td><b>${total}</b></td>\r\n </tr>\r\n `;\r\n document.getElementById(\"load_data\").innerHTML = data;\r\n}", "function Pagination(totalCount, pageIndex) {\n $('#tblPagination').html('');\n var table = document.getElementById(\"tblPagination\");\n var row = table.insertRow(0); row.setAttribute('id', 'trPagination')\n var id = 1;\n var totalRecord = totalCount;\n var currentPage = pageIndex;\n var pageSize = 10;\n var pageCount = totalRecord / pageSize;\n pageCount = Math.ceil(pageCount);\n if (pageCount > 10) {\n if (currentPage <= 10) {\n if (currentPage != 1) {\n var position = 0;\n var first = row.insertCell(position); var prevPage = currentPage - 1;\n first.innerHTML = \"First\"; first.setAttribute('onclick', \"PageClick('1');\"); first.setAttribute('id', id);\n if (currentPage > 1) {\n first.setAttribute(\"class\", \"Cursor\");\n } else {\n first.setAttribute(\"class\", \"CurrentPage\");\n }\n var prev = row.insertCell(position++);\n prev.innerHTML = \"Prev\"; prev.setAttribute('onclick', \"PageClick(\" + prevPage + \");\"); prev.setAttribute('id', id + 1);\n if (currentPage > 1) {\n prev.setAttribute(\"class\", \"Cursor\");\n } else {\n prev.setAttribute(\"class\", \"CurrentPage\");\n }\n }\n else {\n var id = 0;\n }\n\n for (var i = 1; i <= 10; i++) {\n\n position = position + 1; id = id + 1;\n var td = row.insertCell(position);\n td.innerHTML = i;\n td.setAttribute('onclick', \"PageClick(\" + i + \");\");\n td.setAttribute('id', id);\n if (i != currentPage) {\n td.setAttribute(\"class\", \"Cursor\");\n }\n else {\n td.setAttribute(\"class\", \"CurrentPage\");\n }\n }\n var next = row.insertCell(position++); id = id + 1; var nextpage = currentPage + 1;\n next.innerHTML = \"Next\"; next.setAttribute('onclick', \"PageClick(\" + nextpage + \");\");\n next.setAttribute('id', id);\n if (currentPage < pageCount) {\n next.setAttribute(\"class\", \"Cursor\");\n }\n else {\n next.setAttribute(\"class\", \"CurrentPage\");\n }\n var last = row.insertCell(position++);\n last.innerHTML = \"Last\"; last.setAttribute('onclick', \"PageClick(\" + pageCount + \");\"); id = id + 1;\n last.setAttribute('id', id);\n $(\"#trPagination > td\").tsort(\"\", { attr: \"id\" });\n if (currentPage < pageCount) {\n last.setAttribute(\"class\", \"Cursor\");\n }\n else {\n last.setAttribute(\"class\", \"CurrentPage\");\n }\n }\n else {\n var temp = pageCount - currentPage;\n if (temp > 10) {\n var position = 0;\n var first = row.insertCell(position); var prevPage = currentPage - 1;\n first.innerHTML = \"First\"; first.setAttribute('onclick', \"PageClick('1');\"); first.setAttribute('id', id);\n if (currentPage > 1) {\n first.setAttribute(\"class\", \"Cursor\");\n } else {\n first.setAttribute(\"class\", \"CurrentPage\");\n }\n var prev = row.insertCell(position++);\n prev.innerHTML = \"Prev\"; prev.setAttribute('onclick', \"PageClick(\" + prevPage + \");}\"); prev.setAttribute('id', id + 1);\n if (currentPage > 1) {\n prev.setAttribute(\"class\", \"Cursor\");\n } else {\n prev.setAttribute(\"class\", \"CurrentPage\");\n }\n var j = 1;\n for (var i = currentPage; j <= 10; i++) {\n position++; id++\n var td = row.insertCell(position);\n td.innerHTML = i;\n td.setAttribute('onclick', \"PageClick(\" + i + \");\");\n td.setAttribute('id', id);\n\n if (i != currentPage) {\n td.setAttribute(\"class\", \"Cursor\");\n }\n else {\n td.setAttribute(\"class\", \"CurrentPage\");\n }\n j++;\n }\n var next = row.insertCell(position++); id = id + 1; var nextpage = currentPage + 1;\n next.innerHTML = \"Next\"; next.setAttribute('onclick', \"PageClick(\" + nextpage + \");\");\n if (currentPage < pageCount) {\n next.setAttribute(\"class\", \"Cursor\");\n }\n else {\n next.setAttribute(\"class\", \"CurrentPage\");\n }\n var last = row.insertCell(position++); next.setAttribute('id', id);\n last.innerHTML = \"Last\"; last.setAttribute('onclick', \"PageClick(\" + pageCount + \");\"); id = id + 1;\n last.setAttribute('id', id);\n if (currentPage < pageCount) {\n last.setAttribute(\"class\", \"Cursor\");\n }\n else {\n last.setAttribute(\"class\", \"CurrentPage\");\n }\n $(\"#trPagination > td\").tsort(\"\", { attr: \"id\" });\n }\n else {\n var position = 0;\n var first = row.insertCell(position); var prevPage = currentPage - 1;\n first.innerHTML = \"First\"; first.setAttribute('onclick', \"PageClick('1');\"); first.setAttribute('id', id);\n if (currentPage > 1) {\n first.setAttribute(\"class\", \"Cursor\");\n } else {\n first.setAttribute(\"class\", \"CurrentPage\");\n }\n var prev = row.insertCell(position++);\n prev.innerHTML = \"Prev\"; prev.setAttribute('onclick', \"PageClick(\" + prevPage + \");\"); prev.setAttribute('id', id + 1);\n if (currentPage > 1) {\n prev.setAttribute(\"class\", \"Cursor\");\n } else {\n prev.setAttribute(\"class\", \"CurrentPage\");\n }\n var a = pageCount - currentPage;\n var b = 10 - a;\n var startingPoint = currentPage - b;\n var j = startingPoint;\n for (var i = startingPoint; i <= pageCount; i++) {\n position++; id++\n var td = row.insertCell(position);\n td.innerHTML = i;\n td.setAttribute('onclick', \"PageClick(\" + i + \");\");\n td.setAttribute('id', id);\n if (i != currentPage) {\n td.setAttribute(\"class\", \"Cursor\");\n }\n else {\n td.setAttribute(\"class\", \"CurrentPage\");\n }\n j++;\n }\n var next = row.insertCell(position++); id = id + 1; var nextpage = currentPage + 1;\n next.innerHTML = \"Next\"; next.setAttribute('onclick', \"PageClick(\" + nextpage + \");\");\n if (currentPage < pageCount) {\n next.setAttribute(\"class\", \"Cursor\");\n }\n else {\n next.setAttribute(\"class\", \"CurrentPage\");\n }\n var last = row.insertCell(position++); next.setAttribute('id', id);\n last.innerHTML = \"Last\"; last.setAttribute('onclick', \"PageClick(\" + pageCount + \");\"); id = id + 1;\n last.setAttribute('id', id);\n\n if (currentPage < pageCount) {\n last.setAttribute(\"class\", \"Cursor\");\n }\n else {\n last.setAttribute(\"class\", \"CurrentPage\");\n }\n $(\"#trPagination > td\").tsort(\"\", { attr: \"id\" });\n }\n }\n }\n else {\n var position = 0;\n var first = row.insertCell(position);\n first.innerHTML = \"First\"; first.setAttribute('onclick', \"PageClick('1');\"); first.setAttribute('id', id);\n if (currentPage > 1) {\n first.setAttribute(\"class\", \"Cursor\");\n } else {\n first.setAttribute(\"class\", \"CurrentPage\");\n }\n for (var i = 1; i <= pageCount; i++) {\n position++; id++\n var td = row.insertCell(position);\n td.innerHTML = i;\n td.setAttribute('onclick', \"PageClick(\" + i + \");\");\n td.setAttribute('id', id);\n if (i != currentPage) {\n td.setAttribute(\"class\", \"Cursor\");\n }\n else {\n td.setAttribute(\"class\", \"CurrentPage\");\n }\n }\n var last = row.insertCell(pageCount++); id = id + 1;\n last.innerHTML = \"Last\"; last.setAttribute('onclick', \"PageClick(\" + pageCount + \");\");\n last.setAttribute('id', id);\n if (currentPage < pageCount) {\n last.setAttribute(\"class\", \"Cursor\");\n }\n else {\n last.setAttribute(\"class\", \"CurrentPage\");\n }\n $(\"#trPagination > td\").tsort(\"\", { attr: \"id\" });\n }\n}", "function annuairePagination(dataToPaginate){\n $(\"#listGrpsPagination\").pagination({\n dataSource: dataToPaginate,\n pageSize: 5,\n className: 'paginationjs-big custom-paginationjs',\n callback: function(data, pagination){\n let html = userCardTemplate(data);\n $('#listGrps').html(html);\n },\n beforePageOnClick: function(){\n $('#send-message-contact').off('click', 'a');\n },\n beforePreviousOnClick: function(){\n $('#send-message-contact').off('click', 'a');\n },\n beforeNextOnClick: function(){\n $('#send-message-contact').off('click', 'a');\n },\n afterIsFirstPage: function(){\n pageGestion();\n },\n afterPreviousOnClick: function(){\n pageGestion();\n },\n afterNextOnClick: function(){\n pageGestion();\n },\n afterPageOnClick: function(){\n pageGestion();\n }\n })\n }", "handlePageChange(pageNumber) {\n console.log(pageNumber)\n this.setState({activePage: pageNumber});\n this.products = this.allProducts.slice((pageNumber-1)*this.pageSize,pageNumber*this.pageSize);\n }", "changePerPage(value) {\n this.perPage = value;\n if (this.page*value > this.data.meta.total) {\n this.page = Math.floor(this.data.meta.total / value) + 1;\n }\n this.fetch();\n }", "function getpagedPagedReceipts(filter) {\n //initiallize receiptfilter if it is not defined\n if ($scope.receiptFilter == undefined) {\n $scope.receiptFilter = {};\n angular.extend($scope.receiptFilter, ReceiptFilterModel);\n }\n //contruct params of not null fields\n var params;\n (filter == undefined) ? params = constructFilter($scope.receiptFilter) : params = constructFilter(filter);\n $scope.busyloading = true;\n //filter model on receipts over Recource POST attribute\n var f = { Page: params.Page, PageSize: params.PageSize, filt: JSON.stringify(params) }\n $q.all({\n receiptP: $scope.RestPromice.getReceipts(f)\n }).then(function (d) {\n var result = d.receiptP;\n if (result.data != null) {\n $scope.paging.total = result.data.PageCount;\n //var cp = (result.data.CurrentPage == 0) ? 1 : result.data.CurrentPage;\n var cp = result.data.CurrentPage;\n $scope.paging.current = cp; $scope.currentPage = cp;\n $scope.loadedReceipts = result.data.Results;\n }\n if (result.data.length < 1 || result.data == null) { tosterFactory.showCustomToast('No Results found', 'info'); }\n }).finally(function () { //finally(callback, notifyCallback)\n $scope.busyloading = false;\n });\n }", "function PagingInfo(totalCount)\n {\n $scope.totalCount = totalCount;\n $scope.totalPage = Math.ceil( $scope.totalCount / $scope.pageRecord)\n $scope.totalOption=[{}];\n for(var i = 0 ;i< $scope.totalPage;i++)\n {\n $scope.totalOption[i]={size:i+1};\n }\n }", "function PagingInfo(totalCount)\n {\n $scope.totalCount = totalCount;\n $scope.totalPage = Math.ceil( $scope.totalCount / $scope.pageRecord)\n $scope.totalOption=[{}];\n for(var i = 0 ;i< $scope.totalPage;i++)\n {\n $scope.totalOption[i]={size:i+1};\n }\n }", "function pwBuildPager(activePage) {\n var paginationHTML = '';\n var paginationHelperHTML = '';\n var prevMod = 1;\n var nextMod = 2;\n var firstProdOnPage = '';\n var lastProdOnPage = '';\n\n // Pagination helper\n lastProdOnPage = pwProductsPerPage * (activePage+1);\n firstProdOnPage = lastProdOnPage - (pwProductsPerPage) + 1;\n\n if(activePage === pwTotalPages) {\n lastProdOnPage = pwProductAmount;\n }\n\n $('#pagination-helper').text('Showing ' + firstProdOnPage + ' to ' + lastProdOnPage + ' of ' + pwProductAmount);\n\n // Pagination\n if(pwTotalPages >= 1) {\n if(pwTotalPages <= 7) {\n for (var i=0; i <= parseInt(pwTotalPages); i++) {\n if(i === activePage) {\n paginationHTML = paginationHTML + '<span>' + parseInt(i+1) + '</span>';\n } else {\n paginationHTML = paginationHTML + '<a href=\"#\" data-loadpage=\"' + i + '\">' + parseInt(i+1) + '</a>';\n }\n }\n } else {\n if(activePage <= 4) {\n nextMod = 5-activePage;\n prevMod = activePage;\n } if(activePage >= (pwTotalPages-4)) {\n nextMod = activePage;\n prevMod = activePage-(pwTotalPages-4);\n }\n\n for (var i=parseInt(activePage-prevMod); i < parseInt(activePage+nextMod); i++) {\n if(i >= 0 && i <= pwTotalPages) {\n if(i === activePage) {\n paginationHTML = paginationHTML + '<span>' + parseInt(i+1) + '</span>';\n } else {\n paginationHTML = paginationHTML + '<a href=\"#\" data-loadpage=\"' + i + '\">' + parseInt(i+1) + '</a>';\n }\n }\n }\n }\n\n if(activePage != 0) {\n if(paginationHTML.indexOf('data-loadpage=\"0\"') == -1 && paginationHTML.indexOf('<span>0</span>') == -1 && activePage > 3) {\n paginationHTML = '<a href=\"#\" data-loadpage=\"0\">1</a><span class=\"filler\">...</span>' + paginationHTML;\n }\n }\n\n if(activePage != pwTotalPages) {\n if(paginationHTML.indexOf('data-loadpage=\"'+pwTotalPages+'\"') == -1 && paginationHTML.indexOf('<span>'+pwTotalPages+'</span>') == -1 && activePage < parseInt(pwTotalPages-3)) {\n paginationHTML = paginationHTML + '<span class=\"filler\">...</span><a href=\"#\" data-loadpage=\"'+pwTotalPages+'\">' + parseInt(pwTotalPages+1) + '</a>';\n }\n }\n }\n\n if(activePage != 0) {\n paginationHTML = '<a href=\"#\" class=\"prev\" data-loadpage=\"'+ parseInt(activePage-1) +'\">Previous</a>' + paginationHTML;\n } else {\n paginationHTML = '<span class=\"prev\">Previous</span>' + paginationHTML;\n }\n\n if(activePage != pwTotalPages) {\n paginationHTML = paginationHTML + '<a href=\"#\" class=\"next\" data-loadpage=\"'+ parseInt(activePage+1) +'\">Next</a>';\n } else {\n paginationHTML = paginationHTML + '<span class=\"next\">Next</span>';\n }\n\n $('#pagination').html(paginationHTML);\n\n $('#pagination a').click(function(e){\n var pageNumber = $(this).attr('data-loadpage');\n pwLoadPage(pageNumber);\n e.preventDefault();\n });\n }", "static optOrderPagination(){\n return window.API_ROOT + 'rest/optOrder.pagination/v1';\n }", "function getPage(start, number, params) {\n\n var result;\n var totalRows;\n\n getRandomsItems(function cb(randomsItems) {\n var filtered = params.search.predicateObject ? $filter('customFilter')(randomsItems, params.search.predicateObject) : randomsItems;\n console.log(\"Filtro:\" + JSON.stringify(params.search.predicateObject));\n\n if (params.sort.predicate) {\n filtered = $filter('orderBy')(filtered, params.sort.predicate, params.sort.reverse);\n }\n\n result = filtered.slice(start, start + number);\n totalRows = randomsItems.length;\n\n /*console.log(\"Result : \" + JSON.stringify(result));\n console.log(\"Total Rows : \" + JSON.stringify(totalRows));*/\n });\n\n\n var deferred = $q.defer();\n\n $timeout(function () {\n\n deferred.resolve({\n data: result,\n numberOfPages: Math.ceil(totalRows / number)\n });\n\n }, 1500);\n\n return deferred.promise;\n\n }", "function render_table_chunk() {\n\n $tablehead.text('');\n $tablebody.text('');\n \n chunkdata = alien_data.slice((currentPage-1) * perPage, currentPage * perPage);\n\n try {\n \n //setting up a header\n var $headrow = $tablehead.append(\"tr\");\n Object.keys(alien_data[0]).forEach(item => $headrow.append('td').text(item));\n\n // setting up a table\n chunkdata.forEach(function(item) {\n var $bodyrow = $tablebody.append('tr');\n Object.values(item).forEach(value => $bodyrow.append('td').text(value));\n });\n }\n\n catch (error) {\n console.log('NO data in the dataset');\n $tablehead.append('tr')\n .append('td')\n .text('Sorry we do not have the data you have requested. Please refresh the page and do another search.');\n \n d3.selectAll('.pagination')\n .style('display', 'none'); \n }\n\n $currentpage.text(currentPage);\n window.name = JSON.stringify(alien_data);\n numberOfPages = Math.ceil(alien_data.length / perPage);\n \n}", "function changePage(data,page)\r\n {\r\n var btn_next = document.getElementById(\"btn_next\");\r\n var btn_prev = document.getElementById(\"btn_prev\");\r\n var page_span = document.getElementById(\"page\");\r\n const tableArr = (data)\r\n const tableMain = document.getElementById(\"GridBody\");\r\n showHeaders(data)\r\n \r\n // Validate page\r\n if (page < 1) page = 1;\r\n if (page > numPages()) page = numPages();\r\n \r\n tableMain.innerHTML = \"\";\r\n\r\n for (var i = (page-1) * records_per_page; i < (page * records_per_page) && i < tableArr.length; i++) {\r\n let tableRowEle = '<tr class=\"table-row\">'\r\n tableRowEle += '<td>'+`<input type=\"checkbox\" id=\"check${i}\" value=\"${tableArr[i].primkey}\" class=\"tick\" /><label class=\"sall_check\" for=\"check${i}\">`+'<img src=\"images/check_box_outline_blank-black-18dp.svg\" /></label></th>'\r\n Object.entries(tableArr[i]).slice(1).forEach(entry => {\r\n const [key,value] =entry \r\n tableRowEle += `<td class=\"${key}\">`+value+'</td>'\r\n })\r\n tableRowEle += '</tr>'\r\n tableMain.innerHTML += tableRowEle\r\n }\r\n page_span.innerHTML = page + \"/\" + numPages();\r\n\r\n if (page == 1) {\r\n btn_prev.style.visibility = \"hidden\";\r\n } else {\r\n btn_prev.style.visibility = \"visible\";\r\n }\r\n\r\n if (page == numPages()) {\r\n btn_next.style.visibility = \"hidden\";\r\n } else {\r\n btn_next.style.visibility = \"visible\";\r\n }\r\n }", "function pageing() {\r\n opts.actualPage = $(\"#ddPaging\").val();\r\n bindDatasource();\r\n }", "function initPagination() {\n _initSearchablePagination(\n $list,\n $('#search_form'),\n $('#pagination'), \n {\n url: '/appraisal_companies/_manager_list',\n afterLoad: function (content) {\n $list.html(content);\n initDelete();\n }\n }\n );\n }", "function tablePaging() {\n\n $('#loadingModal').modal('show');\n\n GetCustomers(function(myObject) {\n\n j2HTML.Table({\n Data: myObject,\n TableID: '#tbTest',\n AppendTo: '#divTable',\n }).Paging({\n\n TableID: '#tbTest',\n PaginationAppendTo: '#divPagination',\n RowsPerPage: 5,\n ShowPages: 8,\n StartPage: 7\n\n });\n\n setTableMenu('Paging');\n $('#loadingModal').modal('hide');\n\n });\n}", "function nextPage(){\n \n if(currentPage < numberOfPages()){\n currentPage++;\n loadTable(currentPage);\n \n }\n}", "function refreshPagination(projectCount){\n $('.light-pagination').pagination({\n items: projectCount,\n itemsOnPage: 20,\n cssStyle: 'compact-theme',\n onPageClick: function(pageNumber,event){\n pagedOipaLink = oipaLink + '&page='+ pageNumber;\n //$('.modal').show();\n $('#showResults').animate({opacity: 0.4},500,function(){\n $('.modal').show();\n });\n $.getJSON(pagedOipaLink,{\n format: \"json\"\n }).done(function(json){\n $('#showResults').animate({opacity: 1},500,function(){\n $('.modal').hide();\n });\n if(window.searchType == 'F'){\n $('#showResults').html('<div class=\"govuk-inset-text\" style=\"font-size: 14px;\">Default filter shows currently active projects. To see projects at other stages, either use the status filters or select the checkbox to search for completed projects.</div>');\n json = json.output;\n }\n else{\n $('#showResults').html('<div class=\"govuk-inset-text\" style=\"font-size: 14px;\">Default filter shows currently active projects. To see projects at other stages, use the status filters.</div>');\n }\n \n if (!isEmpty(json.next)){\n var tmpStr = '<div>Now showing projects <span name=\"afterFilteringAmount\" style=\"display:inline;\"></span><span id=\"numberofResults\" value=\"\" style=\"display:inline;\">'+(1+(20*(pageNumber-1)))+' - '+(20*pageNumber)+'</span> of '+projectCount+'</div>';\n $('#showResults').append(tmpStr);\n }\n else{\n var tmpStr = '<div>Now showing projects '+(1+(20*(pageNumber-1)))+' - '+projectCount+' of '+projectCount+'</div>';\n $('#showResults').append(tmpStr);\n }\n $.each(json.results,function(i,result){\n var validResults = {};\n validResults['iati_identifier'] = !isEmpty(result.iati_identifier) ? result.iati_identifier : \"\";\n validResults['id'] = !isEmpty(result.id) ? result.id : \"\";\n console.log(validResults['iati_identifier'])\n //Check title\n if(!isEmpty(result.title.narratives)){\n if(!isEmpty(result.title.narratives[0].text)){\n validResults['title'] = result.title.narratives[0].text;\n }\n else {\n validResults['title'] = \"\"; \n }\n }\n else{\n validResults['title'] = \"\";\n }\n //validResults['title'] = !isEmpty(result.title.narratives[0]) ? result.title.narratives[0].text : \"\";\n validResults['total_plus_child_budget_value'] = !isEmpty(result.activity_plus_child_aggregation.activity_children.budget_value) ? result.activity_plus_child_aggregation.activity_children.budget_value : 0;\n validResults['total_plus_child_budget_currency'] = !isEmpty(result.activity_plus_child_aggregation.activity_children.budget_currency) ? result.activity_plus_child_aggregation.activity_children.budget_currency : !isEmpty(result.activity_plus_child_aggregation.activity_children.incoming_funds_currency)? result.activity_plus_child_aggregation.activity_children.incoming_funds_currency: !isEmpty(result.activity_plus_child_aggregation.activity_children.expenditure_currency)? result.activity_plus_child_aggregation.activity_children.expenditure_currency: !isEmpty(result.activity_plus_child_aggregation.activity_children.disbursement_currency)? result.activity_plus_child_aggregation.activity_children.disbursement_currency: !isEmpty(result.activity_plus_child_aggregation.activity_children.commitment_currency)? result.activity_plus_child_aggregation.activity_children.commitment_currency: \"GBP\";\n validResults['total_plus_child_budget_currency_value'] = '';\n //$.getJSON(currencyLink,{amount: validResults['total_plus_child_budget_value'], currency: validResults['total_plus_child_budget_currency']}).done(function(json){validResults['total_plus_child_budget_currency_value'] = json.output});\n validResults['activity_status'] = !isEmpty(result.activity_status.name) ? result.activity_status.name : \"\";\n //Check reporting organization\n if(!isEmpty(result.reporting_organisation)){\n if(!isEmpty(result.reporting_organisation.narratives)){\n if(result.reporting_organisation.narratives[0].text == 'UK Department for International Development' || result.reporting_organisation.narratives[0].text == 'UK - Foreign & Commonwealth Office'){\n validResults['reporting_organisations'] = 'UK - Foreign, Commonwealth and Development Office';\n }\n else{\n validResults['reporting_organisations'] = result.reporting_organisation.narratives[0].text;\n }\n }\n else {\n validResults['reporting_organisations'] = \"\"; \n }\n }\n else{\n validResults['reporting_organisations'] = \"\";\n }\n //validResults['reporting_organisations'] = !isEmpty(result.reporting_organisations[0].narratives[0]) ? result.reporting_organisations[0].narratives[0].text : \"\";\n //check description's existence\n if(!isEmpty(result.descriptions)){\n if(!isEmpty(result.descriptions[0].narratives)){\n validResults['description'] = result.descriptions[0].narratives[0].text;\n }\n else {\n validResults['description'] = \"\"; \n }\n }\n else{\n validResults['description'] = \"\";\n }\n //validResults['description'] = !isEmpty(result.description[0].narratives[0]) ? result.description[0].narratives[0].text : \"\";\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['id']+'\">'+validResults['title']+' <small>['+ validResults['iati_identifier'] +']</small></a></h3><span class=\"budget\">Budget: <em> '+addCommas(validResults['total_plus_child_budget_value'],'B')+'</em></span><span>Status: <em>'+validResults['activity_status']+'</em></span><span>Reporting Org: <em>'+validResults['reporting_organisations']+'</em></span><p class=\"description\">'+validResults['description']+'</p></div>';\n if(window.searchType == 'F'){\n console.log(result.activity_plus_child_aggregation.totalBudget);\n if(validResults['title'].length == 0){\n validResults['title'] = 'Project Title Unavailable';\n }\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span>Reporting Organisation: <em>'+validResults['reporting_organisations']+'</em></span><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span><span>Activity Status: <em>'+validResults['activity_status']+'</em></span><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+result.activity_plus_child_aggregation.totalBudget+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div>'+'</em></span><p class=\"description\">'+validResults['description']+'</p></div>';\n var actualStartDate = '';\n var plannedStartDate = '';\n validResults['activity_dates'] = result.activity_dates;\n for(var i = 0; i < validResults['activity_dates'].length; i++){\n if(validResults['activity_dates'][i]['type']['code'] == 1){\n plannedStartDate = new Date(validResults['activity_dates'][i]['iso_date']).customFormat('#DD#-#MM#-#YYYY#');\n }\n if(validResults['activity_dates'][i]['type']['code'] == 2){\n actualStartDate = new Date(validResults['activity_dates'][i]['iso_date']).customFormat('#DD#-#MM#-#YYYY#');\n }\n }\n if(actualStartDate.length > 0){\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +actualStartDate\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +result.activity_plus_child_aggregation.totalBudget\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>'+actualStartDate+'</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+result.activity_plus_child_aggregation.totalBudget+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>'; \n }\n else if(plannedStartDate.length > 0){\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +plannedStartDate\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +result.activity_plus_child_aggregation.totalBudget\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>'+plannedStartDate+'</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+result.activity_plus_child_aggregation.totalBudget+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>';\n }\n else{\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +'N/A'\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +result.activity_plus_child_aggregation.totalBudget\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>N/A</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+result.activity_plus_child_aggregation.totalBudget+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>';\n }\n }\n else{\n var actualStartDate = '';\n var plannedStartDate = '';\n validResults['activity_dates'] = result.activity_dates;\n for(var i = 0; i < validResults['activity_dates'].length; i++){\n if(validResults['activity_dates'][i]['type']['code'] == 1){\n plannedStartDate = new Date(validResults['activity_dates'][i]['iso_date']).customFormat('#DD#-#MM#-#YYYY#');\n }\n if(validResults['activity_dates'][i]['type']['code'] == 2){\n actualStartDate = new Date(validResults['activity_dates'][i]['iso_date']).customFormat('#DD#-#MM#-#YYYY#');\n }\n }\n if(actualStartDate.length > 0){\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +actualStartDate\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +validResults['total_plus_child_budget_value']\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>'+actualStartDate+'</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+validResults['total_plus_child_budget_value']+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>'; \n }\n else if(plannedStartDate.length > 0){\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +plannedStartDate\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +validResults['total_plus_child_budget_value']\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>'+plannedStartDate+'</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+validResults['total_plus_child_budget_value']+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>';\n }\n else{\n var tempString = '<div class=\"eight columns\"><h3><a href=\"/projects/'\n +encodeURIComponent(validResults['iati_identifier']).toString()\n +'/summary\">'\n +validResults['title']\n +'</a></h3><span class=\"reporting-org\">'\n +validResults['reporting_organisations']\n +'</span><p class=\"description\">'\n +validResults['description']\n +'</p></div><div class=\"four columns\"><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Project Identifier:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['iati_identifier']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Activity Status:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +validResults['activity_status']\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span>Start Date:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span><em>'\n +'N/A'\n +'</em></span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\">Total Budget:</span></div></div><div class=\"bottom-table row\"><div class=\"tweleve columns\"><span class=\"budget\"><em> '\n +'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'\n +validResults['total_plus_child_budget_value']\n +'</span><span class=\"total_plus_child_budget_currency_value_cur\">'\n +validResults['total_plus_child_budget_currency']\n +'</span></div>'\n +'</em></span></div></div></div><hr/><br/>';\n //var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span class=\"reporting-org\">'+validResults['reporting_organisations']+'</span><p class=\"description\">'+validResults['description']+'</p><div class=\"bottom-table row\"><div class=\"six columns\"><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span></div><div class=\"six columns\"><span>Activity Status: <em>'+validResults['activity_status']+'</em></span></div></div><div class=\"bottom-table row\"><div class=\"six columns\"><span>Start Date: <em>N/A</em></span></div><div class=\"six columns\"><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+validResults['total_plus_child_budget_value']+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div></div>'+'</em></span></div>';\n } \n }\n // else{\n // var tempString = '<div class=\"search-result\"><h3><a href=\"/projects/'+validResults['iati_identifier']+'\">'+validResults['title']+'</a></h3><span>Reporting Organisation: <em>'+validResults['reporting_organisations']+'</em></span><span>Project Identifier: <em>'+ validResults['iati_identifier'] +'</em></span><span>Activity Status: <em>'+validResults['activity_status']+'</em></span><span class=\"budget\">Total Budget: <em> '+'<div class=\"tpcbcv\"><span class=\"total_plus_child_budget_currency_value_amount\">'+validResults['total_plus_child_budget_value']+'</span><span class=\"total_plus_child_budget_currency_value_cur\">'+validResults['total_plus_child_budget_currency']+'</span></div>'+'</em></span><p class=\"description\">'+validResults['description']+'</p></div>';\n // }\n //$('.modal').hide();\n $('#showResults').append(tempString);\n });\n })\n .fail(function(error){\n $('#showResults').text(error.toSource());\n console.log(\"AJAX error in request: \" + JSON.stringify(error, null, 2));\n })\n .complete(function(){\n generateBudgetValues();\n });\n }\n });\n // $('.search-result h3 a small[class^=\"GB-\"]').parent().parent().parent().show();\n // $('.search-result h3 a small[class^=\"XM-DAC-12-\"]').parent().parent().parent().show();\n }", "function pagePagination(size){\n try{\n var optInit = {\n items_per_page: items_per_page,\n num_display_entries : items_per_page,\n prev_text: $(\"#previous\").val(),\n next_text: $(\"#next\").val(),\n callback: pageSelectCallback\n };\n $(\"#Pagination\").pagination(size, optInit);\n }catch (ex){\n }\n }", "function printPage(searchParams, response) {\n return function(error, rows) {\t\n if (error) {throw error;}\n\n\t\tcontent = []; \n\t\t\t\n for (i=0; i<rows.length; i++)\n {\n // add like/dislike datas\t\t\t\t\n var likes = (rows[i]['likes'] != null) ? rows[i]['likes'] : 0;\n var dislikes = (rows[i]['dislikes'] != null) ? rows[i]['dislikes'] : 0;\n var total = likes + dislikes;\n var likePerc, dislikePerc;\t\t\t\n if (total == 0)\n {\n likePerc = 0;\n dislikePerc = 0;\n }\n else\n {\n likePerc = likes / total * 100;\n dislikePerc = dislikes / total * 100;\n }\n var obj = {\n iStatus: rows[i]['status'],\n iId: rows[i]['id'],\n iTitle: rows[i]['title'],\n iLastModified:\trows[i]['lastModified'],\n likecount: likes,\n dislikecount: dislikes,\n likepercentage: likePerc,\n dislikepercentage: dislikePerc\n };\t\n content.push(obj);\n }\n \n /* Setup variables */\n var sortbyQueryString = queryString('sortby', searchParams.sortBy);\n var searchQueryString = queryString('search', searchParams.search);\n var directionQueryString = queryString('direction', searchParams.direction);\n var switchDirQueryString = queryString('direction',\n searchParams.direction == 'ASC' ? 'DESC' : 'ASC');\n var title = \"Latest Issues\";\n if(searchParams.search != null)\n {\n title = \"Search Results For: \" + searchParams.search;\n } \n \n variables = {\n title: title,\n content: content,\n pageNumber: searchParams.page,\n resultCount: searchParams.resultCount,\n noResults: content.length == 0,\n wasSearch: searchParams.search != null,\n pageCount: searchParams.pageCount,\n sortbyQueryString: sortbyQueryString,\n searchQueryString: searchQueryString,\n directionQueryString: directionQueryString,\n switchDirQueryString: switchDirQueryString,\n }\n \n /* Previous page */\n if (searchParams.page - 1 > 0)\n {\n variables.previous = searchParams.page - 1;\n }\n \n /* Next page */\n if (parseInt(searchParams.page) + 1 <= searchParams.pageCount)\n {\n variables.next = parseInt(searchParams.page) + 1;\n }\n\n /* Pager */\n var pager = [];\n for (i = searchParams.page - 2; i <= searchParams.pageCount; i++)\n {\n if (i > 0)\n {\n if (i != searchParams.page)\n {\n var link = '<a href=\"/?' + \n sortbyQueryString + \n searchQueryString + \n directionQueryString +\n 'page=' + i + '\">' + i + '</a>';\n } \n else\n {\n var link = '[' + i + ']';\n }\n var obj = { page: link }\n pager.push(obj);\n }\n }\n variables.pager = pager;\n \n response.render('views/listIssue.html', variables);\n };\n}", "function coordinatesTablePagination() {\n\t\t// on load pagination\n\t\tpaginateTable();\n\t\t// on change pagination (on select change, repaginate)\n\t\t$('div.image_marker_main_wrapper').on(\"change\", \"select.limit\", function(){\n\t\t\tvar $parent = $(this).parents('div.image_marker_main_wrapper');\n\t\t\tvar $table = $parent.find('table.InputfieldImageMarkers');\n\t\t\tpaginateTable($table);\n\t\t});\n\t}", "handleLoadMore () {\n let { pagination } = this.state\n if (!this.submitting.dropshipProducts) {\n pagination.page += 1\n this.params = { ...this.params, ...pagination }\n this.submitting = { ...this.submitting, dropshipProducts: true }\n let params = this.generateParamsUrl()\n Router.replace(`/dropship?${params}`)\n this.props.getDropshipProducts(this.params)\n this.setState({ pagination })\n }\n }", "function paginateTable($t = null) {\n\n\t\t// @ Original code by: Gabriele Romanato http://gabrieleromanato.name/jquery-easy-table-pagination/\n\t\t// @ Modified by Francis Otieno (Kongondo) for the ProcessWire Module InputfieldImageMarker\n\n\t\tvar $tables = $t ? $t : $('table.InputfieldImageMarkers');\n\n\t\t$tables.each(function () {\n\n\t\t\tvar $table = $(this);\n\t\t\tvar $parent = $table.parents('div.image_marker_main_wrapper');\n\t\t\t\n\t\t\tvar $limit = $parent.find('select.limit');\n\t\t\tvar $limitValue = $limit.val();\t\t\t\t\n\t\t\t$cookieName = $table.attr('id');\t\t\n\t\t\t\n\t\t\t// sete cookie to remember (server-side) pagination limit\n\t\t\tsetCookie($cookieName, $limitValue);\n\t\t\tvar $numPerPage = $limitValue;\n\t\t\t\n\t\t\t// remove last inserted pagination to avoid duplicates (.ready vs .change)\n\t\t\t$parent.find('ul.pager').remove();\n\t\t\t\n\t\t\t$table.show();\n\t\t\t\n\t\t\tvar $currentPage = 0;\n\t\t\t// if not paginating, show whole table then return to avoid recursion error\n\t\t\tif($numPerPage == 0) {\n\t\t\t\t$table.find('tbody tr').show();\n\t\t\t\treturn;\n\t\t\t}\t\t\t\n\n\t\t\t$table.bind('repaginate', function() {\n\t\t\t\t$table.find('tbody tr').hide().slice($currentPage * $numPerPage, ($currentPage + 1) * $numPerPage).show();\n\t\t\t});\n\t\t\t$table.trigger('repaginate');\n\t\t\tvar $numRows = $table.find('tbody tr').length;\n\n\t\t\tif($numRows <= $numPerPage) return;// if only 1 page, no need to show pagination\n\n\t\t\tvar $numPages = Math.ceil($numRows / $numPerPage);\n\t\t\tvar $pager = $('<ul class=\"pager uk-pagination MarkupPagerNav\"></ul>');\n\t\t\t\n\t\t\tfor (var $page = 0; $page < $numPages; $page++) {\n\t\t\t\tvar $lastRow = ($page + 1) * $numPerPage;// we need this for 'on click marker, show its page'\n\t\t\t\tvar $firstRow = ($lastRow - $numPerPage) + 1;// ditto\n\t\t\t\tvar $innerText = $('<span></span>').text($page + 1);\n\t\t\t\tvar $outterText = $('<a href=\"#\"></a>').append($innerText);\n\t\t\t\t$('<li class=\"page-number\" data-first-row=\"' + $firstRow + '\"></li>')\n\t\t\t\t\t.html($outterText)\n\t\t\t\t\t.bind('click', {\n\t\t\t\t\t\tnewPage: $page\n\t\t\t\t\t},\n\t\t\t\t\tfunction (event) {\n\t\t\t\t\t\t$currentPage = event.data['newPage'];\n\t\t\t\t\t\t$table.trigger('repaginate');\n\t\t\t\t\t\t$(this).addClass('uk-active MarkupPagerNavOn ').siblings().removeClass('uk-active MarkupPagerNavOn');\n\t\t\t\t\t}).appendTo($pager);\n\t\t\t}// end for loop\n\t\t\t\n\t\t\t// mark active\n\t\t\tvar $paginationWrapper = $parent.find('div.pagination_wrapper');\n\t\t\t$pager.appendTo($paginationWrapper).find('li:first').addClass('uk-active MarkupPagerNavOn');\t\t\t\n\n\t\t});\t\n \n\t}", "function getMoreProducts(parameters) {\n\n parameters.offset += 20;\n return parameters;\n }", "list(req, res) {\n logging.logTheinfo(\"bank index Router\");\n var count;\n var skip;\n\n if(req.body.limit)\n {\n count=parseInt(req.body.limit);\n }\n else{\n count=25\n }\n if(req.body.offset)\n {\n skip= parseInt((req.body.offset)*( count))\n }\n else{\n skip=0;\n }\n var obj={};\n obj.where={};\n // obj.where.processingStatus='Open';\n if(req.body.relationId)\n {\n obj.where.relationshipId=parseInt(req.body.relationId);\n }\n if(req.body.classification_1)\n {\n obj.where.classification_1=req.body.classification_1;\n }\n if(req.body.columnname && req.body.findtext)\n { \n obj.where[req.body.columnname]={\n [Op.like]:'%'+req.body.findtext+'%'\n\n \n }\n\n }\n obj.order=[['extRecordsId', 'ASC']];\n obj.offset= skip;\n obj.limit= count;\n \n bank.findAll(\n obj).then(data=>{\n res.send(data) \n })\n }", "function showPagination(count,current_page,offset,baseUrl, queryString,visibleNumbers,el,prefix,noHref) {\n let output=\"\";\n let fullUrl;\n if(el===undefined) el=\".pagination\";\n if(prefix === undefined || prefix === false) prefix=\"\";\n noHref=noHref===undefined ? false:noHref;\n if(queryString){\n fullUrl=baseUrl+\"?\"+queryString+\"&\"+prefix+\"page=%page%\";\n }else{\n fullUrl=baseUrl+\"?\"+prefix+\"page=%page%\";\n }\n if(count > offset){\n let lastPage=Math.ceil(count/offset);\n let endIndex,startIndex;\n if (current_page > 1){\n output+= noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"1\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li><li class=\"page-item\"><a class=\"page-link\" data-page=\"'+(current_page-1)+'\" aria-label=\"Previous\">قبلی</a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+baseUrl+'\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li><li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":current_page-1})+'\" aria-label=\"Previous\">قبلی</a></li>';\n }\n if((current_page+(visibleNumbers-1)) > lastPage){\n endIndex=lastPage;\n startIndex=current_page-(visibleNumbers-(lastPage-current_page));\n }else{\n\n startIndex=current_page - (visibleNumbers-1);\n endIndex=current_page+ (visibleNumbers-1);\n }\n startIndex= startIndex<=0 ? 1:startIndex;\n for(pageNumber=startIndex;pageNumber<=endIndex;pageNumber++){\n output+= pageNumber==current_page ? \"<li class='page-item active'>\":\"<li class='page-item'>\";\n output+=noHref ? \"<a class='page-link' data-page='\"+pageNumber+\"'>\"+pageNumber+\"</a>\":\"<a class='page-link' href='\"+substitute(fullUrl,{\"%page%\":pageNumber})+\"'>\"+pageNumber+\"</a>\";\n }\n if(current_page != lastPage){\n output+=noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"'+(current_page+1)+'\" aria-label=\"Previous\">بعدی</a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":current_page+1})+'\" aria-label=\"Previous\">بعدی</a></li>';\n output+=noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"'+lastPage+'\" aria-label=\"Next\"><span aria-hidden=\"true\">&raquo;</span></a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":lastPage})+'\" aria-label=\"Next\"><span aria-hidden=\"true\">&raquo;</span></a></li>';\n }\n }\n $(el).html(output);\n}", "function handleChangeRowsPerPage(event) {\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n }", "retrieveRecords(currentTab, search, page = 1, perPage = this.state.perPage) {\n const {getRecords, auth, accounting, customer} = this.props;\n const user = auth.get('user');\n const selectedAppraiser = customer.get('selectedAppraiser');\n if (!page) {\n page = currentTab === 'unpaid' ? accounting.getIn(['page', 'unpaid']) : accounting.getIn(['page', 'paid']);\n }\n // Search unpaid\n if (currentTab === 'unpaid') {\n getRecords(user, 'unpaid', page, search, perPage, selectedAppraiser);\n // Search paid\n } else {\n getRecords(user, 'paid', page, search, perPage, selectedAppraiser);\n }\n }", "function populateTable() {\n\n console.log(typeof returnData);\n console.log(returnData);\n \n var i = 0;\n\n // Makes sure that there were actually results found.\n if (maxSize === 0) {\n alert(\"Sorry, no results were found.\");\n }\n else {\n // Limits the number of results per page to at most 40, or\n // to the remainder of the max size divided by 40 if it is\n // on the \"last\" page. Appends the necessary HTML elements\n // to the table.\n while(i < 40 && (page < maxPage || i < maxSize % 40 )){\n $(\"#resultTable\").append(\"<tr id=row\" + i + \" data-id=\" + i + \" class=\\\"results\\\">\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['businessType'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['businessName'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['city'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['state'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['addressTwo'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['numLocations'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['numRooms'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['rate'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['GDS'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['mngtCo'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['contactPerson'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['phone'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['personEmail'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['dateOfLast'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['dateOfNext'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['interestLvl'] + \"</td>\");\n $(\"#row\"+i).append(\"<td>\" + returnData[i]['SPAssigned'] + \"</td>\");\n $(\"#resultTable\").append(\"</tr>\");\n\n // When a row is clicked, this will send all of the data to the\n // add_edit.php page, so that it can be edited.\n $(\"#row\"+i).click(function(e){\n toEdit(returnData[$(this).data(\"id\")]);\n });\n i++;\n }\n\n // Appends buttons to navigate to other pages dependent upon which\n // page the user is currently on.\n if (page !== 0) {\n $(\"body\").append(\"<a id='first' class='results nav' href='#'>First</a>\");\n $(\"#first\").click(function(e) {\n e.preventDefault();\n firstPage();\n });\n $(\"body\").append(\"<a id='prev' class='results nav' href='#'>Previous</a>\");\n $(\"#prev\").click(function(e) {\n e.preventDefault();\n prevPage();\n });\n }\n if (page < maxPage-1) {\n $(\"body\").append(\"<a id='next' class='results nav' href='#'>Next</a>\");\n $(\"#next\").click(function(e) {\n e.preventDefault();\n nextPage();\n });\n $(\"body\").append(\"<a id='last' class='results nav' href='#'>Last</a>\");\n $(\"#last\").click(function(e) {\n e.preventDefault();\n lastPage();\n });\n }\n\n console.log(\"Done\");\n }\n}", "preparePaginationList(){\n let begin = (this.pageNo - 1) * parseInt(this.recordsPerPage);\n let end = parseInt(begin) + parseInt(this.recordsPerPage);\n this.recordToDisplay = this.recordList.slice(begin,end).map(item=>{\n return {...item, \n \"iconName\":showIcons({itemName:item.name,itemURL :item.downloadURL})\n }\n });\n this.searchBar = this.recordList;\n window.clearTimeout(this.delayTimeout);\n this.delayTimeout = setTimeout(()=>{\n this.disableEnableActions();\n },DELAY);\n }", "function expandBookingsListPagination(pagination) {\n page = pagination.current;\n\n var pagination_container = $('<div>', {\n class: 'booking-list-pagination'\n });\n\n if (pagination.last != 1) {\n var previous = $('a[data-page].hidden.fake').clone(true);\n previous.removeClass('hidden').removeClass('fake').html('&laquo;');\n pagination_container.append(previous.attr('data-page', pagination.previous == null ? '' : pagination.previous));\n\n $.each(\n pagination.range,\n function(key, page_number)\n {\n var link = $('a[data-page].hidden.fake').clone(true);\n link.removeClass('hidden').removeClass('fake').html(page_number);\n link.attr('data-page', page_number);\n\n if (page_number == pagination.current) {\n link.addClass('selected');\n }\n\n pagination_container.append(link);\n }\n );\n\n var next = $('a[data-page].hidden.fake').clone(true);\n next.removeClass('hidden').removeClass('fake').html('&raquo;');\n pagination_container.append(next.attr('data-page', pagination.next == null ? '' : pagination.next));\n }\n\n $('.booking-list-pagination').replaceWith(pagination_container);\n}", "function Paginator() {\n var self = this;\n this._products = {};\n this.ppp = $.var.hashParser.get(\"ppp\") | 30;\n this.products = [];\n this.pages = [[]];\n this.currentpage = 0;\n\n $(\"#itemsPerPage\").change(function(e) {\n var v = parseInt(e.currentTarget.value);\n $(e).blur();\n // eslint-disable-next-line\n if (v !== v) {\n self.setPPP(\"all\");\n } else {\n self.setPPP(v);\n }\n self.parse(self._products);\n });\n}", "function loadSaleData() {\n fetch(`https://arnin-web422-ass1.herokuapp.com/api/sales?page=${page}&perPage=${perPage}`)\n .then((response) => {\n return response.json();\n })\n .then((myJson) => {\n saleData = myJson;\n let rows = saleTableTemplate(saleData);\n $(\"#sale-table tbody\").html(rows);\n $(\"#current-page\").html(page);\n })\n}", "static get PAGE_ITEMS() {\n return 50;\n }", "static sliceSampleData(tableData, itemsPerPage, currentPage) {\n const firstIndexToInclude = itemsPerPage * (currentPage - 1);\n let lastIndexToInclude = currentPage * itemsPerPage - 1;\n\n if (lastIndexToInclude > tableData.length - 1) {\n lastIndexToInclude = tableData.length - 1;\n }\n\n return tableData.slice(firstIndexToInclude, lastIndexToInclude + 1);\n }", "function paginate(e,t=1,a=10,r=10){let n,l,g=Math.ceil(e/a);if(t<1?t=1:t>g&&(t=g),g<=r)n=1,l=g;else{let e=Math.floor(r/2),a=Math.ceil(r/2)-1;t<=e?(n=1,l=r):t+a>=g?(n=g-r+1,l=g):(n=t-e,l=t+a)}let i=(t-1)*a,s=Math.min(i+a-1,e-1),o=Array.from(Array(l+1-n).keys()).map(e=>n+e);return{totalItems:e,currentPage:t,pageSize:a,totalPages:g,startPage:n,endPage:l,startIndex:i,endIndex:s,pages:o}}", "function plekit_table_paginator (opts,table_id) {\n\n if(!(\"currentPage\" in opts)) { return; }\n \n var p = document.createElement('p');\n var table=$(table_id);\n var t = $(table_id+'-fdtablePaginaterWrapTop');\n var b = $(table_id+'-fdtablePaginaterWrapBottom');\n\n /* when there's no visible entry, the pagination code removes the wrappers */\n if ( (!t) || (!b) ) return;\n\n /* get how many entries are matching:\n opts.visibleRows only holds the contents of the current page\n so we store the number of matching entries in the table 'matching' attribute\n */\n var totalMatches = opts.totalRows;\n var matching=table['matching'];\n if (matching) totalMatches = matching;\n\n var label;\n\n var matches_text;\n if (totalMatches != opts.totalRows) {\n matches_text = totalMatches + \"/\" + opts.totalRows;\n } else {\n matches_text = opts.totalRows;\n }\n var first = ((opts.currentPage-1) * opts.rowsPerPage) +1;\n var last = Math.min((opts.currentPage * opts.rowsPerPage),totalMatches);\n var items_text = \"Items [\" + first + \" - \" + last + \"] of \" + matches_text;\n var page_text = \"Page \" + opts.currentPage + \" of \" + Math.ceil(totalMatches / opts.rowsPerPage);\n label = items_text + \" -- \" + page_text;\n\n p.className = \"paginationText\"; \n p.appendChild(document.createTextNode(label));\n\n /* t.insertBefore(p.cloneNode(true), t.firstChild); */\n b.appendChild(p);\n}" ]
[ "0.6467562", "0.6442428", "0.6293526", "0.62678313", "0.6221835", "0.6221805", "0.62183696", "0.62111676", "0.61271375", "0.61058706", "0.6097933", "0.6077092", "0.60657465", "0.6065403", "0.6050341", "0.60414356", "0.6007577", "0.5992503", "0.5990029", "0.5979477", "0.5970896", "0.59687895", "0.5966584", "0.59385014", "0.59325725", "0.5930559", "0.5918485", "0.5916362", "0.5913612", "0.5908202", "0.58916295", "0.58686894", "0.5859282", "0.58508486", "0.5845668", "0.58412814", "0.58337474", "0.5820883", "0.581788", "0.5815819", "0.5814874", "0.58091575", "0.58015156", "0.57814026", "0.57732266", "0.57682365", "0.57634604", "0.5757483", "0.5756099", "0.5752392", "0.5749144", "0.57477957", "0.57471114", "0.5740702", "0.5734662", "0.573418", "0.57330865", "0.57310665", "0.5724045", "0.5723778", "0.5718853", "0.57164335", "0.5713741", "0.5712978", "0.57129484", "0.571186", "0.56980306", "0.5696865", "0.56963235", "0.56889874", "0.56889874", "0.56759465", "0.56748474", "0.5672106", "0.5660582", "0.56589895", "0.56578124", "0.56559026", "0.5651045", "0.5643379", "0.5635097", "0.56328773", "0.56285983", "0.5623471", "0.56224376", "0.5621561", "0.56200284", "0.56183636", "0.5616231", "0.56155026", "0.5615179", "0.56123286", "0.56083095", "0.5603855", "0.5597497", "0.5591681", "0.5587006", "0.55776954", "0.5573207", "0.5567634" ]
0.64169353
2
Get pagination for complex merchant table; reactabular table lives in Table.js
get paginator() { if (this.pagination && this.props.globalSelector.orgIds.length > 0) { const pageCount = this.state.filterText !== '' ? this.state.filteredPageCount : this.state.pageCount; return ( <Pagination handlePageClick={this.handlePageClick} pageCount={pageCount} currentPage={this.state.currentPage} /> ); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderPagination() {\n if (!_.isEmpty(this.props.pageMeta)) {\n const lastRecord = this.props.pageMeta.current_items_count + this.props.pageMeta.offset;\n const firstRecord = this.props.pageMeta.offset + 1;\n const totalItemsCount = this.props.pageMeta.total_items_count;\n\n return (\n <div className=\"row\">\n <b> {firstRecord}-{lastRecord}/{totalItemsCount}</b> <br/>\n <nav aria-label=\"Page navigation example\">\n\n <ul className=\"pagination\">\n {this.renderFirstPaginationButton()}\n {this.props.pageMeta.has_prev_page &&\n (<li className=\"page-item\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous page\">\n <span className=\"page-link\"\n onClick={e => this.props.loadMore(this.props.location.pathname, this.props.pageMeta.prev_page_number, this.props.pageMeta.page_size)}>\n {this.props.pageMeta.prev_page_number}\n </span>\n </li>)}\n\n <li className=\"page-item active\">\n <a className=\"page-link page-ite\">\n {this.props.pageMeta.current_page_number}\n </a>\n </li>\n {this.props.pageMeta.has_next_page &&\n <li className=\"page-item\">\n <a className=\"page-link\"\n onClick={e => this.props.loadMore(this.props.location.pathname, this.props.pageMeta.next_page_number, this.props.pageMeta.requested_page_size)}>\n {this.props.pageMeta.next_page_number}\n </a>\n </li>}\n {this.renderLastPaginationButton()}\n </ul>\n </nav>\n </div>\n )\n }\n }", "render() {\n return (\n <div>\n <ReactTable data={\n this.props.dataFromApi\n }\n columns ={[\n {\n Header:\"ResourceLinkHash\",\n accessor:\"resourcelinkHash\"\n },\n {\n Header:\"ResourceHash\",\n accessor:\"resourceHash\"\n },\n {\n Header:\"PatternHash\",\n accessor:\"patternHash\"\n },\n {\n Header:\"IsPatternPresent\",\n accessor:\"isPatternPresent\"\n },\n {\n Header:\"ResourceSummaryHash\",\n accessor:\"resourceSummaryHash\"\n },\n {\n Header:\"StatementIssuer\",\n accessor:\"statementIssuer\"\n },\n\n ]}\n defaultPageSize={10}\n className=\"-striped -highlight\"\n />\n <br />\n </div>\n );\n }", "function Table({ columns, data }) {\r\n // Use the state and functions returned from useTable to build your UI\r\n const {\r\n getTableProps,\r\n getTableBodyProps,\r\n headerGroups,\r\n prepareRow,\r\n page, // Instead of using 'rows', we'll use page,\r\n // which has only the rows for the active page\r\n\r\n // The rest of these things are super handy, too ;)\r\n canPreviousPage,\r\n canNextPage,\r\n pageOptions,\r\n pageCount,\r\n gotoPage,\r\n nextPage,\r\n previousPage,\r\n setPageSize,\r\n\r\n state,\r\n } = useTable({\r\n columns,\r\n data,\r\n },\r\n useFilters, // useFilters!\r\n useGlobalFilter,\r\n useSortBy,\r\n usePagination, // new\r\n useResizeColumns,\r\n useBlockLayout,\r\n )\r\n\r\n // Render the UI for your table\r\n return (\r\n <>\r\n {/* table */}\r\n <div className=\"flex flex-col\">\r\n <div className=\"overflow-x-auto\">\r\n <div className=\"align-middle inline-block\">\r\n <div className=\"overflow-hidden\">\r\n <table {...getTableProps()} className=\"divide-y divide-gray-200\">\r\n <thead >\r\n {headerGroups.map(headerGroup => (\r\n <tr {...headerGroup.getHeaderGroupProps()}>\r\n {headerGroup.headers.map(column => (\r\n // Add the sorting props to control sorting. For this example\r\n // we can add them into the header props\r\n <th\r\n {...column.getHeaderProps(column.getSortByToggleProps())}\r\n className={\"py-3 text-xs font-medium tracking-wider bg-black border border-secondary text-white\"}\r\n >\r\n <div className=\"flex items-center text-center justify-center overflow-ellipsis overflow-hidden\">\r\n {column.render('Header')}\r\n {/* Add a sort direction indicator */}\r\n <span>\r\n {column.isSorted\r\n ? column.isSortedDesc\r\n ? <SortDownIcon className=\"w-4 h-4 text-white\" />\r\n : <SortUpIcon className=\"w-4 h-4 text-white\" />\r\n : (\r\n <SortIcon className=\"w-4 h-4 text-white\" />\r\n )}\r\n </span>\r\n <div\r\n {...column.getResizerProps()}\r\n className={\"inline-block w-2.5 h-full absolute right-0 top-0 z-10 translate-x-2/4\"}\r\n />\r\n </div>\r\n </th>\r\n ))}\r\n </tr>\r\n ))}\r\n </thead>\r\n <tbody\r\n {...getTableBodyProps()}\r\n className=\"divide-y divide-gray-200\"\r\n >\r\n {page.map((row, i) => { // new\r\n prepareRow(row)\r\n return (\r\n <tr {...row.getRowProps()} className={i%2?\"bg-third\":\"bg-primary text-white\"}>\r\n {row.cells.map(cell => {\r\n return (\r\n <td\r\n {...cell.getCellProps()}\r\n className=\"text-center border border-secondary\"\r\n role=\"cell\"\r\n >\r\n {/* {cell.column.Cell.name === \"defaultRenderer\"\r\n ? <div className=\"lg:text-sm sm:text-xs\">{cell.render('Cell')}</div>\r\n : cell.render('Cell')\r\n } */}\r\n <div className=\"lg:text-sm text-xs overflow-ellipsis overflow-hidden\">{cell.render('Cell')}</div>\r\n </td>\r\n )\r\n })}\r\n </tr>\r\n )\r\n })}\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n {/* Pagination */}\r\n <div className=\"py-3 flex items-center justify-between\">\r\n <div className=\"flex-1 flex justify-between sm:hidden\">\r\n <Button onClick={() => previousPage()} disabled={!canPreviousPage}>Previous</Button>\r\n <Button onClick={() => nextPage()} disabled={!canNextPage}>Next</Button>\r\n </div>\r\n <div className=\"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between\">\r\n <div className=\"flex gap-x-2 items-baseline\">\r\n <span className=\"text-sm text-gray-700\">\r\n Page <span className=\"font-medium\">{state.pageIndex + 1}</span> of <span className=\"font-medium\">{pageOptions.length}</span>\r\n </span>\r\n <label>\r\n <span className=\"sr-only\">Items Per Page</span>\r\n <select\r\n className=\"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\"\r\n value={state.pageSize}\r\n onChange={e => {\r\n setPageSize(Number(e.target.value))\r\n }}\r\n >\r\n {[5, 10, 20].map(pageSize => (\r\n <option key={pageSize} value={pageSize}>\r\n Show {pageSize}\r\n </option>\r\n ))}\r\n </select>\r\n </label>\r\n </div>\r\n <div className=\"ml-4\">\r\n <nav className=\"relative z-0 inline-flex rounded-md shadow-sm -space-x-px\" aria-label=\"Pagination\">\r\n <PageButton\r\n className=\"rounded-l-md\"\r\n onClick={() => gotoPage(0)}\r\n disabled={!canPreviousPage}\r\n >\r\n <span className=\"sr-only\">First</span>\r\n <ChevronDoubleLeftIcon className=\"h-5 w-5 text-gray-400\" aria-hidden=\"true\" />\r\n </PageButton>\r\n <PageButton\r\n onClick={() => previousPage()}\r\n disabled={!canPreviousPage}\r\n >\r\n <span className=\"sr-only\">Previous</span>\r\n <ChevronLeftIcon className=\"h-5 w-5 text-gray-400\" aria-hidden=\"true\" />\r\n </PageButton>\r\n <PageButton\r\n onClick={() => nextPage()}\r\n disabled={!canNextPage\r\n }>\r\n <span className=\"sr-only\">Next</span>\r\n <ChevronRightIcon className=\"h-5 w-5 text-gray-400\" aria-hidden=\"true\" />\r\n </PageButton>\r\n <PageButton\r\n className=\"rounded-r-md\"\r\n onClick={() => gotoPage(pageCount - 1)}\r\n disabled={!canNextPage}\r\n >\r\n <span className=\"sr-only\">Last</span>\r\n <ChevronDoubleRightIcon className=\"h-5 w-5 text-gray-400\" aria-hidden=\"true\" />\r\n </PageButton>\r\n </nav>\r\n </div>\r\n </div>\r\n </div>\r\n </>\r\n )\r\n}", "function TablePaged(props) {\n var pageSize = props.pageSize,\n data = props.data,\n pagerPosition = props.pagerPosition,\n rest = Paged_objectWithoutProperties(props, [\"pageSize\", \"data\", \"pagerPosition\"]);\n\n var pagedState = usePages({\n pageSize: pageSize,\n data: data\n });\n\n var tableProps = Paged_objectSpread({}, rest, {\n data: pagedState.data\n });\n\n var showTopPager = pagedState.hasPages && (!pagerPosition || pagerPosition === 'top');\n var showBottomPager = pagedState.hasPages && (!pagerPosition || pagerPosition === 'bottom');\n\n if (showBottomPager) {\n tableProps.borderBottomRightRadius = '0';\n tableProps.borderBottomLeftRadius = '0';\n }\n\n return /*#__PURE__*/react_default.a.createElement(\"div\", null, showTopPager && /*#__PURE__*/react_default.a.createElement(StyledPanel, {\n borderTopRightRadius: \"3\",\n borderTopLeftRadius: \"3\"\n }, /*#__PURE__*/react_default.a.createElement(Paged_Pager, pagedState)), /*#__PURE__*/react_default.a.createElement(Table_Table, tableProps), showBottomPager && /*#__PURE__*/react_default.a.createElement(StyledPanel, {\n borderBottomRightRadius: \"3\",\n borderBottomLeftRadius: \"3\"\n }, /*#__PURE__*/react_default.a.createElement(Paged_Pager, pagedState)));\n}", "pagination() {\n //Convert the data into Int using parseInt(string, base value)\n // || 1 is used in case user does not specify any page value similarly for limit default is 10\n const page = parseInt(this.queryStr.page, 10) || 1;\n const limit = parseInt(this.queryStr.limit, 10) || 10;\n // to get the data on pages rather than page 1\n const skipResults = (page - 1) * limit;\n\n //skip method is used to skip through the specified number of data\n //limit method is used to limit the no of data returned at a time.\n this.query = this.query.skip(skipResults).limit(limit);\n\n return this;\n }", "function loadPagination(pageData,page,rows,isLoadButton){\n\n // 0th index = 1st position\n let firstRecord = (page - 1) * rows;\n\n // 10th index = 11th position\n let lastRecord = page * rows;\n\n //slice will return 1st to 10th position and store in customerData\n let customerData = pageData.slice(firstRecord,lastRecord);\n\n //call function to load table \n loadTable(customerData);\n\n //if true then call function to load button passing the datas length by num of rows\n if(isLoadButton){\n \n loadButton(pageData.length/rows);\n }\n}", "table(req, res) {\n\n let { filter, page, limit } = req.query\n\n page = page || 1\n limit = limit || 3\n let offset = limit * (page - 1)\n\n const params = {\n filter,\n limit,\n page,\n offset,\n callback(instructors){\n const pagination = {\n total: Math.ceil(instructors[0].total / limit),\n page,\n }\n\n return res.render(\"instructors/index\", { instructors, pagination,filter })\n }\n }\n\n Instructor.paginate(params)\n }", "function PatchedPagination(props) {\n const {\n ActionsComponent,\n onChangePage,\n onChangeRowsPerPage,\n ...tablePaginationProps\n } = props;\n\n return (\n <TablePagination\n {...tablePaginationProps}\n // @ts-expect-error onChangePage was renamed to onPageChange\n onPageChange={onChangePage}\n onRowsPerPageChange={onChangeRowsPerPage}\n ActionsComponent={(subprops) => {\n const { onPageChange, ...actionsComponentProps } = subprops;\n return (\n // @ts-expect-error ActionsComponent is provided by material-table\n <ActionsComponent\n {...actionsComponentProps}\n onChangePage={onPageChange}\n />\n );\n }}\n />\n );\n}", "function pages(pageNumber) {\n const itemLimit = 6;\n let page = pageNumber * itemLimit - itemLimit;\n\n const query = knexInstance\n .select(\"*\")\n .from(\"shopping_list\")\n .limit(itemLimit)\n .offset(page);\n let results = query.then(results => console.log(results));\n let sql = query.toString();\n console.log(sql);\n}", "function paginateProducts(page) {\n const productsPerPage = 10\n const offset = productsPerPage * (page - 1)\n knexInstance\n .select('product_id', 'name', 'price', 'category')\n .from('amazong_products')\n .limit(productsPerPage)\n .offset(offset)\n .then(result => {\n console.log(result)\n })\n}", "function TablePaginationActions(props) {\n const classes = useStyles1();\n const theme = useTheme();\n const { count, page, rowsPerPage, onChangePage } = props;\n\n const handleFirstPageButtonClick = event => {\n onChangePage(event, 0);\n };\n\n const handleBackButtonClick = event => {\n onChangePage(event, page - 1);\n };\n\n const handleNextButtonClick = event => {\n onChangePage(event, page + 1);\n };\n\n const handleLastPageButtonClick = event => {\n onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n // Table Pagination Component \n return (\n <div className={classes.root}>\n <IconButton\n onClick={handleFirstPageButtonClick}\n disabled={page === 0}\n aria-label=\"first page\"\n >\n {theme.direction === 'rtl' ? <LastPageIcon /> : <FirstPageIcon />}\n </IconButton>\n <IconButton onClick={handleBackButtonClick} disabled={page === 0} aria-label=\"previous page\">\n {theme.direction === 'rtl' ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}\n </IconButton>\n <IconButton\n onClick={handleNextButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"next page\"\n >\n {theme.direction === 'rtl' ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}\n </IconButton>\n <IconButton\n onClick={handleLastPageButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"last page\"\n >\n {theme.direction === 'rtl' ? <FirstPageIcon /> : <LastPageIcon />}\n </IconButton>\n </div>\n );\n}", "function TablePaginationActions(props) {\n const classes = useStyles1();\n const theme = useTheme();\n const { count, page, rowsPerPage, onChangePage } = props;\n\n const handleFirstPageButtonClick = event => {\n onChangePage(event, 0);\n };\n\n const handleBackButtonClick = event => {\n onChangePage(event, page - 1);\n };\n\n const handleNextButtonClick = event => {\n onChangePage(event, page + 1);\n };\n\n const handleLastPageButtonClick = event => {\n onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n // Table Pagination Component \n return (\n <div className={classes.root}>\n <IconButton\n onClick={handleFirstPageButtonClick}\n disabled={page === 0}\n aria-label=\"first page\"\n >\n {theme.direction === 'rtl' ? <LastPageIcon /> : <FirstPageIcon />}\n </IconButton>\n <IconButton onClick={handleBackButtonClick} disabled={page === 0} aria-label=\"previous page\">\n {theme.direction === 'rtl' ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}\n </IconButton>\n <IconButton\n onClick={handleNextButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"next page\"\n >\n {theme.direction === 'rtl' ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}\n </IconButton>\n <IconButton\n onClick={handleLastPageButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"last page\"\n >\n {theme.direction === 'rtl' ? <FirstPageIcon /> : <LastPageIcon />}\n </IconButton>\n </div>\n );\n}", "fnPrepareData() {\n const { perpage, currPage } = this.state;\n let end = perpage * currPage;\n let start = end - perpage;\n let data = this.state.data.slice(start, end);\n this.setState({\n tableData: data,\n });\n }", "getListbyPaging(currPage, currLimit) {\n var url = api.url_tampildataOutlet(currPage, currLimit);\n this.isLoading = true;\n fetch(url)\n .then(response => response.json())\n .then(data =>\n this.setState({\n result: data.content,\n isLoading: false,\n totalPage: data.totalPages,\n }),\n );\n }", "function TablePaginationActions(props) {\n const classes = useStyles1();\n const theme = useTheme();\n const { count, page, rowsPerPage, onChangePage } = props;\n\n const handleFirstPageButtonClick = event => {\n onChangePage(event, 0);\n };\n\n const handleBackButtonClick = event => {\n onChangePage(event, page - 1);\n };\n\n const handleNextButtonClick = event => {\n onChangePage(event, page + 1);\n };\n\n const handleLastPageButtonClick = event => {\n onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n return (\n <div className={classes.root}>\n <IconButton\n onClick={handleFirstPageButtonClick}\n disabled={page === 0}\n aria-label=\"first page\"\n >\n {theme.direction === 'rtl' ? <LastPageIcon /> : <FirstPageIcon />}\n </IconButton>\n <IconButton onClick={handleBackButtonClick} disabled={page === 0} aria-label=\"previous page\">\n {theme.direction === 'rtl' ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}\n </IconButton>\n <IconButton\n onClick={handleNextButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"next page\"\n >\n {theme.direction === 'rtl' ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}\n </IconButton>\n <IconButton\n onClick={handleLastPageButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"last page\"\n >\n {theme.direction === 'rtl' ? <FirstPageIcon /> : <LastPageIcon />}\n </IconButton>\n </div>\n );\n}", "function searchPageNum(pageNumber){\n const itemsPerPage = 6\n const offset = itemsPerPage * (pageNumber - 1)\n knexInstance\n .select('*')\n .from('shopping_list')\n .limit(pageNumber)\n .offset(offset)\n .then(result => {\n console.log('Drill 2:', result)\n })\n}", "*queryTableFirstPage(_, { put }) {\n yield put({\n type: 'queryTable',\n payload: {\n pagination: {\n current: 1,\n },\n },\n });\n }", "function getPage(tableState) {\n vm.data.isLoading = true;\n if (tableState) {\n _tableState = tableState;\n }\n else if (_tableState) {\n tableState = _tableState;\n }\n else {\n tableState = utility.initTableState(tableState);\n _tableState = tableState;\n }\n\n tableState.draw = tableState.draw + 1 || 1;\n\n var draw = tableState.draw;\n var start = tableState.pagination.start || 0; // This is NOT the page number, but the index of item in the list that you want to use to display the table.\n var number = tableState.pagination.number || 10; // Number of entries showed per page.\n var sortName = tableState.sort.predicate || 'NgayHopDong';\n var sortDir = tableState.sort.reverse ? 'desc' : 'asc';\n var searchString = vm.data.searchString;\n var searchLoaiHopDongId = vm.data.searchLoaiHopDongId || 0;\n var tuNgay = vm.data.startDate;\n var denNgay = vm.data.endDate;\n\n var fields = \"\";\n BaoCaoDoanhThuService.getPage(draw, start, number, searchString, searchLoaiHopDongId, tuNgay, denNgay, sortName, sortDir, fields, vm.data.userInfo.UserId, vm.data.userInfo.NhanVienId)\n .then(function (success) {\n console.log(success);\n if (success.data.data) {\n vm.data.listBaoCaoDoanhThu = success.data.data;\n \n tableState.pagination.numberOfPages = Math.ceil(success.data.metaData.total / number);\n }\n vm.data.isLoading = false;\n }, function (error) {\n vm.data.isLoading = false;\n if (error.data.error != null) {\n alert(error.data.error.message);\n } else {\n alert(error.data.Message);\n }\n });\n }", "createPaging() {\n var result = [];\n for (let i = 1; i <= this.state.totalPage; i++) {\n result.push(\n <MDBPageNav href={\"/product/\" + i} >\n <span aria-hidden=\"true\">{i}</span>\n </MDBPageNav >\n )\n }\n return result;\n }", "function TablePaginationActions(props) {\n const classes = pageNavigationControlStyle();\n const theme = useTheme();\n const { count, page, rowsPerPage, onPageChange } = props;\n\n const handleFirstPageButtonClick = (event) => {\n onPageChange(event, 0);\n };\n\n const handleBackButtonClick = (event) => {\n onPageChange(event, page - 1);\n };\n\n const handleNextButtonClick = (event) => {\n onPageChange(event, page + 1);\n };\n\n const handleLastPageButtonClick = (event) => {\n onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n //render page navigation controls\n return (\n <div className={classes.root}>\n\n <IconButton\n onClick={handleFirstPageButtonClick}\n disabled={page === 0}\n aria-label=\"first page\"\n >\n {theme.direction === 'rtl' ? <LastPageIcon /> : <FirstPageIcon />}\n </IconButton>\n <IconButton onClick={handleBackButtonClick} disabled={page === 0} aria-label=\"previous page\">\n {theme.direction === 'rtl' ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}\n </IconButton>\n <IconButton\n onClick={handleNextButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"next page\"\n >\n {theme.direction === 'rtl' ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}\n </IconButton>\n <IconButton\n onClick={handleLastPageButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"last page\"\n >\n {theme.direction === 'rtl' ? <FirstPageIcon /> : <LastPageIcon />}\n </IconButton>\n </div>\n );\n}", "function _currentPageData() {\n let first = rows.length > 0 ? (currentPage - 1) * rowsPerPage + 1 : 0;\n let last = rows.length < rowsPerPage ? totalItems : (currentPage - 1) * rowsPerPage + rowsPerPage;\n \n return {\n first,\n last,\n current:currentPage,\n totalItems,\n } \n }", "async paginate(per_page = null, page = null) {\r\n if (!_.isNil(per_page)) {\r\n per_page = parseInt(per_page);\r\n } else {\r\n if (Request.has('per_page')) {\r\n per_page = parseInt(Request.get('per_page'));\r\n } else {\r\n per_page = 20;\r\n }\r\n }\r\n if (!_.isNil(page)) {\r\n page = parseInt(page);\r\n } else {\r\n if (Request.has('page')) {\r\n page = parseInt(Request.get('page'));\r\n } else {\r\n page = 1;\r\n }\r\n }\r\n let params = {\r\n offset: (page - 1) * per_page,\r\n limit: per_page,\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n distinct: true\r\n };\r\n\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findAndCountAll(params);\r\n\r\n const paginator = new LengthAwarePaginator(result.rows, result.count, per_page, page);\r\n return paginator;\r\n }", "function changePage(page)\n{\n var btn_next = document.getElementById(\"btn_next\");\n var btn_prev = document.getElementById(\"btn_prev\");\n var listing_table = document.getElementById(\"listingTable\");\n var page_span = document.getElementById(\"page\");\n\n if (page < 1) page = 1;\n if (page > numPages()) page = numPages();\n\n listing_table.innerHTML =\"\";\n\n for (var i = (page-1) * records_per_page; i < (page * records_per_page) && i < objJson.length; i++) {\n listing_table.innerHTML += objJson[i].PaymentId + \"<br>\" + objJson[i].OrderDate + \"<br>\" + objJson[i].MerchantId + \"<br>\" + objJson[i].CustomerEmail + \"<br>\" + objJson[i].Amount + \"<br>\" + objJson[i].PaymentStatus + \"<br><br><br><br>\";\n }\n page_span.innerHTML = page;\n\n if (page == 1) {\n btn_prev.style.visibility = \"hidden\";\n } else {\n btn_prev.style.visibility = \"visible\";\n }\n\n if (page == numPages()) {\n btn_next.style.visibility = \"hidden\";\n } else {\n btn_next.style.visibility = \"visible\";\n }\n}", "function MedicationOrdersTable(props){\n logger.info('Rendering the MedicationOrdersTable');\n logger.verbose('clinical:hl7-resource-encounter.client.MedicationOrdersTable');\n logger.data('MedicationOrdersTable.props', {data: props}, {source: \"MedicationOrdersTable.jsx\"});\n\n const classes = useStyles();\n // const [page, setPage] = useState(0);\n // const [rowsPerPage, setRowsPerPage] = useState(5);\n\n let { \n children, \n id,\n\n data,\n medicationOrders,\n selectedMedicationOrderId,\n query,\n paginationLimit,\n disablePagination,\n \n hideCheckbox,\n hideActionIcons,\n hideIdentifier,\n hideMedication,\n hidePatient,\n hidePatientReference,\n hidePrescriber,\n hideDateWritten,\n hideDosage,\n \n hidePostalCode,\n hideFhirId,\n \n onCellClick,\n onRowClick,\n onMetaClick,\n onRemoveRecord,\n onActionButton,\n hideActionButton,\n hideBarcode,\n actionButtonLabel,\n hideExtensions,\n hideNumEndpoints,\n \n onActionButtonClick,\n showActionButton,\n\n rowsPerPage,\n tableRowSize,\n dateFormat,\n showMinutes,\n size,\n appHeight,\n formFactorLayout,\n\n page,\n onSetPage,\n\n count,\n multiline,\n rows,\n\n ...otherProps \n } = props;\n\n\n if(rowsPerPage){\n // if we receive an override as a prop, render that many rows\n // best to use rowsPerPage with disablePagination\n rowsToRender = rowsPerPage;\n } else {\n // otherwise default to the user selection\n rowsToRender = rowsPerPage;\n }\n\n let paginationCount = 101;\n if(count){\n paginationCount = count;\n } else if(Array.isArray(rows)){\n paginationCount = rows.length;\n }\n\n function rowClick(id){\n // logger.info('MedicationOrdersTable.rowClick', id);\n\n Session.set(\"selectedMedicationOrderId\", id);\n Session.set('medicationOrderPageTabIndex', 1);\n Session.set('medicationOrderDetailState', false);\n\n // Session.set('medicationOrdersUpsert', false);\n // Session.set('selectedMedicationOrder', id);\n\n if(props && (typeof onRowClick === \"function\")){\n onRowClick(id);\n }\n }\n function renderCheckboxHeader(){\n if (!hideCheckbox) {\n return (\n <TableCell className=\"toggle\" style={{width: '60px'}} >Checkbox</TableCell>\n );\n }\n }\n function renderCheckbox(){\n if (!hideCheckbox) {\n return (\n <TableCell className=\"toggle\" style={{width: '60px'}}>\n {/* <Checkbox\n defaultCheckbox={true}\n /> */}\n </TableCell>\n );\n }\n }\n function renderToggleHeader(){\n if (!hideCheckbox) {\n return (\n <TableCell className=\"toggle\" style={{width: '60px'}} >Toggle</TableCell>\n );\n }\n }\n function renderToggle(){\n if (!hideCheckbox) {\n return (\n <TableCell className=\"toggle\" style={{width: '60px'}}>\n {/* <Checkbox\n defaultChecked={true}\n /> */}\n </TableCell>\n );\n }\n }\n function renderActionIconsHeader(){\n if (!hideActionIcons) {\n return (\n <TableCell className='actionIcons'>Actions</TableCell>\n );\n }\n }\n function renderActionIcons( medicationOrder ){\n if (!hideActionIcons) {\n\n let iconStyle = {\n marginLeft: '4px', \n marginRight: '4px', \n marginTop: '4px', \n fontSize: '120%'\n }\n\n return (\n <TableCell className='actionIcons' style={{width: '100px'}}>\n {/* <Icon icon={tag} style={iconStyle} onClick={ showSecurityDialog.bind(this, medicationOrder)} />\n <Icon icon={iosTrashOutline} style={iconStyle} onClick={ removeRecord.bind(this, medicationOrder._id)} /> */}\n </TableCell>\n ); \n }\n } \n function renderStatusHeader(){\n if (!hideStatus) {\n return (\n <TableCell className='patientDisplay'>Status</TableCell>\n );\n }\n }\n function renderStatus(status ){\n if (!hideStatus) {\n return (\n <TableCell className='status' style={{minWidth: '140px'}}>{ status }</TableCell>\n );\n }\n }\n function renderPatientHeader(){\n if (!hidePatient) {\n return (\n <TableCell className='patientDisplay'>Patient</TableCell>\n );\n }\n }\n function renderPatient(patientDisplay ){\n if (!hidePatient) {\n return (\n <TableCell className='patientDisplay' style={{minWidth: '140px'}}>{ patientDisplay }</TableCell>\n );\n }\n }\n function renderPatientReferenceHeader(){\n if (!hidePatientReference) {\n return (\n <TableCell className='patientReference'>Patient Reference</TableCell>\n );\n }\n }\n function renderPatientReference(patientReference ){\n if (!hidePatientReference) {\n return (\n <TableCell className='patientReference' style={{minWidth: '140px'}}>{ patientReference }</TableCell>\n );\n }\n }\n function renderPrescriberHeader(){\n if (!hidePrescriber) {\n return (\n <TableCell className='prescriberDisplay'>Prescriber</TableCell>\n );\n }\n }\n function renderPrescriber(prescriberDisplay ){\n if (!hidePrescriber) {\n return (\n <TableCell className='prescriberDisplay' style={{minWidth: '140px'}}>{ prescriberDisplay }</TableCell>\n );\n }\n }\n function renderIdentifierHeader(){\n if (!hideIdentifier) {\n return (\n <TableCell className='identifier'>Identifier</TableCell>\n );\n }\n }\n function renderIdentifier(identifier ){\n if (!hideIdentifier) {\n return (\n <TableCell className='identifier'>{ identifier }</TableCell>\n );\n }\n } \n function renderMedicationHeader(){\n if (!hideMedication) {\n return (\n <TableCell className='medicationName'>Medication Name</TableCell>\n );\n }\n }\n function renderMedication(medicationName ){\n if (!hideMedication) {\n return (\n <TableCell className='medicationName'>{ medicationName }</TableCell>\n );\n }\n } \n function renderMedicationCodeHeader(){\n if (!hideMedication) {\n return (\n <TableCell className='medicationCode'>Medication Code</TableCell>\n );\n }\n }\n function renderMedicationCode(medicationCode ){\n if (!hideMedication) {\n return (\n <TableCell className='medicationCode'>{ medicationCode }</TableCell>\n );\n }\n } \n function renderDateWrittenHeader(){\n if (!hideDateWritten) {\n return (\n <TableCell className='dateWritten'>Date Written</TableCell>\n );\n }\n }\n function renderDateWritten(dateWritten ){\n if (!hideDateWritten) {\n return (\n <TableCell className='dateWritten'>{ dateWritten }</TableCell>\n );\n }\n } \n function renderDosageHeader(){\n if (!hideDosage) {\n return (\n <TableCell className='dosage'>Dosage</TableCell>\n );\n }\n }\n function renderDosage(dosage ){\n if (!hideDosage) {\n return (\n <TableCell className='dosage' style={{minWidth: '140px'}}>{ dosage }</TableCell>\n );\n }\n }\n function renderBarcode(id){\n if (!hideBarcode) {\n return (\n <TableCell><span className=\"barcode helvetica\">{id}</span></TableCell>\n );\n }\n }\n function renderBarcodeHeader(){\n if (!hideBarcode) {\n return (\n <TableCell>System ID</TableCell>\n );\n }\n }\n function renderActionButtonHeader(){\n if (showActionButton === true) {\n return (\n <TableCell className='ActionButton' >Action</TableCell>\n );\n }\n }\n function renderActionButton(patient){\n if (showActionButton === true) {\n return (\n <TableCell className='ActionButton' >\n <Button onClick={ onActionButtonClick.bind(this, patient[i]._id)}>{ get(props, \"actionButtonLabel\", \"\") }</Button>\n </TableCell>\n );\n }\n }\n function removeRecord(_id){\n logger.info('Remove medication order: ' + _id)\n MedicationOrders._collection.remove({_id: _id})\n }\n function showSecurityDialog(medicationOrder){\n logger.info('Showing the security dialog.')\n\n Session.set('securityDialogResourceJson', MedicationOrders.findOne(get(medicationOrder, '_id')));\n Session.set('securityDialogResourceType', 'MedicationOrder');\n Session.set('securityDialogResourceId', get(medicationOrder, '_id'));\n Session.set('securityDialogOpen', true);\n }\n function handleChangePage(newPage){\n setPage(newPage);\n };\n\n let tableRows = [];\n let medicationOrdersToRender = [];\n\n if(showMinutes){\n dateFormat = \"YYYY-MM-DD hh:mm\";\n }\n if(dateFormat){\n dateFormat = dateFormat;\n }\n\n if(medicationOrders){\n if(medicationOrders.length > 0){ \n let count = 0; \n props.medicationOrders.forEach(function(medicationOrder){\n if((count >= (page * rowsPerPage)) && (count < (page + 1) * rowsPerPage)){\n medicationOrdersToRender.push(FhirDehydrator.dehydrateMedicationOrder(medicationOrder, dateFormat));\n }\n count++;\n }); \n }\n }\n\n if(medicationOrdersToRender.length === 0){\n logger.trace('MedicationOrdersTable: No procedures to render.');\n // footer = <TableNoData noDataPadding={ noDataMessagePadding } />\n } else {\n for (var i = 0; i < medicationOrdersToRender.length; i++) {\n tableRows.push(\n <TableRow className=\"medicationOrderRow\" key={i} onClick={ rowClick.bind(this, medicationOrdersToRender[i]._id)} style={{cursor: 'pointer'}} hover=\"true\" > \n { renderToggle() }\n { renderActionIcons(medicationOrdersToRender[i]) }\n { renderIdentifier(medicationOrdersToRender[i].identifier ) }\n { renderMedicationCode(medicationOrdersToRender[i].medicationCode ) }\n { renderMedication(medicationOrdersToRender[i].medicationCodeableConcept ) }\n { renderStatus(medicationOrdersToRender[i].status)}\n { renderPatient(medicationOrdersToRender[i].patientDisplay)}\n { renderPatientReference(medicationOrdersToRender[i].patientReference)}\n { renderPrescriber(medicationOrdersToRender[i].performerDisplay)}\n { renderDateWritten(medicationOrdersToRender[i].dateWritten)}\n { renderDosage(medicationOrdersToRender[i].dosageInstructionText)}\n { renderBarcode(medicationOrdersToRender[i]._id)}\n { renderActionButton(medicationOrdersToRender[i]) }\n </TableRow>\n ); \n }\n }\n\n\n let paginationFooter;\n if(!disablePagination){\n paginationFooter = <TablePagination\n component=\"div\"\n // rowsPerPageOptions={[5, 10, 25, 100]}\n rowsPerPageOptions={['']}\n colSpan={3}\n count={paginationCount}\n rowsPerPage={rowsPerPage}\n page={page}\n onChangePage={handleChangePage}\n style={{float: 'right', border: 'none'}}\n />\n }\n\n return(\n <div>\n <Table id=\"proceduresTable\" size=\"small\" aria-label=\"a dense table\" hover={true} >\n <TableHead>\n <TableRow>\n { renderToggleHeader() }\n { renderActionIconsHeader() }\n { renderIdentifierHeader() }\n { renderMedicationCodeHeader() }\n { renderMedicationHeader() }\n { renderStatusHeader() }\n { renderPatientHeader() }\n { renderPatientReferenceHeader() }\n { renderPrescriberHeader() }\n { renderDateWrittenHeader() }\n { renderDosageHeader() }\n { renderBarcodeHeader() }\n { renderActionButtonHeader() }\n </TableRow>\n </TableHead>\n <TableBody>\n { tableRows }\n </TableBody>\n </Table>\n { paginationFooter }\n </div>\n ); \n}", "function getPage(tableState) {\n vm.data.isLoading = true;\n if (tableState) {\n _tableState = tableState;\n }\n else if (_tableState) {\n tableState = _tableState;\n }\n else {\n tableState = utility.initTableState(tableState);\n _tableState = tableState;\n }\n\n tableState.draw = tableState.draw + 1 || 1;\n\n var draw = tableState.draw;\n var start = tableState.pagination.start || 0; // This is NOT the page number, but the index of item in the list that you want to use to display the table.\n var number = tableState.pagination.number || 10; // Number of entries showed per page.\n var sortName = tableState.sort.predicate || 'BaoGiaId';\n var sortDir = tableState.sort.reverse ? 'desc' : 'asc';\n var searchString = vm.data.searchString;\n var searchKhachHangId = vm.data.searchKhachHangId || 0;\n var tuNgay = vm.data.startDate;\n var denNgay = vm.data.endDate;\n\n var fields = \"\";\n BaoGiaService.getPage(draw, start, number, searchString, searchKhachHangId, tuNgay, denNgay, sortName, sortDir, fields, vm.data.userInfo.UserId, vm.data.userInfo.NhanVienId)\n .then(function (success) {\n console.log(success);\n if (success.data.data) {\n vm.data.listBaoGia = success.data.data;\n vm.data.BaoGiaChiTietListDisplay = [];\n tableState.pagination.numberOfPages = Math.ceil(success.data.metaData.total / number);\n }\n vm.data.isLoading = false;\n }, function (error) {\n vm.data.isLoading = false;\n if (error.data.error != null) {\n alert(error.data.error.message);\n } else {\n alert(error.data.Message);\n }\n });\n }", "function usePages(_ref) {\n var _ref$pageSize = _ref.pageSize,\n pageSize = _ref$pageSize === void 0 ? 7 : _ref$pageSize,\n _ref$data = _ref.data,\n data = _ref$data === void 0 ? [] : _ref$data;\n\n var _React$useState = react_default.a.useState(0),\n _React$useState2 = usePages_slicedToArray(_React$useState, 2),\n startFrom = _React$useState2[0],\n setFrom = _React$useState2[1]; // set current page to 0 when data source length changes\n\n\n react_default.a.useEffect(function () {\n setFrom(0);\n }, [data.length]);\n\n function onPrev() {\n var prevPage = startFrom - pageSize;\n\n if (prevPage < 0) {\n prevPage = 0;\n }\n\n setFrom(prevPage);\n }\n\n function onNext() {\n var nextPage = startFrom + pageSize;\n\n if (nextPage < data.length) {\n nextPage = startFrom + pageSize;\n setFrom(nextPage);\n }\n }\n\n var totalRows = data.length;\n var endAt = 0;\n var pagedData = data;\n\n if (data.length > 0) {\n endAt = startFrom + (pageSize > data.length ? data.length : pageSize);\n\n if (endAt > data.length) {\n endAt = data.length;\n }\n\n pagedData = data.slice(startFrom, endAt);\n }\n\n return {\n pageSize: pageSize,\n startFrom: startFrom,\n endAt: endAt,\n totalRows: totalRows,\n data: pagedData,\n hasPages: totalRows > pageSize,\n onNext: onNext,\n onPrev: onPrev\n };\n}", "static optOrderPagination(){\n return window.API_ROOT + 'rest/optOrder.pagination/v1';\n }", "function pagination(tableID) {\n var table = tableID;\n var trnum = 0;\n var maxRows = 15;\n var totalRows = $(table + \" tbody tr[class*='inList']\").length;\n $(table + \" tbody tr[class*='inList']\").each(function () {\n trnum++;\n if (trnum > maxRows) {\n $(this).hide();\n } if (trnum <= maxRows) {\n $(this).show();\n }\n });\n\n if (totalRows > maxRows) {\n var pagenu = Math.ceil(totalRows / maxRows);\n for (var i = 1; i <= pagenu && tableID == \"#custb\";) {\n $('#customer .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n for (var i = 1; i <= pagenu && tableID == \"#frtb\";) {\n $('#freelancer .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n for (var i = 1; i <= pagenu && tableID == \"#cattb\";) {\n $('#categoryValue .pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span>\\</li>').show();\n }\n }\n\n $('.pagination li:first-child').addClass('active');\n $('.pagination li').on('click', function () {\n var pagenum = $(this).attr('data-page');\n var trIndex = 0;\n $('.pagination li').removeClass('active')\n $(this).addClass('active');\n $(table + \" tbody tr[class*='inList']\").each(function () {\n trIndex++;\n if (trIndex > (maxRows * pagenum) || trIndex <= ((maxRows * pagenum) - maxRows)) {\n $(this).hide();\n } else {\n $(this).show();\n }\n });\n });\n}", "function GetPages() {\n\n //Get the current page number from Pagination component\n //and pass it as a value to useQuery funtion.\n let pageID = localStorage.getItem('currentPage')\n let defaultID = 1;\n \n const {error, loading, data} = useQuery(PAGE_QUERY, {variables: {id: !pageID?defaultID:pageID}});\n\n if (loading) return <h5 className=\"title\">Loading...</h5>;\n if (error) return `Error! ${error.message}`\n \n //This checks if we sucessfully retrieve data from GraphQL server\n //and display the date in table format.\n if(data) {\n if (data.page == null) {\n return <div>No Data Avialable</div>;\n }\n return (\n <div>\n <h1 id='title'>React Dynamic Table</h1>\n <Pagination/>\n <table id='table'>\n <tbody>\n <tr>{renderTableHeader(data)}</tr>\n {renderTableData(data)}\n </tbody>\n </table>\n </div>\n )\n }\n return null\n \n}", "constructor (props) {\n super(props);\n this.state = {\n table: {\n page: 1,\n limit: isNaN(props.limit) ? 10 : props.limit,\n sort: {\n field: '',\n direction: 'asc'\n },\n filters: {\n date: 'all',\n dtype: 'all'\n }\n }\n };\n }", "function paginate(arr, perPage, pageNumber = 1) {\n perPage = perPage;\n const start = perPage * (pageNumber - 1);\n let nr = arr.slice(start, (start + perPage));\n tableData(tbody, nr);\n }", "function _pagination_setPageData() {\r\n var _pagination = _data['pagination'];\r\n\r\n var _startIdx = _pagination['currentPage'] * _pagination['numElementsPerPage'];\r\n\r\n _pagination['current']['elyos'].empty().pushAll(_data['elyos'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n _pagination['current']['asmodians'].empty().pushAll(_data['asmodians'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n _pagination['current']['versus'].empty().pushAll(_data['versus'].slice(_startIdx, _startIdx + _pagination['numElementsPerPage']));\r\n }", "function showTable(table, page=1){\n //Calculate the page number\n const rows = Array.from(table.rows).slice(1);\n const maxrows = document.getElementById('maxrows').value;\n let maxpage = Math.ceil(rows.length/maxrows);\n //page could not be grater than maxpage\n page = (page <= maxpage)?page:maxpage;\n //page could not be less than 1\n page = (page < 1)?1:page;\n \n //Calculate the init index and final index\n let init_idx = (page-1) * maxrows;\n let final_idx = (rows.length >= page*maxrows)?(page*maxrows):rows.length;\n let show_rows = rows.slice(init_idx, final_idx);\n \n //Hide the table\n hideTable(table);\n //Show the rows\n show_rows.map(showRow);\n //Update the pagination\n selectPagePagination(page);\n}", "handlePageClick(data) {\n const selected = data.selected;\n const offset = Math.ceil(selected * this.state.perPage);\n\n this.setState({\n offset,\n currentPage: selected + 1,\n merchants: this.state.totalRows.slice(offset, offset + this.state.perPage),\n filteredRowsPaged: this.state.filteredRows.slice(offset, offset + this.state.perPage),\n }, () => {\n if (this.state.filteredRowsPaged.length > 0) {\n this.globalSelectorGroup(this.state.filteredRowsPaged);\n } else {\n this.globalSelectorGroup(this.state.merchants);\n }\n });\n }", "handlePaging() {\n if (!this.settings.paging) {\n return;\n }\n\n this.element.addClass('paginated');\n this.tableBody.pager({\n componentAPI: this,\n dataset: this.settings.dataset,\n hideOnOnePage: this.settings.hidePagerOnOnePage,\n source: this.settings.source,\n pagesize: this.settings.pagesize,\n indeterminate: this.settings.indeterminate,\n rowTemplate: this.settings.rowTemplate,\n pagesizes: this.settings.pagesizes,\n pageSizeSelectorText: this.settings.groupable ? 'GroupsPerPage' : 'RecordsPerPage',\n showPageSizeSelector: this.settings.showPageSizeSelector,\n activePage: this.restoreActivePage ? parseInt(this.savedActivePage, 10) : 1\n });\n\n if (this.restoreActivePage) {\n this.savedActivePage = null;\n this.restoreActivePage = false;\n }\n }", "display(){\ndata.then(data=>{\n // console.log(data.length)\n // navigation i.e showing current and total page number\n \n totalPage.innerHTML = data.length/5;\n currentPage.innerHTML = (this.firstIndex/5)+1\n \n //display table\n tbody.innerHTML = ''\n for(let i = this.firstIndex ; i < this.firstIndex+5; i++){\n \n // console.log(data[i].id)\n var row = tr()\n var rowData = [td(), td(), td()]\n rowData[0].innerHTML = data[i].id\n rowData[1].innerHTML = data[i].name\n rowData[2].innerHTML = data[i].email\n row.append(...rowData)\n tbody.append(row)\n }\n \n}).catch(err => console.log(err))\nthis.buttons()\n}", "generatePaginations(activePage, paginationStart, maxViewPageNum) {\n const paginationItems = [];\n for (let number = paginationStart; number <= maxViewPageNum; number++) {\n paginationItems.push(\n <Pagination.Item key={number} active={number === activePage} onClick={() => { return this.getRecentCreatedList(number) }}>{number}</Pagination.Item>,\n );\n }\n return paginationItems;\n }", "function renderTable(page=0) {\r\n $tbody.innerHTML = \"\";\r\n var start =page * $maxresults;\r\n var end=start + $maxresults;\r\n for (var i = 0; i < $maxresults; i++) {\r\n // Get get the current address object and its fields\r\n console.log(start, i);\r\n var alien = filterdata[start + i];\r\n console.log(alien);\r\n var fields = Object.keys(alien);\r\n // Create a new row in the tbody, set the index to be i + startingIndex\r\n var $row = $tbody.insertRow(i);\r\n for (var j = 0; j < fields.length; j++) {\r\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\r\n var field = fields[j];\r\n var $cell = $row.insertCell(j);\r\n $cell.innerText = alien[field];\r\n }\r\n }\r\n // show pagination\r\nvar Numberofpages=filterdata.length/$maxresults;\r\n$pagination.innerHTML=\"\";\r\nfor(let i=0; i < Numberofpages; i++){\r\n var li=document.createElement(\"Li\");\r\n var a=document.createElement(\"a\");\r\n li.classList.add(\"page-item\");\r\n a.classList.add(\"page-Link\");\r\n a.text=i+1;\r\n a.addEventListener(\"click\",function(){\r\n renderTable(i);\r\n });\r\n li.appendChild(a);\r\n $pagination.appendChild(li);\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n}", "function plekit_table_paginator (opts,table_id) {\n\n if(!(\"currentPage\" in opts)) { return; }\n \n var p = document.createElement('p');\n var table=$(table_id);\n var t = $(table_id+'-fdtablePaginaterWrapTop');\n var b = $(table_id+'-fdtablePaginaterWrapBottom');\n\n /* when there's no visible entry, the pagination code removes the wrappers */\n if ( (!t) || (!b) ) return;\n\n /* get how many entries are matching:\n opts.visibleRows only holds the contents of the current page\n so we store the number of matching entries in the table 'matching' attribute\n */\n var totalMatches = opts.totalRows;\n var matching=table['matching'];\n if (matching) totalMatches = matching;\n\n var label;\n\n var matches_text;\n if (totalMatches != opts.totalRows) {\n matches_text = totalMatches + \"/\" + opts.totalRows;\n } else {\n matches_text = opts.totalRows;\n }\n var first = ((opts.currentPage-1) * opts.rowsPerPage) +1;\n var last = Math.min((opts.currentPage * opts.rowsPerPage),totalMatches);\n var items_text = \"Items [\" + first + \" - \" + last + \"] of \" + matches_text;\n var page_text = \"Page \" + opts.currentPage + \" of \" + Math.ceil(totalMatches / opts.rowsPerPage);\n label = items_text + \" -- \" + page_text;\n\n p.className = \"paginationText\"; \n p.appendChild(document.createTextNode(label));\n\n /* t.insertBefore(p.cloneNode(true), t.firstChild); */\n b.appendChild(p);\n}", "changePerPage(event) {\n const {params, accounting, setProp} = this.props;\n const perPage = parseInt(event.target.value, 10);\n setProp(Immutable.fromJS({\n paid: 1,\n unpaid: 1\n }), 'page');\n this.setState({\n perPage\n });\n const tab = accounting.get('tab');\n // Revert to page one, update search\n const search = this.updateBeforeRetrieval(tab);\n // Get records\n this.retrieveRecords(params.type, search, 1, perPage);\n }", "renderPage() {\n const shows = Anime.collection.find({}).fetch();\n\n return (\n <div className=\"gray-background\">\n <Container>\n <Header as=\"h2\" textAlign=\"center\">AniMoo List</Header>\n <Table celled>\n <Table.Header>\n <Table.Row>\n <Table.HeaderCell>Title</Table.HeaderCell>\n <Table.HeaderCell>Image</Table.HeaderCell>\n <Table.HeaderCell>Summary</Table.HeaderCell>\n <Table.HeaderCell>Episodes</Table.HeaderCell>\n <Table.HeaderCell>Rating</Table.HeaderCell>\n <Table.HeaderCell>Add To Favorites</Table.HeaderCell>\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {this.props.anime.slice((this.state.activePage - 1) * 25, this.state.activePage * 25).map((show) => <AnimeItem key={show._id} anime={show} />)}\n </Table.Body>\n </Table>\n <Pagination\n activePage={this.activePage}\n totalPages={Math.ceil(shows.length / 25)}\n firstItem={{ content: <Icon name='angle double left'/>, icon: true }}\n lastItem={{ content: <Icon name='angle double right'/>, icon: true }}\n prevItem={{ content: <Icon name='angle left'/>, icon: true }}\n nextItem={{ content: <Icon name='angle right'/>, icon: true }}\n onPageChange={this.handlePageChange}\n />\n </Container>\n </div>\n );\n }", "function handlePagination() {\n\n var numResults = rowsParent.childElementCount;\n\n //disable and enable buttons based on row count\n if (numResults <= 5){\n //do nothing\n }else if(numResults <= 10){\n createPaginationListElement(2);\n } else if(numResults <= 15){\n createPaginationListElement(2);\n createPaginationListElement(3);\n } else { //over 20\n createPaginationListElement(2);\n createPaginationListElement(3);\n createPaginationListElement(4);\n }\n\n //store all rows in an array\n tableContent = rowsParent.innerHTML;\n\n showSelectedChildren(0, 4)\n\n\n}", "toResults() {\n this.setState({ page: 4 });\n }", "renderPaginate(self, pagContainer) {\n\t\tpagContainer.pagination({\n\t\t\tdataSource: this.dataSource, // total ads from filtered request\n\t\t\tpageSize: this.limit, // num max ads per page\n\t\t\tshowGoInput: this.showGoInput,\n\t\t\tshowGoButton: this.showGoButton,\n\t\t\tshowBeginingOnOmit: this.showBeginingOnOmit,\n\t\t\tshowEndingOnOmit: this.showEndingOnOmit,\n\t\t\thideWhenLessThanOnePage: this.hideWhenLessThanOnePage,\n\t\t\tpageRange: this.pageRange,\n\t\t\tprevText: this.prevText,\n\t\t\tnextText: this.nextText,\n\t\t\tcallback: (data, pagination) => {\n\t\t\t\tconst currentBtn = pagination.pageNumber;\n\t\t\t\tthis.generateCurrentSkip(currentBtn);\n\t\t\t\tself.dataService.createData({ skip: this.skip, limit: this.limit });\n\t\t\t\tself.commonManager.loadAdsPag(self.dataService.getData());\n\t\t\t}\n\t\t});\n\t}", "function Pager(props) {\n var _props$startFrom = props.startFrom,\n startFrom = _props$startFrom === void 0 ? 0 : _props$startFrom,\n _props$endAt = props.endAt,\n endAt = _props$endAt === void 0 ? 0 : _props$endAt,\n _props$totalRows = props.totalRows,\n totalRows = _props$totalRows === void 0 ? 0 : _props$totalRows,\n onPrev = props.onPrev,\n onNext = props.onNext;\n var isPrevDisabled = totalRows === 0 || startFrom === 0;\n var isNextDisabled = totalRows === 0 || endAt === totalRows;\n return /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, null, /*#__PURE__*/react_default.a.createElement(src[\"u\" /* Text */], {\n typography: \"body2\",\n color: \"primary.contrastText\"\n }, \"SHOWING \", /*#__PURE__*/react_default.a.createElement(\"strong\", null, startFrom + 1), \" to \", /*#__PURE__*/react_default.a.createElement(\"strong\", null, endAt), \" of\", ' ', /*#__PURE__*/react_default.a.createElement(\"strong\", null, totalRows)), /*#__PURE__*/react_default.a.createElement(StyledButtons, null, /*#__PURE__*/react_default.a.createElement(\"button\", {\n onClick: onPrev,\n title: \"Previous Page\",\n disabled: isPrevDisabled\n }, /*#__PURE__*/react_default.a.createElement(src_Icon[\"e\" /* CircleArrowLeft */], {\n fontSize: \"3\"\n })), /*#__PURE__*/react_default.a.createElement(\"button\", {\n onClick: onNext,\n title: \"Next Page\",\n disabled: isNextDisabled\n }, /*#__PURE__*/react_default.a.createElement(src_Icon[\"f\" /* CircleArrowRight */], {\n fontSize: \"3\"\n }))));\n}", "function paginateTable($t = null) {\n\n\t\t// @ Original code by: Gabriele Romanato http://gabrieleromanato.name/jquery-easy-table-pagination/\n\t\t// @ Modified by Francis Otieno (Kongondo) for the ProcessWire Module InputfieldImageMarker\n\n\t\tvar $tables = $t ? $t : $('table.InputfieldImageMarkers');\n\n\t\t$tables.each(function () {\n\n\t\t\tvar $table = $(this);\n\t\t\tvar $parent = $table.parents('div.image_marker_main_wrapper');\n\t\t\t\n\t\t\tvar $limit = $parent.find('select.limit');\n\t\t\tvar $limitValue = $limit.val();\t\t\t\t\n\t\t\t$cookieName = $table.attr('id');\t\t\n\t\t\t\n\t\t\t// sete cookie to remember (server-side) pagination limit\n\t\t\tsetCookie($cookieName, $limitValue);\n\t\t\tvar $numPerPage = $limitValue;\n\t\t\t\n\t\t\t// remove last inserted pagination to avoid duplicates (.ready vs .change)\n\t\t\t$parent.find('ul.pager').remove();\n\t\t\t\n\t\t\t$table.show();\n\t\t\t\n\t\t\tvar $currentPage = 0;\n\t\t\t// if not paginating, show whole table then return to avoid recursion error\n\t\t\tif($numPerPage == 0) {\n\t\t\t\t$table.find('tbody tr').show();\n\t\t\t\treturn;\n\t\t\t}\t\t\t\n\n\t\t\t$table.bind('repaginate', function() {\n\t\t\t\t$table.find('tbody tr').hide().slice($currentPage * $numPerPage, ($currentPage + 1) * $numPerPage).show();\n\t\t\t});\n\t\t\t$table.trigger('repaginate');\n\t\t\tvar $numRows = $table.find('tbody tr').length;\n\n\t\t\tif($numRows <= $numPerPage) return;// if only 1 page, no need to show pagination\n\n\t\t\tvar $numPages = Math.ceil($numRows / $numPerPage);\n\t\t\tvar $pager = $('<ul class=\"pager uk-pagination MarkupPagerNav\"></ul>');\n\t\t\t\n\t\t\tfor (var $page = 0; $page < $numPages; $page++) {\n\t\t\t\tvar $lastRow = ($page + 1) * $numPerPage;// we need this for 'on click marker, show its page'\n\t\t\t\tvar $firstRow = ($lastRow - $numPerPage) + 1;// ditto\n\t\t\t\tvar $innerText = $('<span></span>').text($page + 1);\n\t\t\t\tvar $outterText = $('<a href=\"#\"></a>').append($innerText);\n\t\t\t\t$('<li class=\"page-number\" data-first-row=\"' + $firstRow + '\"></li>')\n\t\t\t\t\t.html($outterText)\n\t\t\t\t\t.bind('click', {\n\t\t\t\t\t\tnewPage: $page\n\t\t\t\t\t},\n\t\t\t\t\tfunction (event) {\n\t\t\t\t\t\t$currentPage = event.data['newPage'];\n\t\t\t\t\t\t$table.trigger('repaginate');\n\t\t\t\t\t\t$(this).addClass('uk-active MarkupPagerNavOn ').siblings().removeClass('uk-active MarkupPagerNavOn');\n\t\t\t\t\t}).appendTo($pager);\n\t\t\t}// end for loop\n\t\t\t\n\t\t\t// mark active\n\t\t\tvar $paginationWrapper = $parent.find('div.pagination_wrapper');\n\t\t\t$pager.appendTo($paginationWrapper).find('li:first').addClass('uk-active MarkupPagerNavOn');\t\t\t\n\n\t\t});\t\n \n\t}", "function Table({ columns, data }) {\n console.log('data on FormList', data)\n const filterTypes = React.useMemo(\n () => ({\n text: (rows, id, filterValue) => {\n return rows.filter(row => {\n const rowValue = row.values[id]\n return rowValue !== undefined\n ? String(rowValue)\n .toLowerCase()\n .startsWith(String(filterValue).toLowerCase())\n : true\n })\n },\n }),\n []\n )\n\n const defaultColumn = React.useMemo(\n () => ({\n Filter: DefaultColumnFilter,\n }),\n []\n )\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n state,\n visibleColumns,\n preGlobalFilteredRows,\n setGlobalFilter,\n } = useTable (\n {\n columns,\n data,\n defaultColumn,\n filterTypes,\n initialState: {\n sortBy: [{ id: 'incident_date', desc: true }]\n }\n },\n useFilters,\n useSortBy,\n )\n\n const firstPageRows = rows.slice(0,10)\n\n return (\n <>\n <table className=\"table\" {...getTableProps()}>\n <thead>\n {headerGroups.map(headerGroup => (\n <tr {...headerGroup.getHeaderGroupProps()}>\n {headerGroup.headers.map(column => (\n <th scope=\"col\" {...column.getHeaderProps(column.getSortByToggleProps())}>\n {column.render('Header')}\n {/* Render the columns filter UI */}\n <div>{column.canFilter ? column.render('Filter') : null}</div>\n <span>{column.isSorted ? (column.isSortedDesc ? '' : '') : ''}</span>\n </th>\n ))}\n </tr>\n ))}\n </thead>\n <tbody {...getTableBodyProps()}>\n {firstPageRows.map((row, i) => {\n prepareRow(row)\n return (\n <tr {...row.getRowProps()}>\n {row.cells.map(cell => {\n return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>\n })}\n </tr>\n )\n })}\n </tbody>\n </table>\n <br />\n <div>Showing the first 20 results of {rows.length} rows</div>\n </>\n )\n}", "static get PAGE_ITEMS() {\n return 50;\n }", "function paginate(e,t=1,a=10,r=10){let n,l,g=Math.ceil(e/a);if(t<1?t=1:t>g&&(t=g),g<=r)n=1,l=g;else{let e=Math.floor(r/2),a=Math.ceil(r/2)-1;t<=e?(n=1,l=r):t+a>=g?(n=g-r+1,l=g):(n=t-e,l=t+a)}let i=(t-1)*a,s=Math.min(i+a-1,e-1),o=Array.from(Array(l+1-n).keys()).map(e=>n+e);return{totalItems:e,currentPage:t,pageSize:a,totalPages:g,startPage:n,endPage:l,startIndex:i,endIndex:s,pages:o}}", "function load_page(p) {\r\n const all_btn = document.getElementsByClassName(\"page\");\r\n if (all_btn.length > 0) {\r\n for (let i = 0; i < (Math.ceil(arr.length / page_size)); i++) {\r\n all_btn[i].classList.remove(\"btn-active\");\r\n }\r\n const btn = document.getElementById(`page-${p}`);\r\n btn.classList.add(\"btn-active\");\r\n }\r\n\r\n const min = (p - 1) * page_size;\r\n const max = min + 5;\r\n\r\n var load_data = '';\r\n if (max > arr.length) {\r\n for (let i = min; i < arr.length; i++) {\r\n load_data += `<tr>\r\n <td>${arr[i].id}</td>\r\n <td>${arr[i].device}</td>\r\n <td>${arr[i].action}</td>\r\n <td>${arr[i].date}</td>\r\n </tr>`;\r\n }\r\n } else {\r\n for (let i = min; i < max; i++) {\r\n load_data += `<tr>\r\n <td>${arr[i].id}</td>\r\n <td>${arr[i].device}</td>\r\n <td>${arr[i].action}</td>\r\n <td>${arr[i].date}</td>\r\n </tr>`;\r\n }\r\n }\r\n\r\n let total = arr.length;\r\n const data = load_data + `\r\n <tr style=\"background-color: #FAFBFB;\">\r\n <th scope=\"row\">Total</th>\r\n <td colspan=\"2\"></td>\r\n <td><b>${total}</b></td>\r\n </tr>\r\n `;\r\n document.getElementById(\"load_data\").innerHTML = data;\r\n}", "function SearchResults(props) {\n const classes = useStyles2();\n const [page, setPage] = React.useState(0);\n const [rowsPerPage, setRowsPerPage] = React.useState(10);\n const {data} = props;\n\n // tracking the no of empty rows to be shown on the page\n const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage);\n\n // update the page on the state to reflect the page change\n function handleChangePage(event, newPage) {\n setPage(newPage);\n }\n\n // Handle change rows when paginating\n function handleChangeRowsPerPage(event) {\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n }\n\n // When no results, dont render table\n if(!!data && data.length === 0) {\n return null;\n }\n\n return (\n <Paper className={classes.root}>\n <div className={classes.tableWrapper}>\n <Table className={classes.table} size=\"small\">\n <TableHead>\n <TableRow>\n <StyledTableCell>Repository Name</StyledTableCell>\n <StyledTableCell align=\"right\">Programming Language</StyledTableCell>\n <StyledTableCell align=\"right\">Owner</StyledTableCell>\n <StyledTableCell align=\"center\">Avatar</StyledTableCell>\n <StyledTableCell align=\"right\">Stars</StyledTableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {data.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map(repoItem => (\n <StyledTableRow key={repoItem.repo_full_name}>\n <StyledTableCell component=\"th\" scope=\"repoItem\">\n <Link href={repoItem.repo_url} target=\"_blank\" rel=\"noopener\">\n {repoItem.repo_full_name}\n </Link>\n </StyledTableCell>\n <StyledTableCell align=\"right\">\n\n {\n repoItem.programming_lang &&\n <Chip label={repoItem.programming_lang} className={classes.active} variant=\"outlined\" />\n }\n\n </StyledTableCell>\n <StyledTableCell align=\"right\">\n <Link href={repoItem.owner_url} target=\"_blank\" rel=\"noopener\">\n {repoItem.user_id} \n </Link>\n </StyledTableCell>\n <StyledTableCell align=\"center\"><Avatar className=\"centerAlign\" alt=\"avatar\" src={repoItem.avatar_url}/></StyledTableCell>\n <StyledTableCell align=\"right\">{repoItem.stars_count}</StyledTableCell>\n </StyledTableRow>\n ))}\n\n {emptyRows > 0 && (\n <StyledTableRow style={{ height: 68 * emptyRows }}>\n <StyledTableCell colSpan={6} />\n </StyledTableRow>\n )}\n </TableBody>\n <TableFooter>\n <TableRow>\n <TablePagination\n colSpan={5}\n count={data.length}\n rowsPerPage={rowsPerPage}\n page={page}\n SelectProps={{\n inputProps: { 'aria-label': 'rows per page' },\n native: true,\n }}\n rowsPerPageOptions={[]}\n onChangePage={handleChangePage}\n onChangeRowsPerPage={handleChangeRowsPerPage}\n ActionsComponent={CustomTablePagination}\n />\n </TableRow>\n </TableFooter>\n </Table>\n </div>\n </Paper>\n );\n}", "paginateNext(boundThis) {\n\n\n this.settings.offset = this.settings.offset + this.settings.show;\n const dataSet = this.run();\n\n // console.log(dataSet)\n // console.log(dataSet.data)\n\n boundThis.setState({dataToShow: dataSet.data})\n\n return dataSet\n\n }", "displayRecordPerPage(page) {\n /*let's say for 2nd page, it will be => \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n page = 2; pageSize = 5; startingRecord = 5, endingRecord = 10\n so, slice(5,10) will give 5th to 9th records.\n */\n this.startingRecord = (page - 1) * this.pageSize;\n this.endingRecord = this.pageSize * page;\n\n this.endingRecord =\n this.endingRecord > this.totalRecountCount\n ? this.totalRecountCount\n : this.endingRecord;\n\n this.data = this.items.slice(this.startingRecord, this.endingRecord);\n\n //increment by 1 to display the startingRecord count,\n //so for 2nd page, it will show \"Displaying 6 to 10 of 23 records. Page 2 of 5\"\n this.startingRecord = this.startingRecord + 1;\n }", "function createTable(data, count, flag = undefined) {\n\n function createPatination(dataArr) {\n let paginationWrapp = document.querySelector('.pagination ul');\n let liCounter = Math.ceil(dataArr.length / count);\n for (let i = 0; i < liCounter; i++) {\n let li = document.createElement('li');\n li.innerHTML = i + 1;\n paginationWrapp.appendChild(li);\n }\n\n }\n\n createPatination(data);\n\n let pagination = document.querySelectorAll('.pagination ul li ');\n pagination[0].classList.add('active');\n\n if (flag) {\n for (let j = 0; j < pagination.length; j++) {\n pagination[j].classList.remove('active');\n }\n pagination[flag].classList.add('active');\n }\n\n let tableWrapp = document.querySelector('.table');\n let table = document.createElement('table');\n let tBody = document.createElement('tbody');\n\n table.setAttribute('id', 'my-table');\n let thTr = document.createElement('tr');\n colsArr.forEach(function (item) {\n let th = document.createElement('th');\n th.innerHTML = item;\n thTr.append(th);\n });\n table.appendChild(thTr);\n\n let activeData = data.slice(0, count);\n\n init(activeData, tBody);\n\n for (let i = 0; i < pagination.length; i++) {\n pagination[i].addEventListener('click', function () {\n for (let j = 0; j < pagination.length; j++) {\n pagination[j].classList.remove('active');\n }\n this.classList.add('active');\n let num = +this.innerHTML;\n let start = (num - 1) * count;\n let end = start + count;\n let pageData = data.slice(start, end);\n tBody.innerHTML = '';\n init(pageData, tBody);\n\n });\n }\n\n if (flag) {\n let num = flag;\n let start = (num) * count;\n let end = start + count;\n let pageData = data.slice(start, end);\n tBody.innerHTML = '';\n init(pageData, tBody);\n }\n\n table.appendChild(tBody);\n tableWrapp.appendChild(table);\n limitPagination()\n }", "function Pagination(totalCount, pageIndex) {\n $('#tblPagination').html('');\n var table = document.getElementById(\"tblPagination\");\n var row = table.insertRow(0); row.setAttribute('id', 'trPagination')\n var id = 1;\n var totalRecord = totalCount;\n var currentPage = pageIndex;\n var pageSize = 10;\n var pageCount = totalRecord / pageSize;\n pageCount = Math.ceil(pageCount);\n if (pageCount > 10) {\n if (currentPage <= 10) {\n if (currentPage != 1) {\n var position = 0;\n var first = row.insertCell(position); var prevPage = currentPage - 1;\n first.innerHTML = \"First\"; first.setAttribute('onclick', \"PageClick('1');\"); first.setAttribute('id', id);\n if (currentPage > 1) {\n first.setAttribute(\"class\", \"Cursor\");\n } else {\n first.setAttribute(\"class\", \"CurrentPage\");\n }\n var prev = row.insertCell(position++);\n prev.innerHTML = \"Prev\"; prev.setAttribute('onclick', \"PageClick(\" + prevPage + \");\"); prev.setAttribute('id', id + 1);\n if (currentPage > 1) {\n prev.setAttribute(\"class\", \"Cursor\");\n } else {\n prev.setAttribute(\"class\", \"CurrentPage\");\n }\n }\n else {\n var id = 0;\n }\n\n for (var i = 1; i <= 10; i++) {\n\n position = position + 1; id = id + 1;\n var td = row.insertCell(position);\n td.innerHTML = i;\n td.setAttribute('onclick', \"PageClick(\" + i + \");\");\n td.setAttribute('id', id);\n if (i != currentPage) {\n td.setAttribute(\"class\", \"Cursor\");\n }\n else {\n td.setAttribute(\"class\", \"CurrentPage\");\n }\n }\n var next = row.insertCell(position++); id = id + 1; var nextpage = currentPage + 1;\n next.innerHTML = \"Next\"; next.setAttribute('onclick', \"PageClick(\" + nextpage + \");\");\n next.setAttribute('id', id);\n if (currentPage < pageCount) {\n next.setAttribute(\"class\", \"Cursor\");\n }\n else {\n next.setAttribute(\"class\", \"CurrentPage\");\n }\n var last = row.insertCell(position++);\n last.innerHTML = \"Last\"; last.setAttribute('onclick', \"PageClick(\" + pageCount + \");\"); id = id + 1;\n last.setAttribute('id', id);\n $(\"#trPagination > td\").tsort(\"\", { attr: \"id\" });\n if (currentPage < pageCount) {\n last.setAttribute(\"class\", \"Cursor\");\n }\n else {\n last.setAttribute(\"class\", \"CurrentPage\");\n }\n }\n else {\n var temp = pageCount - currentPage;\n if (temp > 10) {\n var position = 0;\n var first = row.insertCell(position); var prevPage = currentPage - 1;\n first.innerHTML = \"First\"; first.setAttribute('onclick', \"PageClick('1');\"); first.setAttribute('id', id);\n if (currentPage > 1) {\n first.setAttribute(\"class\", \"Cursor\");\n } else {\n first.setAttribute(\"class\", \"CurrentPage\");\n }\n var prev = row.insertCell(position++);\n prev.innerHTML = \"Prev\"; prev.setAttribute('onclick', \"PageClick(\" + prevPage + \");}\"); prev.setAttribute('id', id + 1);\n if (currentPage > 1) {\n prev.setAttribute(\"class\", \"Cursor\");\n } else {\n prev.setAttribute(\"class\", \"CurrentPage\");\n }\n var j = 1;\n for (var i = currentPage; j <= 10; i++) {\n position++; id++\n var td = row.insertCell(position);\n td.innerHTML = i;\n td.setAttribute('onclick', \"PageClick(\" + i + \");\");\n td.setAttribute('id', id);\n\n if (i != currentPage) {\n td.setAttribute(\"class\", \"Cursor\");\n }\n else {\n td.setAttribute(\"class\", \"CurrentPage\");\n }\n j++;\n }\n var next = row.insertCell(position++); id = id + 1; var nextpage = currentPage + 1;\n next.innerHTML = \"Next\"; next.setAttribute('onclick', \"PageClick(\" + nextpage + \");\");\n if (currentPage < pageCount) {\n next.setAttribute(\"class\", \"Cursor\");\n }\n else {\n next.setAttribute(\"class\", \"CurrentPage\");\n }\n var last = row.insertCell(position++); next.setAttribute('id', id);\n last.innerHTML = \"Last\"; last.setAttribute('onclick', \"PageClick(\" + pageCount + \");\"); id = id + 1;\n last.setAttribute('id', id);\n if (currentPage < pageCount) {\n last.setAttribute(\"class\", \"Cursor\");\n }\n else {\n last.setAttribute(\"class\", \"CurrentPage\");\n }\n $(\"#trPagination > td\").tsort(\"\", { attr: \"id\" });\n }\n else {\n var position = 0;\n var first = row.insertCell(position); var prevPage = currentPage - 1;\n first.innerHTML = \"First\"; first.setAttribute('onclick', \"PageClick('1');\"); first.setAttribute('id', id);\n if (currentPage > 1) {\n first.setAttribute(\"class\", \"Cursor\");\n } else {\n first.setAttribute(\"class\", \"CurrentPage\");\n }\n var prev = row.insertCell(position++);\n prev.innerHTML = \"Prev\"; prev.setAttribute('onclick', \"PageClick(\" + prevPage + \");\"); prev.setAttribute('id', id + 1);\n if (currentPage > 1) {\n prev.setAttribute(\"class\", \"Cursor\");\n } else {\n prev.setAttribute(\"class\", \"CurrentPage\");\n }\n var a = pageCount - currentPage;\n var b = 10 - a;\n var startingPoint = currentPage - b;\n var j = startingPoint;\n for (var i = startingPoint; i <= pageCount; i++) {\n position++; id++\n var td = row.insertCell(position);\n td.innerHTML = i;\n td.setAttribute('onclick', \"PageClick(\" + i + \");\");\n td.setAttribute('id', id);\n if (i != currentPage) {\n td.setAttribute(\"class\", \"Cursor\");\n }\n else {\n td.setAttribute(\"class\", \"CurrentPage\");\n }\n j++;\n }\n var next = row.insertCell(position++); id = id + 1; var nextpage = currentPage + 1;\n next.innerHTML = \"Next\"; next.setAttribute('onclick', \"PageClick(\" + nextpage + \");\");\n if (currentPage < pageCount) {\n next.setAttribute(\"class\", \"Cursor\");\n }\n else {\n next.setAttribute(\"class\", \"CurrentPage\");\n }\n var last = row.insertCell(position++); next.setAttribute('id', id);\n last.innerHTML = \"Last\"; last.setAttribute('onclick', \"PageClick(\" + pageCount + \");\"); id = id + 1;\n last.setAttribute('id', id);\n\n if (currentPage < pageCount) {\n last.setAttribute(\"class\", \"Cursor\");\n }\n else {\n last.setAttribute(\"class\", \"CurrentPage\");\n }\n $(\"#trPagination > td\").tsort(\"\", { attr: \"id\" });\n }\n }\n }\n else {\n var position = 0;\n var first = row.insertCell(position);\n first.innerHTML = \"First\"; first.setAttribute('onclick', \"PageClick('1');\"); first.setAttribute('id', id);\n if (currentPage > 1) {\n first.setAttribute(\"class\", \"Cursor\");\n } else {\n first.setAttribute(\"class\", \"CurrentPage\");\n }\n for (var i = 1; i <= pageCount; i++) {\n position++; id++\n var td = row.insertCell(position);\n td.innerHTML = i;\n td.setAttribute('onclick', \"PageClick(\" + i + \");\");\n td.setAttribute('id', id);\n if (i != currentPage) {\n td.setAttribute(\"class\", \"Cursor\");\n }\n else {\n td.setAttribute(\"class\", \"CurrentPage\");\n }\n }\n var last = row.insertCell(pageCount++); id = id + 1;\n last.innerHTML = \"Last\"; last.setAttribute('onclick', \"PageClick(\" + pageCount + \");\");\n last.setAttribute('id', id);\n if (currentPage < pageCount) {\n last.setAttribute(\"class\", \"Cursor\");\n }\n else {\n last.setAttribute(\"class\", \"CurrentPage\");\n }\n $(\"#trPagination > td\").tsort(\"\", { attr: \"id\" });\n }\n}", "setRowPage(){\n var table = document.getElementById(`${this.state.config.tableId}_Body`);\n var tr = table.getElementsByTagName(\"tr\");\n for (var i = 0; i < tr.length; i++) {\n let page = parseInt(tr[i].getAttribute(\"page\"));\n if (page === this.state.currentPage){\n tr[i].classList.add(\"showIt\");\n tr[i].classList.remove(\"hideIt\");\n }else {\n tr[i].classList.add(\"hideIt\");\n tr[i].classList.remove(\"showIt\");\n }\n }\n }", "function PaginationActions(props){\n const classes = useStyles();\n const theme = useTheme();\n const {count, page, rowsPerPage, onChangePage} = props;\n\n const handleFirstPageButtonClick = event => {\n onChangePage(event, 0);\n };\n\n const handleBackButtonClick = event => {\n onChangePage(event, page - 1);\n };\n\n const handleNextButtonClick = event => {\n onChangePage(event, page + 1);\n };\n\n const handleLastPageButtonClick = (event) => {\n onChangePage(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n return(\n <div className={classes.root}>\n <IconButton className=\"arrow\" onClick={handleFirstPageButtonClick} disabled={page === 0}>{theme.direction === 'rtl' ? <LastPageIcon/> : <FirstPageIcon/>}</IconButton>\n <IconButton className=\"arrow\" onClick={handleBackButtonClick} disabled={page === 0}>{theme.direction === 'rtl' ? <ArrowRight/> : <ArrowLeft/>}</IconButton>\n <IconButton className=\"arrow\" onClick={handleNextButtonClick} disabled={page >= Math.ceil(count/rowsPerPage) - 1}>{theme.direction === 'rtl' ? <ArrowLeft/> : <ArrowRight/>}</IconButton>\n <IconButton className=\"arrow\" onClick={handleLastPageButtonClick} disabled={page >= Math.ceil(count/rowsPerPage) - 1}>{theme.direction === 'rtl' ? <FirstPageIcon/> : <LastPageIcon/>}</IconButton>\n </div>\n )\n}", "get pageSize() { return this._pageSize; }", "function showPagination(count,current_page,offset,baseUrl, queryString,visibleNumbers,el,prefix,noHref) {\n let output=\"\";\n let fullUrl;\n if(el===undefined) el=\".pagination\";\n if(prefix === undefined || prefix === false) prefix=\"\";\n noHref=noHref===undefined ? false:noHref;\n if(queryString){\n fullUrl=baseUrl+\"?\"+queryString+\"&\"+prefix+\"page=%page%\";\n }else{\n fullUrl=baseUrl+\"?\"+prefix+\"page=%page%\";\n }\n if(count > offset){\n let lastPage=Math.ceil(count/offset);\n let endIndex,startIndex;\n if (current_page > 1){\n output+= noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"1\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li><li class=\"page-item\"><a class=\"page-link\" data-page=\"'+(current_page-1)+'\" aria-label=\"Previous\">قبلی</a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+baseUrl+'\" aria-label=\"Previous\"><span aria-hidden=\"true\">&laquo;</span></a></li><li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":current_page-1})+'\" aria-label=\"Previous\">قبلی</a></li>';\n }\n if((current_page+(visibleNumbers-1)) > lastPage){\n endIndex=lastPage;\n startIndex=current_page-(visibleNumbers-(lastPage-current_page));\n }else{\n\n startIndex=current_page - (visibleNumbers-1);\n endIndex=current_page+ (visibleNumbers-1);\n }\n startIndex= startIndex<=0 ? 1:startIndex;\n for(pageNumber=startIndex;pageNumber<=endIndex;pageNumber++){\n output+= pageNumber==current_page ? \"<li class='page-item active'>\":\"<li class='page-item'>\";\n output+=noHref ? \"<a class='page-link' data-page='\"+pageNumber+\"'>\"+pageNumber+\"</a>\":\"<a class='page-link' href='\"+substitute(fullUrl,{\"%page%\":pageNumber})+\"'>\"+pageNumber+\"</a>\";\n }\n if(current_page != lastPage){\n output+=noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"'+(current_page+1)+'\" aria-label=\"Previous\">بعدی</a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":current_page+1})+'\" aria-label=\"Previous\">بعدی</a></li>';\n output+=noHref ? '<li class=\"page-item\"><a class=\"page-link\" data-page=\"'+lastPage+'\" aria-label=\"Next\"><span aria-hidden=\"true\">&raquo;</span></a></li>':'<li class=\"page-item\"><a class=\"page-link\" href=\"'+substitute(fullUrl,{\"%page%\":lastPage})+'\" aria-label=\"Next\"><span aria-hidden=\"true\">&raquo;</span></a></li>';\n }\n }\n $(el).html(output);\n}", "renderPagination(maxPage, currentPage, index) {\n var lastPageThreeDots = maxPage - 3;\n var firstPageThreeDots = 3;\n var numberOfNextPage = 1;\n if (maxPage <= 6) {\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else {\n\n // }\n // console.log(\"currentPage: \" + currentPage)\n //3 case: \n //currentPage in first 9 pages\n //currentPage in last 9 pages\n //currentPage in middle of last and first 9 pages\n\n //currentPage in first 9 pages\n if (currentPage <= firstPageThreeDots) {\n // 3 case:\n //index [0, currentPage + 3]\n //index [maxPage -3, maxPage]\n // render component ...\n if (index <= currentPage + numberOfNextPage) {\n //index in [currentPage, currentPage + 3]\n //example index: 2, currentPage = 1 \n //-> this block code will render the paginationItem\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index >= maxPage - numberOfNextPage) {\n //index in last 3 pages\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index === currentPage + numberOfNextPage + 1) {\n // render component ...\n return (<PaginationItem onClick={(e) => e.preventDefault()} key=\"...\">\n <PaginationLink>\n ...\n </PaginationLink>\n </PaginationItem>);\n\n } else {\n // do nothing \n }\n } else if (currentPage >= lastPageThreeDots) {\n //current Page in last 9 pages\n if (index <= numberOfNextPage + 2) { // <= 3\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index >= currentPage - numberOfNextPage) {\n //render currentPage and the 3 previous pages\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index === currentPage - numberOfNextPage - 1) {\n //render component ...\n return (<PaginationItem onClick={(e) => e.preventDefault()} key=\"...\">\n <PaginationLink>\n ...\n </PaginationLink>\n </PaginationItem>);\n\n } else {\n // do nothing \n }\n } else {\n // currentPage in the middle\n if (index <= numberOfNextPage + 2) { // <= 3\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);;\n } else if (index <= currentPage + numberOfNextPage && index >= currentPage - numberOfNextPage) {\n //index in [currentPage-3, currentPage, currentPage +3]\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index >= maxPage - numberOfNextPage) {\n //index in [maxPage-3, maxPage]\n return (<PaginationItem onClick={() => this.sendDataToDataTable(index)} key={index} className={(() => {\n if (index === currentPage) {\n return \"active\";\n } else {\n return \"\";\n }\n })()}>\n <PaginationLink>\n {index}\n </PaginationLink>\n </PaginationItem>);\n } else if (index === currentPage + numberOfNextPage + 1) {\n //render component ...\n return (<PaginationItem onClick={(e) => e.preventDefault()} key=\"...\">\n <PaginationLink>\n ...\n </PaginationLink>\n </PaginationItem>);\n } else if (index === currentPage - numberOfNextPage - 1) {\n //render component ...\n return (<PaginationItem onClick={(e) => e.preventDefault()} key=\"...2\">\n <PaginationLink>\n ...\n </PaginationLink>\n </PaginationItem>);\n\n } else {\n // do nothing\n }\n }\n }\n }", "initPagination(){\n this.getPagination().initPagination();\n }", "renderTable () {\n const table = this.state.table\n const data = api.get.data(table)\n const schema = api.get.schema(table)\n const searchPattern = this.state.searchPattern\n\n return <Table data={data} schema={schema} searchPattern={searchPattern} />\n }", "function getPage(page) {\n var size = 10;\n var offset = (page - 1) * size;\n $.get(\"/get_total\", function (result) {\n var totalCount = result.count;\n if ($('#checkNameDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=name&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkNameAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=name&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkCategoryDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=category&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkCategoryAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=category&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkRatingDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=rating&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkRatingAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=rating&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkPriceDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=price&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkPriceAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=price&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else {\n $.get('/get_table?size=' + size + '&offset=' + offset, function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n }\n });\n}", "paginate(){\n const { page, limit } = this.queryString; // extract page and limit from queryString\n // ex: /api/v1/tours?page=2&limit=10 ==> displaying page nb 2 with 10 documents max per page\n // in this case => 1-10: page 1, 11-20: page 2, 21-30: page 3 .....\n const pageNb = page * 1 || 1; // convert to number || page 1 by default -- we by default limit, if one day we have 1000 documents...\n const limitSet = limit * 1 || 100; // 100 documents limit by page by default\n const skipValue = (pageNb - 1) * limitSet;\n // query = query.skip(10).limit(10); // skip amount of results that will be skiped\n this.query = this.query.skip(skipValue).limit(limitSet);\n\n return this; // for chaining ! return the object\n }", "function paginatedResults(model) {\r\n return (req, res, next) => {\r\n\r\n //get the page an the limit query to a variable\r\n const page = parseInt(req.query.page)\r\n const limit = parseInt(req.query.limit)\r\n \r\n //convert the limit and page for a zero based array\r\n const startIndex = (page - 1) * limit\r\n const endIndex = page* limit\r\n \r\n //make an result object\r\n const results = {}\r\n \r\n //clac next result\r\n if (endIndex < model.length) {\r\n results.next = {\r\n page: page + 1,\r\n limit: limit\r\n }\r\n }\r\n \r\n //clac previous result\r\n if (startIndex > 0){\r\n results.previous = {\r\n page: page - 1,\r\n limit: limit\r\n }\r\n \r\n }\r\n \r\n //slice the array from start to end index\r\n results.results = model.slice(startIndex, endIndex)\r\n \r\n //set the paginated object to a variable in the response\r\n res.paginatedResults = results\r\n next()\r\n \r\n }\r\n}", "getPageSize() {\n return this.paginator.pageSize\n }", "SET_PAGINATION(state, data) {\n state.pagination = data;\n }", "static sliceSampleData(tableData, itemsPerPage, currentPage) {\n const firstIndexToInclude = itemsPerPage * (currentPage - 1);\n let lastIndexToInclude = currentPage * itemsPerPage - 1;\n\n if (lastIndexToInclude > tableData.length - 1) {\n lastIndexToInclude = tableData.length - 1;\n }\n\n return tableData.slice(firstIndexToInclude, lastIndexToInclude + 1);\n }", "function render_table_chunk() {\n\n $tablehead.text('');\n $tablebody.text('');\n \n chunkdata = alien_data.slice((currentPage-1) * perPage, currentPage * perPage);\n\n try {\n \n //setting up a header\n var $headrow = $tablehead.append(\"tr\");\n Object.keys(alien_data[0]).forEach(item => $headrow.append('td').text(item));\n\n // setting up a table\n chunkdata.forEach(function(item) {\n var $bodyrow = $tablebody.append('tr');\n Object.values(item).forEach(value => $bodyrow.append('td').text(value));\n });\n }\n\n catch (error) {\n console.log('NO data in the dataset');\n $tablehead.append('tr')\n .append('td')\n .text('Sorry we do not have the data you have requested. Please refresh the page and do another search.');\n \n d3.selectAll('.pagination')\n .style('display', 'none'); \n }\n\n $currentpage.text(currentPage);\n window.name = JSON.stringify(alien_data);\n numberOfPages = Math.ceil(alien_data.length / perPage);\n \n}", "preparePagination() {\n let currentPage = this.props.pagination.currentPage;\n let totalPages = this.props.pagination.totalPages;\n return this.props.pagination !== undefined ?\n totalPages > 1 ?\n (\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n callback={this.handlePagination}\n />\n ) : ('')\n : ('')\n }", "function fetchListingsPagination(pageNum) {\n\tvar pageSize = 10;\n\tvar subQueryToFetchNumOfResults = 'count(*) OVER() AS numresults, ';\n\tvar subQueryToFetchPageCount = 'ceil((count(*) OVER())::numeric/'+ pageSize + ') AS numpages ';\n\tvar subQueryToHandlePagination = ' LIMIT ' + 10 + ' OFFSET ' + ((pageNum - 1 ) * 10);\n\treturn db.any('SELECT *, ' + subQueryToFetchNumOfResults + subQueryToFetchPageCount + ' FROM listings ORDER BY post_date DESC ' + subQueryToHandlePagination);\n}", "onPageChange(page, sizePerPage) {\n const currentIndex = (page - 1) * sizePerPage;\n this.setState({\n data: this.props.targets.slice(currentIndex, currentIndex + sizePerPage),\n currentPage: page\n });\n }", "function buildTableRows() {\r\n\tconsole.log('buildTableRows');\r\n\r\n\t// Initialise row count\r\n\tvar bodyHtml = [];\r\n\tvar numRowsMatched = 0;\r\n\tvar numRowsDisplayed = 0;\r\n\tvar startRowNo = pageNo == Infinity ? 1 : maxTableRows * (pageNo - 1) + 1;\r\n\tvar endRowNo = pageNo == Infinity ? Infinity : startRowNo + maxTableRows;\r\n\tconsole.log('buildTableRows', pageNo, maxTableRows, startRowNo, endRowNo);\r\n\t\r\n\t// Loop through all data rows\r\n\t$.each(data, function(index, record) {\r\n\t\t\r\n\t\t// Check if this row passes all the filters\r\n\t\tif (record[0] && !record[0].__filters.every(value => value)) return;\r\n\t\tif (record[1] && !record[1].__filters.every(value => value)) return;\r\n\t\tnumRowsMatched++;\r\n\t\t\r\n\t\t// Show only selected page\r\n\t\tif (numRowsMatched >= startRowNo && numRowsMatched < endRowNo) {\r\n\t\t\t\r\n\t\t\t// Add row to table body\r\n\t\t\tbodyHtml.push('<tr' + (record[0] && record[0].elected ? ' class=\"sjo-api-row-elected\"' : '') + '>' + buildTableRowCells(record).join('') + '</tr>');\r\n\t\t\tnumRowsDisplayed++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t});\r\n\t\r\n\t// Calculate actual end row\r\n\tendRowNo = startRowNo + numRowsDisplayed;\r\n\t\r\n\t// Return values as an object\r\n\treturn {\r\n\t\t'bodyHtml': \t\tbodyHtml,\r\n\t\t'numRowsMatched': \tnumRowsMatched,\r\n\t\t'numRowsDisplayed': numRowsDisplayed,\r\n\t\t'startRowNo': \t\tstartRowNo,\r\n\t\t'endRowNo': \t\tendRowNo,\r\n\t};\r\n\t\r\n}", "updateRowsPerPage(rowsPerPage) {\n this.setState({\n rowsPerPage: rowsPerPage,\n currentPage: 1\n })\n this.props.numberOfRows && rowsPerPage ? this._fetchAndSetStateExperimentDesign(this.state.currentPage, rowsPerPage) :\n this._fetchAndSetStateExperimentDesign(this.state.currentPage, this.props.numberOfRows)\n }", "get pageSizeOptions() { return this._pageSizeOptions; }", "function paginatedResults() {\n return async (req, res, next) => {\n let query = {};\n const results = {};\n const { page, limit, title, minPoints, maxPoints, sortOption } = req.query;\n const fields = { Title1: 1, Title2: 1, issn: 1, 'Points.Value': 1, e_issn: 1 };\n const startIndex = (page - 1) * limit;\n const endIndex = page * limit;\n let sortCriteria = {};\n if (typeof title !== 'undefined') {\n const reg = new RegExp(`${title}`);\n query.$or = [{ Title1: reg }, { Title2: reg }];\n }\n const points = {};\n if (typeof minPoints !== 'undefined') {\n points['$gte'] = minPoints;\n }\n if (typeof maxPoints !== 'undefined') {\n points['$lte'] = maxPoints;\n }\n if (Object.keys(points).length > 0) {\n query = { ...query, 'Points.Value': { ...points } };\n }\n if (typeof sortOption !== 'undefined') {\n if (sortOption === 'NameASC') {\n sortCriteria.Title1 = 1;\n }\n if (sortOption === 'NameDESC') {\n sortCriteria.Title1 = -1;\n }\n if (sortOption === 'PointsASC') {\n sortCriteria['Points.Value'] = 1;\n }\n if (sortOption === 'PointsDESC') {\n sortCriteria['Points.Value'] = -1;\n }\n } else {\n sortCriteria.Title1 = 1;\n }\n try {\n const magazines = await magazine\n .find(query, fields)\n .sort(sortCriteria)\n .exec();\n if (endIndex < magazines.length) {\n results.next = {\n page: parseInt(page, 10) + 1,\n limit: limit\n };\n }\n\n if (startIndex > 0) {\n results.previous = {\n page: page - 1,\n limit: limit\n };\n }\n\n results.magazines = magazines.slice(startIndex, endIndex);\n res.paginatedResults = results;\n next();\n // await res.send({ Len: magazines.length });\n } catch (err) {\n console.error(err);\n res.status(500).json({ message: 'Error with fetching list of magazines' });\n }\n };\n}", "setPage(num) {\n\n this.setState({\n indexList: this.state.totalData.slice(num, num + this.state.pageSize)\n })\n\n }", "function renderPagination(currentPage) {\n let changeCategories = sessionStorage.getItem(\"changeCategories\");\n let changePrice = sessionStorage.getItem(\"change\");\n changePrice ? changePrice : \"\";\n let changeLimit = parseInt(sessionStorage.getItem(\"changeLimit\"));\n if (!changeLimit) {\n changeLimit = 10;\n } else {\n changeLimit = changeLimit;\n }\n let str = \"\";\n let data = 50;\n let pages = parseInt(data / changeLimit);\n\n for (let i = 1; i <= pages; i++) {\n str += `<li class=\"page-item${\n i === currentPage ? \" active\" : \"\"\n }\"><button class=\"page-link\" onclick=\"getProductList({page: ${i},limit:${changeLimit},categories:${changeCategories},softPrice:'${changePrice}'})\">${i}</button></li>`;\n }\n\n let pagination = document.getElementById(\"pagination\");\n pagination.innerHTML = `<ul class=\"pagination justify-content-end pagination-custom\">\n <li onclick =\"onscrollTop(event)\" class=\"page-item${\n currentPage === 1 ? \" disabled\" : \"\"\n }\"><button class=\"page-link\" onclick=\"getProductList({page: ${\n currentPage - 1\n },limit:${changeLimit},categories:${changeCategories},softPrice:'${changePrice}'})\">Trang trước</button></li>\n ${str}\n <li class=\"page-item${\n currentPage === pages ? \" disabled\" : \"\"\n }\"><button class=\"page-link\" onclick=\"getProductList({page:${pages},limit:${changeLimit},categories:${changeCategories},softPrice:'${changePrice}'})\">Trang cuối</button></li>\n </ul>`;\n}", "static get PAGE_ITEMS() {\n return 10;\n }", "getList(pageNo) {\n let _this = this;\n axios.get(DOMAIN + 'nurse/list/5/' + pageNo)\n .then(response => {\n if (response.data.status) {\n this.setState({nurseList: response.data.result.datas});\n $(\"#Paging\").table({\n pageNum: response.data.result.totalPage,\n currentPage: pageNo,\n jumpTo: function (current) {\n _this.getList(current);\n }\n });\n } else {\n alert(\"获取数据失败 - 服务器错误!\");\n }\n })\n .catch(error => {\n console.log(error);\n alert(\"请求失败!\");\n })\n }", "function generatePagination(data, totalResults, numResultsToShow) {\n\n $('#custom-pagination').twbsPagination('destroy');\n\n var numPages = totalResults / numResultsToShow;\n if (numPages < 1) {\n numPages = 1;\n }\n\n $('#custom-pagination').twbsPagination({\n totalPages: numPages,\n visiblePages: 5,\n onPageClick: function (event, page) {\n var fromResult = Number(page-1) + \"0\";\n var toResult = page + \"0\";\n generateTable(data, fromResult, toResult);\n }\n });\n\n}", "getAll(initialData) {\n const { \n totalCount, \n page,\n transactions\n } = initialData;\n\n const transactionsPerPage = transactions.length;\n const totalPages = _.ceil(totalCount/transactionsPerPage)\n\n const pagesToFetch = (totalPages > MAX_PAGE_FETCH) \n ? MAX_PAGE_FETCH\n : totalPages;\n\n return this.getTransactionsInPageRange(page + 1, pagesToFetch)\n .then(rangeData => _.concat(transactions, rangeData.transactions))\n .then(this.normalizeTransactions);\n }", "DataTable() {\n return this.state.products.map((res, i) => {\n return <ProductTableRow obj={res} key={i} />;\n });\n }", "function pagination (table) {\n var limit = 10; \n var page = Number($(\"#current_page\").val());\n var Search = $(\"#Search\").val();\n\n if (!Search) {\n var source = \"row_count.php\";\n } \n else {\n var source = \"search_row_count.php\";\n }\n\n getData(table);\n\n $.post(\"includes/\" + source, { \n Table: table,\n Search: Search\n }, function (data) {\n var numRows = data;\n //calculating number of pages\n var totalPages = Math.ceil(numRows / limit);\n // var totalPages = 25; DUMMY to test pagination\n \n if (page == 1) {\n var page1 = Number(page);\n var page2 = Number(page + 1);\n var page3 = Number(page + 2);\n var page4 = Number(page + 3);\n var page5 = Number(page + 4);\n var page6 = Number(page + 5);\n //hiding previous button\n $(\"#previous\").hide();\n }\n\n else {\n var page1 = Number(page - 1);\n var page2 = Number(page);\n var page3 = Number(page + 1);\n var page4 = Number(page + 2);\n var page5 = Number(page + 3);\n var page6 = Number(page + 4); \n // showing previous button\n $(\"#previous\").show(); \n } \n\n if (page == totalPages) {\n //hiding next button\n $(\"#next\").hide();\n }\n else {\n //showing next button\n $(\"#next\").show();\n }\n\n // setting up the page numbers\n $(\"#page1\").val(page1);\n $(\"#page2\").val(page2);\n $(\"#page3\").val(page3);\n $(\"#page4\").val(page4);\n $(\"#page5\").val(page5);\n $(\"#page6\").val(page6);\n\n var i = 1;\n while (i <= 6) {\n var page_num = $(\"#page\" + i).val();\n if (page_num > totalPages) {\n $(\"#page\" + i).hide();\n }\n else {\n $(\"#page\" + i).show(); \n }\n if (page_num == page) {\n $(\"#page\" + i).css({\"background\": \"#FFFFFF\", \"color\": \"rgba(0, 104, 255, 1)\"}); \n }\n else {\n $(\"#page\" + i).css({\"background\": \"rgba(0, 104, 255, 1)\", \"color\": \"#FFFFFF\"});\n }\n i++;\n } \n } \n );\n //getting data\n}", "if (nextState.pageSize === rowCount && nextState.currentPage === 1) {\n return null;\n }", "setPageAmount() {\n const dataLength = this.state.content.length;\n const amountThumbnails = THUMBNAILAMOUNT;\n let numberOfPages = 0;\n\n if (dataLength % amountThumbnails === 0) {\n numberOfPages = dataLength / amountThumbnails;\n } else {\n numberOfPages = ((dataLength - (dataLength % amountThumbnails)) / amountThumbnails) + 1;\n }\n pageAmount = numberOfPages;\n }", "getLimitAndOffsetByPageAndContentPerPage() {\n const offset = this.currentPage() * this.perPage() - this.perPage();\n const limit = this.perPage();\n\n return {\n offset,\n limit,\n };\n }", "function nextPage(){\n \n if(currentPage < numberOfPages()){\n currentPage++;\n loadTable(currentPage);\n \n }\n}", "_paginate (entities, page, pageSize) {\n\t\treturn entities.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize)\n\t}", "function TableIndex({ data, updateMyData, skipReset }) {\n // Use the state and functions returned from useTable to build your UI\n const {\n page,\n headerGroups,\n canPreviousPage,\n canNextPage,\n pageOptions,\n pageCount,\n gotoPage,\n nextPage,\n previousPage,\n setPageSize,\n preGlobalFilteredRows,\n setFilter,\n setGlobalFilter,\n allColumns,\n getTableProps,\n getTableBodyProps,\n prepareRow,\n getToggleHideAllColumnsProps,\n state: {\n pageIndex,\n pageSize,\n sortBy,\n groupBy,\n expanded,\n filters,\n selectedRowIds,\n globalFilter,\n },\n } = useTable(\n {\n data,\n columns,\n defaultColumn,\n filterTypes,\n updateMyData, // isn't part of the API (available on the instance), we can call this function from our cell renderer\n autoResetPage: !skipReset,\n autoResetSelectedRows: !skipReset,\n disableMultiSort: true,\n },\n useFilters,\n useGlobalFilter,\n useGroupBy,\n useSortBy,\n useExpanded,\n usePagination,\n useRowSelect,\n // Here we will use a plugin to add our selection column\n useCheckboxSelection\n );\n\n // Render the UI for your table\n return (\n <div>\n <TableShowHideColumns\n allColumns={allColumns}\n getToggleHideAllColumnsProps={getToggleHideAllColumnsProps}\n />\n <TableSearchInput\n preGlobalFilteredRows={preGlobalFilteredRows}\n globalFilter={globalFilter}\n setGlobalFilter={setGlobalFilter}\n />\n\n <TableAppliedFilters filters={filters} setFilter={setFilter} />\n\n <Table\n getTableProps={getTableProps}\n headerGroups={headerGroups}\n page={page}\n prepareRow={prepareRow}\n getTableBodyProps={getTableBodyProps}\n />\n\n <TablePagination\n pageSize={pageSize}\n setPageSize={setPageSize}\n pageIndex={pageIndex}\n pageCount={pageCount}\n pageOptions={pageOptions}\n nextPage={nextPage}\n previousPage={previousPage}\n canNextPage={canNextPage}\n canPreviousPage={canPreviousPage}\n gotoPage={gotoPage}\n />\n\n <TableDebugVals\n pageIndex={pageIndex}\n pageSize={pageSize}\n pageCount={pageCount}\n canNextPage={canNextPage}\n canPreviousPage={canPreviousPage}\n sortBy={sortBy}\n groupBy={groupBy}\n expanded={expanded}\n filters={filters}\n selectedRowIds={selectedRowIds}\n />\n </div>\n );\n}", "function tablePaging() {\n\n $('#loadingModal').modal('show');\n\n GetCustomers(function(myObject) {\n\n j2HTML.Table({\n Data: myObject,\n TableID: '#tbTest',\n AppendTo: '#divTable',\n }).Paging({\n\n TableID: '#tbTest',\n PaginationAppendTo: '#divPagination',\n RowsPerPage: 5,\n ShowPages: 8,\n StartPage: 7\n\n });\n\n setTableMenu('Paging');\n $('#loadingModal').modal('hide');\n\n });\n}", "get pagination () {\n const { dataSource, activeSlide } = this.state;\n return (\n <Pagination\n dotsLength={dataSource.length}\n activeDotIndex={activeSlide}\n containerStyle={{ backgroundColor: 'transparent' ,marginTop: (Metrics.HEIGHT * 0.03), paddingTop: (Metrics.HEIGHT * 0.0)}}\n dotStyle={{\n width: 10,\n height: 10,\n borderRadius: 5,\n marginHorizontal: 8,\n backgroundColor: 'rgba(255, 255, 255, 0.92)'\n }}\n inactiveDotStyle={{\n // Define styles for inactive dots here\n }}\n inactiveDotOpacity={0.4}\n inactiveDotScale={0.6}\n />\n );\n}", "function getAllActivityLogTable() {\n\n vm.allActivityLogsPagination.length = 0;\n\n vm.tableParams = new NgTableParams({\n // initial value for page\n \n page: 1, // initial page\n count: 10, // number of records in page,\n filter: {\n \"description\": '',\n \"fromDate\": new Date(vm.preMonth.setHours(0,0,0,0)), \n \"toDate\": new Date(new Date().setHours(23,59,59,59))\n } \n },\n {\n counts: [],\n total: vm.allActivityLogsPagination.length,\n getData : function( $defer, params){\n\n vm.paginationLoaded = false;\n\n var tableParams = {\n pageNumber: params.page(),\n pageSize: params.count(),\n filterFieldParams: [\n {\n \"fieldKey\":\"description\",\n \"fieldValue\": params.filter().description\n }\n ],\n filterDateParams: [\n {\n \"fieldKey\":\"fromDate\",\n \"fieldValue\": new Date(params.filter().fromDate.setHours(0,0,0,0))\n },\n {\n \"fieldKey\":\"toDate\",\n \"fieldValue\": new Date(params.filter().toDate.setHours(23,59,59,59))\n }\n ]\n };\n\n ActivityLogService.getAllActivityLogByPagination(tableParams).then(\n function(successResponse){\n\n vm.paginationLoaded = true;\n\n vm.sno = PaginationService.getSno(tableParams);\n vm.allActivityLogsPagination = successResponse.data.activityLogDtos;\n\n params.total(successResponse.data.totalNumberOfRecords);\n\n $defer.resolve(vm.allActivityLogsPagination);\n },\n function(errorResponse){\n\n vm.paginationLoaded = true;\n vm.allActivityLogsPagination.length = 0;\n $defer.resolve(vm.allActivityLogsPagination);\n\n });\n }\n });\n\n }", "function changePage(data,page)\r\n {\r\n var btn_next = document.getElementById(\"btn_next\");\r\n var btn_prev = document.getElementById(\"btn_prev\");\r\n var page_span = document.getElementById(\"page\");\r\n const tableArr = (data)\r\n const tableMain = document.getElementById(\"GridBody\");\r\n showHeaders(data)\r\n \r\n // Validate page\r\n if (page < 1) page = 1;\r\n if (page > numPages()) page = numPages();\r\n \r\n tableMain.innerHTML = \"\";\r\n\r\n for (var i = (page-1) * records_per_page; i < (page * records_per_page) && i < tableArr.length; i++) {\r\n let tableRowEle = '<tr class=\"table-row\">'\r\n tableRowEle += '<td>'+`<input type=\"checkbox\" id=\"check${i}\" value=\"${tableArr[i].primkey}\" class=\"tick\" /><label class=\"sall_check\" for=\"check${i}\">`+'<img src=\"images/check_box_outline_blank-black-18dp.svg\" /></label></th>'\r\n Object.entries(tableArr[i]).slice(1).forEach(entry => {\r\n const [key,value] =entry \r\n tableRowEle += `<td class=\"${key}\">`+value+'</td>'\r\n })\r\n tableRowEle += '</tr>'\r\n tableMain.innerHTML += tableRowEle\r\n }\r\n page_span.innerHTML = page + \"/\" + numPages();\r\n\r\n if (page == 1) {\r\n btn_prev.style.visibility = \"hidden\";\r\n } else {\r\n btn_prev.style.visibility = \"visible\";\r\n }\r\n\r\n if (page == numPages()) {\r\n btn_next.style.visibility = \"hidden\";\r\n } else {\r\n btn_next.style.visibility = \"visible\";\r\n }\r\n }", "function pagination(totalReturn, returnArr){\n const pagesRequired = Math.ceil(totalReturn.totalResults / returnArr.length);\n for (let i = 1; i <= pagesRequired; i++){\n const button = document.createElement(\"button\");\n button.className = \"page__button\";\n button.textContent = i;\n pageButtonContainer.appendChild(button);\n }\n}", "render() {\n return (\n <div className='transaction__container'>\n <Header lcassName='transaction__header' as='h1'>My Transactions</Header>\n <div className='transaction__menu'>\n <Filter\n filterAccountName={this.filterAccountName.bind(this)}\n filterTransaction={this.filterTransaction.bind(this)}\n />\n </div>\n\n <div className='transaction__main'>\n <Table celled>\n <Table.Header>\n <Table.Row>\n <Table.HeaderCell>Account No.</Table.HeaderCell>\n <Table.HeaderCell>Account Name</Table.HeaderCell>\n <Table.HeaderCell>Currency</Table.HeaderCell>\n <Table.HeaderCell>Amount</Table.HeaderCell>\n <Table.HeaderCell>Transaction Type</Table.HeaderCell>\n </Table.Row>\n </Table.Header>\n \n <Table.Body>\n {this.renderTransactions()}\n </Table.Body>\n \n <Table.Footer>\n <Table.Row>\n <Table.HeaderCell colSpan='5'>\n <Menu floated='right' pagination>\n <Menu.Item as='a' icon onClick={this.showPreviousPage}>\n <Icon name='chevron left' />\n </Menu.Item>\n <Menu.Item as='a'>{this.state.page}</Menu.Item>\n <Menu.Item as='a' icon onClick={this.showNextPage}>\n <Icon name='chevron right' />\n </Menu.Item>\n </Menu>\n </Table.HeaderCell>\n </Table.Row>\n </Table.Footer>\n </Table> \n </div>\n </div>\n ); \n }", "_pageData(data) {\n if (!this.paginator) {\n return data;\n }\n const startIndex = this.paginator.pageIndex * this.paginator.pageSize;\n return data.slice(startIndex, startIndex + this.paginator.pageSize);\n }", "getPublishsByCampaignIdPagination(data){\nreturn this.post(Config.API_URL + Constant.PUBLISH_GETPUBLISHSBYCAMPAIGNIDPAGINATION, data);\n}", "function numPages()\n{\n return Math.ceil(objJson.length / records_per_page);\n}", "static async getPaginated(page) {\n const queryLimit = 9;\n const skipMultiplier = page === 1 ? 0 : page - 1;\n const skip = skipMultiplier > 0 ? queryLimit * skipMultiplier : 0;\n\n const variables = { skip, limit: queryLimit };\n\n const query = `query GetPaginatedSlugs($limit: Int!, $skip: Int!) {\n blogPostCollection(limit: $limit, skip: $skip, order: date_DESC) {\n total\n items {\n sys {\n id\n }\n date\n updatedDate\n title\n slug\n excerpt\n externalUrl\n ${GraphQLStringBlocks.topicsCollection()}\n ${GraphQLStringBlocks.authorFull()}\n body {\n json\n links {\n entries {\n inline {\n sys {\n id\n }\n __typename\n ... on BlogPost {\n title\n slug\n excerpt\n ${GraphQLStringBlocks.featuredImage()}\n }\n }\n block {\n sys {\n id\n }\n __typename\n ${GraphQLStringBlocks.videoEmbed()}\n ${GraphQLStringBlocks.codeBlock()}\n ${GraphQLStringBlocks.blogPost()}\n }\n }\n ${GraphQLStringBlocks.linkedAssets()}\n }\n }\n }\n }\n }`;\n\n const response = await this.callContentful(query, variables);\n\n const { total } = response.data.blogPostCollection;\n const posts = response.data.blogPostCollection.items\n ? response.data.blogPostCollection.items\n : [];\n\n return { posts, total };\n }" ]
[ "0.6724144", "0.6720494", "0.6720114", "0.66668576", "0.651038", "0.64357287", "0.6402743", "0.6393985", "0.63901496", "0.6385102", "0.63843", "0.63843", "0.6376642", "0.637434", "0.63591236", "0.63526535", "0.63466215", "0.63443977", "0.63443035", "0.6293342", "0.62765706", "0.62567204", "0.6233998", "0.6223543", "0.6222972", "0.62222284", "0.62212324", "0.62147665", "0.6212191", "0.61572134", "0.6149128", "0.61175203", "0.6108138", "0.6108056", "0.6101416", "0.61011183", "0.6097058", "0.6091851", "0.60903126", "0.6085864", "0.60635716", "0.6056344", "0.60374403", "0.6002632", "0.5985517", "0.59824634", "0.5980161", "0.5975075", "0.5969943", "0.5959559", "0.5958199", "0.5956611", "0.59477586", "0.59438187", "0.5939241", "0.59365666", "0.59295887", "0.59072465", "0.59058857", "0.590095", "0.5896725", "0.5890317", "0.58887374", "0.58839", "0.58815134", "0.5880179", "0.5870043", "0.58700347", "0.5865966", "0.58651096", "0.5863548", "0.5860144", "0.5849154", "0.5825804", "0.5824811", "0.58239055", "0.58176094", "0.5813302", "0.5811068", "0.5805865", "0.57933486", "0.5787493", "0.5787438", "0.5786316", "0.57777005", "0.57664114", "0.5764968", "0.57638514", "0.57518166", "0.574584", "0.5745093", "0.57339036", "0.5733712", "0.5713816", "0.5711879", "0.57016784", "0.57008386", "0.57004434", "0.5697012", "0.5695231" ]
0.61404717
31
Search complex merchant table
filterRows(searchString, columnsToSearch) { const lowercaseSearchString = searchString || ''; const objKeyLength = columnsToSearch.length; this.setState((prevState) => { const newRows = { filteredRows: prevState.totalRows.filter((row) => { for (let i = 0; i < objKeyLength; i += 1) { const key = columnsToSearch[i]; if (row[key] && row[key].toLowerCase && row[key].toLowerCase().indexOf(lowercaseSearchString) > -1) { return row[key]; } } return false; }), }; return newRows; }, () => { /* Nested setState is no bueno, but it's the only way to directly capture the newly set filteredRows value in this function in a live search */ this.setState({ filteredPageCount: Math.ceil(this.state.filteredRows.length / this.state.perPage), filteredRowsPaged: this.state.filteredRows.slice(0, this.state.perPage), }, () => { this.globalSelectorGroup(this.state.filteredRowsPaged); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async index(ctx) {\n const { request, response } = ctx\n\n try {\n const q = await GetRequestQuery(ctx)\n const redisKey = `DownPayment_${q.redisKey}`\n let cached = await RedisHelper.get(redisKey)\n\n if (cached && !q.search) {\n console.log(redisKey)\n return cached\n }\n\n const data = await DownPayment.query()\n .with(\"target.study.university\")\n .with(\"target.study.studyName\")\n .with(\"verifier\", builder => {\n builder.select(\"id\", \"name\")\n })\n .where(function() {\n if (q.search && q.search != \"\") {\n // console.log(\"Search :\" + search)\n // this.where(\"dp\", \"like\", `%${search}%`)\n this.where(\"name\", \"like\", `%${q.search}%`)\n this.orWhere(\"phone\", \"like\", `%${q.search}%`)\n // this.orWhere(\"kelas\", \"like\", `%${search}%`)\n this.orWhere(\"produk\", \"like\", `%${q.search}%`)\n // this.orWhere(\"harga\", \"like\", `%${search}%`)\n this.orWhereHas(\"target\", builder => {\n builder.where(\"code\", \"like\", `%${q.search}%`)\n // builder.orWhereHas(\"study\", builder2 => {\n // builder2.whereHas(\"university\", builder3 => {\n // builder3.where(\"name\", \"like\", `%${search}%`)\n // })\n // builder2.orWhereHas(\"studyName\", builder3 => {\n // builder3.where(\"name\", \"like\", `%${search}%`)\n // })\n // })\n })\n }\n\n if (q.marketing_target_id && q.marketing_target_id != \"\") {\n this.where(\"marketing_target_id\", q.marketing_target_id)\n }\n\n if (q.search_by && q.search_query) {\n this.where(q.search_by, q.search_query)\n }\n\n if (q.between_date && q.start_date && q.end_date) {\n this.whereBetween(q.between_date, [q.start_date, q.end_date])\n }\n })\n .orderBy(q.sort_by, q.sort_mode)\n .paginate(q.page, q.limit)\n\n let parsed = ResponseParser.apiCollection(data.toJSON())\n\n if (!q.search || q.search == \"\") {\n await RedisHelper.set(redisKey, parsed)\n }\n return response.status(200).send(parsed)\n } catch (e) {\n ErrorLog(request, e)\n return response.status(500).send(ResponseParser.unknownError())\n }\n }", "_retrieveSearchData(data: List<Object>, fields: List<string>, needle: string) {\n // Retrieving all records that have the search string\n return data.filter(row => {\n // Searching for search string in all fields\n for (let f = 0; f < fields.size; f++) {\n // Asserting current field has search string, if yes return true and if no \n // continue searching\n if (row[fields.get(f)].toString().toLowerCase().indexOf(needle) > -1) {\n return true;\n }\n }\n\n // Declaring search string was not found in any field\n return false;\n });\n }", "findByLinkKey(payload, err, success) {\n tables[table].find({\n where: {\n maumasiFyKey: payload.maumasiFyKey,\n },\n include: [{\n all: true,\n nested: true,\n }],\n }).then(success).catch(err);\n\n log(null, __filename,\n 'Model CRUD',\n 'Search by link key');\n }", "getResults(field, value, dataStore) {\n if (!this.fields.includes(field)) {\n throw \"Field not found\";\n }\n const results = this.data.filter(item => {\n //return item[field] == value;\n return this.query(item[field], value);\n });\n const relatedResults = this.getRelatedRecords(results, dataStore); \n return relatedResults;\n }", "search() {\n return db.many(`\n SELECT *\n FROM parks p\n WHERE p.borough LIKE '%ook%'\n `);\n }", "search() {\n // If the search base is the id, just load the right card.\n if (this.queryData['searchBase'] == 'id' && this.queryData['search']) {\n this.selectItem(this.queryData['search']);\n } else {\n this.loadData();\n }\n }", "static async search(name) {\n const results = await db.query(\n `SELECT id, \n first_name AS \"firstName\", \n middle_name AS \"middleName\",\n last_name AS \"lastName\", \n phone, \n notes \n FROM customers\n WHERE UPPER(first_name) = $1 OR UPPER(middle_name) = $1 OR UPPER(last_name) = $1`,\n [name.toUpperCase()]\n );\n return results.rows.map(c => new Customer(c));\n }", "function searchData() {\r\n var searchKeyword = document.getElementById(\"navSearch\").value.toUpperCase();\r\n console.log(searchKeyword);\r\n var searchResult = productData.filter((searchItem) => searchItem.product.toUpperCase().includes(searchKeyword));\r\n console.log(searchResult);\r\n cards(searchResult);\r\n}", "searchQuery(value) {\n let result = this.tableData;\n if (value !== '') {\n result = this.fuseSearch.search(this.searchQuery);\n }\n this.searchedData = result;\n }", "function handleSearch() {\n let searchTerm = $('#search-box').val().toLowerCase();\n\n accountSummaries.get().then(function(summaries) {\n let results = [];\n if (searchTerm) {\n for (let i = 0; i < summaries.all().length; i++) {\n let account = summaries.all()[i];\n if (!account.webProperties) {\n continue;\n }\n for (let j = 0; j < account.webProperties.length; j++) {\n let property = account.webProperties[j];\n if (!property.profiles) {\n continue;\n }\n for (let k = 0; k < property.profiles.length; k++) {\n let view = property.profiles[k];\n let tableId = 'ga:' + view.id;\n let match = tableId.indexOf(searchTerm) > -1 ||\n view.id.indexOf(searchTerm) > -1 ||\n view.name.toLowerCase().indexOf(searchTerm) > -1 ||\n property.id.toLowerCase().indexOf(searchTerm) > -1 ||\n property.name.toLowerCase().indexOf(searchTerm) > -1 ||\n account.id.indexOf(searchTerm) > -1 ||\n account.name.toLowerCase().indexOf(searchTerm) > -1;\n if (match) {\n results.push({account: account, property: property, view: view});\n }\n }\n }\n }\n }\n updateResults(results, $('#search-box').val());\n });\n}", "filteredRows() {\n return this.rows.filter(row => {\n for (let key in row) {\n if (Object.prototype.hasOwnProperty.call(row, key)) {\n const stringValue = row[key].toString();\n if (stringValue.toLowerCase().match(this.search.toLowerCase())) return true;\n }\n }\n return false;\n });\n }", "function inventorySearch() {\n var query = \"SELECT * FROM bamazon.products;\";\n connection.query(query, function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.table(res[i]);\n }\n idSearch();\n });\n}", "function searchData(){\n var dd = dList\n var q = document.getElementById('filter').value;\n var data = dd.filter(function (thisData) {\n return thisData.name.toLowerCase().includes(q) ||\n thisData.rotation_period.includes(q) ||\n thisData.orbital_period.includes(q) || \n thisData.diameter.includes(q) || \n thisData.climate.includes(q) ||\n thisData.gravity.includes(q) || \n thisData.terrain.includes(q) || \n thisData.surface_water.includes (q) ||\n thisData.population.includes(q)\n });\n showData(data); // mengirim data ke function showData\n}", "handleSearch(term) {\n let contactsFiltered = this.state.contacts.filter( (contact) => Object.values(contact).some( (blob) => blob.includes(term)));\n this.setState({\n contactsFiltered: contactsFiltered\n })\n }", "productSearch() {\n let query = this.addableProduct.product.name;\n delete this.addableProduct.product.id; // Such that a user cannot input a name for a specific product_id\n\n if (query === undefined || query.length <= 1) {\n this.searchProductsList = [];\n } else {\n this.searchProductsList = this.unreceivedProducts.filter( item => {\n return (item.product.name.match(new RegExp(query, 'i')) !== null) ||\n (item.product.article.match(new RegExp(query, 'i')) !== null);\n })\n }\n }", "function searchByChain()\n{\n\t\n\tvar searchChain = $(\"#searchChain\").val();\n\tif(searchChain =='' || searchChain == null)\n\t{\n\t\tsearchChain = undefined;\n\t}\n\tgetChainList(searchChain,0,0,'asc');\n}", "paymentFilter(type) {\n const { searchResults } = this.state;\n\n const filteredResults = searchResults.filter(hit => {\n return hit.payment_options.indexOf(type) !== -1;\n });\n\n this.setState({\n searchResults: filteredResults,\n currentResults: filteredResults.slice(0, 5),\n count: filteredResults.length,\n currentPayment: type\n });\n }", "function BuildDealerNameSearchArray()\n{\n dealerNameSearchArray = [];\n\n for (var i in Dealers)\n {\n var dealer = Dealers[i];\n\n if (filterBy == 'N' && dealer.NVS != null)\n {\n var dealername = { \"name\": dealer.NVS.Name, \"value\": dealer.Id, \"label\": dealer.NVS.Name + ', ' + dealer.NVS.City + ', ' + dealer.NVS.State };\n\n dealerNameSearchArray.push(dealername);\n }\n\n if (filterBy == 'M' && dealer.NVS != null && dealer.MCertified == true)\n {\n var dealername = { \"name\": dealer.NVS.Name, \"value\": dealer.Id, \"label\": dealer.NVS.Name + ', ' + dealer.NVS.City + ', ' + dealer.NVS.State };\n\n dealerNameSearchArray.push(dealername);\n }\n\n if (filterBy == 'C' && dealer.CPO != null)\n {\n var dealername = { \"name\": dealer.CPO.Name, \"value\": dealer.Id, \"label\": dealer.CPO.Name + ', ' + dealer.CPO.City + ', ' + dealer.CPO.State };\n var found = false;\n\n for (var index in dealerNameSearchArray)\n {\n if (dealerNameSearchArray[index].name == dealername.name)\n {\n found = true;\n }\n }\n\n if (!found)\n {\n dealerNameSearchArray.push(dealername);\n }\n }\n\n if (filterBy == 'S' && dealer.CBS != null)\n {\n var dealername = { \"name\": dealer.CBS.Name, \"value\": dealer.Id, \"label\": dealer.CBS.Name + ', ' + dealer.CBS.City + ', ' + dealer.CBS.State };\n var found = false;\n\n for (var index in dealerNameSearchArray)\n {\n if (dealerNameSearchArray[index].name == dealername.name)\n {\n found = true;\n }\n }\n\n if (!found)\n {\n dealerNameSearchArray.push(dealername);\n }\n }\n\n if (filterBy == 'E' && dealer.CCRC != null)\n {\n var dealername = { \"name\": dealer.CCRC.Name, \"value\": dealer.Id, \"label\": dealer.CCRC.Name + ', ' + dealer.CCRC.City + ', ' + dealer.CCRC.State };\n var found = false;\n\n for (var index in dealerNameSearchArray)\n {\n if (dealerNameSearchArray[index].name == dealername.name)\n {\n found = true;\n }\n }\n\n if (!found)\n {\n dealerNameSearchArray.push(dealername);\n }\n }\n }\n}", "searchByProfessions( professionSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n \n for( let indx=0; indx<list.length; ++indx ) {\n for( let indxProf=0; indxProf<list[indx].professions.length; ++indxProf ) {\n if( list[indx].professions[indxProf].toLowerCase() === professionSearch.toLowerCase() ) {\n itemId = list[indx].id;\n break;\n } \n }\n }\n console.log('searchByProfessions :',itemId);\n\n return itemId;\n }", "function inputSearch(dataSet, filters) {\r\n const filterKeys = Object.keys(filters);\r\n //filter only elements passing all criteria\r\n return dataSet.filter((sighting) => {\r\n return filterKeys.every(key => {\r\n return filters[key].includes(sighting[key]);\r\n })\r\n })\r\n }", "function search(parameter) {\n let currentTableData = [];\n\n initialData.forEach(item => {\n if (item[parameter].toLowerCase().indexOf($(this).val().toLowerCase()) !== -1 && !currentTableData.includes(item)) {\n currentTableData.push(item);\n }\n });\n\n if (currentTableData.length === 0) {\n table.fnClearTable();\n table.fnDraw();\n return;\n }\n\n table.fnClearTable();\n table.fnAddData(currentTableData);\n table.fnDraw();\n}", "function build_query(table){\n\tvar where = {};\n\tif (table == 'projects') {\n\t\t// create needed empty object(s) and array(s)\n\t\tif (Object.keys(this.all_groups).length){\n\t\t\twhere['groups'] = {\n\t\t\t\t'id' : {\n\t\t\t\t\t'$in' : []\n\t\t\t\t}\n\t\t\t};\n\t\t\t// add groups to where-object\n\t\t\t$.each(this.all_groups, function(key, val){\n\t\t\t\twhere['groups']['id']['$in'].push(key);\n\t\t\t});\n\t\t}\n\t}\n\tif (table == 'samples') {\n\t\tif (this.projects.length){\n\t\t\t// create needed empty object(s) and array(s)\n\t\t\twhere['project'] = {\n\t\t\t\t'id' : {\n\t\t\t\t\t'$in' : []\n\t\t\t\t}\n\t\t\t};\n\t\t\t$.each(this.projects, function(key, val){\n\t\t\t\twhere['project']['id']['$in'].push(val);\n\t\t\t});\n\t\t}\n\t}\n\tif (table == 'variants' || table == 'only_variants') {\n\t\tif (this.samples.length){\n\t\t\t// create needed empty object(s) and array(s)\n\t\t\twhere['sa'] = {\n\t\t\t\t'id' : {\n\t\t\t\t\t'$in' : []\n\t\t\t\t}\n\t\t\t};\n\t\t\t// add selected samples to where-array\n\t\t\t$.each(this.samples, function(key, val){\n\t\t\t\twhere['sa']['id']['$in'].push(val);\n\t\t\t});\n\t\t}\n\t\t// add required samples to where-array\n\t\tif (this.require.length){\n\t\t\twhere['sa.id'] = {\n\t\t\t\t'$all' : []\n\t\t\t};\n\t\t\t$.each(this.require, function(key, val){\n\t\t\t\t\t\twhere['sa.id']['$all'].push(val);\n\t\t\t});\n\t\t}\n\t\tif (this.exclude.length){\n\t\t\tif (where.hasOwnProperty(\"sa.id\")){\n\t\t\t\twhere['sa.id']['$nin'] = [];\n\t\t\t} else {\n\t\t\t\twhere['sa.id'] = {\n\t\t\t\t\t'$nin' : []\n\t\t\t\t};\n\t\t\t}\n\t\t\t// add excluded samples to where-array\n\t\t\t$.each(this.exclude, function(key, val){\n\t\t\t\t\t\twhere['sa.id']['$nin'].push(val);\n\t\t\t});\n\t\t}\n\t}\n\n\t// put where-array in query\n\treturn (where);\n}", "_searchForUser(query){\n this.setState({searchQuery: query});\n //console.log('parent query is ' + this.state.searchQuery);\n\n //search for ids containing query\n let results = this._blockstackSearch(query);\n \n //set searchResults in state\n this.setState({searchResults: results,});\n }", "search(req, res) {\n let attacker_king = req.query.king ? req.query.king : '',\n battle_name = req.query.name ? req.query.name : '',\n location = req.query.location ? req.query.location : '',\n battle_type = req.query.type ? req.query.type : '';\n let condition = {};\n condition = {\n $and: [\n {\"attacker_king\": attacker_king},\n {\"battle_type\": battle_type},\n {\"location\": location}\n ]\n }\n \n model.battle.searchBattle(condition, (err, result) => {\n if(err) {\n res.status(500).send({error: constant.ERROR_OCCURED})\n } else {\n res.status(200).json(result);\n }\n });\n }", "function searchEngine(source,criteria1,criteria2,criteria3){\n //return all residence in source if user enter all\n if (criteria1.toLowerCase()==\"all\") {\n var all = new Array;\n for (var i = 0; i < source.length; i++) {\n all.push(source[i].residenceID);\n }\n return all;\n }\n var ignoreKey = [\"jalan\", \"Jalan\", \"Bandar\", \"bandar\", \"Sungai\", \"sungai\", \"Kuala\", \"kuala\"];\n var searchTable = [{index:null, location:\"\"}];\n\n for(var i=0; i<source.length; i++){\n\n searchTable.push({key:source[i].residenceID, residenceID:source[i].residenceID});\n var splitedAddress2 = new Array;\n var splitedAddress = source[i].address.split(\", \");\n for(var x=0; x<splitedAddress.length; x++){\n searchTable.push({key:splitedAddress[x], residenceID:source[i].residenceID});\n\n splitedAddress2 = splitedAddress[x].split(\" \");\n for(var y=0; y<splitedAddress2.length; y++){\n if(!ignoreKey.includes(splitedAddress2[y])){\n searchTable.push({key:splitedAddress2[y], residenceID:source[i].residenceID});\n }\n }\n }\n //var splitedResidenceName2 = new Array;\n var splitedResidenceName = source[i].residenceName.split(\", \");\n for(var x=0; x<splitedResidenceName.length; x++){\n searchTable.push({key:splitedResidenceName[x], residenceID:source[i].residenceID});\n\n splitedResidenceName2 = splitedResidenceName[x].split(\" \");\n for(var y=0; y<splitedResidenceName2.length; y++){\n if(!ignoreKey.includes(splitedResidenceName2[y])){\n searchTable.push({key:splitedResidenceName2[y], residenceID:source[i].residenceID});\n }\n }\n }\n }\n console.log(searchTable);\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n var searchCriteria;\n searchCriteria = [criteria1,criteria2,criteria3]; //<--enter search criteria here!!!\n\n var result = new Array;\n\n for (var x = 0; x < searchCriteria.length; x++) {\n for(var i=1; i<searchTable.length; i++){\n if(searchTable[i].key.toLowerCase() == searchCriteria[x].toLowerCase()){\n result.push(searchTable[i]);\n }\n }\n }\n console.log(result);\n if(result.length>0){\n var refinedResult = [result[0].residenceID];\n var lastItem = result[0].residenceID;\n for (var i = 0; i < result.length; i++) {\n if(result[i].residenceID != lastItem){\n lastItem = result[i].residenceID;\n refinedResult.push(result[i].residenceID);\n }\n }\n //console.log(\"SEARCH ENGINE - result[\" + result.length + \"]: \" + result);;\n //console.log(\"SEARCH ENGINE - refined result: \" +refinedResult);\n console.log(refinedResult);\n return(refinedResult);\n }\n console.log(\"SEARCH ENGINE - result[\" + result.length + \"]: empty\");\n return(\"empty\");\n}", "function searchByProduceName(searchTerm) {\n knexInstance\n .select('product_id', 'name', 'price', 'category')\n .from('amazong_products')\n .where('name', 'ILIKE', `%${searchTerm}%`)\n .then(result => {\n console.log(result)\n });\n}", "function search() {\n __globspace._gly_searchadvanced.removeAll();\n _gly_ubigeo.removeAll();\n let sql = '1=1', \n idtable='#tbl_searchadvanced', \n isexportable=true, \n nquery=__query.length;\n\n // formación del sql \n for (let i = 0; i < nquery; i++){\n let item = __query[i],\n filter = item.filter.toUpperCase(),\n typedata=item.typedata,\n auxsql='';\n\n switch (typedata) {\n case 'double': case 'small-integer': case 'integer': case 'single':\n auxsql = ` ${item.fieldname} ${item.condition} \"${filter}\"`;\n break;\n case 'date':\n console.log(filter);\n let fi = moment(filter).add(5, 'hours').format('YYYY-MM-DD HH:mm:ss'); //consulta al servicio en hora utc (+5);\n let ff = moment(filter).add(29, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n \n if(item.condition == '=' || item.condition == 'contiene'){\n auxsql = `(${ item.fieldname } BETWEEN timestamp '${ fi }' AND timestamp '${ ff }')`;\n }else{\n if(item.condition == '<='){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`; \n }else if(item.condition == '>='){\n fi = moment(filter).add(5, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }else if(item.condition == '>'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`;\n }else if(item.condition == '<'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }\n }\n break;\n default:\n auxsql = `Upper(${item.fieldname}) ${item.condition} '${filter}'`;\n break;\n }\n\n if (item.option == '--') {\n if(typedata == 'date'){\n sql = auxsql;\n }else{\n item.condition == 'contiene' ? sql += ` and Upper(${item.fieldname}) like '%${filter}%'` : sql = auxsql;\n }\n } else {\n if(typedata == 'date'){\n sql += ` ${item.option} ${auxsql}`;\n }else{\n item .condition == 'contiene' ? sql += ` ${item.option} Upper(${item.fieldname}) like '%${filter}%'` : sql += ` ${item.option} ${auxsql}`;\n }\n }\n }\n \n __globspace.currentview.graphics.remove(_gra_ubigeo);\n\n // si se a selecionado un item de ubigeo primero obtengo la geometria del ubigeo y luego la consulta propia\n if(__url_ubigeo!=''){\n let _queryt = new QueryTask({url:__url_ubigeo}),\n _qparams = new Query(); \n _qparams.returnGeometry = true;\n _qparams.where = __sql_ubigeo;\n\n _queryt.execute(_qparams).then(function(response){\n \n __ubigeogeometry=response.features[0].geometry;\n\n let _queryt2 = new QueryTask({url:__url_query}),\n _qparams2 = new Query(); \n\n _qparams2.where = sql;\n _qparams2.outFields = [\"*\"];\n _qparams2.geometry = __ubigeogeometry;\n _qparams2.spatialRelationship = \"intersects\";\n _qparams2.returnGeometry = true;\n\n _queryt2.execute(_qparams2).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\",'', true)\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n // Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n Helper.renderGraphic(response, __globspace._gly_searchadvanced);\n\n\n if(Object.keys(_gra_ubigeo).length ==0){\n _gra_ubigeo = new Graphic({\n geometry: __ubigeogeometry, \n symbol:_symbol,\n });\n }\n _gra_ubigeo.geometry=__ubigeogeometry;\n __globspace.currentview.graphics.add(_gra_ubigeo);\n __globspace.currentview.when(function () {\n __globspace.currentview.goTo({\n target: __ubigeogeometry\n });\n });\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }else{\n let _queryt = new QueryTask({url:__url_query}),\n _qparams = new Query();\n\n _qparams.where = sql;\n _qparams.outFields = [\"*\"];\n _qparams.returnGeometry = true;\n\n _queryt.execute(_qparams).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\", '', true);\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\");\n console.log(error);\n })\n }\n }", "searchQuery(state, payload) {\n let filtered = [];\n if (payload === \"\") alert(\"Enter Valid Warehouse Name\");\n else {\n filtered = state.data.filter((item) => {\n return item.name.toLowerCase().includes(payload.toLowerCase());\n });\n state.warehouses = filtered;\n }\n }", "function search() {\n $scope.disAdvance = 'none';\n //if ($scope.searchText != '') {\n apiService.get('api/Customer/search?key=' + $scope.searchText, null, function (result) {\n $scope.listCustomer1 = result.data;\n }, function () {\n console.log('load items failed');\n });\n // }\n // else {\n // $scope.listCustomer1 = [];\n // $scope.shoppingCart[$scope.tab].customer = {};\n // }\n }", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "function consultaCartorios(){\n $(\"#table-search\").on(\"keyup\", function() {\n let value = $(this).val().toLowerCase();\n $(\".table-data tr\").filter(function() {\n $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)\n });\n });\n}", "function searchProduct(value, data) {\r\n let filteredData = [];\r\n for (let i = 0; i < data.length; i++) {\r\n value = value.toLowerCase();\r\n let heading = data[i].headingContent.toLowerCase();\r\n let price = data[i].price.toLowerCase();\r\n if (heading.includes(value) || price.includes(value)) {\r\n filteredData.push(data[i]);\r\n }\r\n }\r\n return filteredData;\r\n}", "function searchProduct(searchValue) {\r\n let searchedProducts = products.filter(function(product,index){\r\n let searchString = \r\n product.name +\"\"+ product.color +\"\"+ product.description;\r\n\r\n return searchString.toUpperCase().indexOf(searchValue.toUpperCase()) != -1;\r\n });\r\n\r\n displayProducts(searchedProducts);\r\n\r\n}", "function searchContact() {\n let searchVal = document.getElementById('txtFilter').value.toLowerCase();\n subADDRESSES = [];\n\n for (i=0; i<ADDRESSES.length; i++) {\n\n let name = ADDRESSES[i].name.toLowerCase();\n let surname = ADDRESSES[i].surname.toLowerCase();\n let phone = ADDRESSES[i].phone.toLowerCase();\n let address = ADDRESSES[i].address.toLowerCase();\n\n if (name.includes(searchVal) || surname.includes(searchVal) ||\n phone.includes(searchVal) || address.includes(searchVal)) {\n subADDRESSES.push(ADDRESSES[i]);\n }\n\n };\n displayTbl(subADDRESSES);\n}", "function searchByTerm(searchTerm){\n knexInstance\n .select('*')\n .from('shopping_list')\n .where('name', 'ILIKE', `%${searchTerm}%`)\n .then(result => {\n console.log('Drill 1:', result)\n })\n}", "getProductsBasedOnSearch(searchText) {\n return products().then((productsCollection) => {//$text: { $search: searchText }\n return productsCollection.find( {$text: { $search: searchText }} ).toArray().then((allUserProducts)=>{\n if (!allUserProducts) Promise.reject(\"User Products not found\");\n return allUserProducts;\n }).catch((e) => {\n console.log(\"Error while searching for products:\", e);\n });\n });\n }", "function manufacturersQuerySearch() {\n var tracker = $q.defer();\n var results = (vm.vehicle.manuf ? vm.manufacturers.filter(createFilterForManufacturers(vm.vehicle.manuf)) : vm.manufacturers);\n\n if (results.length > 0) {\n return results;\n }\n\n amCustomers.getManufacturers().then(allotManufacturers).catch(noManufacturers);\n return tracker.promise;\n\n function allotManufacturers(res) {\n vm.manufacturers = res;\n results = (vm.vehicle.manuf ? vm.manufacturers.filter(createFilterForManufacturers(vm.vehicle.manuf)) : vm.manufacturers);\n tracker.resolve(results);\n }\n\n function noManufacturers(error) {\n results = [];\n tracker.resolve(results);\n }\n }", "onSearchChange(searchText, colInfos, multiColumnSearch) {\n const currentIndex = (this.state.currentPage - 1) * this.state.sizePerPage;\n const text = searchText.trim();\n if (text === '') {\n this.setState({\n data: this.props.targets.slice(currentIndex, currentIndex + this.state.sizePerPage),\n });\n return;\n }\n\n let searchTextArray = [];\n if (multiColumnSearch) {\n searchTextArray = text.split(' ');\n } else {\n searchTextArray.push(text);\n }\n\n const result = this.props.targets.filter((product) => {\n const keys = Object.keys(product);\n let valid = false;\n for (let i = 0, keysLength = keys.length; i < keysLength; i++) {\n const key = keys[i];\n if (colInfos[key] && product[key]) {\n const { format, filterFormatted, formatExtraData, searchable, hidden } = colInfos[key];\n let targetVal = product[key];\n if (!hidden && searchable) {\n if (filterFormatted && format) {\n targetVal = format(targetVal, product, formatExtraData);\n }\n for (let j = 0, textLength = searchTextArray.length; j < textLength; j++) {\n const filterVal = searchTextArray[j].toLowerCase();\n if (targetVal.toString().toLowerCase().indexOf(filterVal) !== -1) {\n valid = true;\n break;\n }\n }\n }\n }\n }\n return valid;\n });\n this.setState(() => ({\n data: result.slice(currentIndex, currentIndex + this.state.sizePerPage),\n totalSize: result.length,\n }));\n }", "function filterCards(cost){\n var flag1 = false;\n if ($scope.searchText != undefined && $scope.searchText != null && $scope.searchText != ''){\n if($scope.searchBy == 'CustomerID'){\n if (cost.customer_ID != null && cost.customer_ID.toLowerCase().indexOf($scope.searchText.toLowerCase()) != -1) {\n flag1 = true;\n }\n }\n else{\n if ((cost.customer_Name != null && cost.customer_Name.toLowerCase().indexOf($scope.searchText.toLowerCase()) != -1) && (cost.customer_DOB != null && cost.customer_DOB.toLowerCase().indexOf($scope.customerDOB.toLowerCase()) != -1)) {\n flag1 = true;\n } \n }\n } \n else{\n flag1 = true;\n }\n return flag1;\n }", "handlerSearch(search){\n const filterContacts = this.state.contacts.filter( contact =>\n contact.name.toLowerCase().includes(search.toLowerCase())\n || contact.email.toLowerCase().includes(search.toLowerCase())\n || contact.website.toLowerCase().includes(search.toLowerCase())\n || checkPhone(contact.phone, search)\n || contact.company.name.toLowerCase().includes(search.toLowerCase())\n || contact.address.country.toLowerCase().includes(search.toLowerCase())\n );\n this.setState({filterContacts});\n }", "function execute_query(data, params){\n //gets list of all searchable fields\n const keys = window.store.filter(a => a.searchable).map(a => a.value);\n //build full index\n const options = {\n keys: keys,\n threshold: window.threshold,\n useExtendedSearch: true,\n findAllMatches: true,\n }\n const fuse = new Fuse(data, options);\n //SEARCH 1: All fields search (q) + fuzzy text search (a)\n //adds q and a together and formats them in the way fuse.js expects them\n const a = params.a ? params.a : [];\n const q = params.q ? params.q : [];\n const or = q.length ? { $or: keys.map((k) => ({[k]:q.join(\" \")}))} : '';\n const search1 = typeof or === \"object\"? {$and: [...a, or ]} : {$and: [...a]};\n //search all fields and text fields\n //If there are search results, maps them to be in the same format as the original data\n //If there are no search params, return all data\n let searchRes = search1.$and.length ? fuse.search(search1).map(a => a.item) : data;\n const n = params.n ? params.n : [];\n if (n.length){\n //iterate through each item in the n field\n for (const param in n){\n //get type of param\n const field = Object.keys(n[param])[0];\n const type = get_field_by_value(\"type\", field);\n //deals with numbers\n if (type === \"num\"){\n //blank Set for storing unique results from among all num searches\n let newSearchResSet = new Set();\n //split number field into array on \",\" (trim whitespace)\n const nums = String(n[param][field]).split(\",\").map(a => a.replace(/\\s/g,''));\n for (const num in nums){\n if (nums[num].includes(\">\")){\n searchRes.filter(a => a[field] >= nums[num].replace(\">\",'')).forEach(a => newSearchResSet.add(a));\n } else if (nums[num].includes(\"<\")){\n searchRes.filter(a => a[field] <= nums[num].replace(\"<\",'')).forEach(a => newSearchResSet.add(a));\n } else {\n //note this works fine for numbers without a hyphen in them too, so there's no seperate case for that\n const numrange = nums[num].split(\"-\");\n searchRes.filter(a => (a[field] >= parseInt(numrange[0]) && (numrange[numrange.length -1].length ? a[field] <= parseInt(numrange[numrange.length - 1]) : true))).forEach(a => newSearchResSet.add(a));\n }\n }\n //passes new set of results back into searchRes variable.\n searchRes = [...newSearchResSet];\n //deals with symbols\n } else if (type === \"sym\"){\n //blank Set for storing unique results form among all sym searches\n let newSearchResSet = new Set();\n ///split symbol field into array on \"|\" (trim whitespace)\n const syms = String(n[param][field]).split(\"|\").map(a => a.replace(/\\s/g,''));\n for (const sym in syms){\n //if sym contains *, remove * and do a search for anything including the letters\n if (syms[sym].includes(\"*\")){\n //removes * from sym and converts it to an array of characters\n const wildsym = syms[sym].replace(\"*\",'').split('');\n //filters only search results that contain the array of charaters in wildsym\n searchRes.filter(a => wildsym.every(val => a[field].split('').includes(val))).forEach(a => newSearchResSet.add(a));\n } else { //if sym doesn't contain *, do a search for anything exactly matching the letters\n //note: sorts both strings to ensure that the order doesn't matter\n searchRes.filter(a => (a[field].split('').sort().join('') === syms[sym].split('').sort().join(''))).forEach(a => newSearchResSet.add(a));\n }\n }\n //passes new set of results back into searchRes variable.\n searchRes = [...newSearchResSet];\n }\n }\n }\n return searchRes;\n}", "function searchResults(results,columns,filterBy,filterColumn){\n\t\t\tvar resultIndex = 0;\n\t\t\tif(filterBy && filterColumn){\n\t\t\t\tresultIndex = filterResults(results,filterBy,filterColumn);\n\t\t\t}\n\n \t\t\tif(results.length > 0){\n \t\t\t\t\n \t\t\t\tvar data = '';\n \t\t\t\tvar internalid;\n\t\t\t\tfor (var k = 0; k < columns.length; k++) {\n\t\t\t\t\tvar columnData = results[resultIndex].getValue({\n\t \t\tname:columns[k]\n\t \t});\n\n \t\tdata = data + columnData + '|';\n \n \tif(columns[k].name === 'internalid'){\n\t \t\tlog.debug({\n\t\t\t title: 'Found internalid',\n\t\t\t details: columnData\n\t\t\t \t});\n\t\t\t\t\t\tinternalid = columnData;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t \tlog.debug({\n\t title: 'Data',\n\t details: data\n\t \t});\n\n\t \treturn internalid; \n\n\t \t\t}\n\n\t \t\telse{\n\t \t\t\treturn false;\n\t \t\t}\n \t\t}", "filterData(bookings,searchKey){\n const result = bookings.filter((post)=>\n post.email.includes(searchKey)\n )\n this.setState({bookings:result})\n}", "search(database, quary) {\n return database\n .filter((elementSearched) => {\n return elementSearched.name.toLowerCase()\n .includes(quary.toLowerCase());\n })\n .map((protester) => protester.name);\n }", "function search(dataSet, searchWord) {\r\n\r\n //if is not email, capitalize name\r\n if ( !searchWord.includes(\"@\") ) {\r\n searchWord = capitalize(searchWord);\r\n }\r\n\r\n for(let row of dataSet) {\r\n for(let item in row) {\r\n let position = row[item].indexOf( searchWord );\r\n\r\n //if nothing is found returns -1\r\n if(position > -1) {\r\n return row;\r\n }\r\n }\r\n }\r\n}", "function mySearchFn() {\n var obj = {};\n obj.firstname = $('#FirstName').val();\n obj.lastname = $('#LastName').val();\n obj.location = [];\n var locas = $('#Location').children();\n for(var i = 0; i < locas.length; i++){\n obj.location.push(locas[i].innerHTML);\n }\n obj.phone = $('#Phone').val();\n obj.current_class = $('#Class').val();\n var data = getData();\n var newData = [];\n for(var i = 0; i < data.length; i ++){\n if(matchDetail(data[i], obj)){\n newData.push(data[i]);\n }\n }\n showTable(newData);\n }", "onSearch(value) {\n let tempPhones = [];\n for (let i = 0; i < this.state.phonesTemp.length; i++) {\n // If the phone's name contains the name entered then add it\n if (this.state.phonesTemp[i].name.toLowerCase().includes(value.toLowerCase())) {\n tempPhones.push(this.state.phonesTemp[i]);\n }\n }\n this.setState({ phones: tempPhones }); // Render phones mathing criteria\n }", "function searchProducts(request,response){\n const page=request.query.page;\n const limit=request.query.limit;\n const startIndex=(page-1)*limit;\n const endIndex=limit;\n let splitStr=[];\n let searchQuery = request.body.searchString;\n splitStr = searchQuery.split(\" \");\n console.log(splitStr)\n console.log(request.body.searchString)\n let sqlQuery=\"SELECT * FROM milk_comparison RIGHT JOIN milk ON milk.id=milk_comparison.milk_id WHERE \";\n if(page!=null && limit!=null){\n for(let i=0;i<splitStr.length;i++){\n if(i!=splitStr.length-1){\n // console.log(\"adding to the sql query\")\n sqlQuery+=\"searchString LIKE '%\"+splitStr[i]+\"%' AND \"\n }else{\n sqlQuery+=\"searchString LIKE '%\"+splitStr[i]+\"%' \"\n // console.log(\"last bit added to the search query\")\n }\n }\n sqlQuery+=\"LIMIT \"+startIndex+\",\"+endIndex;\n\n}else if(page==null&limit==null){\n for(let i=0;i<splitStr.length;i++){\n if(i!=splitStr.length-1){\n sqlQuery+=\"searchString LIKE '%\"+splitStr[i]+\"%' AND \"\n }else{\n sqlQuery+=\"searchString LIKE '%\"+splitStr[i]+\"%' \"\n }\n }\n}\n connectionPool.query(sqlQuery,(err,result)=>{\n if (err) {//Check for errors\n console.error(\"Error executing query: \" + JSON.stringify(err));\n response.send(\"error\");\n }\n else {\n let obj=JSON.stringify(result);\n console.log(\"this is the object sent from server\"+obj);\n console.log(\"object length\"+obj.length)\n if(obj.length==2){\n // if object empty search in cheese\n \n sqlQuery=\"SELECT * FROM cheeses_comparison RIGHT JOIN cheeses ON cheeses.id=cheeses_comparison.cheese_id WHERE \";\n if(page!=null && limit!=null){\n for(let i=0;i<splitStr.length;i++){\n if(i!=splitStr.length-1){\n // console.log(\"adding to the sql query\")\n sqlQuery+=\"searchString LIKE '%\"+splitStr[i]+\"%' AND \"\n }else{\n sqlQuery+=\"searchString LIKE '%\"+splitStr[i]+\"%' \"\n // console.log(\"last bit added to the search query\")\n }\n }\n sqlQuery+=\"LIMIT \"+startIndex+\",\"+endIndex;\n \n }else if(page==null&limit==null){\n for(let i=0;i<splitStr.length;i++){\n if(i!=splitStr.length-1){\n sqlQuery+=\"searchString LIKE '%\"+splitStr[i]+\"%' AND \"\n }else{\n sqlQuery+=\"searchString LIKE '%\"+splitStr[i]+\"%' \"\n }\n }\n }\n connectionPool.query(sqlQuery,(err,result)=>{\n if (err) {//Check for errors\n console.error(\"Error executing query: \" + JSON.stringify(err));\n response.send(\"error\");\n }\n else {\n obj=JSON.stringify(result); \n response.send(obj);\n console.log(\"This is cheese:\"+obj)\n }\n });\n }else{\n response.send(obj);\n }\n }\n });\n\n}", "function search(){\n\tvar searchString=document.getElementById(\"search-box\").value;\n\tvar filteredData=[];\n\tfor(i=0;i<object.Data.length;i++){\n\t\tif(object.Data[i].Name.indexOf(searchString)==-1 && object.Data[i].Technician.indexOf(searchString)==-1 && object.Data[i].Order_Date.indexOf(searchString)==-1 && \n\t\tobject.Data[i].Type.indexOf(searchString)==-1 && object.Data[i].Cell_Number.indexOf(searchString)==-1 && object.Data[i].Email.indexOf(searchString)==-1 &&\n\t\tobject.Data[i].Order.indexOf(searchString)==-1){\n\t\t}\n\t\telse{\n\t\t\tfilteredData[filteredData.length]=object.Data[i];\n\t\t}\n\t}\n\tloaddata(filteredData);\n}", "search(searchTerm) {\n let results = undefined;\n if (this.props.data) {\n\n if (this.props.caseInsensitive) {\n results = this.props.data.filter(object => this.getObjectText(object).toLowerCase().includes(searchTerm.toLowerCase()));\n } else {\n results = this.props.data.filter(object => this.getObjectText(object).includes(searchTerm));\n }\n }\n return results;\n }", "function search(){\n\t\t$(\"#mySearch\").on(\"keyup\", function() {\n\t\t\tvar value = $(this).val().toLowerCase();\n\t\t\t$(\".table-device tbody tr\").filter(function() {\n\t\t\t $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);\n\t\t\t});\n\t\t });\n\t}", "async findBy(request, response, next, app) {\n let queryState = { $or: [{ \"key\": 0 }, { \"key\": 2 }] };\n findDocuments(State_1.default, queryState, \"\", {}, '', '', 0, null, null).then((findResult) => {\n response.json({\n message: findResult,\n success: false\n });\n }).catch((err) => {\n response.json({\n message: err.message,\n success: false\n });\n });\n }", "function esQuerySearch(onderwerp, prodType, period, callback){\r\n console.log(onderwerp);\r\n console.log(prodType);\r\n var query_body = {\r\n \r\n \"query\": {\r\n \"bool\": {\r\n \"should\": [\r\n {\r\n \"multi_match\": {\r\n \"query\": onderwerp,\r\n \"type\": \"best_fields\",\r\n \"fields\": [\r\n \"title^3\",\r\n \"description\",\r\n \"categoryTypeName^2\",\r\n \"tags\"\r\n ]\r\n }\r\n },\r\n {\r\n \"multi_match\": {\r\n \"query\": onderwerp,\r\n \"type\": \"cross_fields\",\r\n \"fields\": [\r\n \"title^3\",\r\n \"description\",\r\n \"categoryTypeName^2\",\r\n \"tags\"\r\n ],\r\n \"boost\": 0.8\r\n }\r\n },\r\n {\r\n \"multi_match\": {\r\n \"query\": onderwerp,\r\n \"fuzziness\": \"1\",\r\n \"prefix_length\": \"3\",\r\n \"fields\": [\r\n \"title^3\",\r\n \"description\",\r\n \"categoryTypeName^2\",\r\n \"tags\"\r\n ],\r\n \"boost\": 0.3\r\n }\r\n }\r\n ],\r\n \"filter\": {\r\n \"term\": {\r\n \"active\": true, \r\n \r\n }\r\n },\r\n \"minimum_should_match\": 1\r\n }\r\n },\r\n \"size\": 5000 \r\n } ;\r\n \r\n if (period != \"alles\"){\r\n if (prodType != \"alles\"){\r\n query_body.query.bool.filter = [{\"term\":{\"active\":true}}, {\"term\": {\"contentTypeName\": prodType}}];\r\n query_body.query.bool.must_not = {\"range\":{\"createDate\":{\"lt\":period}}};\r\n }\r\n else {\r\n query_body.query.bool.must_not = {\"range\":{\"createDate\":{\"lt\":period}}};\r\n } \r\n }\r\n else {\r\n if (prodType != \"alles\"){\r\n query_body.query.bool.filter = [{\"term\":{\"active\":true}}, {\"term\": {\"contentTypeName\": prodType}}];\r\n }\r\n else { \r\n query_body = query_body;\r\n } \r\n }\r\n\r\n // send the framed query to the es client. Retrieve only tile, path and createDat of the resutls.\r\n client.search({\r\n _source: ['title', 'path', 'createDate', 'contentTypeName'],\r\n body: query_body\r\n }).then( function (body){ \r\n // console.log(body.hits.hits);\r\n callback(body);\r\n \r\n }, function (error){\r\n console.trace(error.message);\r\n }\r\n );\r\n}", "function searchUsers() {\n\n firebase.database().ref('shoppings/').on('value', function(snapshot) {\n var userData = snapshot.val();\n \n console.log(userData)\n\n\n\n var val = $(\"#searchInput\").val();\n if(val == searchVal) {\n return; \n } else {\n searchVal = val;\n var searchResults = {};\n searchResults = [];\n $.each(userData, function(i, v) {\n if (v.info.nome.toLowerCase().indexOf(val) != -1) {\n searchResults.push(v); \n }\n });\n loadData(searchResults); \n }\n \n });\n\n}", "function getInputData() {\n //Dynamically create Saved Search to grab all eligible Sales orders to invoice\n //In this example, we are grabbing all main level data where sales order status are \n //any of Pending Billing or Pending Billing/Partially Fulfilled\n return search.create({\n type: \"salesorder\",\n filters:\n [\n [\"shipmethod\", \"anyof\", \"37\"],\n \"AND\",\n [\"type\", \"anyof\", \"SalesOrd\"],\n \"AND\",\n [\"status\", \"anyof\", \"SalesOrd:A\"],\n \"AND\",\n [\"memorized\", \"is\", \"F\"],\n \"AND\",\n [\"mainline\", \"is\", \"T\"],\n \"AND\", \n [\"amount\",\"greaterthan\",\"0.00\"], \n \"AND\", \n [\"custbody1\",\"anyof\",\"4926\"]\n ],\n columns:\n [\n search.createColumn({ name: \"tranid\", label: \"Document Number\" })\n ]\n });\n }", "function search(profiles) {\n return profiles.filter(\n (profile) =>\n profile.Gender.toLowerCase().indexOf(query) > -1 ||\n profile.PaymentMethod.toLowerCase().indexOf(query) > -1 ||\n profile.CreditCardType.toLowerCase().indexOf(query) > -1\n );\n }", "function get_matching_sf( sf_searchResults, cust_id, cust_group, supplier, factory ) {\r\n \r\n var index;\r\n \r\n if ( sf_searchResults.length == 0 || sf_searchResults == null )\r\n return null;\r\n \r\n // Init columns\r\n var sf_custid_col = new nlobjSearchColumn( 'custrecord_sourcingfee_customercode' );\r\n var sf_custgrp_col = new nlobjSearchColumn( 'custrecord_sourcingfee_customergrp' );\r\n var sf_supplier_col = new nlobjSearchColumn( 'custrecord_sourcingfee_supplier' );\r\n var sf_factory_col = new nlobjSearchColumn( 'custrecord_sourcing_fty' );\r\n \r\n var sf_agent_col = new nlobjSearchColumn( 'custrecord_sourcingfee_sourcingagent' );\r\n var sf_commis_col = new nlobjSearchColumn( 'custrecord_sourcingfee_commis' );\r\n \r\n // Init result object\r\n var sf_obj = new Object();\r\n \r\n // Filter 1 \r\n for ( index = 0; index < sf_searchResults.length; index ++ ) {\r\n \r\n var sf_custid = sf_searchResults[index].getValue( sf_custid_col ) ? sf_searchResults[index].getValue( sf_custid_col ) : null;\r\n var sf_custgrp = sf_searchResults[index].getValue( sf_custgrp_col ) ? sf_searchResults[index].getValue( sf_custgrp_col ) : null;\r\n var sf_supplier = sf_searchResults[index].getValue( sf_supplier_col ) ? sf_searchResults[index].getValue( sf_supplier_col ) : null;\r\n var sf_factory = sf_searchResults[index].getValue( sf_factory_col ) ? sf_searchResults[index].getValue( sf_factory_col ) : null; \r\n \r\n if ( sf_custid == cust_id && sf_custgrp == cust_group && sf_supplier == supplier && sf_factory == factory ) {\r\n \r\n sf_obj.id = sf_searchResults[index].getId();\r\n sf_obj.agent = sf_searchResults[index].getValue( sf_agent_col );\r\n sf_obj.commis = sf_searchResults[index].getValue( sf_commis_col );\r\n sf_obj.filter = 1;\r\n \r\n return sf_obj;\r\n \r\n }\r\n \r\n }\r\n \r\n // Filter 2\r\n for ( index = 0; index < sf_searchResults.length; index ++ ) {\r\n \r\n var sf_custid = sf_searchResults[index].getValue( sf_custid_col ) ? sf_searchResults[index].getValue( sf_custid_col ) : null;\r\n var sf_custgrp = sf_searchResults[index].getValue( sf_custgrp_col ) ? sf_searchResults[index].getValue( sf_custgrp_col ) : null;\r\n var sf_supplier = sf_searchResults[index].getValue( sf_supplier_col ) ? sf_searchResults[index].getValue( sf_supplier_col ) : null;\r\n var sf_factory = sf_searchResults[index].getValue( sf_factory_col ) ? sf_searchResults[index].getValue( sf_factory_col ) : null;\r\n \r\n if ( sf_custid == cust_id && sf_custgrp == cust_group && sf_supplier == supplier && sf_factory == null ) {\r\n \r\n sf_obj.id = sf_searchResults[index].getId();\r\n sf_obj.agent = sf_searchResults[index].getValue( sf_agent_col );\r\n sf_obj.commis = sf_searchResults[index].getValue( sf_commis_col );\r\n sf_obj.filter = 2;\r\n \r\n return sf_obj;\r\n \r\n }\r\n \r\n }\r\n \r\n // Filter 3\r\n for ( index = 0; index < sf_searchResults.length; index ++ ) {\r\n \r\n var sf_custid = sf_searchResults[index].getValue( sf_custid_col ) ? sf_searchResults[index].getValue( sf_custid_col ) : null;\r\n var sf_custgrp = sf_searchResults[index].getValue( sf_custgrp_col ) ? sf_searchResults[index].getValue( sf_custgrp_col ) : null;\r\n var sf_supplier = sf_searchResults[index].getValue( sf_supplier_col ) ? sf_searchResults[index].getValue( sf_supplier_col ) : null;\r\n var sf_factory = sf_searchResults[index].getValue( sf_factory_col ) ? sf_searchResults[index].getValue( sf_factory_col ) : null;\r\n \r\n if ( sf_custid == cust_id && sf_custgrp == cust_group && sf_supplier == null && sf_factory == null ) {\r\n \r\n sf_obj.id = sf_searchResults[index].getId();\r\n sf_obj.agent = sf_searchResults[index].getValue( sf_agent_col );\r\n sf_obj.commis = sf_searchResults[index].getValue( sf_commis_col );\r\n sf_obj.filter = 3;\r\n \r\n \r\n return sf_obj;\r\n \r\n }\r\n \r\n }\r\n \r\n // Filter 4\r\n for ( index = 0; index < sf_searchResults.length; index ++ ) {\r\n \r\n var sf_custid = sf_searchResults[index].getValue( sf_custid_col ) ? sf_searchResults[index].getValue( sf_custid_col ) : null;\r\n var sf_custgrp = sf_searchResults[index].getValue( sf_custgrp_col ) ? sf_searchResults[index].getValue( sf_custgrp_col ) : null;\r\n var sf_supplier = sf_searchResults[index].getValue( sf_supplier_col ) ? sf_searchResults[index].getValue( sf_supplier_col ) : null;\r\n var sf_factory = sf_searchResults[index].getValue( sf_factory_col ) ? sf_searchResults[index].getValue( sf_factory_col ) : null;\r\n \r\n if ( sf_custid == cust_id && sf_custgrp == null && sf_supplier == null && sf_factory == null ) {\r\n \r\n sf_obj.id = sf_searchResults[index].getId();\r\n sf_obj.agent = sf_searchResults[index].getValue( sf_agent_col );\r\n sf_obj.commis = sf_searchResults[index].getValue( sf_commis_col );\r\n sf_obj.filter = 4;\r\n \r\n return sf_obj;\r\n \r\n }\r\n \r\n }\r\n \r\n // Filter 5\r\n for ( index = 0; index < sf_searchResults.length; index ++ ) {\r\n \r\n var sf_custid = sf_searchResults[index].getValue( sf_custid_col ) ? sf_searchResults[index].getValue( sf_custid_col ) : null;\r\n var sf_custgrp = sf_searchResults[index].getValue( sf_custgrp_col ) ? sf_searchResults[index].getValue( sf_custgrp_col ) : null;\r\n var sf_supplier = sf_searchResults[index].getValue( sf_supplier_col ) ? sf_searchResults[index].getValue( sf_supplier_col ) : null;\r\n var sf_factory = sf_searchResults[index].getValue( sf_factory_col ) ? sf_searchResults[index].getValue( sf_factory_col ) : null;\r\n \r\n if ( sf_custgrp == cust_group && sf_custid == null && sf_supplier == null && sf_factory == null ) {\r\n \r\n sf_obj.id = sf_searchResults[index].getId();\r\n sf_obj.agent = sf_searchResults[index].getValue( sf_agent_col );\r\n sf_obj.commis = sf_searchResults[index].getValue( sf_commis_col );\r\n sf_obj.filter = 5;\r\n \r\n return sf_obj;\r\n \r\n }\r\n \r\n }\r\n \r\n return null;\r\n \r\n}", "static searchSeed(req, res) {\n var { strain } = req.query\n models.Product.findAll({\n where: {\n strain: strain\n },\n attributes: [\n \"id\",\n \"strain\",\n \"quantity\",\n \"type\",\n \"thc\",\n \"cbd\",\n ]\n })\n .then(function (seed) {\n if (seed) {\n }\n })\n .catch(function (err) {\n return res.status(500).json({\n status: \"FAILED\",\n message: \"Error processing request, please try again\",\n Error: err.toString()\n })\n })\n }", "handleSearch(event) {\n\n this.setState({\n\n [event.target.id]: event.target.value\n\n }, function() {\n\n this.setState({\n\n filteredProducts: Object.values(this.state.products).filter(user => user.name.toLowerCase().includes(this.state.search.toLowerCase()))\n \n })\n\n });\n\n }", "function searchingProducts(listToFilter) {\n\n if (searchValue.value) {\n listToFilter = listToFilter.filter(availProduct => {\n return availProduct.name.toLowerCase().includes(searchValue.value.toLowerCase());\n });\n }\n\n if (countryValue.options[countryValue.selectedIndex].value) {\n listToFilter = listToFilter.filter(availProduct => {\n return availProduct.shipsTo.map(selectOption => selectOption.toLowerCase()).includes(countryValue.options[countryValue.selectedIndex].value.toLowerCase());\n });\n } \n\n sortProducts(listToFilter);\n\n renderProducts(listToFilter);\n}", "function getAccountLinkRetailSearchRecords(newMetadataList, request, accSearchType, dealerId){\n\t\t\n\t\tconsole.log('----------> inside getAccountLinkRetailSearchRecords');\n\t\t\n //List<Account_Link__c> accLinkList = new List<Account_Link__c>();\n\t\tvar accLinkList;\n\t\tvar recordTypeID;\n var finalMap = new Map();\n //Implementing dynamic response switch\n var strBaseQueryDynamicSearch;\n\t\tvar finalQueyParam = [];\n\t\t\n\t\t\n if(true == newMetadataList[0].enabled_dynamic_response__c){\n //New implementation for Dynamic response; Call to create the query dynamically\n if(responseTagAPIName!= ''){\n //strBaseQueryDynamicSearch = 'SELECT ' + responseTagAPIName + ' FROM Account_Link__c';\n\t\t\t\tstrBaseQueryDynamicSearch = 'SELECT ' + responseTagAPIName + ' FROM herokusbox.Account_Link__c ac INNER JOIN herokusbox.Account a ON ac.fromRole__c::VARCHAR = a.sfid::VARCHAR INNER JOIN herokusbox.Account a1 ON ac.toRole__c::VARCHAR = a1.sfid::VARCHAR ';\n \n\t\t\t\tif(responseTagAPIName.includes('recordType.'))\n\t\t\t\tstrBaseQueryDynamicSearch = strBaseQueryDynamicSearch + 'INNER JOIN herokusbox.recordtype recordType ON ac.recordTypeID::VARCHAR = recordType.sfid::VARCHAR ';\n\t\t\t\t\n\t\t\t\tconsole.log('------strBaseQueryDynamicSearch------' + strBaseQueryDynamicSearch);\n }else {\n\t\t\t\t\n return accLinkList;\n }\n }\n \n var isRetailCopyAtCompany = newMetadataList[0].retailcopyatcompany__c;\n //console.log('------getAccountLinkRetailSearchRecords ---> strBaseQueryDynamicSearch------' + strBaseQueryDynamicSearch);\n\t\t\n var searchCriteria;\n var whereClause;\t\t\n //var andMap = new Map();\n //var orMap = new Map();\n\t\tvar orAccountLnkMap = new Map();\n\t\tvar andAccountLnkMap = new Map();\n\t\t\n if(accSearchType){\n searchCriteria = newMetadataList[0].dynamic_person_search_retail_fields__c;\n\t\t\tconsole.log('------searchCriteria when accSearchType is true ------' + searchCriteria);\n recordTypeID = 'select sfid from herokusbox.recordtype where sobjecttype = \\'Account_Link__c\\' and Name = \\'Retail Person\\'';\n //recordTypeIDAccount = PERSONRECORDTYPEID;\n }else {\n searchCriteria = newMetadataList[0].dynamic_company_search_retail_fields__c;\n\t\t\tconsole.log('------searchCriteria when accSearchType is false ------' + searchCriteria);\n recordTypeID = 'select sfid from herokusbox.recordtype where sobjecttype = \\'Account_Link__c\\' and Name = \\'Retail Company\\'';\n //recordTypeIDAccount = COMPANYRECORDTYPEID;\n\t\tconsole.log('------orderbyField ------' + orderbyField);\n }\n var orderbyField = newMetadataList[0].order_by_field__c;\n\t\t\n isCustomerTypeEnabled = newMetadataList[0].enabled_customer_type__c;\n\t\tconsole.log('------isCustomerTypeEnabled ------' + isCustomerTypeEnabled);\n\t\t\n customerType = request.customerType;\n\t\tconsole.log('------customerType ------' + customerType);\n \n //Fetching dealer record\n //var dealerAccount = getDealerRecord(isRetailCopyAtCompany, newMetadataList[0].use_dealer_default_flag__c,request);\n \n console.log('------ dealerId inside getAccountLinkRetailSearchRecords------' + dealerId);\n \n\t\t\n if(dealerId != null){\n whereClause = 'AND ac.Retail_Duplicate_Flag__c= false AND ac.RecordTypeId='+ '(' + recordTypeID + ')' + \n ' AND ac.Market__c=\\''+request.market +\n '\\' AND a.sfid=\\''+ dealerId +'\\'';\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n }else {\n return accLinkList;\n }\n \n if(isCustomerTypeEnabled && customerType!= null && (!request.customerType)){\n whereClause += ' AND a1.Customer_Type__c =\\''+customerType+'\\'';\n }\n\t\t\n\t\t//console.log('-----whereClause ------' + whereClause);\n\t\t\n searchCriteria = searchCriteria.replace(/\\(/g,'');\t\t\n searchCriteria = searchCriteria.replace(/\\)/g,'');\n\t\t\n\t\t//console.log('------searchCriteria after removing bracket ------' + searchCriteria);\n\t\t\n\t\tvar companySearchFileds = searchCriteria.split('&&');\n\t\t\n\t\t//console.log (\"companySearchFileds::::: \" + companySearchFileds);\n\t\t\n\t\tfor (i=0; i<companySearchFileds.length;i++) {\t\n\t\t\t//console.log('inside for loop');\t\n //console.log('row value -------------->' + companySearchFileds[i]);\n \n if(String(companySearchFileds[i]).includes('OR')) {\n\t\t\t\t\n\t\t\t\t//console.log('inside if loop as OR found');\t \n\t\t\t\t\n var orArray = companySearchFileds[i].split('OR');\t\t\t\t\n \n\t\t\t\t//console.log (\"orArray::::: \" + orArray);\n\t\t\t\t\n\t\t\t\tfor(j=0; j<orArray.length;j++){\t\t\t\t\t\n\t\t\t\t\t\n var orValues=orArray[j].split(':');\n \n if(orValues!=null){\n if(String(orValues[1]).trim() != ''){\n orAccountLnkMap.set(String(orValues[0]),String(orValues[1]));\n\t\t\t\t\t\t\t//console.log ('orAccountLnkMap:::' + orAccountLnkMap);\n }\n }\n }\n } else {\n\t\t\t\t//console.log (\"in else as no OR\");\n \n\t\t\t\tvar andValues=companySearchFileds[i].split(':');\n\t\t\t\t//console.log('andValues -------------->' + andValues);\n\t\t\t\t\n andAccountLnkMap.set(String(andValues[0]),String(andValues[1]));\n\t\t\t\t\n\t\t\t\t//console.log ('andAccountLnkMap:::' + andAccountLnkMap);\n }\n }\n\t\t\n\t\tvar paramCounter = 1;\n\t\tconst requestMap = new Map(Object.entries(request));\n\t\t\n for(let objKeySetANDCaluse of andAccountLnkMap.keys()) {\n //if(String.isNotBlank(requestMap.get(andAccountLnkMap.get(objKeySetANDCaluse).trim())))\n\t\t\t \n\t\t\tvar param1 = andAccountLnkMap.get(objKeySetANDCaluse);\n\t\t\t//console.log('-----------> objKeySetANDCaluse::::' + objKeySetANDCaluse);\n\t\t\tconsole.log('-----------> param1::::' + param1);\n\t\t\t\n\t\t\tvar requestAndString = requestMap.get(param1.trim());\n\t\t\t\n\t\t\tconsole.log('requestAndString.........' + requestAndString);\n\t\t\tif(requestAndString.length >0)\n\t\t\t\t\n\t\t\t{ if(param1.trim().equalsIgnoreCase('firstname') || param1.trim().equalsIgnoreCase('lastname') || param1.trim().equalsIgnoreCase('mobilePhone') || param1.trim().equalsIgnoreCase('homePhone') || param1.trim().equalsIgnoreCase('workPhone'))\n\t\t\t\t{ \n\t\t\t\t\tconsole.log('inside if of requestAndString');\n\t\t\t\t//whereClause += ' AND '+objKeySetANDCaluse +'='+'\\''+ String.escapeSingleQuotes(requestMap.get(andAccountLnkMap.get(objKeySetANDCaluse).trim()))+ '\\'';\n\t\t\t\t//whereClause += ' AND '+objKeySetANDCaluse +'='+'\\''+ requestAndString.replace(/'/g,'') + '\\'';\n\t\t\t\twhereClause += ' AND ' + 'ac.' + objKeySetANDCaluse.trim() +' like '+'$' + paramCounter;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tconsole.log('inside else of requestAndString');\n\t\t\t\t\n //whereClause += ' AND '+objKeySetANDCaluse +'='+'\\''+ String.escapeSingleQuotes(requestMap.get(andAccountLnkMap.get(objKeySetANDCaluse).trim()))+ '\\'';\n\t\t\t\t//whereClause += ' AND '+objKeySetANDCaluse +'='+'\\''+ requestAndString.replace(/'/g,'') + '\\'';\n\t\t\t\twhereClause += ' AND ' + 'ac.' + objKeySetANDCaluse.trim() +'= '+'$' + paramCounter;\n\t\t\t\t}\n\t\t\t\tparamCounter ++;\n\t\t\t\t\n\t\t\t\tfinalQueyParam.push(param1);\t\n\t\t\t\t\n }\n }\n\t\t\n\t\t//console.log('whereClause after for loop.........' + whereClause);\n\t\t\n\t\t//console.log('size of orAccountLnkMap:::::' + orAccountLnkMap.size);\n\t\t\n if(orAccountLnkMap.size > 0) {\n\t\t\t\n whereClause = whereClause+ ' AND ';\n }\n whereClause += '( ';\n var counter = 0;\n for(let objKeySetORCaluse of orAccountLnkMap.keys()) {\n\t\t\t\n //if(String.isNotBlank(requestMap.get(orAccountLnkMap.get(objKeySetORCaluse).trim())) && String.isNotEmpty(requestMap.get(orAccountLnkMap.get(objKeySetORCaluse).trim())))\n\t\t\t\n\t\t\tvar param2 = orAccountLnkMap.get(objKeySetORCaluse);\n\t\t\tconsole.log('-----------> param2:::::::' + param2);\t\t\n\t\t\t\n\t\t\t\n\t\t\tvar requestOrString = requestMap.get(param2.trim());\n\t\t\t\n\t\t\tconsole.log('requestOrString.........' + requestOrString);\n\t\t\n\t\t\t//var requestOrString = \"request.\" + param2;\n\t\t\t\n\t\t\tif(requestOrString.length >0)\n\t\t\t{\n if(counter == 0) {\n \n\t\t\t\t if(param2.trim().equalsIgnoreCase('firstname') || param2.trim().equalsIgnoreCase('lastname') || param2.trim().equalsIgnoreCase('mobilePhone') || param2.trim().equalsIgnoreCase('homePhone') || param2.trim().equalsIgnoreCase('workPhone'))\n\t\t\t\t\t{\n\t\t\t\t\t\t//whereClause += objKeySetORCaluse +'= ' +'\\''+ String.escapeSingleQuotes(requestMap.get(orAccountLnkMap.get(objKeySetORCaluse).trim()))+ '\\'';\n\t\t\t\t\t//whereClause += objKeySetORCaluse +'= ' +'\\''+ requestOrString.replace(/'/g,'')+ '\\'';\n\t\t\t\t\twhereClause += 'ac.' + objKeySetORCaluse.trim() +'like ' +'$' + paramCounter;\n\t\t\t\t\tfinalQueyParam.push(param2);\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t \n\t\t\t\t //whereClause += objKeySetORCaluse +'= ' +'\\''+ String.escapeSingleQuotes(requestMap.get(orAccountLnkMap.get(objKeySetORCaluse).trim()))+ '\\'';\n\t\t\t\t\t//whereClause += objKeySetORCaluse +'= ' +'\\''+ requestOrString.replace(/'/g,'')+ '\\'';\n\t\t\t\t\twhereClause += 'ac.' + objKeySetORCaluse.trim() +'= ' +'$' + paramCounter;\n\t\t\t\t\tfinalQueyParam.push(param2);\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tparamCounter++;\n counter++;\n } else {\n \n\t\t\t\t\tif(param2.trim().equalsIgnoreCase('firstname') || param2.trim().equalsIgnoreCase('lastname') || param2.trim().equalsIgnoreCase('mobilePhone') || param2.trim().equalsIgnoreCase('homePhone') || param2.trim().equalsIgnoreCase('workPhone')){\n\t\t\t\t\t\t\n\t\t\t\t\t\t//whereClause += ' OR '+ objKeySetORCaluse +'= ' +'\\''+ String.escapeSingleQuotes(requestMap.get(orAccountLnkMap.get(objKeySetORCaluse).trim()))+ '\\'';\n\t\t\t\t\t//whereClause += ' OR '+ objKeySetORCaluse +'= ' +'\\'' + requestOrString.replace(/'/g,'') + '\\'';\n\t\t\t\t\twhereClause += ' OR '+ 'ac.' + objKeySetORCaluse.trim() +'like ' +'$' + paramCounter;\n\t\t\t\t\tfinalQueyParam.push(param2);\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\telse{\n\n\t\t\t\t //whereClause += ' OR '+ objKeySetORCaluse +'= ' +'\\''+ String.escapeSingleQuotes(requestMap.get(orAccountLnkMap.get(objKeySetORCaluse).trim()))+ '\\'';\n\t\t\t\t\t//whereClause += ' OR '+ objKeySetORCaluse +'= ' +'\\'' + requestOrString.replace(/'/g,'') + '\\'';\n\t\t\t\t\twhereClause += ' OR '+ 'ac.' + objKeySetORCaluse.trim() +'= ' +'$' + paramCounter;\n\t\t\t\t\tfinalQueyParam.push(param2);\n\t\t\t\t\t}\n\t\t\t\t\tparamCounter++;\n\t\t\t\t\t\n }\n }\n }\n whereClause += ')';\n\t\t\n\t\t//console.log (\"final whereClause :::::::::\" + whereClause);\n\t\t\n\t\tconsole.log (\"finalQueyParam :::::::::\" + finalQueyParam);\n\t\t\n\t\t\n strBaseQueryDynamicSearch += whereClause;\n\t\tvar offset = calculateOffset(request);\n if(orderbyField != null) {\n strBaseQueryDynamicSearch += ' order by ac.' + orderbyField + ' LIMIT ' + parseInt(request.pageSize) + ' OFFSET ' + offset;\n }\n\t\t\n\t\t\n\t\tvar replacemobile = 'REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(ac.Retail_Mobile__c,' + '\\'\\-\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\+\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\)\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\(\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\ \\'' + ',' + '\\'\\'' + ')';\n\t\t\n\t\tvar replacehomeph = 'REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(ac.Retail_Individual_Home_Phone__c,' + '\\'\\-\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\+\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\)\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\(\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\ \\'' + ',' + '\\'\\'' + ')';\n\t\t\n\t\tvar replaceworkph = 'REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(ac.Retail_Work_Phone__c,' + '\\'\\-\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\+\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\)\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\(\\'' + ',' + '\\'\\'' + ')' + ',' + '\\'\\ \\'' + ',' + '\\'\\'' + ')';\n\t\t\n\t\tstrBaseQueryDynamicSearch = strBaseQueryDynamicSearch.replace(/ac.Retail_Mobile_For_Search__c/g, replacemobile);\n\t\tstrBaseQueryDynamicSearch = strBaseQueryDynamicSearch.replace(/ac.Retail_Home_Phone_For_Search__c/g, replacehomeph);\n\t\tstrBaseQueryDynamicSearch = strBaseQueryDynamicSearch.replace(/ac.Retail_Work_Phone_For_Search__c/g, replaceworkph);\n\t\t\n\t\t\n\t\tfinalMap.set('finalQuery', strBaseQueryDynamicSearch);\n\t\tfinalMap.set('finalQueryParam', finalQueyParam);\n\t\t\n //String queryString = strBaseQueryDynamicSearch;\n //console.log('-----------> Before executing strBaseQueryDynamicSearch');\n console.log('-----------> final query ::strBaseQueryDynamicSearch ::::::::::' + strBaseQueryDynamicSearch);\n //console.log('check debug'+request);\n //accLinkList = Database.query(strBaseQueryDynamicSearch);\n //console.log('accLinkList 1-------------->'+accLinkList);\n\t\t\n return finalMap;\n }", "function searchDriver() {\n const queries = [\n\t['bre'],\n\t['bread'],\n\t['break'],\n\t['piz'],\n\t['nach'],\n\t['garbage'],\n\n\t['bre', 'piz'],\n\t['bre', 'flour'],\n ];\n for( const q of queries ) {\n\tconsole.log( \"query=[%s]\", q.join(\", \") );\n\tsearchElements( q, recipeIndex );\n }\n}", "function top_parts_by_quantity(request){\n\n\t\t\t//var searchObj = search.load({id: 'customsearch1428'});\n\t\t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\n\t\t\tvar customer = request.parameters.customer;\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\"; // \"none of 0\" will let to show everything\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\n\t\t\tif(customer==parent){\t// customer is a parent, we need to show all the childs\n\t\t\t\tlogic1=\"anyof\";\t\t\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\t// customer is a child, we need to show only that one child\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\n\t\t\tvar fleet_logic=\"noneof\";\t\t\t\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\n/*\t\t\t\t\t\t\n\t\t\t\t\t[\n\t\t\t\t\t\t[\"type\",\"anyof\",\"CustInvc\"], \n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"account\",\"anyof\",\"54\"], \n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)],\n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"item.pricinggroup\",\"noneof\",\"233\"], \n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"location.custrecord_sales_area\",\"anyof\",\"7\",\"8\"], \n\t\t\t\t\t\t\"AND\", \n\t\t\t\t\t\t[\"custcol_fleet_num.custrecordfl_body_style\",\"anyof\",\"@ALL@\"]\n\t\t\t\t\t\t],\n\t*/\n\t\t\tvar filter=[\n\t\t\t\t[\"type\",\"anyof\",\"CustInvc\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"account\",\"anyof\",\"54\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)],\n\t\t\t\t\"AND\", \n\t\t\t\t[\"item.pricinggroup\",\"noneof\",\"233\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"custcol_fleet_num.custrecordfl_body_style\",\"anyof\",\"@ALL@\"],\n\t\t\t\t\"AND\", \n\t\t\t\t[\"customer.parent\",logic1,parent1],\n\t\t\t\t\"AND\",\n\t\t\t\t[\"entity\",logic2,parent2],\n\t\t\t \"AND\",\n\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet]\n\t\t\t\t];\n\t\t\t\n\t\t\tvar searchObj = search.create({\n\t\t\t\ttype: \"invoice\",\n\t\t\t\tfilters: filter,\n\t\t\t\tcolumns:\n\t\t\t\t\t[\n\t\t\t\t\t\tsearch.createColumn({\n\t\t\t\t\t\t\tname: \"upccode\",\n\t\t\t\t\t\t\tjoin: \"item\",\n\t\t\t\t\t\t\tsummary: \"GROUP\",\n\t\t\t\t\t\t\tlabel: \"Item #\"\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsearch.createColumn({\n\t\t\t\t\t\t\tname: \"salesdescription\",\n\t\t\t\t\t\t\tjoin: \"item\",\n\t\t\t\t\t\t\tsummary: \"GROUP\",\n\t\t\t\t\t\t\tlabel: \"Description\"\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsearch.createColumn({\n\t\t\t\t\t\t\tname: \"quantity\",\n\t\t\t\t\t\t\tsummary: \"SUM\",\n\t\t\t\t\t\t\tsort: search.Sort.DESC,\n\t\t\t\t\t\t\tlabel: \"Quantity\"\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsearch.createColumn({\n\t\t\t\t\t\t\tname: \"formulacurrency\",\n\t\t\t\t\t\t\tsummary: \"SUM\",\n\t\t\t\t\t\t\tformula: \"nvl(({quantity}*{item.cost})+{amount},0)\",\n\t\t\t\t\t\t\tlabel: \"Formula (Currency)\"\n\t\t\t\t\t\t})\n\t\t\t\t\t\t]\n\t\t\t});\n\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t\t\tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t\t\tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t\t\treturn result_array;\n\n\t\t}", "function search(data) { \r\n for (var i=0 ; i < users.length ; i++) {\r\n if (users[i]._id == data) { \r\n return users[i]; // 5 le return \r\n }\r\n }\r\n }", "function findProductBySearchKey(searchKey, callback) {\n let queryStr = \"SELECT * \"\n + \" FROM product \"\n + \" WHERE product_name LIKE ? \"\n + \" OR product_category LIKE ? \"\n + \" OR product_description LIKE ? ;\";\n\n let term = \"%\" + searchKey + \"%\";\n let queryVar = [ term, term, term ];\n\n mySQL_DbConnection.query(queryStr, queryVar, function (err, result_rows, fields) { \n if(err) {\n console.log(\"Error: \", err);\n callback([]);\n } else { \n callback(result_rows);\n } \n });\n}", "function searchKeyword( p_table, p_searchKey, p_searchIn ){ \n var search_sql = \"SELECT * FROM \" + p_table + \" WHERE \";\n\n for( var i=0; i<p_searchIn.length; i++ ){\n for( var j=0; j<p_searchKey.length; j++ ){\n search_sql += p_searchIn[i] +\" ILIKE '%\" + p_searchKey[j] + \"%'\"; \n \n if( p_searchKey.length>1 && j< p_searchKey.length-1 ){\n search_sql += \" OR \";\n }\n }\n if( p_searchIn.length>1 && i<p_searchIn.length-1 ){\n search_sql += \" OR \";\n }\n \n } \n return search_sql; \n}", "function search(input){\r\n console.log(data);\r\n for(var i=0; i<data.length; i++){\r\n //ith reaction\r\n //array of elts\r\n console.log(i);\r\n var elt = data[i].elt.split(\",\");\r\n var elt_en = data[i].elt_en.split(\",\");\r\n var res = 1;\r\n for(var j=0; j<input.length; j++){\r\n //check jth input\r\n var find = 0; //not find\r\n for(var m=0; m<elt.length; m++){\r\n if(input[j].trim().localeCompare(elt[m].toLowerCase().trim())==0){\r\n find = 1;\r\n break;\r\n }\r\n }\r\n for(var m=0; m<elt_en.length; m++){\r\n if(input[j].trim().localeCompare(elt_en[m].toLowerCase().trim())==0){find = 1;break;}}\r\n if(find == 0){\r\n res = 0;break;}\r\n }\r\n if(res == 1){\r\n results.push(data[i].id);\r\n } \r\n }\r\n}", "function modelQuerySearch() {\n var tracker = $q.defer();\n var results = (vm.vehicle.model ? vm.models.filter(createFilterForModel(vm.vehicle.model)) : vm.models);\n\n if (results.length > 0)\n return results;\n\n amCustomers.getModels(vm.vehicle.manuf).then(allotModels).catch(noModels);\n return tracker.promise;\n\n function allotModels(res) {\n vm.models = res;\n results = (vm.vehicle.model ? vm.models.filter(createFilterForModel(vm.vehicle.model)) : vm.models);\n tracker.resolve(results);\n }\n\n function noModels(err) {\n results = [];\n tracker.resolve(results);\n }\n }", "function searchEndPoint(userQuery) {\n\n\tlet found = [];\n\n\t$.ajax({\n\n\t\turl: \"/products\",\n\t\tmethod: \"GET\",\n\t\tformat: \"json\",\n\n\t\tsuccess: function(responseJSON) {\n\n\t\t\tvar name, description, brand, model, condition, category;\n\t\t\tvar namePos, descriptionPos, brandPos, modelPos, conditionPos, categoryPos;\n\n\t\t\t$(\".search\").empty();\n\t\t\t$(\".search\").append(`<h2 class=\"searchTitle\">🔎 Resultados de ${$(\"#ex1\").val()}...</h2>`);\n\t\t\t$(\".search\").append(`<a href=\"./advancedSearch.html\"><button type=\"button\" class=\"btn btn-info advanced-search\">Busqueda Avanzada</button></a>`);\n\t\t\t$(\".search\").append(`<content class=\"searches-content\">`);\n\t\t\t$(\".searches-content\").empty();\n\n\t\t\tfor (let i=0; i<responseJSON.length; i++)\n\t\t\t\tif (!responseJSON[i].bought)\n\t\t\t\t\tfound.push(responseJSON[i]);\n\n\t\t\tfor (let i=0; i<found.length; i++) {\n\n\t\t\t\tname = found[i].name.toLowerCase();\n\t\t\t\tdescription = found[i].description.toLowerCase();\n\t\t\t\tbrand = found[i].brand.toLowerCase();\n\t\t\t\tmodel = found[i].model.toLowerCase();\n\t\t\t\tcondition = found[i].condition.toLowerCase();\n\t\t\t\tcategory = found[i].category.toLowerCase();\n\n\t\t\t\tnamePos = name.search(userQuery);\n\t\t\t\tdescriptionPos = description.search(userQuery);\n\t\t\t\tbrandPos = brand.search(userQuery);\n\t\t\t\tmodelPos = model.search(userQuery);\n\t\t\t\tconditionPos = condition.search(userQuery);\n\t\t\t\tcategoryPos = category.search(userQuery);\n\n\t\t\t\tif (namePos != -1 || descriptionPos != -1 || brandPos != -1 || modelPos != -1 || conditionPos != -1 || categoryPos != -1) {\n\n\t\t\t\t\t$(\".search\").append(`\n\t\t\t\t\t\t<div class=\"searches-container\" id=\"${found[i].id}\">\n\t\t\t\t\t\t\t<div class=\"searches-image\" >\n\t\t\t\t\t\t\t\t<img class=\"searches-image-size\" id=\"${found[i].id}\" src=\"./img/${found[i].image}\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"searches-info\" id=\"${found[i].id}\">\n\t\t\t\t\t\t\t\t<h5 class=\"search-info-title\" id=\"${found[i].id}\">${found[i].name}</h5>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-description search-info-sub\" id=\"${found[i].id}\">${found[i].description}</li>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-condition search-info-sub\" id=\"${found[i].id}\">${found[i].condition}</li>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-location search-info-sub\" id=\"${found[i].id}\">${found[i].location}</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$(\".search\").append(\n\t\t\t\t`\n\t\t\t\t\t</content>\n\t\t\t\t\t<div class=\"space\"></div>\n\t\t\t\t`\n\t\t\t);\n\n\t\t\tmain();\n\t\t},\n\n\t\terror: function(err) {\n\t\t\tconsole.log(\"Juguito de Chale\", errors)\n\t\t}\n\t});\n}", "function customerSearch() {\n\n var input, filter, table, tr, td, i;\n input = document.getElementById(\"myInput\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"customerInfoTable\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[1];\n if (td) {\n if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "\"filter:database\"(queryPayload) {\n return queryDatabase(queryPayload, (data, attrs) => _.filter(data.results, attrs));\n }", "@POST(\"/search\")\n\tsearch(req, res)\n\t{\n\t\tlet search = req.body.search;\n\t\tlet searchQuery = {};\n\t\tif(search && search.length > 0)\n\t\t{\n\t\t\tvar searchTags = search.split(\" \");\n\t\t\tsearchQuery = [];\n\t\t\tfor(var tag of searchTags)\n\t\t\t{\n\t\t\t\tsearchQuery.push(\n\t\t\t\t\t{\n\t\t\t\t\t\tsymbol: {\n\t\t\t\t\t\t\t$regex: tag,\n\t\t\t\t\t\t\t$options: \"i\",\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrencies: {\n\t\t\t\t\t\t\t$regex: tag,\n\t\t\t\t\t\t\t$options: \"i\",\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\t$regex: tag,\n\t\t\t\t\t\t\t$options: \"i\",\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tCurrencies.find({\n\t\t\t\t$or: searchQuery,\n\t\t\t\tvisible: true\n\t\t\t},\n\t\t\t{\n\t\t\t\t_id: 0,\n\t\t\t\texchanges: 0,\n\t\t\t\tindexes: 0,\n\t\t\t\tticker: 0\n\t\t\t}).sort({rank: -1}).limit(25).lean().then( currencies => {\n\t\t\t\tres.json({success: true, currencies: currencies });\n\t\t\t}).catch( error => {\n\t\t\t\tres.serverError(error);\n\t\t\t});\n\t\t}else{\n\t\t\tres.json({success: true, currencies: [] });\n\t\t}\n\t}", "function search(res, value) {\n\tres = res.filter(res => res.name.toLowerCase().includes(value.toLowerCase()) ||\n\t\tres.employeeId.toString().includes(value.toLowerCase()));\n\treturn res;\n}", "search() {\n this.recipeService.filterRecipes(this.searchQuery, 'name')\n .then(res => this.hydrate = res)\n .catch(console.error);\n }", "function amazonSearch(id, key, search) {\n\tvar aws = require(\"aws-lib\");\n\n\tif(DEBUG){\n\t\t//My own key that took forever omg they had a robot call my phone\n\t\tid = \"AKIAJTXO7LB2XAHXZH5Q\";\n\t\tkey = \"OgyQy7EUolqy3TpOjIC5P/xdxRVUCcfY4GFZTR0r\";\n\n\t\t//Search parameters\n\t\tsearch = \"test\";\n\t}\n\t\n\tsearchResult = \"NONE\";\n\tprodAdv = aws.createProdAdvClient(id, key, \"NetCentric\");\n\t\n\tprodAdv.call(\"ItemSearch\", {SearchIndex: \"Books\", Keywords: search, ResponseGroup: \"ItemAttributes\", TotalPages: \"2\"}, function (err, result) {\n\t\t//console.log(JSON.stringify(result, null, 2));\n\n\t\t//Collect search results\n\t\tvar book = result.Items.Item;\n\t\tvar books = [];\n\t\tfor (var i = 0; i < book.length; i++) {\n\t\t\tvar asin = book[i].ASIN;\n\t\t\tvar pageURL = book[i].DetailPageURL;\n\t\t\tvar author = book[i].ItemAttributes.Author;\n\t\t\tvar edition = book[i].ItemAttributes.Edition;\n\t\t\tvar isbn = book[i].ItemAttributes.ISBN;\n\t\t\tvar title = book[i].ItemAttributes.Title;\n\n\t\t\tbooks.push({asin, pageURL, author, edition, isbn, title});\n\t\t}\n\t\t\n\t\t//Initial HTML\n\t\tsearchResult = \"<h1 style=\\\"color: #FF5722;\\\">Search Results:</h1>\";\n\t\tsearchResult += \"<link href='https://fonts.googleapis.com/css?family=Roboto:400,900,700' rel='stylesheet' type='text/css'>\";\n\t\tsearchResult += \"<style>body{font-family: Roboto}</style>\";\n\t\t\n\t\t//For each book\n\t\tfor (var i = 0; i < books.length; i++) {\n\t\t\tvar asin = book[i].ASIN;\n\t\t\t\n\t\t\tprodAdv.call(\"ItemLookup\", {ItemId: asin, ResponseGroup: \"Images\", TotalPages: \"2\"}, (function() {\n\t\t\t\tvar index = i;\n\t\t\t\treturn function (err, result2) {\n\t\t\t\t\t//Retrieve image\n\t\t\t\t\t\n\t\t\t\t\tif(DEBUG) {\n\t\t\t\t\t\tconsole.log(\"CURRENT LOOP: \" + index);\n\t\t\t\t\t\tconsole.log(\"About to search: \" + asin);\n\t\t\t\t\t\tconsole.log(JSON.stringify(result2, null, 2));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpicture = result2.Items.Item.LargeImage.URL;\n\t\t\t\t\tif(DEBUG)\n\t\t\t\t\t\tconsole.log(\"Searching thread result: \" + picture);\n\t\t\t\t\n\t\t\t\t\t//Numbering (Out of order, broken)\n\t\t\t\t\t//searchResult += (\"<h3><b>\" + (index + 1) + \".</b> \");\n\n\t\t\t\t\t//URL and Title\n\t\t\t\t\t//Truncate title first\n\t\t\t\t\tvar title = books[index].title;\n\t\t\t\t\tif (title.length > 100) {\n\t\t\t\t\t\ttitle = title.substring(0, 100);\n\t\t\t\t\t\ttitle += \"...\";\n\t\t\t\t\t}\n\t\t\t\t\tsearchResult += (\"<h3><a href=\\\"\" + books[index].pageURL + \"\\\">\" + title + \"</a></h3>\");\n\n\t\t\t\t\t//Image\n\t\t\t\t\tsearchResult += (\"<img src=\\\"\" + picture + \"\\\" style=\\\"width:200px;height:250px;\\\" border=\\\"4\\\" style=\\\"border-color:#FF5722;\\\" \\\"<br><br>\");\n\t\t\t\t\tif(DEBUG)\n\t\t\t\t\t\tconsole.log(\"PICTURE PLACEMENT COMPLETE\");\n\t\t\t\t\t\n\t\t\t\t\tpicture = \"PICTURE NOT LOADED\"; //Reset\n\n\t\t\t\t\t//Author\n\t\t\t\t\tif(books[index].author != undefined)\n\t\t\t\t\t\tsearchResult += (\"<br><b>Author:</b> \" + books[index].author + \"<br>\");\n\n\t\t\t\t\t//Edition\n\t\t\t\t\tif(books[index].edition != undefined)\n\t\t\t\t\t\tsearchResult += (\"<b>Edition:</b> \" + books[index].edition + \"<br>\");\n\n\t\t\t\t\t//ISBN\n\t\t\t\t\tif(books[index].isbn != undefined)\n\t\t\t\t\t\tsearchResult += (\"<b>ISBN:</b> \" + books[index].isbn + \"<br>\");\n\n\t\t\t\t\t//Spacer\n\t\t\t\t\tsearchResult += (\"<br><br>\");\n\t\t\t\t}\n\t\t\t})());\n\t\t}\n\t\t\t\n\t\t//Done\n\t\tcontrol = \"DONE\"; //Reset\n\t});\n}", "function filterContacts(){\n matchedWords=[];\n filterActive=true;\n var value = $('#city-selector').val();\n var valueChecked = true;\n if( $('#show-active:checked').length == 0 ){\n valueChecked = false;\n };\n\n var searchWord = $('#name-search').val().trim();\n var pattern = new RegExp(searchWord, 'gi');\n for(var i=0; i<contactsData.length; i++){\n var testword = contactsData[i]['name'];\n if(testword.match(pattern)!= null){\n var filteredData = contactsData[i];\n if(value == 'none' && valueChecked == true){\n if(contactsData[i]['active'] == true){\n matchedWords.push(filteredData);\n }\n }else if( value == filteredData['city'] && (valueChecked == filteredData['active'] || filteredData['active']== undefined) ){\n matchedWords.push(filteredData);\n }else if(value == 'none' && (valueChecked == filteredData['active'] || filteredData['active']== undefined )) {\n matchedWords.push(filteredData);\n }\n }\n }\n //Perpiesiama nauja lentele su isfiltruotais duomenimis\n createTable(matchedWords);\n }", "function employeeSearch() {\n let query = `\n SELECT employee.id, first_name, last_name, title, salary, dep_name, manager_id\n FROM employee\n JOIN roles\n ON role_id = roles.id\n JOIN department\n ON dep_id = department.id;`;\n return connection.query(query, (err, res) => {\n if (err) throw err;\n console.table(res);\n startSearch();\n });\n}", "function search(value) {\n try {\n $('table.searchable > tbody > tr').show();\n // split on \", \"\n var params = value.split(\", \");\n for (var param = 0; param < params.length; param++) {\n if (params[param] != \"\") {\n var $rows = $('table.searchable > tbody > tr').filter(\":visible\");\n for (var i = 0; i < $rows.length; i++) {\n var $dataValue = $rows.eq(i).children();\n var match = false;\n for (var data = 0; data < $dataValue.length; data++) {\n var $dataHtml = $.trim($dataValue.eq(data).html());\n if ($dataHtml.toLowerCase() === params[param].toLowerCase()) {\n match = true;\n }\n // check if there is a \",\" after the word but no space\n else if (params[param].toLowerCase().charAt(params[param].length-1) === ',') {\n if (params[param].toLowerCase().substring(0, params[param].length-1) === $dataHtml.toLowerCase()) {\n match = true;\n }\n if($dataHtml.toLowerCase().includes(params[param].toLowerCase())) {\n match = true;\n }\n }\n else if (param === params.length-1){\n if($dataHtml.toLowerCase().includes(params[param].toLowerCase())) {\n match = true;\n }\n }\n }\n if (!match) {\n $rows.eq(i).hide();\n }\n else {\n $rows.eq(i).show();\n }\n }\n }\n }\n }\n catch (err) {\n console.log(err);\n // LogErrorScript(err.message, \"SearchScript.search\")\n }\n}", "getValidDeals(node) {\n const term = this.props.searchTerm\n const deals = node.deals\n\n if (!deals) {\n return 0;\n }\n\n const matches = deals.filter(deal => {\n const notFiltered = this.isNotFiltered(deal)\n return deal.description.toLowerCase().indexOf(term) !== -1 && notFiltered\n })\n return matches\n }", "function searchFunction() {\n let input = document.getElementById('myinput');\n let filter = input.value.toUpperCase();\n let ul = document.getElementById('catalog');\n \n html = '';\n for (let recipe of allRecipes) {\n let ingredientMatches = false;\n let allargiesMatches = false;\n\n for (let ingredient of recipe.recipeIngredients) {\n if(ingredient.toLowerCase().includes(input.value.toLowerCase())) {\n ingredientMatches = true;\n }\n }\n for (let allargies of recipe.recipeAllargies) {\n if(allargies.toLowerCase().includes(input.value.toLowerCase())) {\n allargiesMatches = true;\n } \n }\n if (recipe.recipeTitle.toLowerCase().includes(input.value.toLowerCase()) || ingredientMatches || allargiesMatches ){\n html += recipe.generateHTMLStructure()\n \n } \n document.getElementById('catalog').innerHTML = html\n let addToCartButtons = document.getElementsByClassName('btn-shop')\n for (var i = 0; i < addToCartButtons.length; i++) {\n var button = addToCartButtons[i]\n button.addEventListener('click', addToCartClicked)\n }\n\n }\n}", "function searchMatches(payload) {\n console.log('payload', payload)\n return new Promise((resolve, reject) => {\n const sql = \"SELECT * FROM [matches]\";\n const request = new Request(sql, (err, rowcount) => {\n if (err) {\n reject(err);\n console.log(err);\n } else if (rowcount == 0) {\n reject({ message: \"data not exist\" });\n }\n });\n\n request.on(\"done\", (rowcount, more, rows) => {\n console.log(row);\n });\n\n const selected = {};\n request.on(\"row\", (columns) => {\n columns.map(({ value, metadata }) => {\n selected[metadata.colName] = value;\n });\n resolve(selected);\n });\n connection.execSql(request);\n });\n}", "search(e: Event) {\n // Retrieving input html element with the search string\n const target = ((e.target: any): HTMLInputElement);\n\n // Retrieving search string\n const needle: string = target.value.toLowerCase();\n\n // Asserting search was initialized\n invariant(this._preSearchData && this._preSearchData != null, \"CRUDActions.search: search wasn't initialized\");\n\n // If search string wasn't retrieved successfully or it is an empty string, stop search\n if (!needle) {\n this.crudStore.setData(this._preSearchData);\n return;\n }\n\n // Retrieving fields of data\n const fields: List<string> = this.crudStore.getSchema().map(item => item.id);\n\n // Retrieving all records that have the search string\n let searchData;\n if (this._preSearchData && this._preSearchData != null) {\n searchData = this._retrieveSearchData(this._preSearchData, fields, needle)\n\n // Updating data in store without committing since this update is temporary until\n // search in finished\n this.crudStore.setData(searchData);\n }\n }", "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCategories.forEach(function(categoryObj) {\n allCategoryNames.push(categoryObj.name);\n checkEmergencyTerms(categoryObj.name);\n });\n search.search({ category: allCategoryNames.join(',') });\n }", "function getFilter() {\r\n function createFilterEntry(rs, attribute, obj) { \r\n return {\r\n \"score\": rs.SCORE,\r\n \"terms\": rs.COMPANYNAME,\r\n \"attribute\": attribute,\r\n \"category\": obj\r\n };\r\n }\r\n\r\n var body = '';\r\n var terms = $.request.parameters.get(\"query\");\r\n terms = terms.replace(\"'\",\"\");\r\n var conn = $.hdb.getConnection();\r\n var rs;\r\n var query;\r\n var list = [];\r\n var i;\r\n\r\n try {\r\n\r\n // Business Partner Company Name\t\r\n\r\n query = 'SELECT TO_INT(SCORE()*100)/100 AS SCORE, TO_NVARCHAR(COMPANYNAME) AS COMPANYNAME FROM \"sap.hana.democontent.epm.models::BUYER\" ' + ' WHERE CONTAINS(\"COMPANYNAME\",?,FUZZY( 0.7 , \\'similarCalculationMode=symmetricsearch\\')) ORDER BY score DESC';\r\n rs = conn.executeQuery(query, terms);\r\n\r\n for (i = 0; i < rs.length; i++) {\r\n list.push(createFilterEntry(rs[i], MESSAGES.getMessage('SEPM_POWRK',\r\n '001'), \"company\"));\r\n }\r\n\r\n // Business Partner City\r\n query = 'SELECT TO_INT(SCORE()*100)/100 AS score, TO_NVARCHAR(CITY) AS COMPANYNAME FROM \"sap.hana.democontent.epm.models::BUYER\" ' + ' WHERE CONTAINS(\"CITY\",?,FUZZY( 0.7 , \\'similarCalculationMode=symmetricsearch\\')) ORDER BY score DESC';\r\n rs = conn.executeQuery(query, terms);\r\n\r\n for (i = 0; i < rs.length; i++) {\r\n list.push(createFilterEntry(rs[i], MESSAGES.getMessage('SEPM_POWRK',\r\n '007'), \"businessPartner\"));\r\n }\r\n\r\n conn.close();\r\n } catch (e) {\r\n $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n $.response.setBody(e.message);\r\n return;\r\n }\r\n body = JSON.stringify(list);\r\n $.trace.debug(body);\r\n $.response.contentType = 'application/json';\r\n $.response.setBody(body);\r\n $.response.status = $.net.http.OK;\r\n}", "list(req, res) {\n logging.logTheinfo(\"bank index Router\");\n var count;\n var skip;\n\n if(req.body.limit)\n {\n count=parseInt(req.body.limit);\n }\n else{\n count=25\n }\n if(req.body.offset)\n {\n skip= parseInt((req.body.offset)*( count))\n }\n else{\n skip=0;\n }\n var obj={};\n obj.where={};\n // obj.where.processingStatus='Open';\n if(req.body.relationId)\n {\n obj.where.relationshipId=parseInt(req.body.relationId);\n }\n if(req.body.classification_1)\n {\n obj.where.classification_1=req.body.classification_1;\n }\n if(req.body.columnname && req.body.findtext)\n { \n obj.where[req.body.columnname]={\n [Op.like]:'%'+req.body.findtext+'%'\n\n \n }\n\n }\n obj.order=[['extRecordsId', 'ASC']];\n obj.offset= skip;\n obj.limit= count;\n \n bank.findAll(\n obj).then(data=>{\n res.send(data) \n })\n }", "function filteredShoes() {\n let searchTerm = \"shoe\";\n console.log(searchTerm);\n console.log(products);\n let searchedProducts = products.filter((product) => \n product.product_type.toLowerCase().includes(searchTerm.toLowerCase())\n \n );\n console.log(searchedProducts);\n make_products(searchedProducts);\n\n}", "searchProperty(details, success, failure) {\n ApolloService.query({\n query: Queries.SEARCH_PROPERTY,\n variables: details\n }).then(data => { success(data.data.searchProperties) }).catch(error => failure(error));\n }", "filterSearchData(searchDataAr) {\n let filteredAr = searchDataAr.filter(item => item.name.toLowerCase().includes(this.state.filter.toLowerCase()) === true)\n return filteredAr\n }", "function jsonSearcher(list, term) {\n var quantity = 0\n var sku = \"#\"\n\n console.log(finalJsonOutput.list0.rowList)\n for (var i = 0; i < finalJsonOutput.list0.rowList.length; i++) {\n console.log(JSON.stringify(finalJsonOutput.list0.rowList[i].rowName))\n if (JSON.stringify(finalJsonOutput.list0.rowList[i].rowName).includes(term)){\n finalJsonOutput.list0.rowList[i].rowName\n }\n return [quantity, sku]\n }\n}", "filterData(postsDisni,searchKey){\n const result =postsDisni.filter((postDisni)=>\n postDisni.Cus_name.toLowerCase().includes(searchKey) ||\n postDisni.Cus_name.includes(searchKey)\n\n\n )\n\nthis.setState({postsDisni:result})\n\n}", "function findContact(searchTerm){\n searchResults = [];\n\n var list = contacts.find().fetch();\n console.log(list);\n for(var i=0; i < list.length; i++)\n {\n obj = list[i];\n if(obj.firstname == searchTerm || obj.lastname === searchTerm || obj.gender === searchTerm || obj.email === searchTerm || obj.number === searchTerm || obj.latitude === searchTerm || obj.longitude === searchTerm)\n {\n searchResults.push(obj);\n }\n }\n Session.set(\"searchRes\",searchResults);\n}", "function total_sales_by_location(request){\n\n \t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar customer = request.parameters.customer;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\n//fleet\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\";\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\n\t\t\tif(customer==parent){\n\t\t\t\tlogic1=\"anyof\";\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\n//fleet variables for fleet number filter\n\t\t\tvar fleet_logic=\"noneof\";\n\t\t\t\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\t\t\t\n/*\t\t\t\t\t\t\n\t\t\tvar filter1=[\n\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t \"AND\", \n\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t \"AND\", \n\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t \"AND\", \n\t\t\t [\"location\",\"anyof\",\"8\",\"9\",\"10\",\"51\",\"52\",\"5\",\"228\",\"225\",\"223\",\"224\",\"222\"], \n\t\t\t \"AND\", \n\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t ];\n\t\t\tvar filter2=[\n\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t \"AND\", \n\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t \"AND\", \n\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t \"AND\", \n\t\t\t [\"entity\",\"is\",customer], \n\t\t\t \"AND\", \n\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t ];\n\t\t\t\n\t\t\tif(customer==848) filter=filter2\n\t\t\telse filter=filter1;\n\t*/\n\t\t\tvar filter=[\n\t\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"customer.parent\",logic1,parent1],\n\t\t\t\t \"AND\",\n\t\t\t\t [\"entity\",logic2,parent2],\n//fleet\t\t\t\t \n\t\t\t\t \"AND\",\n\t\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet],\n\t\t\t\t \"AND\",\n\t\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t\t ];\n\t\t\t\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\n\t\t\tvar searchObj = search.create({\n\t\t\t\t type: \"transaction\",\n\t\t\t\t filters:filter,\n\t\t\t\t columns:\n\t\t\t\t [\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"companyname\",\n\t\t\t\t join: \"customer\",\n\t\t\t\t summary: \"GROUP\",\n\t\t\t\t label: \"Location\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"formulacurrency\",\n\t\t\t\t summary: \"SUM\",\n\t\t\t\t formula: \"CASE WHEN {customer.category} != 'Krone' THEN {netamountnotax} ELSE 0 END\",\n\t\t\t\t label: \"Formula (Currency)\"\n\t\t\t\t })\n\t\t\t\t ]\n\t\t\t\t});\n\t\t\t\t\n\t \t//var searchObj = search.load({id: 'customsearch_sal_sales_by_branch_3_2_3'});\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t \tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t \tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\t\t\t\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t \treturn result_array;\n\t\t}", "function search(req, res, callback) {\r\n /*res.setHeader('Access-Control-Allow-Origin', 'http://localhost:4200');\r\n res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');\r\n res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');\r\n res.setHeader('Access-Control-Allow-Credentials', true);*/\r\n\r\n var query = Doctor.find({\r\n statusflag: 'A' \r\n //orguid: req.session.orguid\r\n })\r\n\r\n console.log('name : ' + req.body.name);\r\n console.log('location : ' + req.body.location);\r\n console.log('specialty : ' + req.body.specialtyuid);\r\n\r\n /*if (req.body.code != null && req.body.code.length > 0)\r\n query.where('code').equals(!!req.body.isstrictcode ? req.body.code : { '$regex': getBetweenRegx(req.body.code) });\r\n */\r\n if (req.body.location != null && req.body.location.length > 0) {\r\n query.where({\r\n orguid: {\r\n $in: req.body.location\r\n }\r\n });\r\n }\r\n\r\n if (req.body.specialtyuid != null && req.body.specialtyuid.length > 0) {\r\n query.where({\r\n specialtyuid: {\r\n $in: req.body.specialtyuid\r\n }\r\n });\r\n }\r\n \r\n if (req.body.name != null && req.body.name.length > 0) {\r\n query.where({\r\n $or: [{\r\n name: {\r\n '$regex': getBetweenRegx(req.body.name)\r\n }\r\n }, {\r\n lastname: {\r\n '$regex': getBetweenRegx(req.body.name)\r\n }\r\n },\r\n {\r\n licensenumber: {\r\n '$regex': getBetweenRegx(req.body.name)\r\n }\r\n }\r\n ]\r\n });\r\n }\r\n\r\n /*if (req.body.location != null && req.body.location.length > 0) {\r\n query.where({\r\n location: {\r\n '$regex': getBetweenRegx(req.body.location)\r\n }\r\n });\r\n } */\r\n \r\n \r\n query.select('printname genderuid titleuid primarydept location qualification specialtyuid _id externalid orguid');\r\n query.populate('genderuid', 'valuedescription');\r\n query.populate('titleuid', 'valuedescription');\r\n query.populate('specialtyuid', 'valuedescription');\r\n\r\n query.exec(function(err, docs) { \r\n if (!err) {\r\n console.log(docs);\r\n\r\n if (!!callback) {\r\n setTimeout(function() { callback(null, docs); });\r\n return;\r\n } else {\r\n res.status(200).json({\r\n doctors: docs\r\n });\r\n }\r\n } else {\r\n //winston.error(err, {\r\n // timestamp: Date.now(),\r\n // pid: process.pid,\r\n // url: req.url\r\n //});\r\n if (!!callback) {\r\n setTimeout(function() { callback('ERRORS.RECORDNOTFOUND'); });\r\n return;\r\n } else {\r\n res.status(500).json({\r\n error: 'ERRORS.RECORDNOTFOUND'\r\n });\r\n }\r\n }\r\n });\r\n}", "ingredientFilter(recipe) {\n const searchTerm = this.state.search;\n if (recipe.ingredients.length !== 0) {\n for (let i = 0; i < recipe.ingredients.length; i++) {\n if (recipe.ingredients[i].ingredient.toLowerCase().includes(searchTerm.toLowerCase())) {\n return recipe.ingredients[i].ingredient.toLowerCase().includes(searchTerm.toLowerCase());\n }\n }\n return false;\n } else {\n return false;\n }\n }", "function BuildQuery()\n {\n selectedCriteriaJSON = \"{\\\"securityFilters\\\":[\";\n\n query = _spPageContextInfo.webAbsoluteUrl + \"/_api/search/query?querytext='\";\n var queryAnd = \"\";\n var queryOr = \"\";\n\n //Auto Allowance Level\n if (vm.termsAutoAllowanceLevel.length > 0)\n {\n var selectedValues = \"\";\n\n selectedCriteriaJSON += \"{\\\"title\\\":\\\"Auto Allowance Level\\\",\";\n for (var i = 0; i < vm.termsAutoAllowanceLevel.length; i++)\n {\n selectedValues += vm.termsAutoAllowanceLevel[i].Name + \";\";\n if ($scope.aalSelectedOption == \"==\") {\n if ($scope.aalAndOr == \"And\") {\n queryAnd += \" CCIPAutoAllowanceLevel:\" + vm.termsAutoAllowanceLevel[i].Name + \" AND \";\n } else if ($scope.aalAndOr == \"Or\") {\n queryOr += \"CCIPAutoAllowanceLevel:\" + vm.termsAutoAllowanceLevel[i].Name + \" OR \";\n }\n }\n else {\n if ($scope.aalAndOr == \"And\") {\n queryAnd += \"CCIPAutoAllowanceLevel<>\" + vm.termsAutoAllowanceLevel[i].Name + \" AND \";\n } else if ($scope.aalAndOr == \"Or\") {\n queryOr += \"CCIPAutoAllowanceLevel<>\" + vm.termsAutoAllowanceLevel[i].Name + \" OR \";\n }\n }\n }\n \n if ($scope.aalAndOr == \"And\") {\n selectedCriteriaJSON += \"\\\"AndOr\\\":\\\"And\\\",\";\n }\n if ($scope.aalAndOr == \"Or\") {\n selectedCriteriaJSON += \"\\\"AndOr\\\":\\\"Or\\\",\";\n }\n if ($scope.aalSelectedOption == \"==\") {\n selectedCriteriaJSON += \"\\\"selectedOption\\\":\\\"Equal to\\\",\";\n }\n else {\n selectedCriteriaJSON += \"\\\"selectedOption\\\":\\\"Not equal to\\\",\";\n }\n selectedCriteriaJSON += \"\\\"selectedValue\\\":\\\"\" + selectedValues + \"\\\"},\";\n }\n\n //Business Unit\n if (vm.termsBusinessUnit.length > 0) {\n var selectedValues = \"\";\n\n selectedCriteriaJSON += \"{\\\"title\\\":\\\"Business Unit\\\",\";\n for (var i = 0; i < vm.termsBusinessUnit.length; i++) {\n selectedValues += vm.termsBusinessUnit[i].Name + \";\";\n\n if ($scope.buSelectedOption == \"==\") {\n for (var i = 0; i < vm.termsBusinessUnit.length; i++) {\n if ($scope.buAndOr == \"And\") {\n queryAnd += \"CCIPBusinessUnit:\" + vm.termsBusinessUnit[i].Name + \" AND \";\n } else if ($scope.buAndOr == \"Or\") {\n queryOr += \"CCIPBusinessUnit:\" + vm.termsBusinessUnit[i].Name + \" OR \";\n }\n }\n }\n else {\n for (var i = 0; i < vm.termsBusinessUnit.length; i++) {\n if ($scope.buAndOr == \"And\") {\n queryAnd += \"CCIPBusinessUnit<>\" + vm.termsBusinessUnit[i].Name + \" AND \";\n } else if ($scope.buAndOr == \"Or\") {\n queryOr += \"CCIPBusinessUnit<>\" + vm.termsBusinessUnit[i].Name + \" OR \";\n }\n }\n }\n }\n \n if ($scope.buAndOr == \"And\") {\n selectedCriteriaJSON += \"\\\"AndOr\\\":\\\"And\\\",\";\n }\n if ($scope.buAndOr == \"Or\") {\n selectedCriteriaJSON += \"\\\"AndOr\\\":\\\"Or\\\",\";\n }\n if ($scope.buSelectedOption == \"==\") {\n selectedCriteriaJSON += \"\\\"selectedOption\\\":\\\"Equal to\\\",\";\n }\n else {\n selectedCriteriaJSON += \"\\\"selectedOption\\\":\\\"Not equal to\\\",\";\n }\n selectedCriteriaJSON += \"\\\"selectedValue\\\":\\\"\" + selectedValues + \"\\\"},\";\n }\n\n //Career Level\n if (vm.termsCareerLevel.length > 0) {\n if ($scope.clSelectedOption == \"==\") {\n for (var i = 0; i < vm.termsCareerLevel.length; i++) {\n if ($scope.clAndOr == \"And\") {\n queryAnd += \"CCIPCareerLevel:\" + vm.termsCareerLevel[i].Name + \" AND \";\n } else if ($scope.clAndOr == \"Or\") {\n queryOr += \"CCIPCareerLevel:\" + vm.termsCareerLevel[i].Name + \" OR \";\n }\n }\n }\n else {\n for (var i = 0; i < vm.termsCareerLevel.length; i++) {\n if ($scope.clAndOr == \"And\") {\n queryAnd += \"CCIPCareerLevel<>\" + vm.termsCareerLevel[i].Name + \" AND \";\n } else if ($scope.clAndOr == \"Or\") {\n queryOr += \"CCIPCareerLevel<>\" + vm.termsCareerLevel[i].Name + \" OR \";\n }\n }\n }\n }\n\n //Commissioned\n if (vm.termsCommissioned.length > 0) {\n if ($scope.commissionedSelectedOption == \"==\") {\n for (var i = 0; i < vm.termsCommissioned.length; i++) {\n if ($scope.comAndOr == \"And\") {\n queryAnd += \"CCIPCommissioned:\" + vm.termsCommissioned[i].Name + \" AND \";\n } else if ($scope.comAndOr == \"Or\") {\n queryOr += \"CCIPCommissioned:\" + vm.termsCommissioned[i].Name + \" OR \";\n }\n }\n }\n else {\n for (var i = 0; i < vm.termsCommissioned.length; i++) {\n if ($scope.comAndOr == \"And\") {\n queryAnd += \"CCIPCommissioned<>\" + vm.termsCommissioned[i].Name + \" AND \";\n } else if ($scope.comAndOr == \"Or\") {\n queryOr += \"CCIPCommissioned<>\" + vm.termsCommissioned[i].Name + \" OR \";\n }\n }\n }\n }\n\n //Department\n if (vm.termsDepartment.length > 0) {\n if ($scope.deptSelectedOption == \"==\") {\n for (var i = 0; i < vm.termsDepartment.length; i++) {\n if ($scope.deptAndOr == \"And\") {\n queryAnd += \"CCIPDept:\" + vm.termsDepartment[i].Name + \" AND \";\n } else if ($scope.deptAndOr == \"Or\") {\n queryOr += \"CCIPDept:\" + vm.termsDepartment[i].Name + \" OR \";\n }\n }\n }\n else {\n for (var i = 0; i < vm.termsDepartment.length; i++) {\n if ($scope.deptAndOr == \"And\") {\n queryAnd += \"CCIPDept<>\" + vm.termsDepartment[i].Name + \" AND \";\n } else if ($scope.deptAndOr == \"Or\") {\n queryOr += \"CCIPDept<>\" + vm.termsDepartment[i].Name + \" OR \";\n }\n }\n }\n }\n\n //FLSA Status\n if (vm.termsFLSAStatus.length > 0) {\n if ($scope.flsaSelectedOption == \"==\") {\n for (var i = 0; i < vm.termsFLSAStatus.length; i++) {\n if ($scope.flsaAndOr == \"And\") {\n queryAnd += \"CCIPFLSAStatus:\" + vm.termsFLSAStatus[i].Name + \" AND \";\n } else if ($scope.flsaAndOr == \"Or\") {\n queryOr += \"CCIPFLSAStatus:\" + vm.termsFLSAStatus[i].Name + \" OR \";\n }\n }\n }\n else {\n for (var i = 0; i < vm.termsFLSAStatus.length; i++) {\n if ($scope.flsaAndOr == \"And\") {\n queryAnd += \"CCIPFLSAStatus<>\" + vm.termsFLSAStatus[i].Name + \" AND \";\n } else if ($scope.flsaAndOr == \"Or\") {\n queryOr += \"CCIPFLSAStatus<>\" + vm.termsFLSAStatus[i].Name + \" OR \";\n }\n }\n }\n }\n\n queryOr = queryOr.slice(0, queryOr.lastIndexOf(\" OR \"));\n queryAnd = queryAnd.slice(0, queryAnd.lastIndexOf(\" AND \"));\n if (queryAnd.length > 0 && queryOr.length > 0)\n {\n query += \"(\" + queryAnd + \") OR (\" + queryOr + \")'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&selectproperties='AccountName,PreferredName'\";\n }\n else if (queryAnd.length > 0)\n {\n query += \"(\" + queryAnd + \")'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&selectproperties='AccountName,PreferredName'\";\n }\n else if (queryOr.length > 0) {\n query += \"(\" + queryOr + \")'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&selectproperties='AccountName,PreferredName'\";\n }\n else {\n return \"\";\n }\n \n //query = \"https://sr0101.sharepoint.com/sites/ng/_api/search/query?querytext='(CCIPDept:IT)'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'\";\n\n selectedCriteriaJSON = selectedCriteriaJSON.slice(0, selectedCriteriaJSON.lastIndexOf(\",\"));\n selectedCriteriaJSON += \"]}\";\n return query;\n }", "filterProducts(filterText) {\n const { products } = this.state;\n const filterValue = (filterText || \"\").toLowerCase();\n let filtredProducts = products;\n\n if (filterText !== \"\") {\n filtredProducts = products.filter(\n c =>\n c.name.toLowerCase().includes(filterValue) ||\n c.shortDescription.toLowerCase().includes(filterValue)\n );\n }\n\n this.setState({\n filtredProducts,\n filterText\n });\n }", "function searchUtil(item,toSearch)\n{\n /* Search Text in all 3 fields */\n return ( item.name.toLowerCase().indexOf(toSearch.toLowerCase()) > -1 || item.Email.toLowerCase().indexOf(toSearch.toLowerCase()) > -1 || item.EmpId == toSearch\n ) \n ? true : false ;\n}", "function treatmentQuerySearch() {\n var tracker = $q.defer();\n var results = (editMsVm.treatment.details ? editMsVm.treatments.filter(createFilterForTreatments(editMsVm.treatment.details)) : editMsVm.treatments);\n\n return results;\n }", "async function studentSearch(data, id) {\n var isQuery = false; //checks if there is a query to be matched\n\n var session = driver.session();\n var student;\n var readTxResultPromise = await session.readTransaction(async txc => {\n var query = `MATCH (s:Student) WHERE ID(s) = ${id} RETURN s;`;\n var studentNode = await txc.run(query);\n student = studentNode.records[0]._fields[0].properties;\n });\n session.close();\n\n query = `MATCH (s:Student) WITH COLLECT(ID(s)) AS s_filter `;\n\n var student_filter = false;\n\n if (data.myClass === true) {\n // console.log(\"myclass is true\");\n isQuery = true;\n student_filter = true;\n query += `OPTIONAL MATCH (s:Student) WHERE s.class = '${student.class}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) AS s_filter `\n } else {\n if (data.department.length > 0) {\n // console.log(\"dep is true\");\n isQuery = true;\n student_filter = true;\n query += `OPTIONAL MATCH (s:Student) WHERE s.department = '${data.department}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) AS s_filter `\n }\n if (parseInt(data.semester) > 0) {\n // console.log(\"sem is true\");\n isQuery = true;\n student_filter = true;\n query += `OPTIONAL MATCH (s:Student) WHERE s.semester = '${data.semester}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) AS s_filter `\n }\n }\n\n if (student_filter) {\n query += `WITH s_filter AS res, s_filter `\n\n data.institutes.forEach(institute => {\n query += `OPTIONAL MATCH (s:Student)-[:STUDIED_IN]->(i:Institute) WHERE i.name CONTAINS '${institute}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.skills.forEach(skill => {\n query += `OPTIONAL MATCH (s:Student)-[:HAS]->(sk:Skill) WHERE sk.name CONTAINS '${skill}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.courses.forEach(course => {\n query += `OPTIONAL MATCH (s:Student)-[:COMPLETED]->(c:Course) WHERE c.name CONTAINS '${course}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.projects.forEach(project => {\n query += `OPTIONAL MATCH (s:Student)-[:HAS_DONE]->(p:Project) WHERE p.name CONTAINS '${project}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.achievements.forEach(achievement => {\n query += `OPTIONAL MATCH (s:Student)-[:HAS_ACHIEVED]->(a:Achievement) WHERE a.title CONTAINS '${achievement}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.researchPapers.forEach(researchPaper => {\n query += `OPTIONAL MATCH (s:Student)-[:PUBLISHED]->(r:ResearchPaper) WHERE r.title CONTAINS '${researchPaper}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.clubs.forEach(club => {\n query += `OPTIONAL MATCH (s:Student)-[:PART_OF]->(c:Club) WHERE c.name CONTAINS '${club}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.interests.forEach(interest => {\n query += `OPTIONAL MATCH (s:Student)-[:INTERESTED_IN]->(i:Interest) WHERE i.name CONTAINS '${interest}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.languages.forEach(language => {\n query += `OPTIONAL MATCH (s:Student)-[:SPEAKS]->(l:Language) WHERE l.name CONTAINS '${language}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n });\n\n data.companies.forEach(company => {\n query += `OPTIONAL MATCH (s:Student)-[:WORKED_IN]->(c:Company) WHERE c.name CONTAINS '${company}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter OPTIONAL MATCH (s:Student)-[:WORKED_IN]->(c:Company) WHERE c.field CONTAINS '${company}' AND ID(s) IN s_filter WITH COLLECT(ID(s)) + res AS res, s_filter `\n })\n\n query += `RETURN res; `\n } else {\n query = `WITH [] AS res `\n\n data.institutes.forEach(institute => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:STUDIED_IN]->(i:Institute) WHERE i.name CONTAINS '${institute}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.skills.forEach(skill => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:HAS]->(sk:Skill) WHERE sk.name CONTAINS '${skill}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.courses.forEach(course => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:COMPLETED]->(c:Course) WHERE c.name CONTAINS '${course}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.projects.forEach(project => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:HAS_DONE]->(p:Project) WHERE p.name CONTAINS '${project}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.achievements.forEach(achievement => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:HAS_ACHIEVED]->(a:Achievement) WHERE a.title CONTAINS '${achievement}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.researchPapers.forEach(researchPaper => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:PUBLISHED]->(r:ResearchPaper) WHERE r.title CONTAINS '${researchPaper}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.clubs.forEach(club => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:PART_OF]->(c:Club) WHERE c.name CONTAINS '${club}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.interests.forEach(interest => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:INTERESTED_IN]->(i:Interest) WHERE i.name CONTAINS '${interest}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.languages.forEach(language => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:SPEAKS]->(l:Language) WHERE l.name CONTAINS '${language}' WITH COLLECT(ID(s)) + res AS res `\n });\n\n data.companies.forEach(company => {\n isQuery = true;\n query += `OPTIONAL MATCH (s:Student)-[:WORKED_IN]->(c:Company) WHERE c.name CONTAINS '${company}' WITH COLLECT(ID(s)) + res AS res OPTIONAL MATCH (s:Student)-[:WORKED_IN]->(c:Company) WHERE c.field CONTAINS '${company}' WITH COLLECT(ID(s)) + res AS res `\n })\n\n query += `RETURN res; `\n }\n var res = await queryNeo4j(query);\n var students = res.map(r => {\n var student = r.records.map(record => {\n return {\n ...record._fields[0].properties,\n ...record._fields[1].properties,\n }\n })\n return student[0];\n })\n // console.log(\"student inside neo\", students);\n return isQuery === true ? students : [];\n}", "function search() {\n let regex_no = `^${req.params.query}.*`;\n let regex_name = `${req.params.query}.*`;\n User.find( {$or: [{username: {$regex: regex_name, $options: 'i'} }, \n {phone_number: {$regex: regex_no, $options: 'i'} } ]}, (err, users) => {\n if (err) res.send(err); \n else {\n res.json(users); \n }\n });\n }", "function top_parts_by_value(request){\n\n\t\t\t//var searchObj = search.load({id: 'customsearch1428'});\n \t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\t\t\t\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\n\t\t\tvar customer = request.parameters.customer;\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\"; // \"none of 0\" will let to show everything\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\n\t\t\tif(customer==parent){\t// customer is a parent, we need to show all the childs\n\t\t\t\tlogic1=\"anyof\";\t\t\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\t// customer is a child, we need to show only that one child\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\n\t\t\tvar fleet_logic=\"noneof\";\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\t\t\t\n/*\t\t\t\t\t\t\n\t\t\t\t [\n\t\t\t\t [\"type\",\"anyof\",\"CustInvc\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"account\",\"anyof\",\"54\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)],\n\t\t\t\t \"AND\", \n\t\t\t\t [\"item.pricinggroup\",\"noneof\",\"233\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"location.custrecord_sales_area\",\"anyof\",\"7\",\"8\"], \n\t\t\t\t \"AND\", \n\t\t\t\t [\"custcol_fleet_num.custrecordfl_body_style\",\"anyof\",\"@ALL@\"]\n\t\t\t\t ]\n\t*/\n\t\t\tvar filter=[\n\t\t\t\t[\"type\",\"anyof\",\"CustInvc\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"account\",\"anyof\",\"54\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)],\n\t\t\t\t\"AND\", \n\t\t\t\t[\"item.pricinggroup\",\"noneof\",\"233\"], \n\t\t\t\t\"AND\", \n\t\t\t\t[\"custcol_fleet_num.custrecordfl_body_style\",\"anyof\",\"@ALL@\"],\n\t\t\t\t\"AND\", \n\t\t\t\t[\"customer.parent\",logic1,parent1],\n\t\t\t\t\"AND\",\n\t\t\t\t[\"entity\",logic2,parent2],\n\t\t\t \"AND\",\n\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet]\t\t\t\t\n\t\t\t\t];\n\n\t\t\tvar searchObj = search.create({\n\t\t\t\t type: \"invoice\",\n\t\t\t\t filters:filter,\n\t\t\t\t columns:\n\t\t\t\t [\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"upccode\",\n\t\t\t\t join: \"item\",\n\t\t\t\t summary: \"GROUP\",\n\t\t\t\t label: \"Item #\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"salesdescription\",\n\t\t\t\t join: \"item\",\n\t\t\t\t summary: \"GROUP\",\n\t\t\t\t label: \"Description\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"quantity\",\n\t\t\t\t summary: \"SUM\",\n\t\t\t\t label: \"Quantity\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"formulacurrency\",\n\t\t\t\t summary: \"SUM\",\n\t\t\t\t formula: \"nvl(({quantity}*{item.cost})+{amount},0)\",\n\t\t\t\t sort: search.Sort.DESC,\n\t\t\t\t label: \"Formula (Currency)\"\n\t\t\t\t })\n\t\t\t\t ]\n\t\t\t\t});\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t \tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t \tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\t\t\t\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t \treturn result_array;\n\t \t\n\t\t}" ]
[ "0.58776355", "0.5789239", "0.5677279", "0.5620365", "0.55751693", "0.55638516", "0.55566597", "0.55396926", "0.55245984", "0.55237097", "0.55235994", "0.5513817", "0.5482206", "0.5473594", "0.546288", "0.54501927", "0.5425111", "0.5424942", "0.5405259", "0.53923196", "0.53841406", "0.53426594", "0.5336672", "0.533553", "0.53351337", "0.5332215", "0.5330988", "0.5327813", "0.5327423", "0.53267217", "0.5326305", "0.5317", "0.5310795", "0.529638", "0.5291631", "0.5288303", "0.52745306", "0.5270337", "0.5268088", "0.52675545", "0.52608335", "0.5235946", "0.5231735", "0.5214023", "0.52087", "0.5206316", "0.5203362", "0.51998144", "0.5192832", "0.5190873", "0.5189276", "0.51787865", "0.51663905", "0.5165869", "0.516219", "0.51500314", "0.51476043", "0.51460594", "0.51309955", "0.51225513", "0.5119211", "0.5119023", "0.5118457", "0.5116121", "0.51146567", "0.51109123", "0.5110386", "0.51081616", "0.5101074", "0.50932145", "0.50925905", "0.50913334", "0.50617456", "0.50605494", "0.50574887", "0.5049712", "0.50496006", "0.50492126", "0.50465214", "0.50457954", "0.50457466", "0.5045122", "0.504242", "0.5037195", "0.50357354", "0.50343186", "0.50315374", "0.50295734", "0.5018267", "0.5017186", "0.50140166", "0.50122726", "0.5012084", "0.50115824", "0.5008145", "0.50080687", "0.5006636", "0.50032115", "0.5000597", "0.49972123", "0.49918142" ]
0.0
-1
Parse through merchants to create global selector hierarchy
globalSelectorGroup(merchants) { const trueHierarchy = createSelectorBar(merchants); this.setState({ globalSelectorGroup: trueHierarchy, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get selectors () {\n return _.extend(super.selectors, {\n node: '.arc',\n highlight: '.highlight',\n })\n }", "parseTreeSelector() {\n this.skipSpace(); // Ignore space after a comma, for example\n\n // A tree selector must begin with a node selector\n let ns = this.parseNodeSelector();\n\n for (;;) {\n // Now check the next token. If there is none, or if it is a\n // comma, then we're done with the treeSelector. Otherwise\n // we expect a combinator followed by another node selector.\n // If we don't see a combinator, we throw an error. If we\n // do see a combinator and another node selector then we\n // combine the current node selector with the new node selector\n // using a Selector subclass that depends on the combinator.\n const token = this.nextToken();\n\n if (!token || token === \",\") {\n break;\n } else if (token === \" \") {\n this.consume();\n ns = new AncestorCombinator(ns, this.parseNodeSelector());\n } else if (token === \">\") {\n this.consume();\n ns = new ParentCombinator(ns, this.parseNodeSelector());\n } else if (token === \"+\") {\n this.consume();\n ns = new PreviousCombinator(ns, this.parseNodeSelector());\n } else if (token === \"~\") {\n this.consume();\n ns = new SiblingCombinator(ns, this.parseNodeSelector());\n } else {\n throw new ParseError(\"Unexpected token: \" + token);\n }\n }\n\n return ns;\n }", "setSelectorGroup(currentPathSet) {\n let allowGroupCreate = window.user.isEditor;\n html(this.host, \"\");\n currentPathSet.split(\"¬\").forEach((currentPath) => {\n let parent = c(null, \"DIV\", this.host);\n let pathSplit = currentPath.split(\"/\");\n let tree = index.groupTree(null, false); // exclude generated alpha groupings\n let clevel = tree;\n let groupSelectors = \"\";\n for (let i = 0; i < pathSplit.length || clevel && currentPath; i++) {\n if (i < pathSplit.length || clevel.keys.length > 0 || allowGroupCreate) {\n let selector = c(null, \"SELECT\", parent);\n selector.setAttribute(\"title\", i < pathSplit.length ? s(\"selectGroup\", \"Select group\") : s(\"putIntoSubgroup\", \"Put into a subgroup\"));\n {\n // First option in the menu\n let option = new Option(\"-\", \"\", false, i >= pathSplit.length);\n selector[selector.options.length] = option;\n }\n let keys = clevel.keys;\n let selectionFound = false;\n /*if (clevel.autoSubsKeys && clevel.autoSubsKeys.length > 0) {\n clevel.autoSubsKeys.forEach(ask => {\n let option = c(null, \"OPTION\", selector);\n option.setAttribute(\"value\", ask);\n html(option, ask);\n });\n } else*/ {\n keys.forEach(k => {\n let selected = i < pathSplit.length && k == pathSplit[i];\n selectionFound |= selected;\n if (k.length > 0) {\n let option = new Option(k, k, false, selected);\n selector[selector.options.length] = option;\n }\n });\n }\n if (!selectionFound && i < pathSplit.length && pathSplit[i]) {\n // New option only known in this instance\n let option = new Option(pathSplit[i], pathSplit[i], false, true);\n selector[selector.options.length] = option;\n }\n if (allowGroupCreate || i + 1 == pathSplit.length) {\n let option = new Option(`(${s('createNew', 'create new')})`, '(new)', false, false);\n selector[selector.options.length] = option;\n }\n }\n clevel = i < pathSplit.length ? clevel.subs[pathSplit[i]] : null;\n }\n });\n //if (allowGroupCreate) {\n // Add extra group control:\n let addGroupUi = c(null, \"DIV\", this.host);\n addGroupUi.style = \"position:absolute;top:0;right:4px;\";\n addGroupUi.title = s(\"addToMultipleGroups\", \"Add to multiple groups\");\n html(addGroupUi, \"+\");\n addGroupUi.addEventListener(\"click\", e => { this.setGroup(this.Path + \"¬\"); });\n //}\n }", "get selectors () {\n return _.extend(super.selectors, {\n node: '.arc',\n active: '.active',\n })\n }", "static get selectors() {\n return (0, _reselectTree.createNestedSelector)({\n ast: _selectors4.default,\n data: _selectors2.default,\n trace: _selectors6.default,\n evm: _selectors8.default,\n solidity: _selectors10.default,\n session: _selectors12.default,\n controller: _selectors14.default\n });\n }", "parseTreeSelector() {\n this.skipSpace(); // Ignore space after a comma, for example\n // A tree selector must begin with a node selector\n\n var ns = this.parseNodeSelector();\n\n for (;;) {\n // Now check the next token. If there is none, or if it is a\n // comma, then we're done with the treeSelector. Otherwise\n // we expect a combinator followed by another node selector.\n // If we don't see a combinator, we throw an error. If we\n // do see a combinator and another node selector then we\n // combine the current node selector with the new node selector\n // using a Selector subclass that depends on the combinator.\n var token = this.nextToken();\n\n if (!token || token === \",\") {\n break;\n } else if (token === \" \") {\n this.consume();\n ns = new AncestorCombinator(ns, this.parseNodeSelector());\n } else if (token === \">\") {\n this.consume();\n ns = new ParentCombinator(ns, this.parseNodeSelector());\n } else if (token === \"+\") {\n this.consume();\n ns = new PreviousCombinator(ns, this.parseNodeSelector());\n } else if (token === \"~\") {\n this.consume();\n ns = new SiblingCombinator(ns, this.parseNodeSelector());\n } else {\n throw new ParseError$2(\"Unexpected token: \" + token);\n }\n }\n\n return ns;\n }", "parent (selector = '*') {\n let result = new Set()\n let selectorData = cssParser(selector)\n\n for (let item of this) {\n let parent = item.parent\n\n if (!parent || !selectorData) {\n continue\n }\n\n if (cssMatch(parent, selectorData[0])) {\n result.add(parent)\n }\n }\n\n let $elements = new this.constructor([...result])\n\n return $elements\n }", "parse() {\n // We expect at least one tree selector\n var ts = this.parseTreeSelector(); // Now see what's next\n\n var token = this.nextToken(); // If there is no next token then we're done parsing and can return\n // the tree selector object we got above\n\n if (!token) {\n return ts;\n } // Otherwise, there is more go come and we're going to need a\n // list of tree selectors\n\n\n var treeSelectors = [ts];\n\n while (token) {\n // The only character we allow after a tree selector is a comma\n if (token === \",\") {\n this.consume();\n } else {\n throw new ParseError$2(\"Expected comma\");\n } // And if we saw a comma, then it must be followed by another\n // tree selector\n\n\n treeSelectors.push(this.parseTreeSelector());\n token = this.nextToken();\n } // If we parsed more than one tree selector, return them in a\n // SelectorList object.\n\n\n return new SelectorList(treeSelectors);\n }", "parse() {\n // We expect at least one tree selector\n const ts = this.parseTreeSelector();\n\n // Now see what's next\n let token = this.nextToken();\n\n // If there is no next token then we're done parsing and can return\n // the tree selector object we got above\n if (!token) {\n return ts;\n }\n\n // Otherwise, there is more go come and we're going to need a\n // list of tree selectors\n const treeSelectors = [ts];\n while (token) {\n // The only character we allow after a tree selector is a comma\n if (token === \",\") {\n this.consume();\n } else {\n throw new ParseError(\"Expected comma\");\n }\n\n // And if we saw a comma, then it must be followed by another\n // tree selector\n treeSelectors.push(this.parseTreeSelector());\n token = this.nextToken();\n }\n\n // If we parsed more than one tree selector, return them in a\n // SelectorList object.\n return new SelectorList(treeSelectors);\n }", "getAgentEntries(agent, entries) {\n let nodeEntries = entries.filter(e => e.parent_id.path === \"/spire/server\")\n if(agent === undefined) {\n return [];\n }\n if(agent.selectors === undefined) {\n agent.selectors = [];\n }\n let agentSelectors = new Set(agent.selectors.map(formatSelectors))\n let isAssocWithAgent = e => {\n if(e.selectors === undefined) {\n e.selectors = [];\n }\n let entrySelectors = new Set(e.selectors.map(formatSelectors))\n return isSuperset(agentSelectors, entrySelectors)\n }\n return nodeEntries.filter(isAssocWithAgent)\n }", "function parseSelector(selector) {\n var sel = selector.trim();\n var tagRegex = new RegExp(TAG, 'y');\n var tag = tagRegex.exec(sel)[0];\n var regex = new RegExp(TOKENS, 'y');\n regex.lastIndex = tagRegex.lastIndex;\n var matches = [];\n var nextSelector = undefined;\n var lastCombinator = undefined;\n var index = -1;\n while (regex.lastIndex < sel.length) {\n var match = regex.exec(sel);\n if (!match && lastCombinator === undefined) {\n throw new Error('Parse error, invalid selector');\n }\n else if (match && combinatorRegex.test(match[0])) {\n var comb = combinatorRegex.exec(match[0])[0];\n lastCombinator = comb;\n index = regex.lastIndex;\n }\n else {\n if (lastCombinator !== undefined) {\n nextSelector = [\n getCombinator(lastCombinator),\n parseSelector(sel.substring(index))\n ];\n break;\n }\n matches.push(match[0]);\n }\n }\n var classList = matches\n .filter(function (s) { return s.startsWith('.'); })\n .map(function (s) { return s.substring(1); });\n var ids = matches.filter(function (s) { return s.startsWith('#'); }).map(function (s) { return s.substring(1); });\n if (ids.length > 1) {\n throw new Error('Invalid selector, only one id is allowed');\n }\n var postprocessRegex = new RegExp(\"(\" + IDENT + \")\" + SPACE + \"(\" + OP + \")?\" + SPACE + \"(\" + VALUE + \")?\");\n var attrs = matches\n .filter(function (s) { return s.startsWith('['); })\n .map(function (s) { return postprocessRegex.exec(s).slice(1, 4); })\n .map(function (_a) {\n var attr = _a[0], op = _a[1], val = _a[2];\n var _b;\n return (_b = {},\n _b[attr] = [getOp(op), val ? parseAttrValue(val) : val],\n _b);\n })\n .reduce(function (acc, curr) { return (__assign({}, acc, curr)); }, {});\n var pseudos = matches\n .filter(function (s) { return s.startsWith(':'); })\n .map(function (s) { return postProcessPseudos(s.substring(1)); });\n return {\n id: ids[0] || '',\n tag: tag,\n classList: classList,\n attributes: attrs,\n nextSelector: nextSelector,\n pseudos: pseudos\n };\n}", "function parseSelector(selector) {\n var sel = selector.trim();\n var tagRegex = new RegExp(TAG, 'y');\n var tag = tagRegex.exec(sel)[0];\n var regex = new RegExp(TOKENS, 'y');\n regex.lastIndex = tagRegex.lastIndex;\n var matches = [];\n var nextSelector = undefined;\n var lastCombinator = undefined;\n var index = -1;\n while (regex.lastIndex < sel.length) {\n var match = regex.exec(sel);\n if (!match && lastCombinator === undefined) {\n throw new Error('Parse error, invalid selector');\n }\n else if (match && combinatorRegex.test(match[0])) {\n var comb = combinatorRegex.exec(match[0])[0];\n lastCombinator = comb;\n index = regex.lastIndex;\n }\n else {\n if (lastCombinator !== undefined) {\n nextSelector = [\n getCombinator(lastCombinator),\n parseSelector(sel.substring(index))\n ];\n break;\n }\n matches.push(match[0]);\n }\n }\n var classList = matches\n .filter(function (s) { return s.startsWith('.'); })\n .map(function (s) { return s.substring(1); });\n var ids = matches.filter(function (s) { return s.startsWith('#'); }).map(function (s) { return s.substring(1); });\n if (ids.length > 1) {\n throw new Error('Invalid selector, only one id is allowed');\n }\n var postprocessRegex = new RegExp(\"(\" + IDENT + \")\" + SPACE + \"(\" + OP + \")?\" + SPACE + \"(\" + VALUE + \")?\");\n var attrs = matches\n .filter(function (s) { return s.startsWith('['); })\n .map(function (s) { return postprocessRegex.exec(s).slice(1, 4); })\n .map(function (_a) {\n var attr = _a[0], op = _a[1], val = _a[2];\n var _b;\n return (_b = {},\n _b[attr] = [getOp(op), val ? parseAttrValue(val) : val],\n _b);\n })\n .reduce(function (acc, curr) { return (__assign({}, acc, curr)); }, {});\n var pseudos = matches\n .filter(function (s) { return s.startsWith(':'); })\n .map(function (s) { return postProcessPseudos(s.substring(1)); });\n return {\n id: ids[0] || '',\n tag: tag,\n classList: classList,\n attributes: attrs,\n nextSelector: nextSelector,\n pseudos: pseudos\n };\n}", "function lookup(node){\n \tfor (var i=0;i<node.childNodes.length;i++){\n var tag = node.childNodes[i]; //console.log(subgroup.childNodes);\n \t\tif(tag.childNodes.length > 0){ lookup(tag); } //keep digging\n \t\tif( tag.getAttribute && \n tag.getAttribute('class') && \n tag.getAttribute('class').split(\" \").indexOf(className) >= 0){ //console.log(subgroup.getAttribute('class'));\n \t\t\t targets.push(tag);\n \t\t}\n \t}\n\t}", "function merchandiseHierarchyNativeSelection() {\n\t\treturn {\n\t\t\trestrict: 'A',\n\t\t\tscope: {\n\t\t\t\t'treeMap': '=',\n\t\t\t\t'ngModel': '=',\n\t\t\t\t'defaultLabels': '=',\n\t\t\t\t'disableSelection': '='\n\t\t\t},\n\t\t\ttemplate: multidropdown,\n\t\t\tcontrollerAs: 'ctrl',\n\t\t\tbindToController: true,\n\t\t\tcontroller: MerchandiseHierarchySelection\n\n\t\t};\n\t}", "function parseSelector(selector) {\n var sel = selector.trim();\n var tagRegex = new RegExp(TAG, 'y');\n var tag = tagRegex.exec(sel)[0];\n var regex = new RegExp(TOKENS, 'y');\n regex.lastIndex = tagRegex.lastIndex;\n var matches = [];\n var nextSelector = undefined;\n var lastCombinator = undefined;\n var index = -1;\n while (regex.lastIndex < sel.length) {\n var match = regex.exec(sel);\n if (!match && lastCombinator === undefined) {\n throw new Error('Parse error, invalid selector');\n }\n else if (match && combinatorRegex.test(match[0])) {\n var comb = combinatorRegex.exec(match[0])[0];\n lastCombinator = comb;\n index = regex.lastIndex;\n }\n else {\n if (lastCombinator !== undefined) {\n nextSelector = [getCombinator(lastCombinator), parseSelector(sel.substring(index))];\n break;\n }\n matches.push(match[0]);\n }\n }\n var classList = matches\n .filter(function (s) {\n return s.startsWith('.');\n })\n .map(function (s) {\n return s.substring(1);\n });\n var ids = matches\n .filter(function (s) {\n return s.startsWith('#');\n })\n .map(function (s) {\n return s.substring(1);\n });\n if (ids.length > 1) {\n throw new Error('Invalid selector, only one id is allowed');\n }\n var postprocessRegex = new RegExp(\"(\" + IDENT + \")\" + SPACE + \"(\" + OP + \")?\" + SPACE + \"(\" + VALUE + \")?\");\n var attrs = matches\n .filter(function (s) {\n return s.startsWith('[');\n })\n .map(function (s) {\n return postprocessRegex.exec(s).slice(1, 4);\n })\n .map(function (_a) {\n var attr = _a[0], op = _a[1], val = _a[2];\n var _b;\n return _b = {},\n _b[attr] = [getOp(op), val ? parseAttrValue(val) : val],\n _b;\n })\n .reduce(function (acc, curr) { return (__assign({}, acc, curr)); }, {});\n var pseudos = matches\n .filter(function (s) {\n return s.startsWith(':');\n })\n .map(function (s) {\n return postProcessPseudos(s.substring(1));\n });\n return {\n tag: tag,\n classList: classList,\n nextSelector: nextSelector,\n pseudos: pseudos,\n id: ids[0] || '',\n attributes: attrs,\n };\n }", "_findSelectors() {\n this._container = document.querySelector(this._settings.targetSelector);\n this._items = Array.from(\n document.querySelectorAll(`.${this._container.firstElementChild.className}`)\n );\n this._relatedSliders = this._settings.relatedSlidersSelectors\n .map(selector => document.querySelector(selector));\n this._leftControl = document.querySelector(this._settings.leftSelector);\n this._rightControl = document.querySelector(this._settings.rightSelector);\n }", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }", "_addSelectable(cssSelector, callbackCtxt, listContext) {\n let matcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n }\n else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n }\n else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n }\n else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }", "generateSelector() {\n /* root element cannot have a selector as it isn't a proper element */\n if (this.isRootElement()) {\n return null;\n }\n const parts = [];\n let root;\n for (root = this; root.parent; root = root.parent) {\n /* .. */\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let cur = this; cur.parent; cur = cur.parent) {\n /* if a unique id is present, use it and short-circuit */\n if (cur.id) {\n const escaped = escapeSelectorComponent(cur.id);\n const matches = root.querySelectorAll(`#${escaped}`);\n if (matches.length === 1) {\n parts.push(`#${escaped}`);\n break;\n }\n }\n const parent = cur.parent;\n const child = parent.childElements;\n const index = child.findIndex((it) => it.unique === cur.unique);\n const numOfType = child.filter((it) => it.is(cur.tagName)).length;\n const solo = numOfType === 1;\n /* if this is the only tagName in this level of siblings nth-child isn't needed */\n if (solo) {\n parts.push(cur.tagName.toLowerCase());\n continue;\n }\n /* this will generate the worst kind of selector but at least it will be accurate (optimizations welcome) */\n parts.push(`${cur.tagName.toLowerCase()}:nth-child(${index + 1})`);\n }\n return parts.reverse().join(\" > \");\n }", "function selectorsFromGlobalMetadata(selectors,outputCtx){if(selectors.length>1||selectors.length==1&&selectors[0].value){var selectorStrings=selectors.map(function(value){return value.value;});selectorStrings.some(function(value){return!value;})&&error('Found a type among the string selectors expected');return outputCtx.constantPool.getConstLiteral(literalArr(selectorStrings.map(function(value){return literal(value);})));}if(selectors.length==1){var first=selectors[0];if(first.identifier){return outputCtx.importExpr(first.identifier.reference);}}error('Unexpected query form');return NULL_EXPR;}", "function mergeAndedSelectorsNested(obj) {\n for (var prop in obj) {\n if (Array.isArray(obj)) {\n for (var i in obj) {\n if (obj[i]['$and']) {\n obj[i] = mergeAndedSelectors(obj[i]['$and']);\n }\n }\n }\n var value = obj[prop];\n if (typeof value === 'object') {\n mergeAndedSelectorsNested(value); // <- recursive call\n }\n }\n return obj;\n}", "function createSelectors() {\n var selectors = {ids: {}, classes: {} };\n\n $.each(cfg.ids, function (key, value) {\n selectors.ids[key] = '#' + value;\n });\n $.each(cfg.classes, function (key, value) {\n selectors.classes[key] = '.' + value;\n });\n\n return selectors;\n }", "getDropdownTargets(\n triggerSelector,\n triggerParentSelector,\n targetSelector,\n ) {\n $(triggerSelector).each((index, trigger) => {\n this.dropdowns.push({\n trigger,\n toggle: true,\n target: $(trigger)\n .parents(triggerParentSelector)\n .children(targetSelector),\n });\n });\n }", "function addInternalSelectors(){\n //adding internal class names to void problem with common ones\n $(options.sectionSelector).each(function(){\n $(this).addClass(SECTION);\n });\n $(options.slideSelector).each(function(){\n $(this).addClass(SLIDE);\n });\n }", "function addInternalSelectors(){\n //adding internal class names to void problem with common ones\n $(options.sectionSelector).each(function(){\n $(this).addClass(SECTION);\n });\n $(options.slideSelector).each(function(){\n $(this).addClass(SLIDE);\n });\n }", "function addInternalSelectors(){\n //adding internal class names to void problem with common ones\n $(options.sectionSelector).each(function(){\n $(this).addClass(SECTION);\n });\n $(options.slideSelector).each(function(){\n $(this).addClass(SLIDE);\n });\n }", "scanForSelector() {\n let match = this.match(/(?<identifier>[#.&])([\\w-]+)/g);\n if (!match) {\n return null;\n }\n let identifier = match.groups.identifier;\n if (identifier === '.' || identifier === '#') {\n let selector = simple_selector_1.SimpleSelector.create(identifier + match.text, match.index);\n return selector ? [selector] : null;\n }\n if (this.supportsNesting && identifier === '&') {\n return this.parseAndGetSelectors(match.text, match.index);\n }\n return null;\n }", "function getCssSelectors() {\n const selectors = [\n { id: 'root', classList: ['root'], lvl: 0, children: [] }\n ]\n const rootEl = document.getElementById('root')\n\n const walker = (nodes, selectors) => {\n for (let node of nodes) {\n if (node.nodeType !== 1) continue\n if (node.tagName === 'use') continue\n\n const sel = { id: node.id, tag: node.tagName.toLowerCase() }\n\n const attrs = []\n for (let attr of node.attributes) {\n if (attr.name === 'class') continue\n if (attr.name === 'title') continue\n if (attr.name === 'tabindex') continue\n\n attrs.push([attr.name, attr.value])\n }\n\n if (attrs.length) sel.attrs = attrs\n\n if (typeof node.className === 'string') {\n sel.classList = node.className.split(' ')\n }\n\n selectors.push(sel)\n\n if (node.childNodes && node.childNodes.length) {\n sel.children = []\n walker(node.childNodes, sel.children)\n }\n }\n }\n walker(rootEl.childNodes, selectors[0].children)\n\n return selectors\n}", "function cacheSelectors() {\n nodes = {\n htmlEl: document.querySelector(selectors.htmlEl),\n navToggle: document.querySelectorAll(selectors.navToggle),\n };\n }", "function parseRuleSet(ruleset) {\n ruleset.selectors.forEach(function(selector) {\n var queryString = '',\n nodes = [],\n targets = [fragment],\n parts = defaults.autoExpand ? expand(selector.parts) : selector.parts;\n parts.forEach(function(part) {\n var text = part.text\n\n // Strip browser specific selectors.\n .replace(/(:[:\\-])(?![^\\[]+[\\]])[^ >+~]+/g, '') \n\n // Strip pseudo elements and classes.\n .replace(/:(active|after|before|empty|first-letter|first-line|focus|hover|link|visited)(?![^\\[]+[\\]])/g, '') \n\n // Strip html (root) and body selectors.\n .replace(/^((:root|html)([ >]body|)|body)/g, '');\n if (!text) {\n return;\n }\n queryString += text;\n if (part instanceof parserlib.css.SelectorPart) {\n try {\n nodes = fragment.querySelectorAll('#' + id + '>' + queryString);\n }\n catch(error) {\n error.queryString = queryString;\n report(error);\n }\n if (!nodes.length) {\n var node = createNode(part);\n if (defaults.dataAttr) {\n node.setAttribute('data-selector', queryString);\n }\n \n // Test for various child pseudo classes and ensure enough nodes exist to match the selectors.\n // Plus one more to illustrate variation.\n var n = (text.match(/:nth[^(]+\\(([^)]+)\\)(?![^\\[]+[\\]])/));\n n = n ? (parseInt(n[1], 10) || 1) + 1\n : /:(first|last)-(of|child)(?![^\\[]+[\\]])/.test(text) ? 2\n : 1;\n nodes = [];\n targets.forEach(function(target) {\n var i = n;\n while (i--) {\n var clone = node.cloneNode(false);\n\n // Remember the selector for populating the node.\n clone.__selectorPart__ = text;\n target.appendChild(clone);\n nodes.push(clone);\n }\n });\n }\n }\n else if (part instanceof parserlib.css.Combinator) {\n if (/[> ]/.test(text)) {\n \n // If it's a `descendant` or `child` combinator \n // then the current nodes become the next targets.\n targets = [].slice.call(nodes);\n }\n }\n });\n });\n }", "function lookupNodes(){\n\t\tif( typeof(arg) == 'string') {\n\t\tvar selector = arg;\n\t\tsatellite.cssQuery(selector, function(matched) {\n\t\t\tnodes = matched;\n\t\t});\n\t\t} else if(Array.isArray(arg) == true){\n\t\t\tnodes = arg;\n\t\t} else if(arg == eam.global || arg == eam.context || arg && arg.parentNode){\n\t\t\tnodes = [arg];\n\t\t} else {\n\t\t\tnodes = [];\n\t\t}\n\t\tnode = nodes[0];\n\t}", "extractAll () {\n this.selectors.forEach(selector => {\n if (!this.realEstate.hasOwnProperty(selector.field)) {\n throw new Error('No such property in RealEstate: ' + selector.field)\n }\n\n let extractorCommand = `this.parent.find('${selector.selector}')`\n const methods = Object.keys(selector.methods).reduce((reduced, current) => {\n const args =\n selector.methods[current].reduce((reducedArgs, currentArg) => {\n if (reducedArgs.length > 1) {\n reducedArgs += ','\n }\n return reducedArgs + '\"' + currentArg + '\"'\n }, '')\n return reduced + `.${current}(${args})`\n }, '')\n extractorCommand += methods\n\n this.realEstate[selector.field] = eval(extractorCommand)\n })\n }", "function get_current_selector() {\n\n var parentsv = body.attr(\"data-clickable-select\");\n\n if (isDefined(parentsv)) {\n return parentsv;\n } else {\n get_parents(null, \"default\");\n }\n\n }", "function set_organisms_select(inputs, cb) {\n var target = 'cgi_request.php';\n var data = {\n action: 'get_organisms'\n };\n if (typeof cb === 'function') {\n function callback(out, inputs, cb) {\n parse_organisms(out, inputs);\n cb();\n }\n send_ajax_request(target, data, callback, true, inputs, cb);\n } else {\n var callback = parse_organisms;\n send_ajax_request(target, data, callback, true, inputs);\n }\n}", "function getParentSelector(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.ParentSelectorType,'&',token.ln,token.col);}", "parseAndGetSelectors(word, wordLeftOffset) {\n let { ranges } = new css_range_parser_1.CSSRangeParser(this.document).parse();\n let currentRange;\n let selectorIncludedParentRange;\n // Binary searching should be better, but not help much.\n for (let i = 0; i < ranges.length; i++) {\n let range = ranges[i];\n let start = this.document.offsetAt(range.range.start);\n let end = this.document.offsetAt(range.range.end);\n // Is a ancestor and has selector\n if (this.startOffset >= start && this.startOffset < end) {\n if (currentRange && this.isRangeHaveSelector(currentRange)) {\n selectorIncludedParentRange = currentRange;\n }\n currentRange = range;\n }\n if (this.startOffset < start) {\n break;\n }\n }\n if (!selectorIncludedParentRange) {\n return null;\n }\n let selectors = [];\n for (let { full } of selectorIncludedParentRange.names) {\n if (full[0] === '.' || full[0] === '#') {\n let selector = simple_selector_1.SimpleSelector.create(full + word, wordLeftOffset);\n if (selector) {\n selectors.push(selector);\n }\n }\n }\n return selectors;\n }", "getTree() {\n\n return [\n 'apply',\n this.address.getTree(),\n this.args.map(arg => arg.getTree()),\n this.block\n ];\n }", "function combine(peg_parser, tree_obj){\n\t\tvar child_funcs = [];\n\t\tfor (var i = 0; i < tree_obj.term.length; i++){\n\t\t\tchild_funcs.push(term(peg_parser, tree_obj.term[i]));\n\t\t}\n\t\treturn peg_parser.and.apply(peg_parser, child_funcs);\n\t}", "allParents(selector) {\n let parent = this.parent();\n let ret = [];\n while (parent.isPresent()) {\n if (parent.matchesSelector(selector)) {\n ret.push(parent);\n }\n parent = parent.parent();\n }\n return new DomQuery(...ret);\n }", "allParents(selector) {\n let parent = this.parent();\n let ret = [];\n while (parent.isPresent()) {\n if (parent.matchesSelector(selector)) {\n ret.push(parent);\n }\n parent = parent.parent();\n }\n return new DomQuery(...ret);\n }", "parentsWhileMatch(selector) {\n const retArr = [];\n let parent = this.parent().filter(item => item.matchesSelector(selector));\n while (parent.isPresent()) {\n retArr.push(parent);\n parent = parent.parent().filter(item => item.matchesSelector(selector));\n }\n return new DomQuery(...retArr);\n }", "parentsWhileMatch(selector) {\n const retArr = [];\n let parent = this.parent().filter(item => item.matchesSelector(selector));\n while (parent.isPresent()) {\n retArr.push(parent);\n parent = parent.parent().filter(item => item.matchesSelector(selector));\n }\n return new DomQuery(...retArr);\n }", "_groupCustomClasses() {\n const result = [];\n if (this.options.customClasses && Array.isArray(this.options.customClasses)) {\n this.options.customClasses.forEach((customClass) => {\n if (typeof (customClass.targetXPathIndex) === 'number') {\n if (typeof (result[customClass.targetXPathIndex]) === 'undefined') {\n result[customClass.targetXPathIndex] = [customClass];\n } else {\n result[customClass.targetXPathIndex].push(customClass);\n }\n delete customClass.targetXPathIndex;\n }\n });\n }\n return result;\n }", "ChainSelector() {\n\n }", "function initSelector() {\n\n var userAgent = (window.navigator.userAgent||window.navigator.vendor||window.opera),\n isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(userAgent),\n mobileState = isMobile ? ' ___is-mobile' : '',\n isFirefox = /Firefox/i.test(userAgent);\n \n function buildSelector() {\n // Build selector out of each 'select' that is found\n $dataSelector.each(function(index) {\n var selectorClass = '';\n if ( $(this).attr('data-selector') ) {\n selectorClass = ' ___'+ $(this).attr('data-selector');\n }\n\n var tabIndex = 0;\n if ( $(this).attr('tabindex') ) {\n tabIndex = $(this).attr('tabindex');\n }\n\n $(this).attr('tabindex', -1);\n // Wrap the 'select' element in a new stylable selector\n $(this).wrap('<div class=\"selector' + mobileState + selectorClass + '\"></div>');\n // Fill the selector with a stylable 'select'\n $(this).parent().append('<div class=\"selector__select\" tabindex=\"'+ tabIndex + '\"></div><div class=\"selector__options\"><ul class=\"selector__list\"></ul></div>');\n\n var optionSelectedText = '';\n $(this).children('option').each(function() {\n var optionText = $(this).text(),\n optionValue = $(this).attr('value'),\n optionSelected = '';\n\n // Check if option is selected\n if ( $(this).attr('selected') ) {\n optionSelected = ' ___is-selected';\n optionSelectedText = optionText;\n }\n \n if ( $(this).attr('disabled') ) {\n optionSelected += ' ___is-disabled';\n optionValue = '';\n if (optionSelectedText.length === 0) {\n optionSelectedText = optionText;\n }\n }\n\n // Fill the selector with stylable 'options'\n if ( selectorClass === ' ___reversed' ) {\n $(this).closest('.selector')\n .find('.selector__list')\n .prepend('<li class=\"selector__option'+ optionSelected +'\" data-value=\"'+ optionValue +'\">'+ optionText +'</li>');\n } else {\n $(this).closest('.selector')\n .find('.selector__list')\n .append('<li class=\"selector__option'+ optionSelected +'\" data-value=\"'+ optionValue +'\">'+ optionText +'</li>');\n }\n });\n // Set our selector to the disabled ('Make a choice..') or selected text\n $(this).closest('.selector').children('.selector__select').text(optionSelectedText)\n });\n }\n \n buildSelector();\n \n // Original select changes on mobile\n $dataSelector.change(function() {\n $(this).children('option:selected').each(function() {\n $(this).closest('.selector').children('.selector__select').text( $(this).text() );\n });\n });\n\n // SELECTOR : the \"new\" select consisting of li's\n var $selector = $('.selector'),\n $selectorSelect = $('.selector__select'),\n $selectorOption = $('.selector__option'),\n openState = '___is-open';\n\n\n // Show options\n $selectorSelect.on('click', function(e) {\n e.preventDefault();\n $(this).parent('.selector').addClass(openState);\n });\n\n // Add and remove a .___has-focus class when selected with keyboard\n $selectorSelect.on('focusin', function(){\n $(this).addClass('___has-focus');\n }).on('focusout', function(){\n $(this).removeClass('___has-focus');\n $(this).parent('.selector').removeClass('___is-open');\n });\n\n // Remove .___is-open and close our selector when navigating outside of this element\n $(document).mouseup(function(e) {\n // If the target of the click isn't the container nor a descendant of the container\n if ( !$('.selector.___is-open').is(e.target) && $('.selector.___is-open').has(e.target).length === 0 ) {\n $('.selector.___is-open').removeClass(openState);\n }\n });\n\n // Select option\n $selectorOption.on('click', function(e) {\n e.preventDefault();\n if ( $(this).hasClass('___is-disabled') ) {\n return;\n }\n selectOption(this);\n });\n \n var selectedState = '___is-selected';\n \n /**\n * Actions to perform when selection one of the options with either mouse, keyboard.\n * @param HtmlElement el the selected option\n * @param Boolean close whether to close after selecting\n */\n\n function selectOption(el, close) {\n \n var $selectedOption = $(el);\n var selectedOptionText = $selectedOption.text();\n \n // Add selected state\n $selectedOption.siblings().removeClass(selectedState);\n $selectedOption.addClass(selectedState);\n\n // Update selected value\n $selectedOption.closest('.selector').children('.selector__select').text(selectedOptionText);\n\n // Select option in the original 'select' element\n var selectedValue = $selectedOption.attr('data-value');\n $selectedOption.closest('.selector').find('select')\n .val(selectedValue)\n .trigger('change');\n\n // Hide options\n if (close) {\n $selectedOption.closest('.selector').removeClass(openState);\n }\n\n if ( $(el).attr('data-value').indexOf('.html') > 0 ) {\n var optionLink = $(el).attr('data-value');\n window.location.href = optionLink;\n }\n }\n \n $selector.on('keydown', function(ev) {\n \n if (ev.keyCode === 13) { // enter key\n\n var found = $(this).find('.___is-selected');\n selectOption(found, true);\n \n } else if ( ev.keyCode !== 9 && (!ev.metaKey && !ev.altKey && !ev.ctrlKey && !ev.shiftKey) ) {\n \n ev.preventDefault();\n ev.stopPropagation();\n \n var found = $(this).find('.' + selectedState);\n if (found.length === 0) {\n found = $(this).find('.selector__option')[0];\n }\n \n if (ev.keyCode === 38) { // up\n var prev = $(found).prev('.selector__option:not(.___is-disabled)');\n if (prev.length) {\n $(this).find('.selector__option').removeClass(selectedState);\n $(prev).addClass(selectedState);\n selectOption(prev);\n }\n \n } else if (ev.keyCode === 40) { // down\n var next = $(found).next('.selector__option:not(.___is-disabled)');\n if (next.length) {\n $(this).find('.selector__option').removeClass(selectedState);\n $(next).addClass(selectedState);\n selectOption(next);\n }\n }\n }\n \n });\n \n }", "function expandCommaSeparatedGlobals(selectorWithGlobals) {\n // We the selector does not have a :global() we can shortcut\n if (!globalSelectorRegExp.test(selectorWithGlobals)) {\n return selectorWithGlobals;\n }\n var replacementInfo = [];\n var findGlobal = /\\:global\\((.+?)\\)/g;\n var match = null;\n // Create a result list for global selectors so we can replace them.\n while ((match = findGlobal.exec(selectorWithGlobals))) {\n // Only if the found selector is a comma separated list we'll process it.\n if (match[1].indexOf(',') > -1) {\n replacementInfo.push([\n match.index,\n match.index + match[0].length,\n // Wrap each of the found selectors in :global()\n match[1]\n .split(',')\n .map(function (v) { return \":global(\" + v.trim() + \")\"; })\n .join(', ')\n ]);\n }\n }\n // Replace the found selectors with their wrapped variants in reverse order\n return replacementInfo.reverse().reduce(function (selector, _a) {\n var matchIndex = _a[0], matchEndIndex = _a[1], replacement = _a[2];\n var prefix = selector.slice(0, matchIndex);\n var suffix = selector.slice(matchEndIndex);\n return prefix + replacement + suffix;\n }, selectorWithGlobals);\n}", "function expandCommaSeparatedGlobals(selectorWithGlobals) {\n // We the selector does not have a :global() we can shortcut\n if (!globalSelectorRegExp.test(selectorWithGlobals)) {\n return selectorWithGlobals;\n }\n var replacementInfo = [];\n var findGlobal = /\\:global\\((.+?)\\)/g;\n var match = null;\n // Create a result list for global selectors so we can replace them.\n while ((match = findGlobal.exec(selectorWithGlobals))) {\n // Only if the found selector is a comma separated list we'll process it.\n if (match[1].indexOf(',') > -1) {\n replacementInfo.push([\n match.index,\n match.index + match[0].length,\n // Wrap each of the found selectors in :global()\n match[1]\n .split(',')\n .map(function (v) { return \":global(\" + v.trim() + \")\"; })\n .join(', '),\n ]);\n }\n }\n // Replace the found selectors with their wrapped variants in reverse order\n return replacementInfo\n .reverse()\n .reduce(function (selector, _a) {\n var matchIndex = _a[0], matchEndIndex = _a[1], replacement = _a[2];\n var prefix = selector.slice(0, matchIndex);\n var suffix = selector.slice(matchEndIndex);\n return prefix + replacement + suffix;\n }, selectorWithGlobals);\n}", "function expandCommaSeparatedGlobals(selectorWithGlobals) {\n // We the selector does not have a :global() we can shortcut\n if (!globalSelectorRegExp.test(selectorWithGlobals)) {\n return selectorWithGlobals;\n }\n var replacementInfo = [];\n var findGlobal = /\\:global\\((.+?)\\)/g;\n var match = null;\n // Create a result list for global selectors so we can replace them.\n while ((match = findGlobal.exec(selectorWithGlobals))) {\n // Only if the found selector is a comma separated list we'll process it.\n if (match[1].indexOf(',') > -1) {\n replacementInfo.push([\n match.index,\n match.index + match[0].length,\n // Wrap each of the found selectors in :global()\n match[1]\n .split(',')\n .map(function (v) { return \":global(\" + v.trim() + \")\"; })\n .join(', '),\n ]);\n }\n }\n // Replace the found selectors with their wrapped variants in reverse order\n return replacementInfo\n .reverse()\n .reduce(function (selector, _a) {\n var matchIndex = _a[0], matchEndIndex = _a[1], replacement = _a[2];\n var prefix = selector.slice(0, matchIndex);\n var suffix = selector.slice(matchEndIndex);\n return prefix + replacement + suffix;\n }, selectorWithGlobals);\n}", "function createBookmarkTreeSelect(){\r\n chrome.bookmarks.getTree(function(tree){\r\n window.rootTree = tree;\r\n var option = {text:''};\r\n traverseTree(tree,0,option,'');\r\n _folders = '<select id=\"folder_select\">';\r\n _folders += option.text;\r\n _folders += '</select>';\r\n log('Running createBookmarkTreeSelect()');\r\n });\r\n\r\n }", "setup_selectors() {\n var block = this.block\n var _this = this\n this.res_type_changed($('#admin_user_access_control_resource_type'));\n block.on('change', '#admin_user_access_control_resource_type', function () {\n _this.res_type_changed($(this))\n })\n }", "function setupDirectorSelector(data) {\n const top_dirs = findTopDirectors(data, 20);\n const selects = [document.getElementById(\"director1-select\"), document.getElementById(\"director2-select\"), document.getElementById(\"director3-select\")]\n for(select of selects) {\n for(dir of top_dirs){\n let option = document.createElement('option')\n option.value = dir;\n option.text = dir;\n select.add(option)\n }\n }\n\n // set default selection of first dropdown\n document.getElementById(\"director1-select\").options[0].selected = false;\n document.getElementById(\"director1-select\").options[1].selected = true;\n selected_dirs = [document.getElementById(\"director1-select\").options[1].value]\n \n // add listeners for selectors\n document.getElementById(\"director1-select\").addEventListener(\"change\", (ev) => {onDirectorChange()})\n document.getElementById(\"director2-select\").addEventListener(\"change\", (ev) => {onDirectorChange()})\n document.getElementById(\"director3-select\").addEventListener(\"change\", (ev) => {onDirectorChange()})\n}", "_splitConfig() {\n const res = [];\n if (typeof (this.options.targetXPath) !== 'undefined') {\n // everything revolves around an xpath\n if (Array.isArray(this.options.targetXPath)) {\n // group up custom classes according to index\n const groupedCustomClasses = this._groupCustomClasses();\n // need to ensure it's array and not string so that code doesnt mistakenly separate chars\n const renderToPathIsArray = Array.isArray(this.options.renderToPath);\n // a group should revolve around targetXPath\n // break up the array, starting from the first element\n this.options.targetXPath.forEach((xpath, inner) => {\n // deep clone as config may have nested objects\n const config = cloneDeep(this.options);\n // overwrite targetXPath\n config.targetXPath = xpath;\n // sync up renderToPath array\n if (renderToPathIsArray && typeof (this.options.renderToPath[inner]) !== 'undefined') {\n config.renderToPath = this.options.renderToPath[inner] ? this.options.renderToPath[inner] : null;\n } else {\n // by default, below parent of target\n config.renderToPath = '..';\n }\n // sync up relatedElementActions array\n if (this.options.relatedElementActions\n && typeof (this.options.relatedElementActions[inner]) !== 'undefined'\n && Array.isArray(this.options.relatedElementActions[inner])) {\n config.relatedElementActions = this.options.relatedElementActions[inner];\n }\n // sync up customClasses\n if (typeof (groupedCustomClasses[inner]) !== 'undefined') {\n config.customClasses = groupedCustomClasses[inner];\n }\n // duplicate ignoredPriceElements string / array if exists\n if (this.options.ignoredPriceElements) {\n config.ignoredPriceElements = this.options.ignoredPriceElements;\n }\n // that's all, append\n res.push(config);\n });\n } else {\n // must be a single string\n res.push(this.options);\n }\n }\n return res;\n }", "function autoInit_trees() {\n var candidates = document.getElementsByTagName('ul');\n for(var i=0;i<candidates.length;i++) {\n \n //normal trees\n if(candidates[i].className && candidates[i].className.indexOf('tree') != -1) {\n initTree(candidates[i], treeToggle, 'closed', 'spanClosed');\n candidates[i].className = candidates[i].className.replace(/ ?unformatted ?/, ' ');\n }\n \n //selectable trees\n if(candidates[i].className && candidates[i].className.indexOf('selectableTree') != -1) {\n initTree(candidates[i], treeSelectionToggle, 'unselected', 'spanUnselected');\n candidates[i].className = candidates[i].className.replace(/ ?unformatted ?/, ' ');\n }\n \n }\n}", "makeSelector() {\n this.nodes.selector_wrapper = this.makeElement(\"div\", [\n this.makeClass(\"selector_wrapper\")\n ]);\n const selector = (this.nodes.selector = this.makeElement(\"select\", [\n this.makeClass(\"selector\")\n ]));\n this.nodes.selector_wrapper.appendChild(selector);\n for (let component of this.config.components) {\n const option = this.makeElement(\n \"option\",\n [this.makeClass(\"option\")],\n {\n value: component.name\n }\n );\n option.innerText = component.alias || component.name;\n this.nodes.options.push(option);\n selector.appendChild(option);\n }\n selector.value = this.data.component || this.config.components[0].name;\n selector.addEventListener(\"change\", event =>\n this.changeComponent(event.target)\n );\n this.changeComponent(selector);\n return this.nodes.selector_wrapper;\n }", "setGroups() {\n var objectGroups = {\"nodes\": [], \"links\": []},\n tempNodes = [],\n tempLinks = [];\n\n this.dataAll[\"nodes\"].forEach(function(node) {\n if (node[\"id\"].includes(\"Unitarians\") || node[\"id\"].includes(\"Company\") ||\n node[\"id\"].includes(\"Committee\") || node[\"id\"].includes(\"Channing, William Ellery\")) {\n tempNodes.push(node);\n }\n });\n\n this.dataAll[\"links\"].forEach(function(link) {\n if ((link[\"source\"].includes(\"Unitarians\") || link[\"source\"].includes(\"Company\") ||\n link[\"source\"].includes(\"Committee\") || link[\"source\"].includes(\"Channing, William Ellery\")) &&\n (link[\"target\"].includes(\"Unitarians\") || link[\"target\"].includes(\"Company\") ||\n link[\"target\"].includes(\"Committee\") || link[\"target\"].includes(\"Channing, William Ellery\"))) {\n tempLinks.push(link);\n }\n });\n\n objectGroups[\"nodes\"] = tempNodes;\n objectGroups[\"links\"] = tempLinks;\n\n return objectGroups;\n }", "function _selector(name, ancestor) {\n\t\treturn $('.' + BOXPLUS + '-' + name, ancestor);\n\t}", "function addSelCtgs() {\n // reset these properties couse after delete it is displayed 1st list\n optID = 0;\n slevel = 1;\n\n // if items in Root, shows 1st <select>, else, resets properties to initial value\n if(optHierarchy[0].length > 0) document.getElementById('n_sl'+slevel).innerHTML = getSelect(optHierarchy[0]);\n else {\n optHierarchy = {'0':[]};\n optData = {'0':{'value':'Root', 'content':'', 'parent':-1}};\n document.getElementById('n_sl'+slevel).innerHTML = '';\n }\n }", "getAgentsEntries(agents, entries) {\n let nodeEntries = [];\n if (entries !== undefined) {\n nodeEntries = entries.filter(e => e.parent_id.path === \"/spire/server\");\n }\n var lambdas = [];\n var agentEntriesDict = {};\n\n for (let i = 0; i < agents.length; i++) {\n let agent = agents[i];\n let agentId = this.getAgentSpiffeid(agent);\n agentEntriesDict[agentId] = [];\n if(agent.selectors === undefined) {\n agent.selectors = [];\n }\n let agentSelectors = new Set(agent.selectors.map(formatSelectors));\n let isAssocWithAgent = e => {\n if(e.selectors === undefined) {\n e.selectors = [];\n }\n let entrySelectors = new Set(e.selectors.map(formatSelectors))\n if (isSuperset(agentSelectors, entrySelectors)) {\n agentEntriesDict[agentId].push(e);\n }\n };\n lambdas.push(isAssocWithAgent);\n }\n\n for (let i = 0; i < nodeEntries.length; i++) {\n for (let j = 0; j < lambdas.length; j++) {\n lambdas[j](nodeEntries[i])\n }\n }\n\n return agentEntriesDict\n }", "function expandCommaSeparatedGlobals(selectorWithGlobals) {\r\n // We the selector does not have a :global() we can shortcut\r\n if (!globalSelectorRegExp.test(selectorWithGlobals)) {\r\n return selectorWithGlobals;\r\n }\r\n var replacementInfo = [];\r\n var findGlobal = /\\:global\\((.+?)\\)/g;\r\n var match = null;\r\n // Create a result list for global selectors so we can replace them.\r\n while ((match = findGlobal.exec(selectorWithGlobals))) {\r\n // Only if the found selector is a comma separated list we'll process it.\r\n if (match[1].indexOf(',') > -1) {\r\n replacementInfo.push([\r\n match.index,\r\n match.index + match[0].length,\r\n // Wrap each of the found selectors in :global()\r\n match[1]\r\n .split(',')\r\n .map(function (v) { return \":global(\" + v.trim() + \")\"; })\r\n .join(', ')\r\n ]);\r\n }\r\n }\r\n // Replace the found selectors with their wrapped variants in reverse order\r\n return replacementInfo.reverse().reduce(function (selector, _a) {\r\n var matchIndex = _a[0], matchEndIndex = _a[1], replacement = _a[2];\r\n var prefix = selector.slice(0, matchIndex);\r\n var suffix = selector.slice(matchEndIndex);\r\n return prefix + replacement + suffix;\r\n }, selectorWithGlobals);\r\n}", "function positionAllSelectors() {\r\n 'use strict';\r\n \r\n\tfor(var i = 1; i <= group_cnt; i++) {\r\n\t\tpositionSelector(i);\r\n\t}\t\t\r\n}", "function finalizeSubselector() {\n if (tokens.length &&\n tokens[tokens.length - 1].type === types_1.SelectorType.Descendant) {\n tokens.pop();\n }\n if (tokens.length === 0) {\n throw new Error(\"Empty sub-selector\");\n }\n subselects.push(tokens);\n }", "function applySelectors(selectors, gList, assoc) {\n var ix, selectComponent;\n \n for (ix = 0; ix < selectors.length; ix += 1) {\n selectComponent = selectors[ix]; \n\n if (selectComponent.type === 'global') {\n selectAll(selectComponent, gList, assoc);\n }\n else if (selectComponent.type === 'id') {\n selectById(selectComponent, gList, assoc);\n }\n else if (selectComponent.type === 'class') {\n selectByClass(selectComponent, gList, assoc);\n }\n else if (selectComponent.type === 'kind') {\n selectByKind(selectComponent, gList, assoc);\n }\n else if (selectComponent.type === 'attr') {\n selectByAttribute(selectComponent, gList, assoc);\n }\n else if (selectComponent.type === 'selectorAnd') {\n selectCompound(selectComponent, gList, assoc);\n }\n else {\n GSP.log('Unclassified squery selector: ' + selectComponent);\n }\n } \n }", "function get_selector_array(selector) {\n\n var selectorArray = [];\n\n // Clean\n selector = $.trim(selector);\n\n // Clean multispaces\n selector = selector.replace(/\\s\\s+/g, ' ');\n\n // Clean spaces before \">,+,~\" and after\n selector = selector.replace(/(\\s)?(\\>|\\,|\\+|\\~)(\\s)?/g, '$2');\n\n // Convert > to space\n selector = selector.replace(/\\>/g, ' ');\n\n selector = $.trim(selector);\n\n // Check if still there have another selector\n if (selector.indexOf(\" \") != -1) {\n\n // Split with space\n $.each(selector.split(\" \"), function (i, v) {\n\n // Clean\n v = $.trim(v);\n\n // Push\n selectorArray.push(v);\n\n });\n\n } else {\n\n // Push if single.\n selectorArray.push(selector);\n\n }\n\n var selectorArrayNew = [];\n\n // Add spaces again\n $.each(selectorArray, function (i, v) {\n selectorArrayNew.push(v.replace(/\\~/g, ' ~ ').replace(/\\+/g, ' + '));\n });\n\n return selectorArrayNew;\n\n }", "function parse(selector) {\n var subselects = [];\n var endIndex = parseSelector(subselects, \"\".concat(selector), 0);\n if (endIndex < selector.length) {\n throw new Error(\"Unmatched selector: \".concat(selector.slice(endIndex)));\n }\n return subselects;\n}", "function queriesFromGlobalMetadata(queries,outputCtx){return queries.map(function(query){var read=null;if(query.read&&query.read.identifier){read=outputCtx.importExpr(query.read.identifier.reference);}return{propertyName:query.propertyName,first:query.first,predicate:selectorsFromGlobalMetadata(query.selectors,outputCtx),descendants:query.descendants,read:read};});}", "function group_comms() {\n // Create an array of all committees\n // These are the names associated with the \n // nodes on the chart.\n // We'll pull out the top 'ntop' comms after the first generation\n comm_group={}; // reset\n comm_type={}; //reset\n for (i=0; i < nc; i++) {\n mycand_id=comm_cand_id[i];\n if (mycand_id == ''){\n mygroup='PAC'; \n mytype='PAC';\n } else {\n mygroup=cand_party[i_cand_id[mycand_id]];\n mytype='candidates';\n\t }\n\t comm_group[comm_name[i]]=mygroup;\n\t comm_type[comm_name[i]]=mytype;\n }\n // The selected comm gets assigned by itself to a group\n \n if (comm_type[comm_name[iselect]] == 'candidates') {\n isCandidate=true;\n } else {\n isCandidate=false;\n \n }\n comm_group[comm_name[iselect]]=comm_name[iselect];\n comm_type[comm_name[iselect]]='iselect';\n}", "function GlobalSiteAutoCompleteRootPage() {\n\n\tGlobalSiteAutoCompleteChildPage();\n\n}", "function createSelectorsManager() {\n var selectors = {};\n\n return {\n addSelector: addSelector,\n executeSelector: executeSelector\n };\n\n /*\n * Add a selector that matches source keys that start with the\n * specified prefix.\n *\n * @param {string} prefix\n * @param {function} [selector] The selector for the specified prefix.\n * @return {function} The selector for the specified prefix.\n */\n function addSelector(prefix, selector) {\n if (selector !== undefined) {\n selectors[prefix] = selector;\n }\n return selectors[prefix];\n }\n\n /*\n * Checks whether the source key matches one of the existing selectors.\n * If it does, the selector's handler is invoked on the source key.\n *\n * @param {object} source The source object.\n * @param {string} sourceKey The source object key.\n * @param {string} targetKey The target object key.\n * @param {object} sourceKeys The keys of the source properties to merge.\n * @param {object} overrideKeys\n * The keys of the source properties to not report an error if the\n * property already exists in the target object.\n */\n function executeSelector(source, sourceKey, targetKey,\n sourceKeys, overrideKeys) {\n\n for (var prefix in selectors) {\n // sourceKey starts with selector's prefix\n if (sourceKey.indexOf(prefix) === 0) {\n\n // Remove prefix from source key.\n sourceKey = sourceKey.substring(prefix.length);\n\n // Execute the selector's handler.\n selectors[prefix]({\n source: source,\n sourceKey: sourceKey,\n targetKey: targetKey ? targetKey : sourceKey,\n sourceKeys: sourceKeys,\n overrideKeys: overrideKeys\n });\n\n return true;\n }\n }\n return false;\n }\n}", "function ciniki_tenants_main() {\n this.tenants = null;\n this.menu = null;\n this.helpContentSections = {};\n\n this.statusOptions = {\n '10':'Ordered',\n '20':'Started',\n '25':'SG Ready',\n '30':'Racked',\n '40':'Filtered',\n '60':'Bottled',\n '100':'Removed',\n '*':'Unknown',\n };\n\n this.init = function() {\n //\n // Build the menus for the tenant, based on what they have access to\n //\n this.menu = new M.panel('Tenant Menu', 'ciniki_tenants_main', 'menu', 'mc', 'medium', 'sectioned', 'ciniki.tenants.main.menu');\n this.menu.data = {};\n this.menu.liveSearchCb = function(s, i, value) {\n if( this.sections[s].search != null && value != '' ) {\n var sargs = (this.sections[s].search.args != null ? this.sections[s].search.args : []);\n sargs['tnid'] = M.curTenantID;\n sargs['start_needle'] = encodeURIComponent(value);\n sargs['limit'] = 10;\n var container = this.sections[s].search.container;\n M.api.getJSONBgCb(this.sections[s].search.method, sargs, function(rsp) {\n M.ciniki_tenants_main.menu.liveSearchShow(s, null, M.gE(M.ciniki_tenants_main.menu.panelUID + '_' + s), rsp[container]);\n });\n return true;\n }\n };\n this.menu.liveSearchResultClass = function(s, f, i, j, d) {\n if( this.sections[s].search != null ) {\n if( this.sections[s].search.cellClasses != null && this.sections[s].search.cellClasses[j] != null ) {\n return this.sections[s].search.cellClasses[j];\n }\n return '';\n }\n return '';\n };\n this.menu.liveSearchResultValue = function(s, f, i, j, d) {\n if( this.sections[s].search != null && this.sections[s].search.cellValues != null ) {\n return eval(this.sections[s].search.cellValues[j]);\n }\n return '';\n }\n this.menu.liveSearchResultRowFn = function(s, f, i, j, d) { \n if( this.sections[s].search != null ) {\n if( this.sections[s].search.edit != null ) {\n var args = '';\n for(var i in this.sections[s].search.edit.args) {\n args += (args != '' ? ', ':'') + '\\'' + i + '\\':' + eval(this.sections[s].search.edit.args[i]);\n }\n return 'M.startApp(\\'' + this.sections[s].search.edit.method + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{' + args + '});';\n } \n return null;\n }\n return null;\n };\n this.menu.liveSearchResultRowClass = function(s, f, i, d) {\n if( this.sections[s].search.rowClass != null ) {\n return eval(this.sections[s].search.rowClass);\n }\n return '';\n };\n this.menu.liveSearchResultRowStyle = function(s, f, i, d) {\n if( this.sections[s].search.rowStyle != null ) {\n return eval(this.sections[s].search.rowStyle);\n }\n return '';\n };\n this.menu.liveSearchSubmitFn = function(s, search_str) {\n if( this.sections[s].search != null && this.sections[s].search.submit != null ) {\n var args = {};\n for(var i in this.sections[s].search.submit.args) {\n args[i] = eval(this.sections[s].search.submit.args[i]);\n }\n M.startApp(this.sections[s].search.submit.method,null,'M.ciniki_tenants_main.showMenu();','mc',args);\n }\n };\n this.menu.liveSearchResultCellFn = function(s, f, i, j, d) {\n// if( this.sections[s].search != null ) {\n// if( this.sections[s].search.cellFns != null && this.sections[s].search.cellFns[j] != null ) {\n// return eval(this.sections[s].search.cellFns[j]);\n// }\n// return '';\n// }\n/* if( d.app != null && d.app != '' ) {\n var args = '{';\n if( d.args != null ) {\n for(var i in d.args) {\n args[i] = eval(d.args[i]);\n }\n }\n return 'M.startApp(\\'' + d.app + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',);';\n } */\n // FIXME: This needs to move into hooks/uiSettings\n if( this.sections[s].id == 'calendars' || s == 'datepicker' ) {\n if( j == 0 && d.start_ts > 0 ) {\n return 'M.startApp(\\'ciniki.calendars.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'date\\':\\'' + d.date + '\\'});';\n }\n if( d.module == 'ciniki.wineproduction' ) {\n return 'M.startApp(\\'ciniki.wineproduction.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'appointment_id\\':\\'' + d.id + '\\'});';\n }\n if( d.module == 'ciniki.atdo' ) {\n return 'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'atdo_id\\':\\'' + d.id + '\\'});';\n }\n if( d.app == 'ciniki.customers.reminders' ) {\n return 'M.startApp(\\'ciniki.customers.reminders\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'reminder_id\\':\\'' + d.id + '\\',\\'source\\':\\'tenantmenu\\'});';\n }\n }\n return '';\n };\n this.menu.liveSearchResultCellColour = function(s, f, i, j, d) {\n if( this.sections[s].search != null ) {\n if( this.sections[s].search.cellColours != null && this.sections[s].search.cellColours[j] != null ) {\n return eval(this.sections[s].search.cellColours[j]);\n }\n return '';\n }\n return '';\n };\n this.menu.cellValue = function(s, i, j, d) {\n if( s == '_messages' ) {\n return M.multiline((d.viewed == 'no' ? ('<b>'+d.subject+'</b>') : d.subject)\n + M.subdue(' [', d.project_name, ']'),\n d.last_followup_user + ' - ' + d.last_followup_age);\n }\n if( s == '_tasks' ) {\n switch (j) {\n case 0: return '<span class=\"icon\">' + M.curTenant.atdo.priorities[d.priority] + '</span>';\n case 1: \n var pname = '';\n if( d.project_name != null && d.project_name != '' ) {\n pname = ' <span class=\"subdue\">[' + d.project_name + ']</span>';\n }\n return '<span class=\"maintext\">' + d.subject + pname + '</span><span class=\"subtext\">' + d.assigned_users + '&nbsp;</span>';\n case 2: return d.due_date;\n// case 2: return '<span class=\"maintext\">' + d.due_date + '</span><span class=\"subtext\">' + d.due_time + '</span>';\n }\n }\n if( s == '_timetracker_types' ) {\n switch(j) {\n case 0: return M.multiline(d.type, d.notes);\n case 1: return (d.today_length_display != null ? d.today_length_display : '-');\n case 2: \n if( d.entry_id > 0 ) {\n return '<button onclick=\"event.stopPropagation();M.ciniki_tenants_main.menu.stopEntry(\\'' + d.entry_id + '\\');\">Stop</button>';\n } else {\n return '<button onclick=\"event.stopPropagation();M.ciniki_tenants_main.menu.startEntry(\\'' + d.type + '\\');\">Start</button>';\n }\n }\n }\n if( s == '_timetracker_entries' ) {\n switch(j) {\n case 0: return M.multiline(d.type, d.notes);\n case 1: return M.multiline(d.start_dt_display, (d.end_dt_display != '' ? d.end_dt_display : '-'));\n case 2: return d.length_display;\n }\n }\n };\n this.menu.rowFn = function(s, i, d) {\n if( s == '_timetracker_entries' ) {\n return 'M.startApp(\\'ciniki.timetracker.tracker\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'entry_id\\':\\'' + d.id + '\\'});';\n }\n if( (s == '_tasks' || s == '_messages') && d != null ) {\n return 'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'atdo_id\\':\\'' + d.id + '\\'});';\n }\n return null;\n };\n this.menu.rowClass = function(s, i, d) {\n if( s == '_timetracker_types' ) {\n if( d.entry_id > 0 ) {\n return 'statusgreen aligncenter';\n } else {\n return 'statusred aligncenter';\n }\n }\n if( s == '_tasks' && d.status != 'closed' ) {\n switch(d.priority) {\n case '10': return 'statusyellow';\n case '30': return 'statusorange';\n case '50': return 'statusred';\n }\n }\n if( s == 'datepicker' ) {\n var dt = new Date();\n if( (dt.getFullYear() + '-' + ('00' + (dt.getMonth()+1)).substr(-2) + '-' + dt.getDate()) == this.date ) {\n return 'statusgreen';\n }\n }\n return null;\n }\n this.menu.helpSections = function() {\n return M.ciniki_tenants_main.helpContentSections;\n }\n }\n\n this.start = function(cb, ap, aG) {\n args = {};\n if( aG != null ) { args = eval(aG); }\n\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer('mc', 'ciniki_tenants_main', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n\n //\n // Get the tnid to be opened\n //\n if( args.id != null && args.id != '' ) {\n this.openTenant(cb, args.id);\n } else {\n M.alert('Tenant not found');\n return false;\n }\n }\n\n //\n // Open a tenant for the specified ID\n //\n this.openTenant = function(cb, id) {\n if( id != null ) {\n M.curTenantID = id;\n // (re)set the tenant object\n delete M.curTenant;\n M.curTenant = {'id':id};\n }\n if( M.curTenantID == null ) {\n M.alert('Invalid tenant');\n }\n\n //\n // Reset all buttons\n //\n this.menu.leftbuttons = {};\n this.menu.rightbuttons = {};\n\n //\n // If both callbacks are null, then this is the root of the menu system\n //\n M.menuHome = this.menu;\n if( cb == null ) {\n // \n // Add the buttons required on home menu\n //\n this.menu.addButton('account', 'Account', 'M.startApp(\\'ciniki.users.main\\',null,\\'M.home();\\');');\n this.menu.addLeftButton('logout', 'Logout', 'M.logout();');\n if( M.stMode == null && M.userID > 0 && (M.userPerms&0x01) == 0x01 ) {\n this.menu.addLeftButton('sysadmin', 'Admin', 'M.startApp(\\'ciniki.sysadmin.main\\',null,\\'M.home();\\');');\n }\n// M.menuHome = this.menu;\n } else {\n this.menu.addClose('Back');\n if( typeof(Storage) !== 'undefined' ) {\n localStorage.setItem(\"lastTenantID\", M.curTenantID);\n }\n }\n this.menu.cb = cb;\n\n this.openTenantSettings();\n }\n\n this.openTenantSettings = function() {\n // \n // Get the list of owners and employees for the tenant\n //\n M.api.getJSONCb('ciniki.tenants.getUserSettings', {'tnid':M.curTenantID}, function(rsp) {\n // If user doesn't have permission, bump back to main menu\n if( rsp.stat != 'ok' && rsp.err != null && rsp.err.code == 'ciniki.tenants.14' ) {\n localStorage.removeItem(\"lastTenantID\");\n M.curTenantID = null;\n delete M.curTenant;\n M.startApp(M.startMenu);\n return false;\n }\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_tenants_main.openTenantFinish(rsp);\n });\n }\n\n this.openTenantFinish = function(rsp) {\n // \n // Setup menu name\n //\n M.curTenant.name = rsp.name;\n\n //\n // Setup CSS\n //\n if( rsp.css != null && rsp.css != '' ) {\n M.gE('tenant_colours').innerHTML = rsp.css;\n } else {\n M.gE('tenant_colours').innerHTML = M.defaultTenantColours;\n }\n\n //\n // Check if ham radio statio\n //\n if( rsp.flags != null && (rsp.flags&0x02) == 0x02 ) {\n M.curTenant.hamMode = 'yes';\n }\n\n //\n // Setup employees\n //\n M.curTenant.employees = {};\n var ct = 0;\n for(i in rsp.users) {\n M.curTenant.employees[rsp.users[i].user.id] = rsp.users[i].user.display_name;\n ct++;\n }\n M.curTenant.numEmployees = ct;\n\n // \n // Setup tenant permissions for the user\n //\n M.curTenant.permissions = {};\n M.curTenant.permissions = rsp.permissions;\n\n // \n // Setup the settings for activated modules\n //\n if( rsp.settings != null && rsp.settings['ciniki.bugs'] != null ) {\n M.curTenant.bugs = {};\n M.curTenant.bugs.priorities = {'10':'<span class=\"icon\">Q</span>', '30':'<span class=\"icon\">W</span>', '50':'<span class=\"icon\">E</span>'};\n if( M.size == 'compact' ) {\n M.curTenant.bugs.priorityText = {'10':'<span class=\"icon\">Q</span>', '30':'<span class=\"icon\">W</span>', '50':'<span class=\"icon\">E</span>'};\n } else {\n M.curTenant.bugs.priorityText = {'10':'<span class=\"icon\">Q</span> Low', '30':'<span class=\"icon\">W</span> Medium', '50':'<span class=\"icon\">E</span> High'};\n }\n M.curTenant.bugs.settings = rsp.settings['ciniki.bugs'];\n }\n if( rsp.settings != null && rsp.settings['ciniki.atdo'] != null ) {\n M.curTenant.atdo = {};\n M.curTenant.atdo.priorities = {'10':'<span class=\"icon\">Q</span>', '30':'<span class=\"icon\">W</span>', '50':'<span class=\"icon\">E</span>'};\n if( M.size == 'compact' ) {\n M.curTenant.atdo.priorityText = {'10':'<span class=\"icon\">Q</span>', '30':'<span class=\"icon\">W</span>', '50':'<span class=\"icon\">E</span>'};\n } else {\n M.curTenant.atdo.priorityText = {'10':'<span class=\"icon\">Q</span> Low', '30':'<span class=\"icon\">W</span> Medium', '50':'<span class=\"icon\">E</span> High'};\n }\n M.curTenant.atdo.settings = rsp.settings['ciniki.atdo'];\n }\n if( rsp.settings != null && rsp.settings['ciniki.customers'] != null ) {\n M.curTenant.customers = {'settings':rsp.settings['ciniki.customers']};\n }\n if( rsp.settings != null && rsp.settings['ciniki.taxes'] != null ) {\n M.curTenant.taxes = {'settings':rsp.settings['ciniki.taxes']};\n }\n if( rsp.settings != null && rsp.settings['ciniki.services'] != null ) {\n M.curTenant.services = {'settings':rsp.settings['ciniki.services']};\n }\n if( rsp.settings != null && rsp.settings['ciniki.mail'] != null ) {\n M.curTenant.mail = {'settings':rsp.settings['ciniki.mail']};\n }\n if( rsp.settings != null && rsp.settings['ciniki.artcatalog'] != null ) {\n M.curTenant.artcatalog = {'settings':rsp.settings['ciniki.artcatalog']};\n }\n if( rsp.settings != null && rsp.settings['ciniki.sapos'] != null ) {\n M.curTenant.sapos = {'settings':rsp.settings['ciniki.sapos']};\n }\n if( rsp.settings != null && rsp.settings['ciniki.products'] != null ) {\n M.curTenant.products = {'settings':rsp.settings['ciniki.products']};\n }\n if( rsp.settings != null ) {\n if( M.curTenant.settings == null ) {\n M.curTenant.settings = {};\n }\n if( rsp.settings['googlemapsapikey'] != null && rsp.settings['googlemapsapikey'] != '' ) {\n M.curTenant.settings.googlemapsapikey = rsp.settings['googlemapsapikey'];\n }\n if( rsp.settings['uiAppOverrides'] != null && rsp.settings['uiAppOverrides'] != '' ) {\n M.curTenant.settings.uiAppOverrides = rsp.settings['uiAppOverrides'];\n }\n }\n if( rsp.intl != null ) {\n M.curTenant.intl = rsp.intl;\n }\n\n var modules = {};\n for(i in rsp.modules) {\n modules[rsp.modules[i].module.name] = rsp.modules[i].module;\n if( rsp.settings != null && rsp.settings[rsp.modules[i].module.name] != null ) {\n modules[rsp.modules[i].module.name].settings = rsp.settings[rsp.modules[i].module.name];\n }\n }\n M.curTenant.modules = modules;\n\n //\n // FIXME: Check if tenant is suspended status, and display message\n //\n\n //\n // Show the menu, which loads modules and display up to date message counts, etc.\n //\n this.showMenuFinish(rsp, 'yes');\n };\n\n //\n // This function is called upon return from opening a main menu item\n //\n this.showMenu = function() {\n //\n // Get the list of modules (along with other information that's not required)\n //\n M.api.getJSONCb('ciniki.tenants.getUserSettings', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_tenants_main.openTenantFinish(rsp, 'no');\n });\n }\n\n this.showMenuFinish = function(r, autoopen) {\n this.menu.title = M.curTenant.name;\n //\n // If sysadmin, or tenant owner\n //\n if( M.userID > 0 && ( (M.userPerms&0x01) == 0x01 || M.curTenant.permissions.owners != null || M.curTenant.permissions.resellers != null )) {\n this.menu.addButton('settings', 'Settings', 'M.startApp(\\'ciniki.tenants.settings\\',null,\\'M.ciniki_tenants_main.openTenantSettings();\\');');\n M.curTenant.settings_menu_items = r.settings_menu_items;\n }\n\n var c = 0;\n var join = -1; // keep track of how many are already joined together\n\n var perms = M.curTenant.permissions;\n\n //\n // Check that the module is turned on for the tenant, and the user has permissions to the module\n //\n\n this.menu.sections = {};\n var tenant_possession = 'our';\n var g = 0;\n var menu_search = 0;\n\n //\n // Build the main menu from the items supplied\n //\n if( r.menu_items != null ) {\n // Get the number of search items\n for(var i in r.menu_items) {\n if( r.menu_items[i].search != null ) {\n menu_search++\n }\n }\n if( menu_search < 2 ) {\n menu_search = 0;\n }\n for(var i in r.menu_items) {\n var item = {'label':r.menu_items[i].label};\n //\n // Check if there is help content for the internal help mode\n //\n if( r.menu_items[i].helpcontent != null && r.menu_items[i].helpcontent != '' ) {\n this.helpContentSections[i] = {\n 'label':r.menu_items[i].label, \n 'type':'htmlcontent', \n 'html':r.menu_items[i].helpcontent,\n };\n }\n if( r.menu_items[i].edit != null ) {\n var args = '';\n if( r.menu_items[i].edit.args != null ) {\n for(var j in r.menu_items[i].edit.args) {\n args += (args != '' ? ', ':'') + '\\'' + j + '\\':' + eval(r.menu_items[i].edit.args[j]);\n }\n item.fn = 'M.startApp(\\'' + r.menu_items[i].edit.app + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{' + args + '});';\n } else {\n item.fn = 'M.startApp(\\'' + r.menu_items[i].edit.app + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\');';\n }\n } else if( r.menu_items[i].fn != null ) {\n item.fn = r.menu_items[i].fn;\n }\n if( r.menu_items[i].count != null ) {\n item.count = r.menu_items[i].count;\n }\n if( r.menu_items[i].add != null && menu_search > 0 ) {\n var args = '';\n for(var j in r.menu_items[i].add.args) {\n args += (args != '' ? ', ':'') + '\\'' + j + '\\':' + eval(r.menu_items[i].add.args[j]);\n }\n item.addFn = 'M.startApp(\\'' + r.menu_items[i].add.app + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{' + args + '});';\n }\n\n if( r.menu_items[i].search != null && menu_search > 0 ) {\n item.search = r.menu_items[i].search;\n if( r.menu_items[i].id != null ) {\n item.id = r.menu_items[i].id;\n }\n item.type = 'livesearchgrid';\n item.searchlabel = item.label;\n item.aside = 'yes';\n item.label = '';\n item.livesearchcols = item.search.cols;\n item.noData = item.search.noData;\n if( item.search.headerValues != null ) {\n item.headerValues = item.search.headerValues;\n }\n if( r.menu_items[i].search.searchtype != null && r.menu_items[i].search.searchtype != '' ) {\n item.livesearchtype = r.menu_items[i].search.searchtype;\n }\n item['flexcolumn'] = 1;\n item['minwidth'] = '10em';\n item['width'] = '30em';\n item['maxwidth'] = '40em';\n this.menu.sections[c++] = item;\n menu_search = 1;\n }\n else if( r.menu_items[i].subitems != null ) {\n item.aside = 'yes';\n item.list = {};\n for(var j in r.menu_items[i].subitems) {\n var args = '';\n for(var k in r.menu_items[i].subitems[j].edit.args) {\n args += (args != '' ? ', ':'') + '\\'' + k + '\\':' + eval(r.menu_items[i].subitems[j].edit.args[k]);\n }\n item.list[j] = {'label':r.menu_items[i].subitems[j].label, 'fn':'M.startApp(\\'' + r.menu_items[i].subitems[j].edit.app + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{' + args + '});'};\n if( r.menu_items[i].subitems[j].count != null ) {\n item.list[j].count = r.menu_items[i].subitems[j].count;\n }\n }\n this.menu.sections[c] = item;\n menu_search = 0;\n join = 0;\n c++;\n this.menu.sections[c] = {'label':'Menu', 'aside':'yes', 'list':{}, 'flexcolumn':1, 'minwidth':'10em', 'width':'30em', 'maxwidth':'40em'};\n }\n else if( join > -1 ) {\n this.menu.sections[c].list['item_' + i] = item;\n join++;\n// this.menu.sections[c].list['item_' + i] = {'label':r.menu_items[i].label, 'fn':fn};\n } else {\n this.menu.sections[c++] = {'label':'', 'aside':'yes', 'list':{'_':item}, 'flexcolumn':1, 'minwidth':'10em', 'width':'30em', 'maxwidth':'40em'};\n// this.menu.sections[c++] = {'label':'', 'list':{'_':{'label':r.menu_items[i].label, 'fn':fn}}};\n }\n if( c > 4 && join < 0 ) {\n join = 0;\n this.menu.sections[c] = {'label':' &nbsp; ', 'aside':'yes', 'list':{}, 'flexcolumn':1, 'minwidth':'10em', 'width':'30em', 'maxwidth':'40em'};\n }\n }\n }\n\n //\n // Check for archived modules\n //\n if( r.archived_items != null ) {\n c++;\n this.menu.sections[c] = {'label':'Archive', 'list':{}, 'flexcolumn':1, 'minwidth':'10em', 'width':'30em', 'maxwidth':'40em'};\n for(var i in r.archived_items) {\n var item = {'label':r.archived_items[i].label};\n if( r.archived_items[i].edit != null ) {\n var args = '';\n if( r.archived_items[i].edit.args != null ) {\n for(var j in r.archived_items[i].edit.args) {\n args += (args != '' ? ', ':'') + '\\'' + j + '\\':' + eval(r.archived_items[i].edit.args[j]);\n }\n item.fn = 'M.startApp(\\'' + r.archived_items[i].edit.app + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{' + args + '});';\n } else {\n item.fn = 'M.startApp(\\'' + r.archived_items[i].edit.app + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\');';\n }\n } else if( r.archived_items[i].fn != null ) {\n item.fn = r.archived_items[i].fn;\n }\n this.menu.sections[c].list['item_' + i] = item;\n }\n }\n\n //\n // Setup the auto split if long menu\n //\n if( join > 8 ) {\n this.menu.sections[c].as = 'yes';\n }\n\n //\n // Check if we should autoopen the submenu when there is only one menu item.\n //\n if( autoopen == 'yes' && c == 1 \n && this.menu.sections[0].list != null \n && this.menu.sections[0].list._ != null \n && this.menu.sections[0].list._.fn != null ) {\n this.menu.autoopen = 'skipped';\n eval(this.menu.sections[0].list._.fn);\n } else {\n this.menu.autoopen = 'no';\n }\n\n // Set size of menu based on contents\n if( menu_search == 1 ) {\n this.menu.size = 'medium';\n } else {\n this.menu.size = 'narrow';\n }\n \n //\n // Clear any timeouts\n //\n if( this.menu.calTimeout != null ) {\n clearTimeout(this.menu.calTimeout);\n }\n if( this.menu.messagesTimeout != null ) {\n clearTimeout(this.menu.tasksTimeout);\n }\n if( this.menu.tasksTimeout != null ) {\n clearTimeout(this.menu.tasksTimeout);\n }\n if( this.menu.timeTrackerTimeout != null ) {\n clearTimeout(this.menu.timeTrackerTimeout);\n }\n\n //\n // Show the calendar, tasks and time tracker on main menu screen\n //\n if( M.modFlagOn('ciniki.tenants', 0x0100) \n && (perms.owners != null || perms.employees != null || perms.resellers != null || (M.userPerms&0x01) == 1) \n ) {\n this.menu.sections[0].label = 'Menu';\n this.menu.size = 'flexible';\n if( M.modOn('ciniki.calendars') ) {\n if( this.menu.date == null ) {\n var dt = new Date();\n dt.setHours(0);\n dt.setMinutes(0);\n dt.setSeconds(0);\n this.menu.date = dt.getFullYear() + '-' + ('00' + (dt.getMonth()+1)).substr(-2) + '-' + dt.getDate();\n }\n this.menu.datePickerValue = function(s, d) { return this.date; }\n this.menu.scheduleDate = function(s, d) { return this.date; }\n this.menu.sections['datepicker'] = {'label':'Calendar', 'type':'datepicker', \n 'livesearch':'yes', 'livesearchtype':'appointments', \n 'livesearchempty':'no', 'livesearchcols':2, \n 'addTxt':'Add',\n 'addTopFn':'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'add\\':\"appointment\"});',\n 'search':{\n 'method':'ciniki.calendars.search',\n 'args':[],\n 'container':'appointments',\n 'searchtype':'appointments',\n 'cols':2,\n 'cellClasses':['multiline slice_0', 'schedule_appointment'],\n 'cellColours':[\n '\\'\\'',\n 'if( d.colour != null && d.colour != \\'\\' ) { d.colour; } else { \\'#77ddff\\'; }'\n ],\n 'cellValues':[\n 'if( d.start_ts == 0 ) { \"unscheduled\"; } '\n + 'else if( d.appointment_allday == \"yes\" ) { d.start_date.split(/ [-]+:/)[0]; } '\n + 'else { \\'<span class=\"maintext\">\\' + d.start_date.split(/ [0-9]+:/)[0] + \\'</span><span class=\"subtext\">\\' + d.start_date.split(/, [0-9][0-9][0-9][0-9] /)[1] + \\'</span>\\'}',\n 'var t=\"\";'\n + 'if( d.secondary_colour != null && d.secondary_colour != \\'\\') {'\n + 't+=\\'<span class=\"colourswatch\" style=\"background-color:\\' + d.secondary_colour + \\'\">\\';'\n + 'if( d.secondary_colour_text != null && d.secondary_colour_text != \\'\\' ) {'\n + 't += d.secondary_colour_text; '\n + '} else {'\n + 't += \\'&nbsp;\\'; '\n + '} '\n + 't += \\'</span> \\''\n + '} '\n + 't += d.subject;'\n + 'if( d.secondary_text != null && d.secondary_text != \\'\\' ) {'\n + 't += \\' <span class=\"secondary\">\\' + d.secondary_text + \\'</span>\\';'\n + '} '\n + 't;',\n ],\n 'submit':{'method':'ciniki.calendars.main', 'args':{'search':'search_str'}},\n },\n 'fn':'M.ciniki_tenants_main.menu.showSelectedDayCb',\n 'flexcolumn':2,\n 'flexgrow':5,\n 'minwidth':'20em',\n 'width':'20em',\n 'hint':'Search',\n 'headerValues':null,\n 'noData':'No appointments found',\n };\n this.menu.sections['schedule'] = {'label':'', 'type':'dayschedule', 'calloffset':0,\n 'flexcolumn':2,\n 'flexgrow':5,\n 'minwidth':'20em',\n 'width':'20em',\n 'start':'8:00',\n 'end':'20:00',\n 'notimelabel':'All Day',\n };\n this.menu.showSelectedDayCb = function(i, scheduleDate) {\n var h = M.gE(this.panelUID + '_datepicker_calendar');\n if( h != null ) { \n this.toggleDatePickerCalendar(scheduleDate, null);\n }\n if( scheduleDate != null ) { this.date = scheduleDate; }\n M.api.getJSONBgCb('ciniki.calendars.appointments', \n {'tnid':M.curTenantID, 'date':this.date}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_main.menu;\n p.data.schedule = rsp.appointments;\n p.refreshSection('datepicker');\n p.refreshSection('schedule');\n });\n }\n this.menu.appointmentEventText = function(ev) {\n var t = '';\n if( ev.secondary_colour != null && ev.secondary_colour != '' ) {\n t += '<span class=\"colourswatch\" style=\"background-color:' + ev.secondary_colour + '\">';\n if( ev.secondary_colour_text != null && ev.secondary_colour_text != '' ) { t += ev.secondary_colour_text; }\n else { t += '&nbsp;'; }\n t += '</span> '\n }\n t += ev.subject;\n if( ev.secondary_text != null && ev.secondary_text != '' ) {\n t += ' <span class=\"secondary\">' + ev.secondary_text + '</span>';\n }\n return t;\n }\n this.menu.appointmentTimeFn = function(d, t, ad) {\n if( M.curTenant.modules['ciniki.fatt'] != null ) {\n return 'M.startApp(\\'ciniki.fatt.offerings\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'add\\':\\'courses\\',\\'date\\':\\'' + d + '\\',\\'time\\':\\'' + t + '\\',\\'allday\\':\\'' + ad + '\\'});';\n } else {\n return 'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'add\\':\\'appointment\\',\\'date\\':\\'' + d + '\\',\\'time\\':\\'' + t + '\\',\\'allday\\':\\'' + ad + '\\'});';\n }\n };\n this.menu.appointmentFn = function(ev) {\n if( ev.app != null ) {\n return 'M.startApp(\\'' + ev.app + '\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'appointment_id\\':\\'' + ev.id + '\\'});';\n } else {\n if( ev.module == 'ciniki.wineproduction' ) {\n return 'M.startApp(\\'ciniki.wineproduction.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'appointment_id\\':\\'' + ev.id + '\\'});';\n } \n if( ev.module == 'ciniki.atdo' ) {\n return 'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'atdo_id\\':\\'' + ev.id + '\\'});';\n }\n if( ev.module == 'ciniki.fatt' ) {\n return 'M.startApp(\\'ciniki.fatt.offerings\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'appointment_id\\':\\'' + ev.id + '\\'});';\n }\n }\n return '';\n };\n this.menu.calTimeout = null;\n this.menu.loadCalendar = function() {\n M.api.getJSONBgCb('ciniki.calendars.appointments', {'tnid':M.curTenant.id, 'date':M.ciniki_tenants_main.menu.date},\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_main.menu;\n p.data.schedule = rsp.appointments;\n p.refreshSection('schedule');\n if( p.calTimeout != null ) {\n clearTimeout(p.calTimeout);\n }\n p.calTimeout = setTimeout(M.ciniki_tenants_main.menu.loadCalendar, (5*60*1000));\n });\n }\n this.menu.loadCalendar();\n } else {\n if( this.menu.calTimeout != null ) {\n clearTimeout(this.menu.calTimeout);\n }\n }\n if( M.modFlagAny('ciniki.atdo', 0x20) == 'yes' ) {\n this.menu.sections._messages = {'label':'Messages', 'visible':'yes', 'type':'simplegrid', 'num_cols':1,\n 'flexcolumn':3,\n 'flexgrow':2,\n 'limit':10,\n 'changeTxt':'View Messages',\n 'changeFn':'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'messages\\':\\'yes\\'});',\n 'minwidth':'20em',\n 'width':'20em',\n 'cellClasses':['multiline'],\n 'noData':'Loading...',\n 'addTxt':'Add',\n 'addTopFn':'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'add\\':\\'message\\'});',\n };\n this.menu.messagesTimeout = null;\n this.menu.loadMessages = function() {\n M.api.getJSONBgCb('ciniki.atdo.messagesList', {'tnid':M.curTenant.id, \n 'assigned':'yes', 'status':'open'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_main.menu;\n p.data._messages = rsp.messages;\n p.sections._messages.noData = 'No messages';\n p.refreshSection('_messages');\n if( p.messagesTimeout != null ) {\n clearTimeout(p.messagesTimeout);\n }\n p.messagesTimeout = setTimeout(M.ciniki_tenants_main.menu.loadMessages, (5*60*1000));\n });\n }\n this.menu.loadMessages();\n } else {\n if( this.menu.calTimeout != null ) {\n clearTimeout(this.menu.calTimeout);\n }\n }\n if( M.modOn('ciniki.timetracker') ) {\n this.menu.data._timetracker_types = {};\n this.menu.data._timetracker_entries = {};\n this.menu.sections._timetracker_types = {'label':'Time Tracker', 'type':'simplegrid', 'num_cols':3,\n 'minwidth':'20em',\n 'flexcolumn':3,\n 'flexgrow':1,\n 'maxwidth':'30em',\n 'cellClasses':['multiline', '', 'alignright'],\n 'footerClasses':['', '', 'alignright'],\n 'noData':'Loading...',\n 'rowFn':function(i, d) { \n if( d.entry_id > 0 ) {\n return 'M.startApp(\\'ciniki.timetracker.tracker\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'entry_id\\':\\'' + d.entry_id + '\\'});';\n }\n return ''; \n },\n 'changeTxt':'View Logs',\n 'changeFn':'M.startApp(\\'ciniki.timetracker.tracker\\',null,\\'M.ciniki_tenants_main.showMenu();\\');',\n };\n/* this.menu.sections._timetracker_entries = {'label':'Recent', 'type':'simplegrid', 'num_cols':3,\n 'minwidth':'20em',\n 'flexcolumn':4,\n 'flexgrow':1,\n 'maxwidth':'30em',\n 'cellClasses':['multiline', 'multiline', ''],\n 'limit':15,\n 'noData':'Loading...',\n }; */\n this.menu.startEntry = function(id) {\n M.api.getJSONBgCb('ciniki.timetracker.tracker', {'tnid':M.curTenantID, 'action':'start', 'type':id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_main.menu;\n p.data = rsp;\n p.sections._timetracker_types.label = 'Time Tracker - ' + rsp.today_length_display;\n p.data._timetracker_types = rsp.types;\n p.data._timetracker_entries = rsp.entries;\n p.refreshSections(['_timetracker_types', '_timetracker_entries']);\n });\n }\n this.menu.stopEntry = function(id) {\n M.api.getJSONCb('ciniki.timetracker.tracker', {'tnid':M.curTenantID, 'action':'stop', 'entry_id':id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_main.menu;\n p.data = rsp;\n p.sections._timetracker_types.label = 'Time Tracker - ' + rsp.today_length_display;\n p.data._timetracker_types = rsp.types;\n p.data._timetracker_entries = rsp.entries;\n p.refreshSections(['_timetracker_types', '_timetracker_entries']);\n });\n }\n this.menu.timeTrackerTimeout = null;\n this.menu.loadTimeTracker = function() {\n M.api.getJSONBgCb('ciniki.timetracker.tracker', {'tnid':M.curTenant.id},\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_main.menu;\n p.sections._timetracker_types.label = 'Time Tracker - ' + rsp.today_length_display;\n p.data._timetracker_types = rsp.types;\n// p.data._timetracker_entries = rsp.entries;\n p.sections._timetracker_types.noData = 'No projects';\n// p.sections._timetracker_entries.noData = 'No entries';\n p.refreshSections(['_timetracker_types', '_timetracker_entries']);\n if( p.timeTrackerTimeout != null ) {\n clearTimeout(p.timeTrackerTimeout);\n }\n p.timeTrackerTimeout = setTimeout(M.ciniki_tenants_main.menu.loadTimeTracker, (5*60*1000));\n });\n }\n this.menu.loadTimeTracker();\n } else {\n if( this.menu.timeTrackerTimeout != null ) {\n clearTimeout(this.menu.timeTrackerTimeout);\n }\n }\n if( M.modFlagAny('ciniki.atdo', 0x02) == 'yes' ) {\n this.menu.sections._tasks = {'label':'Tasks', 'visible':'yes', 'type':'simplegrid', 'num_cols':3,\n 'flexcolumn':3,\n 'flexgrow':2,\n 'limit':10,\n 'minwidth':'20em',\n 'width':'20em',\n 'headerValues':['', 'Task', 'Due'],\n 'cellClasses':['multiline aligncenter', 'multiline', 'multiline'],\n 'noData':'Loading...',\n 'changeTxt':'View Tasks',\n 'changeFn':'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'tasks\\':\\'yes\\'});',\n 'addTxt':'Add',\n 'addTopFn':'M.startApp(\\'ciniki.atdo.main\\',null,\\'M.ciniki_tenants_main.showMenu();\\',\\'mc\\',{\\'add\\':\\'task\\'});',\n };\n // Need to query enough rows to get at least 10 including assigned users, average 5 employees assigned.\n this.menu.tasksTimeout = null;\n this.menu.loadTasks = function() {\n M.api.getJSONBgCb('ciniki.atdo.tasksList', {'tnid':M.curTenant.id,\n 'assigned':'yes', 'status':'open', 'limit':50},\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_main.menu;\n p.data._tasks = rsp.tasks;\n p.sections._tasks.noData = 'No tasks';\n p.refreshSection('_tasks');\n if( p.tasksTimeout != null ) {\n clearTimeout(p.tasksTimeout);\n }\n p.tasksTimeout = setTimeout(M.ciniki_tenants_main.menu.loadTasks, (5*60*1000));\n });\n }\n this.menu.loadTasks();\n } else {\n if( this.menu.calTimeout != null ) {\n clearTimeout(this.menu.calTimeout);\n }\n }\n }\n //\n // Check if there should be a task list displayed\n //\n else if( M.curTenant.modules['ciniki.atdo'] != null && M.curTenant.atdo != null\n && M.curTenant.atdo.settings['tasks.ui.mainmenu.category.'+M.userID] != null \n && M.curTenant.atdo.settings['tasks.ui.mainmenu.category.'+M.userID] != ''\n && (perms.owners != null || perms.employees != null || perms.resellers != null || (M.userPerms&0x01) == 1) \n ) {\n this.menu.data._tasks = {};\n this.menu.sections[0].label = 'Menu';\n this.menu.sections._tasks = {'label':'Tasks', 'visible':'yes', 'type':'simplegrid', 'num_cols':3,\n 'flexcolumn':3,\n 'flexgrow':2,\n 'minwidth':'20em',\n 'maxwidth':'40em',\n 'width':'20em',\n 'headerValues':['', 'Task', 'Due'],\n 'cellClasses':['multiline aligncenter', 'multiline', 'multiline'],\n 'noData':'No tasks found',\n };\n M.api.getJSONCb('ciniki.atdo.tasksList', {'tnid':M.curTenant.id,\n 'category':M.curTenant.atdo.settings['tasks.ui.mainmenu.category.'+M.userID], 'assigned':'yes', 'status':'open'},\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_main.menu;\n if( rsp.tasks != null && rsp.tasks.length > 0 ) {\n p.data._tasks = rsp.tasks;\n p.refreshSection('_tasks');\n p.size = 'medium mediumaside';\n M.gE(p.panelUID).children[0].className = 'medium mediumaside';\n } \n });\n }\n\n //\n // Check if add to home screen should be shown\n //\n// if( M.device == 'ipad' && !window.navigator.standalone ) {\n// this.menu.sections.addtohomescreen = {'label':'', 'list':{\n// 'add':{'label':'Download App', 'fn':''},\n// }},\n// }\n\n this.menu.refresh();\n this.menu.show();\n }\n}", "function createSelection(data){\n var dockerDropDown=[];\n for(let i=0;i<data.length;i++){\n if(!dockerDropDown.includes(data[i][\"Spec\"][\"Role\"]))\n dockerDropDown.push(data[i][\"Spec\"][\"Role\"]);\n\n if(Object.keys(data[i]).includes(\"ManagerStatus\"))\n {\n if(Object.keys(data[i][\"ManagerStatus\"]).includes(\"Leader\"))\n {\n if(!dockerDropDown.includes(\"Swarm-Leader\"))\n dockerDropDown.push(\"Swarm-Leader\"); \n }\n }\n }\n\n for(let i=0;i<dockerDropDown.length;i++){\n dockerDropDown[i]=dockerDropDown[i].replace(\"worker\",\"Swarm-Worker\");\n dockerDropDown[i]=dockerDropDown[i].replace(\"manager\",\"Swarm-Manager\");\n};\nreturn dockerDropDown;\n}", "setUpGroups() {\n this['providerGroups'] = [];\n this['searchOptionsGroups'] = {};\n this['searchOptionsNoGroup'] = [];\n\n const proGroups = /** @type {!Object<!Array<string>>} */ (Settings.getInstance().get('providerGroups', {}));\n const copiedOptions = googArray.clone(this['searchOptions']);\n\n // Iterate over the Provider group names\n for (const groupName in proGroups) {\n const searchNameArray = proGroups[groupName];\n\n this['providerGroups'].push(groupName);\n\n const currentGroup = [];\n\n // Iterate over the searches under the provider group, and add the search to the group\n searchNameArray.forEach(function(searchName) {\n const ind = olArray.findIndex(copiedOptions, function(searchOption) {\n return searchName == searchOption.getName();\n });\n if (ind > -1) {\n currentGroup.push(copiedOptions[ind]);\n googArray.removeAt(copiedOptions, ind);\n }\n }, this);\n this['searchOptionsGroups'][groupName] = currentGroup;\n }\n\n const order = /** @type {Array} */ (Settings.getInstance().get('providerGroupOrder', []));\n order.forEach(function(value, index) {\n const currentIndex = this['providerGroups'].indexOf(value);\n if (currentIndex > 0) {\n googArray.moveItem(this['providerGroups'], currentIndex, index);\n }\n }, this);\n\n this['searchOptionsNoGroup'] = copiedOptions;\n }", "function generateSelector(target) {\n var sel = '';\n target = $(target);\n var targetElement = target.get(0);\n\n var ancestors = target.parents().andSelf();\n ancestors.each(function(i, ancestorElement) {\n ancestor = $(ancestorElement);\n var subsel = ancestorElement.tagName.toLowerCase();;\n\n var id = ancestor.attr('id');\n if (id && id.length > 0) {\n subsel += '#' + id;\n } else {\n var classes = ancestor.attr('class');\n if (classes && classes.length > 0) {\n subsel += '.' + classes.replace(/\\s+/g, '.');\n }\n\n var index = ancestor.index(sel + subsel);\n if ($(sel + subsel).siblings(subsel).length > 0) {\n subsel += ':eq(' + index + ')';\n }\n }\n\n sel += subsel;\n\n if (i < ancestors.length - 1) {\n sel += ' > ';\n }\n });\n\n return sel;\n}", "_querySelectorAllDeep(selector) {\n var _a;\n if (!((_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length)) {\n return this;\n }\n let foundNodes = new DomQuery(...this.rootNode);\n let selectors = selector.split(/\\/shadow\\//);\n for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {\n if (selectors[cnt2] == \"\") {\n continue;\n }\n let levelSelector = selectors[cnt2];\n foundNodes = foundNodes.querySelectorAll(levelSelector);\n if (cnt2 < selectors.length - 1) {\n foundNodes = foundNodes.shadowRoot;\n }\n }\n return foundNodes;\n }", "_querySelectorAllDeep(selector) {\n var _a;\n if (!((_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length)) {\n return this;\n }\n let foundNodes = new DomQuery(...this.rootNode);\n let selectors = selector.split(/\\/shadow\\//);\n for (let cnt2 = 0; cnt2 < selectors.length; cnt2++) {\n if (selectors[cnt2] == \"\") {\n continue;\n }\n let levelSelector = selectors[cnt2];\n foundNodes = foundNodes.querySelectorAll(levelSelector);\n if (cnt2 < selectors.length - 1) {\n foundNodes = foundNodes.shadowRoot;\n }\n }\n return foundNodes;\n }", "function selectorsFromGlobalMetadata(selectors, outputCtx) {\n if (selectors.length > 1 || selectors.length == 1 && selectors[0].value) {\n var selectorStrings = selectors.map(function (value) {\n return value.value;\n });\n selectorStrings.some(function (value) {\n return !value;\n }) && error('Found a type among the string selectors expected');\n return outputCtx.constantPool.getConstLiteral(literalArr(selectorStrings.map(function (value) {\n return literal(value);\n })));\n }\n\n if (selectors.length == 1) {\n var first = selectors[0];\n\n if (first.identifier) {\n return outputCtx.importExpr(first.identifier.reference);\n }\n }\n\n error('Unexpected query form');\n return NULL_EXPR;\n}", "function AuthorizeAllSubTagEndpoints(authorizeAllElement) {\n let tagCollapse = $(authorizeAllElement).prev();\n let dataTarget = $(tagCollapse).attr(\"data-target\");\n let targetUl = $(dataTarget);\n\n $(targetUl).children('li').each(function () {\n let ul = $(this).children('ul');\n let li = $(ul).children().get(0);\n let checkbox = $(li).children().get(0);\n checkbox.checked = authorizeAllElement.checked;\n });\n}", "function parseGemCategories() {\n var gemMap = vm.tabs.reduce(function(map, category) {\n map[category] = {initial: true, gems: []};\n return map;\n }, {});\n return gemMap;\n }", "get blockSelectors() {\n return \"a\";\n }", "function single_selector(selector) {\n\n var customClass = 'yp-selected';\n if (body.hasClass(\"yp-control-key-down\") && is_content_selected()) {\n customClass = 'yp-multiple-selected';\n }\n\n // Clean\n selector = left_trim(selector, \"htmlbody \");\n selector = left_trim(selector, \"html \");\n selector = left_trim(selector, \"body \");\n\n var selectorArray = get_selector_array(selector);\n var i = 0;\n var indexOf = 0;\n var selectorPlus = '';\n\n for (i = 0; i < selectorArray.length; i++) {\n\n if (i > 0) {\n selectorPlus += window.separator + selectorArray[i];\n } else {\n selectorPlus += selectorArray[i];\n }\n\n if (iframe.find(selectorPlus).length > 1) {\n\n iframe.find(selectorPlus).each(function () {\n\n if (selectorPlus.substr(selectorPlus.length - 1) != ')') {\n\n if ($(this).parent().length > 0) {\n\n indexOf = 0;\n\n $(this).parent().children().each(function () {\n\n indexOf++;\n\n if ($(this).find(\".\" + customClass).length > 0 || $(this).hasClass((customClass))) {\n\n selectorPlus = selectorPlus + \":nth-child(\" + indexOf + \")\";\n\n }\n\n });\n\n }\n\n }\n\n });\n\n }\n\n }\n\n\n // Clean no-need nth-childs.\n if (selectorPlus.indexOf(\":nth-child\") != -1) {\n\n // Selector Array\n selectorArray = get_selector_array(selectorPlus);\n\n // Each all selector parts\n for (i = 0; i < selectorArray.length; i++) {\n\n // Get previous parts of selector\n var prevAll = get_previous_item(selectorArray, i).join(\" \");\n\n // Gext next parts of selector\n var nextAll = get_next_item(selectorArray, i).join(\" \");\n\n // check the new selector\n var selectorPlusNew = prevAll + window.separator + selectorArray[i].replace(/:nth-child\\((.*?)\\)/i, '') + window.separator + nextAll;\n\n // clean\n selectorPlusNew = space_cleaner(selectorPlusNew);\n\n // Add \" > \" to last part of selector for be sure everything works fine.\n if (iframe.find(selectorPlusNew).length > 1) {\n selectorPlusNew = selectorPlusNew.replace(/(?=[^ ]*$)/i, ' > ');\n }\n\n // Check the selector without nth-child and be sure have only 1 element.\n if (iframe.find(selectorPlusNew).length == 1) {\n selectorArray[i] = selectorArray[i].replace(/:nth-child\\((.*?)\\)/i, '');\n }\n\n }\n\n // Array to spin, and clean selector.\n selectorPlus = space_cleaner(selectorArray.join(\" \"));\n\n }\n\n\n // Add > symbol to last if selector finding more element than one.\n if (iframe.find(selectorPlus).length > 1) {\n selectorPlus = selectorPlus.replace(/(?=[^ ]*$)/i, ' > ');\n }\n\n\n // Ready.\n return space_cleaner(selectorPlus);\n\n }", "function selectorsFromGlobalMetadata(selectors, outputCtx) {\n if (selectors.length > 1 || selectors.length == 1 && selectors[0].value) {\n var selectorStrings = selectors.map(function (value) {\n return value.value;\n });\n selectorStrings.some(function (value) {\n return !value;\n }) && error('Found a type among the string selectors expected');\n return outputCtx.constantPool.getConstLiteral(literalArr(selectorStrings.map(function (value) {\n return literal(value);\n })));\n }\n\n if (selectors.length == 1) {\n var first = selectors[0];\n\n if (first.identifier) {\n return outputCtx.importExpr(first.identifier.reference);\n }\n }\n\n error('Unexpected query form');\n return NULL_EXPR;\n }", "function get_extensions() {\n\t$.getJSON('json/extensions.php', null, function(data) {\n\t\tvar booster_suggestions = document.getElementById('booster_suggestions') ;\n\t\tvar si = booster_suggestions.selectedIndex ;\n\t\t// Empty list\n\t\tnode_empty(booster_suggestions) ;\n\t\t// Base editions\n\t\tgroup = create_element('optgroup') ;\n\t\tgroup.label = 'Base editions' ;\n\t\tfor ( var i = 0 ; i < data.base.length ; i++ )\n\t\t\tgroup.appendChild(create_option(data.base[i].name, data.base[i].se)) ;\n\t\tbooster_suggestions.appendChild(group) ;\n\t\t// Blocs\n\t\tvar bloc = -1 ;\n\t\tvar blocs = [] ;\n\t\tfor ( var i = 0 ; i < data.bloc.length ; i++ ) {\n\t\t\tif ( typeof blocs[parseInt(data.bloc[i].bloc)] == 'undefined' ) { // First time bloc is encountered\n\t\t\t\tvar group = create_element('optgroup') ; // Create bloc's group\n\t\t\t\tblocs[data.bloc[i].bloc] = group ;\n\t\t\t\tbooster_suggestions.appendChild(group) ;\n\t\t\t\tbloc = data.bloc[i].bloc ;\n\t\t\t}\n\t\t\tgroup = blocs[data.bloc[i].bloc] ; // Get current bloc's group\n\t\t\tgroup.appendChild(create_option(data.bloc[i].name, data.bloc[i].se)) ;\n\t\t\tif ( data.bloc[i].bloc == data.bloc[i].id ) { // Main extension\n\t\t\t\tgroup.label = data.bloc[i].name ;\n\t\t\t\tvar tt = document.getElementById('tournament_type') ;\n\t\t\t\tvar boostnb = 0 ;\n\t\t\t\tif ( tt.value == 'draft' )\n\t\t\t\t\tboostnb = 3 ;\n\t\t\t\telse\n\t\t\t\t\tif ( tt.value == 'sealed' )\n\t\t\t\t\t\tboostnb = 6 ;\n\t\t\t\tvar nb = Math.round(boostnb/group.children.length) ; // Nb of each boosters\n\t\t\t\tvar b = '' ;\n\t\t\t\tfor ( var k = 0 ; k < group.children.length ; k++ ) {\n\t\t\t\t\t//for ( var j = 0 ; j < nb ; j++ ) {\n\t\t\t\t\tif ( b != '' )\n\t\t\t\t\t\tb += '-' ;\n\t\t\t\t\tb += group.children[k].value\n\t\t\t\t\tif ( nb > 1 )\n\t\t\t\t\t\tb += '*'+nb ;\n\t\t\t\t}\n\t\t\t\tgroup.appendChild(create_option('Bloc '+data.bloc[i].name, b)) ;\n\t\t\t}\n\t\t}\n\t\t// Special\n\t\t/*\n\t\tgroup = create_element('optgroup') ;\n\t\tgroup.label = 'Special' ;\n\t\tfor ( var i = 0 ; i < data.special.length ; i++ )\n\t\t\tgroup.appendChild(create_option(data.special[i].name, data.special[i].se)) ;\n\t\tbooster_suggestions.appendChild(group) ;\n\t\t*/\n\t\t// Restore selected index\n\t\tbooster_suggestions.selectedIndex = si;\n\t}) ;\n}", "selectAll ( fragments, ... tokens ) {\n fragments =\n [].concat ( ... [fragments] )\n\n const\n zip = (selector, token) =>\n selector + token + fragments.shift ()\n\n return Array\n .from\n (this.querySelectorAll\n (tokens.reduce (zip, fragments.shift ())))\n }", "function generateSelectionMenu() {\n // Iterate through the river info to determine the dropdow groupings\n var selectionGroups = [];\n for(var i=0; i < riverInfo.length; i++) {\n if(i == 0) {\n selectionGroups.push(riverInfo[i].state);\n } else {\n if(selectionGroups.includes(riverInfo[i].state) == false) {\n selectionGroups.push(riverInfo[i].state);\n }\n }\n }\n\n // Iterate over each selection group, placing the group in the item-list\n for(var i=0; i < selectionGroups.length; i++) {\n var currentGroup = '<div id=\"' + abbrState(selectionGroups[i], 'abbr') + '-group\" class=\"item-group\" data-state=\"' + selectionGroups[i] + '\"></div>';\n $('.item-list').append(currentGroup);\n }\n\n // Iterate over each item in the river info list, placing each one in its appropriate dropdown group\n riverInfo.forEach((riverData, i) => {\n var selectionIDText = riverData.river.toLowerCase().split(\" \").join(\"-\") + \"-selection\";\n var currentItem = document.createElement('div');\n currentItem.id = riverData.river.toLowerCase().split(\" \").join(\"-\") + '-selection';\n currentItem.classList.add('item');\n currentItem.dataset.index = i;\n currentItem.addEventListener('click', () => selectItem(selectionIDText));\n currentItem.innerHTML = riverData.river;\n var itemGroup = '#' + abbrState(riverData.state, 'abbr') + '-group';\n $(itemGroup).append(currentItem);\n })\n}", "function getQuery (element, eltype) {\n if (element.id) return [{ id: element.id }]\n if (element.localName === 'html') return [{ type: 'html' }]\n\n var parent = element.parentNode\n var parentSelector = getQuery(parent)\n\n const type = element.localName || 'text'\n // ..\n let realindex = -1\n let offset = 0\n while (parent.childNodes[++realindex] && parent.childNodes[realindex] !== element) {\n if (eltype && parent.childNodes[realindex].className === HIGHLIGHT_CLASS) {\n offset += (parent.childNodes[realindex].previousSibling ? 2 : 1) // 1 for the span and 1 for the next text element\n }\n }\n const index = (parent.childNodes[realindex] === element) ? (realindex - offset) : -1\n // if (index<0) console.warn(\"DID NOT find the getQuery\")\n // let index = Array.prototype.indexOf.call(parent.childNodes, element);\n parentSelector.push({ type, index })\n return parentSelector\n }", "function attachClickHandlers() {\r\n $('.tree > ul').attr('role', 'tree').find('ul').attr('role', 'group');\r\n // Find element class tree, find all sub elements li that \"has(ul)\",\r\n // add class parent_li to those elements, looks for attribute role\r\n // 'treeitem' find direct children sub-elements 'span' add click\r\n // handler which is the function inside { ... }\r\n $('.tree').find('li:has(ul)').addClass('parent_li').attr('role', 'treeitem').find(' > span').on('click', function (e) {\r\n treeClickHandler(e, this);\r\n });\r\n}", "function qwerySelector (cssQuery, context) {}", "GetTargets(){this.targets = document.querySelectorAll(this.target_selector)}", "function fork(peg_parser, tree_obj){\n\t\tvar child_funcs = [];\n\t\tfor (var i = 0; i < tree_obj.combine.length; i++){\n\t\t\tchild_funcs.push(combine(peg_parser, tree_obj.combine[i]));\n\t\t}\n\t\treturn peg_parser.or.apply(peg_parser, child_funcs);\n\t}", "renderOptionsOfTypeLinks() {\n const pathname = this.props.location.pathname;\n const action = this.props.location.query.action;\n const parentPath = dropLastPathComponent(pathname);\n const dimension = this.props.dimension;\n const entryMap = dimension.entryMap;\n const optionTypeMap = dimension.optionTypeMap;\n const entryTypeMap = dimension.entryTypeMap;\n const levelTypeMap = dimension.levelTypeMap;\n\n const leafType = this.props.location.query.type;\n const leafId = this.props.location.query.id;\n const leafHierarchyId = this.props.location.query.hierarchyId;\n\n const optionSet = levelTypeMap.get(leafType);\n const topLevelItems = getBrowseList(optionSet);\n\n const combinedEntryId = leafHierarchyId + ':' + leafId;\n const entries = !leafId ? topLevelItems : new Set(this.props.dimension.entryMap.get(combinedEntryId).options);\n\n const checkBoxItems = getEntriesOfType(leafType, entries)\n const linkItems = getEntriesWithLeafType(leafType, entries)\n\n // todo: implement displaying links and checkboxes on the same page\n if (checkBoxItems.size > 0) {\n const orderedOptions = Array.from(checkBoxItems).sort((a, b) => {\n if(a.name < b.name) return -1;\n if(a.name > b.name) return 1;\n return 0;\n });\n console.log(orderedOptions);\n const selectorProps = {\n router: this.props.router,\n datasetID: this.props.params.id,\n dimensionID: this.props.params.dimensionID,\n options: orderedOptions,\n onSave: () => {\n this.props.router.push({\n pathname: this.props.location.pathname,\n query: {\n action: 'summary'\n }\n })\n }\n }\n \n return <SimpleSelector {...selectorProps} />\n }\n\n const geographyLinks = [];\n if (linkItems.size > 0) {\n\n const orderedLinks = [...linkItems.values()].sort((a, b) => {\n if(a.name < b.name) return -1;\n if(a.name > b.name) return 1;\n return 0;\n });\n\n orderedLinks.forEach(item => {\n const query = {\n action,\n id: item.id,\n hierarchyId: item.hierarchy_id,\n type: leafType\n };\n\n const combinedEntryId = item.hierarchy_id + ':' + item.id;\n const optionName = entryMap.get(combinedEntryId).options[0].name;\n const summary = `For example: ${optionName}`;\n\n geographyLinks.push(\n <p key={item.id} className=\"margin-top\">\n <Link to={{ pathname, query }}>{item.name}</Link><br />\n <span>{summary}</span>\n </p>\n );\n });\n }\n\n return (\n <div className=\"margin-bottom--8\">\n <h1 className=\"margin-top--4 margin-bottom\">Browse {this.props.dimensionID}</h1>\n {geographyLinks}\n <br/>\n <Link className=\"inline-block font-size--17\" to={parentPath}>Cancel</Link>\n </div>\n )\n }", "function get_human_selector(data) {\n\n var allSelectors, i;\n\n // Don't search it always\n if (window.humanSelectorArray.length === 0) {\n\n // Getting minimized data.\n data = get_minimized_css(data, true);\n\n // if no data, stop.\n if (data == '') {\n return false;\n }\n\n data = data.toString().replace(/\\}\\,/g, \"}\");\n\n // Getting All CSS Selectors.\n allSelectors = array_cleaner(data.replace(/\\{(.*?)\\}/g, '|BREAK|').split(\"|BREAK|\"));\n\n }\n\n // Vars\n var foundedSelectors = [];\n var selector;\n\n // get cached selector Array\n if (window.humanSelectorArrayEnd) {\n allSelectors = window.humanSelectorArray;\n }\n\n if (isUndefined(allSelectors)) {\n return false;\n }\n\n // Each All Selectors\n for (i = 0; i < allSelectors.length; i++) {\n\n // Get Selector.\n selector = space_cleaner(allSelectors[i]);\n selector = space_cleaner(selector.replace(\"{\", '').replace(\"}\", ''));\n\n // YP not like so advanced selectors.\n if (selector.indexOf(\",\") != -1 || selector.indexOf(\":\") != -1 || selector.indexOf(\"*\") != -1 || selector.indexOf(\"/\") != -1) {\n continue;\n }\n\n // Not basic html tag selectors.\n if (selector.indexOf(\"#\") == -1 && selector.indexOf(\".\") == -1) {\n continue;\n }\n\n // min two\n if (get_selector_array(selector).length < 2) {\n continue;\n }\n\n // Check if selector valid\n if (iframeBody.find(selector).length > 0) {\n\n // Cache other selectors.\n if (window.humanSelectorArrayEnd === false) {\n window.humanSelectorArray.push(selector);\n }\n\n // Founded Selector\n if (iframeBody.find(selector).hasClass(\"yp-selected\")) {\n foundedSelectors.push(selector);\n }\n\n }\n\n }\n\n // Don't read again css files. cache all human CSS selectors.\n window.humanSelectorArrayEnd = true;\n\n // New selectors\n var foundedNewSelectors = [];\n\n // Each all founded selectors.\n // Don't use if has non useful classes as format-link etc.\n for (i = 0; i < foundedSelectors.length; i++) {\n\n var selectorBefore = foundedSelectors[i].replace(/\\-/g, 'W06lXW');\n var passedClasses = true;\n\n // Check if has an useful class\n $.each((filterBadClassesBasic), function (x, v) {\n\n v = v.replace(/\\-/g, 'W06lXW').replace(/0W06lXW9/g, '0-9').replace(/\\(\\w\\+\\)/g, '\\(\\\\w\\+\\)').replace(/aW06lXWzAW06lXWZ0-9_W06lXW/g, 'a-zA-Z0-9_-').toString();\n var re = new RegExp(\"\\\\b\" + v + \"\\\\b\", \"g\");\n\n // Founded an non useful class.\n if (selectorBefore.match(re) !== null) {\n passedClasses = false;\n }\n\n });\n\n // Check if has bad class\n $.each((filterBadClassesPlus), function (x, v) {\n\n v = v.replace(/\\-/g, 'W06lXW').replace(/0W06lXW9/g, '0-9').replace(/\\(\\w\\+\\)/g, '\\(\\\\w\\+\\)').replace(/aW06lXWzAW06lXWZ0-9_W06lXW/g, 'a-zA-Z0-9_-').toString();\n var re = new RegExp(\"\\\\b\" + v + \"\\\\b\", \"g\");\n\n // Founded an bad class.\n if (selectorBefore.match(re) !== null) {\n passedClasses = false;\n }\n\n });\n\n // Successful.\n if (passedClasses === true) {\n foundedNewSelectors.push(foundedSelectors[i]);\n }\n\n }\n\n return foundedNewSelectors;\n\n }", "function parseSelector(selector) {\n var splitByHash = selector.split('#');\n var splitByDots = splitByHash[0].split('.');\n var tagName = splitByDots[0] === '' ? 'div' : splitByDots[0];\n var classList = splitByDots.slice(1);\n return { tagName: tagName, classList: classList, id: splitByHash[1] || null };\n}", "function selectorsFromGlobalMetadata(selectors, outputCtx) {\n if (selectors.length > 1 || (selectors.length == 1 && selectors[0].value)) {\n var selectorStrings = selectors.map(function (value) { return value.value; });\n selectorStrings.some(function (value) { return !value; }) &&\n error('Found a type among the string selectors expected');\n return outputCtx.constantPool.getConstLiteral(literalArr(selectorStrings.map(function (value) { return literal(value); })));\n }\n if (selectors.length == 1) {\n var first = selectors[0];\n if (first.identifier) {\n return outputCtx.importExpr(first.identifier.reference);\n }\n }\n error('Unexpected query form');\n return NULL_EXPR;\n}", "function selectorsFromGlobalMetadata(selectors, outputCtx) {\n if (selectors.length > 1 || (selectors.length == 1 && selectors[0].value)) {\n var selectorStrings = selectors.map(function (value) { return value.value; });\n selectorStrings.some(function (value) { return !value; }) &&\n error('Found a type among the string selectors expected');\n return outputCtx.constantPool.getConstLiteral(literalArr(selectorStrings.map(function (value) { return literal(value); })));\n }\n if (selectors.length == 1) {\n var first = selectors[0];\n if (first.identifier) {\n return outputCtx.importExpr(first.identifier.reference);\n }\n }\n error('Unexpected query form');\n return NULL_EXPR;\n}", "function selectorsFromGlobalMetadata(selectors, outputCtx) {\n if (selectors.length > 1 || (selectors.length == 1 && selectors[0].value)) {\n var selectorStrings = selectors.map(function (value) { return value.value; });\n selectorStrings.some(function (value) { return !value; }) &&\n error('Found a type among the string selectors expected');\n return outputCtx.constantPool.getConstLiteral(literalArr(selectorStrings.map(function (value) { return literal(value); })));\n }\n if (selectors.length == 1) {\n var first = selectors[0];\n if (first.identifier) {\n return outputCtx.importExpr(first.identifier.reference);\n }\n }\n error('Unexpected query form');\n return NULL_EXPR;\n}", "function getAllMerchantsForDeplyment() {\n\t// \n\t$.ajax({\n\t\turl : link+':8082/v1/merchant/all',\n\t\ttype : 'GET',\n\t\tcontentType : \"application/json; charset=utf-8\",\n\t\tdata : {},\n\t\tdataType : 'json',\n\t\tsuccess : function(response) {\n\t\t\tprocessGetAllMerchantsForDeplyment(response);\n\t\t},\n error: function(data, textStatus, jqXHR) {\n handleAjaxError(data, textStatus, jqXHR);\n }\n\t});\n}", "function searchTreesByName (element, global) {\n var treeToSearch = {value: element.value};\n var TreeSearchResult = document.getElementById('TreeSearchResult');\n\n if (global) {\n request('POST', '/protected/searchTreesByName', treeToSearch, function() {\n if(this.readyState == 4 && this.status == 200) {\n TreeSearchResult.innerHTML = \"\";\n for (var i = 0; i < this.response.length; ++i) {\n var mya = document.createElement('option');\n mya.value = this.response[i].name;\n TreeSearchResult.appendChild(mya);\n }\n }\n });\n } else {\n TreeSearchResult.innerHTML = \"\";\n var res = data.trees.filter(obj => (new RegExp(\".*\" + treeToSearch + \".*\", \"i\")).test(obj.name));\n for (var i = 0; i < res.length; ++i) {\n var mya = document.createElement('option');\n mya.value = res[i].name;\n TreeSearchResult.appendChild(mya);\n }\n }\n}", "function getExpandOptions(syntax, emmetConfig, filter) {\n emmetConfig = emmetConfig || {};\n emmetConfig['preferences'] = emmetConfig['preferences'] || {};\n // Fetch snippet registry\n let baseSyntax = isStyleSheet(syntax) ? 'css' : 'html';\n if (!customSnippetRegistry[syntax] && customSnippetRegistry[baseSyntax]) {\n customSnippetRegistry[syntax] = customSnippetRegistry[baseSyntax];\n }\n // Fetch Profile\n let profile = getProfile(syntax, emmetConfig['syntaxProfiles']);\n let filtersFromProfile = (profile && profile['filters']) ? profile['filters'].split(',') : [];\n filtersFromProfile = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());\n // Update profile based on preferences\n if (emmetConfig['preferences']['format.noIndentTags']) {\n if (Array.isArray(emmetConfig['preferences']['format.noIndentTags'])) {\n profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'];\n }\n else if (typeof emmetConfig['preferences']['format.noIndentTags'] === 'string') {\n profile['formatSkip'] = emmetConfig['preferences']['format.noIndentTags'].split(',');\n }\n }\n if (emmetConfig['preferences']['format.forceIndentationForTags']) {\n if (Array.isArray(emmetConfig['preferences']['format.forceIndentationForTags'])) {\n profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'];\n }\n else if (typeof emmetConfig['preferences']['format.forceIndentationForTags'] === 'string') {\n profile['formatForce'] = emmetConfig['preferences']['format.forceIndentationForTags'].split(',');\n }\n }\n if (emmetConfig['preferences']['profile.allowCompactBoolean'] && typeof emmetConfig['preferences']['profile.allowCompactBoolean'] === 'boolean') {\n profile['compactBooleanAttributes'] = emmetConfig['preferences']['profile.allowCompactBoolean'];\n }\n // Fetch Add Ons\n let addons = {};\n if (filter && filter.split(',').find(x => x.trim() === 'bem') || filtersFromProfile.indexOf('bem') > -1) {\n addons['bem'] = { element: '__' };\n if (emmetConfig['preferences']['bem.elementSeparator']) {\n addons['bem']['element'] = emmetConfig['preferences']['bem.elementSeparator'];\n }\n if (emmetConfig['preferences']['bem.modifierSeparator']) {\n addons['bem']['modifier'] = emmetConfig['preferences']['bem.modifierSeparator'];\n }\n }\n if (syntax === 'jsx') {\n addons['jsx'] = true;\n }\n // Fetch Formatters\n let formatters = getFormatters(syntax, emmetConfig['preferences']);\n if (filter && filter.split(',').find(x => x.trim() === 'c') || filtersFromProfile.indexOf('c') > -1) {\n if (!formatters['comment']) {\n formatters['comment'] = {\n enabled: true\n };\n }\n else {\n formatters['comment']['enabled'] = true;\n }\n }\n // If the user doesn't provide specific properties for a vendor, use the default values\n let preferences = emmetConfig['preferences'];\n for (const v in vendorPrefixes) {\n let vendorProperties = preferences['css.' + vendorPrefixes[v] + 'Properties'];\n if (vendorProperties == null) {\n preferences['css.' + vendorPrefixes[v] + 'Properties'] = defaultVendorProperties[v];\n }\n }\n return {\n field: exports.emmetSnippetField,\n syntax: syntax,\n profile: profile,\n addons: addons,\n variables: getVariables(emmetConfig['variables']),\n snippets: customSnippetRegistry[syntax],\n format: formatters,\n preferences: preferences\n };\n}", "function parseBuild(root) {\n var parsed = {blocks: []};\n parsed.name = querySelector(root, \".selected-role h3\").innerText.trim();\n\n var blocks = querySelectorAll(root, \".build-wrapper\");\n var headings = querySelectorAll(blocks[0].parentNode.parentNode, \"h2\");\n var buildTexts = querySelectorAll(blocks[0].parentNode.parentNode,\n \".build-text\");\n expect(blocks[0], blocks.length == headings.length);\n expect(blocks[0], blocks.length == buildTexts.length);\n for (var i = 0; i < blocks.length; ++i) {\n // Reverse the order so that Starters is first.\n var index = blocks.length - 1 - i;\n var block = parseBlock(blocks[index], headings[index], buildTexts[index]);\n var len = parsed.blocks.push(block);\n\n // If the last 2 builds are equal, just drop the last one.\n if (len > 1 &&\n arraysEqual(parsed.blocks[len-1].items, parsed.blocks[len-2].items))\n parsed.blocks.splice(-1, 1);\n }\n\n try {\n var skills = querySelectorAll(root, \".skill-order\");\n expect(skills, skills.length == 2);\n var buildTexts = querySelectorAll(skills[0].parentNode,\n \".skill-order ~ .build-text\");\n expect(skills, buildTexts.length >= 2);\n parsed.skills = [\n parseSkills(skills[0], buildTexts[0]),\n parseSkills(skills[1], buildTexts[1]),\n ];\n } catch(e) {\n console.warn(\"Couldn't parse skill section.\", e.stack);\n }\n\n return parsed;\n}" ]
[ "0.5643752", "0.564177", "0.5522093", "0.5512223", "0.55110604", "0.54667956", "0.53392327", "0.5235726", "0.51027375", "0.5054602", "0.498947", "0.498947", "0.4982487", "0.49774575", "0.49722803", "0.49584448", "0.4940216", "0.4940216", "0.4940216", "0.4940216", "0.4917505", "0.48941112", "0.48762837", "0.48759776", "0.484999", "0.48055598", "0.48055598", "0.48055598", "0.4796547", "0.47658834", "0.47618192", "0.47574395", "0.4752106", "0.4746584", "0.47362784", "0.4722827", "0.4703751", "0.46864763", "0.467753", "0.46739948", "0.46648145", "0.46648145", "0.46513033", "0.46513033", "0.46510124", "0.46166742", "0.45948744", "0.45895782", "0.45813662", "0.45813662", "0.45760554", "0.4569494", "0.45637855", "0.45621723", "0.4550023", "0.45440933", "0.4539963", "0.4537498", "0.45274425", "0.45215556", "0.45211682", "0.45197418", "0.45029765", "0.44941154", "0.44921765", "0.44897643", "0.44828254", "0.44813934", "0.4473838", "0.44640118", "0.44601634", "0.44566", "0.44501856", "0.4439107", "0.44366196", "0.44366196", "0.44309744", "0.44277018", "0.44267994", "0.44252428", "0.44133008", "0.4413284", "0.44089627", "0.4406492", "0.43950802", "0.4394302", "0.43909466", "0.43905038", "0.4387431", "0.4385638", "0.43814367", "0.43809208", "0.43785515", "0.43784207", "0.43784207", "0.43784207", "0.43762302", "0.4376079", "0.43759987", "0.43693364" ]
0.65161645
0
Helper function for sorting
compareBy(a, b) { const { key, order } = this.state.sort; if (key && order) { if (a[key] < b[key]) return -1; if (a[key] > b[key]) return 1; return 0; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sort() {}", "sort() {\n\t}", "sort() {\n\t}", "sort(){\n\n }", "function sorter(a,b) {\n return a - b;\n}", "function sortData (data) {\n ...\n}", "function sortFunction(val){\n return val.sort();\n}", "Sort() {\n\n }", "function sortAsc(a, b) {\n return a - b;\n }", "function sortAsc(a, b) {\n return a[1] - b[1];\n }", "function sortFunction ( a, b ) { \n\t\t if (a[0] - b[0] != 0) {\n\t\t return (a[0] - b[0]);\n\t\t } else if (a[1] - b[1] != 0) { \n\t\t return (a[1] - b[1]);\n\t\t } else { \n\t\t return (a[2] - b[2]);\n\t\t }\n\t\t }", "function ascSort(a,b){\n return a - b;\n }", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function Sort(a,b){\n\tif (a.ChoosedBy < b.ChoosedBy)\n\t\treturn 1;\n\telse\n\t\treturn -1;\n}", "function smartSort(a, b) {\n switch (typeof(a)) {\n case \"string\": return d3.ascending(a, b);\n case \"number\": return a - b; //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n default: return d3.ascending(a, b);\n }\n }", "sortData() {\n this.data.sort(($val1, $val2 ) => {\n const a = JSON.stringify($val1[this.sortBy]);\n const b = JSON.stringify($val2[this.sortBy]);\n if ( a < b ){\n return -this.sortDir;\n }\n if ( a > b ){\n return this.sortDir;\n }\n return 0;\n });\n }", "function sortJson() {\r\n\t \r\n}", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "function orderSortingFunction(v1, v2)\r\n{\r\n return (v1[1] == v2[1] ? v1[2] - v2[2] : v1[1] - v2[1]);\r\n}", "get sortingOrder() {}", "function sortFunction(){\r\n // parse arguments into an array\r\n var args = [].slice.call(arguments);\r\n return args.sort();\r\n}", "function sortAlpha(a, b){\r\n\t if(a < b) return -1;\r\n\t if(a > b) return 1;\r\n\t return 0;\r\n}//sortAlpha", "function sortFunction(a, b) {\n if (a[1] === b[1]) {\n return 0;\n } else {\n return (a[1] > b[1]) ? -1 : 1;\n }\n }", "function sort(a, b) {\n return a - b;\n}", "function sort(argument) {\r\n return argument.sort();\r\n}", "async function TopologicalSort(){}", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function sort( a , b){\n if(a > b) return -1;\n if(a < b) return 1;\n return 0;\n}", "function sortArrayAscByItem(){\r\n return function(obj1, obj2){\r\n if (obj1.itemText > obj2.itemText) return 1;\r\n if (obj1.itemText < obj2.itemText) return -1;\r\n return 0;\r\n }\r\n}", "function sortByFunc() {\n switch (sortBy.field) {\n case 'name':\n case 'ticker':\n if (sortBy.desc === 0) {\n return (a, b) => a[sortBy.field].localeCompare(b[sortBy.field])\n }\n return (a, b) => b[sortBy.field].localeCompare(a[sortBy.field])\n case 'price':\n case 'changes':\n case 'marketCapitalization':\n default:\n if (sortBy.desc === 0) {\n return (a, b) => (a[sortBy.field] - b[sortBy.field])\n }\n return (a, b) => (b[sortBy.field] - a[sortBy.field])\n }\n }", "function sortFunction(a,b){\n if (a[1]===b[1]){\n return 0;\n }\n else{\n return (a[1]<b[1])?1:-1;\n }\n}", "function sortMethod(a, b) {\n var x = a.name.toLowerCase();\n var y = b.name.toLowerCase();\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n }", "function Sort(arr)\n{\n\n}", "function basicSort (first, second) {\r\n\treturn first - second;\r\n}", "function sortab(a,b){\n return a - b;\n }", "_sortBy(array, selectors) {\n return array.concat().sort((a, b) => {\n for (let selector of selectors) {\n let reverse = selector.order ? -1 : 1;\n\n a = selector.value ? JP.query(a, selector.value)[0] : JP.query(a,selector)[0];\n b = selector.value ? JP.query(b, selector.value)[0] : JP.query(b,selector)[0];\n\n if (a.toUpperCase() > b.toUpperCase()) {\n return reverse;\n }\n if (a.toUpperCase() < b.toUpperCase()) {\n return -1 * reverse;\n }\n }\n return 0;\n });\n }", "sort() {\n const a = this.dict;\n const n = a.length;\n\n if( n < 2 ) { // eslint-disable-line \n } else if( n < 100 ) {\n // insertion sort\n for( let i = 1; i < n; i += 1 ) {\n const item = a[ i ];\n let j = i - 1;\n while( j >= 0 && item[ 0 ] < a[ j ][ 0 ] ) {\n a[ j + 1 ] = a[ j ];\n j -= 1;\n }\n a[ j + 1 ] = item;\n }\n } else {\n /**\n * Bottom-up iterative merge sort\n */\n for( let c = 1; c <= n - 1; c = 2 * c ) {\n for( let l = 0; l < n - 1; l += 2 * c ) {\n const m = l + c - 1;\n const r = Math.min( l + 2 * c - 1, n - 1 );\n if( m > r ) continue;\n merge( a, l, m, r );\n }\n }\n }\n }", "function sort(theArray){\n\n}", "sortBy() {\n // YOUR CODE HERE\n }", "function sortFunction(a, b) {\n if (a[0] === b[0]) {\n return 0;\n }\n else {\n return (a[0] < b[0]) ? -1 : 1;\n }\n}", "function twpro_sortJobs(){\r\n\t\tif (TWPro.twpro_failure) return;\r\n\t\tvar sortby = TWPro.twpro_jobsort, twpro_jobValues = TWPro.twpro_jobValues;\r\n\t\tvar sortfunc = function(twpro_a, twpro_b){\r\n\t\t\tvar twpro_a_str = twpro_a.name,\r\n\t\t\t\ttwpro_b_str = twpro_b.name;\r\n\t\t\tif(sortby == 'name'){\r\n\t\t\t\treturn twpro_a_str.localeCompare(twpro_b_str);\r\n\t\t\t}\r\n\t\t\tif(sortby == 'comb'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].jobrank == twpro_jobValues[twpro_b.shortName].jobrank) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].jobrank - twpro_jobValues[twpro_a.shortName].jobrank);\r\n\t\t\t}\r\n\t\t\tif(sortby == 'erfahrung'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].experience == twpro_jobValues[twpro_b.shortName].experience) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].experience - twpro_jobValues[twpro_a.shortName].experience);\r\n\t\t\t} if(sortby == 'lohn'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].wages == twpro_jobValues[twpro_b.shortName].wages) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].wages - twpro_jobValues[twpro_a.shortName].wages);\r\n\t\t\t} if(sortby == 'glueck'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].luckvaluemax == twpro_jobValues[twpro_b.shortName].luckvaluemax) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].luckvaluemax - twpro_jobValues[twpro_a.shortName].luckvaluemax);\r\n\t\t\t} if(sortby == 'gefahr'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].danger == twpro_jobValues[twpro_b.shortName].danger) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_a.shortName].danger - twpro_jobValues[twpro_b.shortName].danger);\r\n\t\t\t} else {\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName][sortby] == twpro_jobValues[twpro_b.shortName][sortby]) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName][sortby] - twpro_jobValues[twpro_a.shortName][sortby]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tTWPro.twpro_jobs.sort(sortfunc);\r\n\t\t//if(sortby == 'danger') TWPro.twpro_jobs.reverse();\r\n\t}", "function numSort(a,b) { \n\t\t\t\treturn a - b; \n\t\t\t}", "_orderSort(l, r) {\n return l.order - r.order;\n }", "function sortItems(arr) {\r\n return arr.sort();\r\n}", "sortBy({ value }) {\n\n }", "function compare_asc(a, b) {\n return a - b;\n}", "function sortFunction(a, b) {\n if (a[0] - b[0] != 0) {\n return a[0] - b[0];\n } else if (a[1] - b[1] != 0) {\n return a[1] - b[1];\n } else {\n return a[2] - b[2];\n }\n }", "function sortByDate(a, b){\nvar aDate = a.date;\nvar bDate = b.date; \nreturn ((aDate > bDate) ? -1 : ((aDate < bDate) ? 1 : 0));\n}", "function sortNumeric(val1, val2)\n{\n return val1 - val2;\n}", "function sortNumbersAscending(a, b) {\n\t return a - b;\n\t}", "function sortRenderOrder() {\n \n var sortBy = function(field, reverse, primer){\n var key = primer ? function(x) {return primer(x[field])} : function(x) {return x[field]};\n reverse = [-1, 1][+!!reverse];\n return function (a, b) {\n\treturn a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n } \n }\n \n gadgetRenderOrder.sort(sortBy(\"tabPos\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"paneId\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"parentColumnId\", true, parseInt));\n }", "genSortAscendingByField(field) {\n return (a, b) => {\n const valA = a[field].toUpperCase()\n const valB = b[field].toUpperCase()\n let order = 0\n if (valA < valB) order = -1\n if (valA > valB) order = 1\n return order\n }\n }", "function sortfunction(a, b){\n //Compare \"a\" and \"b\" in some fashion, and return -1, 0, or 1\n var n1 = a[\"number\"];\n var n2 = b[\"number\"];\n return (n2 - n1);\n}", "function sortRows(){\n sortRowsAlphabeticallyUpwards();\n}", "function sortFunc(a, b) {\n var aDate = new Date(a.time);\n var bDate = new Date(b.time);\n\n if (aDate > bDate) {\n return -1;\n } else if (aDate < bDate) {\n return 1;\n } else {\n return 0;\n }\n }", "function sortByOrder(a, b)\n{\n return (a.order - b.order);\n}", "sort() {\r\n\t\treturn this.data.sort((a,b) => {\r\n\t\t\tfor(var i=0; i < this.definition.length; i++) {\r\n\t\t\t\tconst [code, key] = this.definition[i];\r\n\t\t\t\tswitch(code) {\r\n\t\t\t\t\tcase 'asc':\r\n\t\t\t\t\tcase 'desc':\r\n\t\t\t\t\t\tif (a[key] > b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? 1 : -1;\r\n\t\t\t\t\t\tif (a[key] < b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? -1 : 1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'fn':\r\n\t\t\t\t\t\tlet result = key(a, b);\r\n\t\t\t\t\t\tif (result != 0) // If it's zero the sort wasn't decided.\r\n\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t});\r\n\t}", "function sortFunction(arrTemp,orderAsc,sortElementType){\r\n var temp ;\r\n var value1;\r\n var value2;\r\n \r\n // alert(\"in sortFunction\");\r\n \r\n for(i=0;i<arrTemp.length;i++){\r\n\t\t for(j=0;j<arrTemp.length-1;j++){\r\n\t\t\t \r\n\t\t\t //extract value depedning on data type\r\n\t\t\t if(sortElementType=='N'){\r\n\r\n\t\t\t\t \tif(arrTemp[j][0] == \"\"){\r\n\t\t\t\t\t\tvalue1 = -1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t {\r\n\t\t\t\t\t\tvalue1 = eval(arrTemp[j][0]);\r\n\t\t\t\t }\r\n\t\t\t\t\tif(arrTemp[j+1][0] == \"\"){\r\n\t\t\t\t\t\tvalue2 = -1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t {\r\n\t\t\t\t\t\tvalue2 = eval(arrTemp[j+1][0]);\r\n\t\t\t\t }\r\n\r\n\t\t\t\t \r\n\r\n\t\t\t }\r\n\t\t\t else if (sortElementType == 'D'){\r\n\t\t\t\t\tdataVal1 = convertDateFormat(arrTemp[j][0])\r\n\t\t\t\t\tdataVal2 = convertDateFormat(arrTemp[j+1][0])\r\n\t\t\t\t\tif(dataVal1 == \"\"){\r\n\t\t\t\t\t\tdataVal1 = \"01/01/1900\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(dataVal2 == \"\"){\r\n\t\t\t\t\t\tdataVal2 = \"01/01/1900\"\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue1 = new Date(dataVal1);\r\n\t\t\t\t\tvalue2 = new Date(dataVal2);\r\n\t\t\t }\r\n\t\t\t else if (sortElementType == 'A'){\r\n\t\t\t\t // alert('proper call to sort A Function');\r\n\t\t\t\t value1 = arrTemp[j][0];\r\n\t\t\t\t // alert(value1);\r\n\t\t\t\t value2 = arrTemp[j+1][0];\r\n\t\t\t\t value1 = value1.toUpperCase();\r\n\t\t\t\t value2 = value2.toUpperCase();\r\n\t\t\t\t if(value1 == \"\"){\r\n\t\t\t\t\t value1 = \"zzzzzzzzzzzzzzzzzzzz\";\r\n\t\t\t\t }\r\n\t\t\t\t if(value2 == \"\"){\r\n\t\t\t\t\t value2 = \"zzzzzzzzzzzzzzzzzzzz\";\r\n\t\t\t\t }\r\n\t\t\t\t // alert(value2);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t//\t alert('Improper call to sort Function');\r\n\t\t\t\t return false;\r\n\t\t\t }\r\n\r\n\t\t\tif(sortElementType=='N'){\r\n\t\t\t\tif(value1!=value2){\r\n\t\t\t\t\tif(orderAsc && (value1 < value2)){\r\n\t\t\t\t\t\ttemp = arrTemp[j];\r\n\t\t\t\t\t\tarrTemp[j] = arrTemp[j+1];\r\n\t\t\t\t\t\tarrTemp[j+1] = temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!orderAsc && (value1 > value2)){\r\n\t\t\t\t\t\ttemp = arrTemp[j];\r\n\t\t\t\t\t\tarrTemp[j] = arrTemp[j+1];\r\n\t\t\t\t\t\tarrTemp[j+1] = temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//return;\r\n\t\t\t}\r\n\r\n\t\t\t //apply interchange of data elements to sort in order\r\n\t\t\t if(value1!=value2 && sortElementType!='N')\r\n\t\t\t\t {\r\n\t\t\t\t\t\t//alert(value1 + ':::' + value2);\r\n\t\t\t\t\t if(orderAsc && ((value1 < value2)||((value1=='')&&(value2!=''))))\r\n\t\t\t\t\t{\r\n\t\t\t//\t\t\t alert('interchanging');\r\n\r\n\t\t\t///\t\t\t alert('j b4 changing' + arrTemp[j]);\r\n\t\t\t//\t\t\t alert('j + 1 b4 changing' + arrTemp[j + 1]);\r\n\t\t\t\t\t\ttemp = arrTemp[j];\r\n\t\t\t\t\t\tarrTemp[j] = arrTemp[j+1];\r\n\t\t\t\t\t\tarrTemp[j+1] = temp;\r\n\t\t\t\t//\t\talert('j after changing' + arrTemp[j]);\r\n\t\t\t\t//\t\talert('j + 1 after changing' +arrTemp[j + 1]);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t if(!orderAsc && ((value1 > value2)||(value1=='')&&(value2!='')))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttemp = arrTemp[j];\r\n\t\t\t\t\t\tarrTemp[j] = arrTemp[j+1]\r\n\t\t\t\t\t\tarrTemp[j+1] = temp;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t}\r\n\r\n//\talert('Leaving sort Function');\r\n\r\n}", "function numberSortFunction(a, b) {\n return a - b;\n}", "function sort_it(a,b) {\n if(isNaN(a)) {\n if(a < b) return -1;\n if(a > b) return 1;\n return 0;\n } else {\n return a - b;\n }\n}", "function sortByProcName(a, b) {//sort by name(display_as) ascending only\n\t\tif (a.DISPLAY_AS.toUpperCase() > b.DISPLAY_AS.toUpperCase()) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (a.DISPLAY_AS.toUpperCase() < b.DISPLAY_AS.toUpperCase()) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}", "nameSort() {\n orders.sort( \n function(a,b) {\n return (a[0] < b[0]) ? -1 : (a[0] > b[0]) ? 1 : 0; \n }\n ); \n }", "function sortHelper(a, b){\n // Compare the 2 dates\n return a.start < b.start ? -1 : 1;\n}", "function sortResults(){\n return sort.sortCustomerRecords(result);\n}", "sort (sort = {}) {\n let obj = Helpers.is(sort, 'Object') ? sort : { default: sort };\n Object.keys(obj).forEach((key, idx) => {\n Array.prototype.sort.call(this, (a, b) => {\n let vals = (Helpers.is(a.value, 'Object') && Helpers.is(b.value, 'Object')) ? Helpers.dotNotation(key, [a.value, b.value]) : [a, b];\n return (vals[0] < vals[1]) ? -1 : ((vals[0] > vals[1]) ? 1 : 0);\n })[obj[key] === -1 ? 'reverse' : 'valueOf']().forEach((val, idx2) => {\n return this[idx2] = val;\n });\n });\n return this;\n }", "sorted(x) {\n super.sorted(0, x);\n }", "function sortArr(a, b){\n return a - b ;\n }", "function sortNumeric(a, b) {\n return a - b;\n}", "function sort_li(a, b) {\n an = Date.parse($(a).find('.col2').text());\n bn = Date.parse($(b).find('.col2').text());\n\n return bn < an ? 1 : -1;\n }", "function sortByName (a,b) {\n if (a.name > b.name){\n return 1\n } else {\n return -1\n }\n}", "get overrideSorting() {}", "function stringSortFunction(a, b) {\n if (a < b) {\n return -1\n } else if (a === b) {\n return 0\n } else {\n return 1\n }\n}", "function sort_li(a, b) {\n console.log('in');\n an = Date.parse($(a).find('.col1').text());\n bn = Date.parse($(b).find('.col1').text());\n\n return bn < an ? 1 : -1;\n }", "function sortBy(field, reverse, primer) {\r\n reverse = (reverse) ? -1 : 1;\r\n return function(a,b) {\r\n a = a[field];\r\n b = b[field];\r\n if (typeof(primer) != 'undefined'){\r\n a = primer(a);\r\n b = primer(b);\r\n }\r\n if (a<b) return reverse * -1;\r\n if (a>b) return reverse * 1;\r\n return 0;\r\n }\r\n}", "function sortListByOrder(a, b) {\n if (a.acf.order < b.acf.order) {\n return -1;\n } else {\n return 1;\n }\n}", "function sorting(arr){\n arr.sort((a,b)=>{\n var item1 = a.name\n var item2 = b.name\n return item1 < item2 ? -1 : item1 > item2 ? 1 : 0;\n })\n}", "sort(comparator) {\n }", "function numsort(a, b) {return (a - b);}", "function sortCompare( a, b ) {\n if ( a.departure < b.departure ){\n return -1;\n }\n if ( a.departure > b.departure ){\n return 1;\n }\n return 0;\n }", "function sort_ascending (a, b) \n {\n if (a < b) return -1;\n if (a > b) return 1;\n return 0;\n }", "function cmp(a, b) {\n if(a < b) {\n return -1;\n } else if(a > b) {\n return 1;\n } else {\n return 0;\n }\n }", "function cmp(a, b) {\n if(a < b) {\n return -1;\n } else if(a > b) {\n return 1;\n } else {\n return 0;\n }\n }", "function cmp(a, b) {\n if(a < b) {\n return -1;\n } else if(a > b) {\n return 1;\n } else {\n return 0;\n }\n }", "function sortBy(prop){\r\n return function(a,b){\r\n if( a[prop] > b[prop]){\r\n return 1;\r\n }else if( a[prop] < b[prop] ){\r\n return -1;\r\n }\r\n return 0;\r\n }\r\n}", "function msortBy(cmp, l){\r\n return mergesort(cmp, l);\r\n}", "function asc_sort(a, b) {\n return ($(b).text().toLowerCase()) < ($(a).text().toLowerCase()) ? 1 : -1;\n}", "function numSort(a, b) {\n if (a > b) {\n return -1\n } else if (a < b) {\n return 1\n } else {\n return 0\n }\n}", "function sortByPriceAsc(a,b)\n{\n console.log(a.price - b.price);\n return a.price - b.price\n}", "function sortByFirstVal(a, b) {\n if (a[0] < b[0]) return -1;\n if (a[0] > b[0]) return 1;\n return 0;\n }", "function numsort(a, b) {\n return b - a;\n }", "function compSort(p1, p2) {\n if (p1[0] > p2[0]) {\n return -1;\n } else if (p1[0] < p2[0]) {\n return 1;\n } else if (p1[1] > p2[1]) {\n return -1;\n } else if (p1[1] < p2[1]) {\n return 1;\n } else {\n return 0;\n }\n }", "function compSort(p1, p2) {\n if (p1[0] > p2[0]) {\n return -1;\n } else if (p1[0] < p2[0]) {\n return 1;\n } else if (p1[1] > p2[1]) {\n return -1;\n } else if (p1[1] < p2[1]) {\n return 1;\n } else {\n return 0;\n }\n }", "function compSort(p1, p2) {\n if (p1[0] > p2[0]) {\n return -1;\n } else if (p1[0] < p2[0]) {\n return 1;\n } else if (p1[1] > p2[1]) {\n return -1;\n } else if (p1[1] < p2[1]) {\n return 1;\n } else {\n return 0;\n }\n }", "function sort() {\n // // parse arguments into an array\n var args = [].slice.call(arguments);\n\n // // .. do something with each element of args\n // // YOUR CODE HERE\n var sortedargs = args.sort(function(a, b) {\n return a > b ? 1 : -1\n })\n return sortedargs\n}", "sortedRankings ({ rankings, sortBy }) {\n const { field, order } = sortBy\n const sortComparator = (a, b) => {\n if (order === 'asc') {\n return a.stats[field] - b.stats[field]\n }\n return b.stats[field] - a.stats[field]\n }\n return rankings.sort(sortComparator)\n }", "function sortNameUp(arr) {\n return arr.sort()\n }", "function numsort(a, b) {\n return b - a;\n }" ]
[ "0.81394196", "0.77322215", "0.77322215", "0.77019256", "0.7466116", "0.74345654", "0.74153644", "0.7377754", "0.7324186", "0.7306006", "0.72732276", "0.720845", "0.7200787", "0.7200787", "0.7200787", "0.7200787", "0.7182604", "0.71309775", "0.71250474", "0.7122583", "0.7109681", "0.7080964", "0.70603603", "0.70498973", "0.7044958", "0.7040034", "0.7032977", "0.70221436", "0.7016818", "0.70101565", "0.70101565", "0.7005734", "0.6990726", "0.69906527", "0.69837195", "0.6983443", "0.69833994", "0.69771785", "0.696741", "0.6957252", "0.693379", "0.6919541", "0.6918203", "0.6911795", "0.6911256", "0.68993604", "0.6893555", "0.68930936", "0.6859189", "0.6838019", "0.6828747", "0.68277687", "0.6826045", "0.68169785", "0.68138814", "0.6805763", "0.67971164", "0.67899036", "0.6787471", "0.6782043", "0.6769819", "0.67689085", "0.6765977", "0.6764293", "0.6759215", "0.6746104", "0.67446256", "0.6744171", "0.6740684", "0.6738772", "0.673793", "0.6732178", "0.6728442", "0.672528", "0.6724054", "0.67162454", "0.67134655", "0.67126745", "0.67079645", "0.6705361", "0.6704008", "0.6693506", "0.6677601", "0.66751194", "0.6673995", "0.6673995", "0.6673995", "0.6673137", "0.66695446", "0.6666843", "0.66644526", "0.6662703", "0.66548973", "0.6654578", "0.6652079", "0.6652079", "0.6652079", "0.6650396", "0.6649129", "0.664815", "0.66468555" ]
0.0
-1
All functions to be called on $(document).ready() should be in this function
function edgtfOnDocumentReady() { edgtfButton().init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "function initOnDomReady() {}", "function edgtfOnDocumentReady() {\n edgtfHeaderBehaviour();\n edgtfSideArea();\n edgtfSideAreaScroll();\n edgtfFullscreenMenu();\n edgtfInitMobileNavigation();\n edgtfMobileHeaderBehavior();\n edgtfSetDropDownMenuPosition();\n edgtfDropDownMenu(); \n edgtfSearch();\n }", "function eltdfOnDocumentReady() {\n eltdfInitQuantityButtons();\n eltdfInitSelect2();\n\t eltdfInitPaginationFunctionality();\n\t eltdfReinitWooStickySidebarOnTabClick();\n eltdfInitSingleProductLightbox();\n\t eltdfInitSingleProductImageSwitchLogic();\n eltdfInitProductListCarousel();\n }", "function bindEvents() {\n $(document).on('ready', onDocumentReady);\n }", "function eltdfOnDocumentReady() {\n eltdfHeaderBehaviour();\n eltdfSideArea();\n eltdfSideAreaScroll();\n eltdfFullscreenMenu();\n eltdfInitDividedHeaderMenu();\n eltdfInitMobileNavigation();\n eltdfMobileHeaderBehavior();\n eltdfSetDropDownMenuPosition();\n eltdfDropDownMenu();\n eltdfSearch();\n eltdfVerticalMenu().init();\n }", "function qodefOnDocumentReady() {\n qodefInitQuantityButtons();\n qodefInitButtonLoading();\n qodefInitSelect2();\n\t qodefInitSingleProductLightbox();\n }", "function DOMReady() {\n }", "function _Initialise(){\r\n\t\t\r\n\t\tfunction __ready(){\r\n\t\t\t_PrecompileTemplates();\r\n\t\t\t_DefineJqueryPlugins();\r\n\t\t\t_CallReadyList();\r\n\t\t};\r\n\r\n\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\r\n\t\tif(_jQueryDetected){\r\n\t\t\tjQuery(document).ready(__ready);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.addEventListener(\"DOMContentLoaded\", __ready, false);\r\n\t\t}\r\n\t\t\r\n\t}", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function init() {\n documentReady(documentLoaded);\n}", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "function eltdfOnWindowLoad() {\n\t eltdfWooCommerceStickySidebar().init();\n\t eltdfInitButtonLoading();\n eltdfInitProductListMasonryShortcode();\n }", "function _init() {\n $(function() {\n $(window).resize(_checkWindowSize).resize();\n _sessionTimeoutWarning();\n });\n }", "function pageReady() {\n legacySupport();\n initSliders();\n }", "function eltdfOnDocumentReady() {\n eltdfQuestionHint();\n eltdfQuestionCheck();\n eltdfQuestionChange();\n eltdfQuestionAnswerChange();\n }", "function readyCallBack() {\n}", "function readyFunctionCalls() {\n\n\tclickToChatCall();\n\tsetUpTypeHead();\n\tjQuery(\".s7LazyLoad\").unveil();\n\tjQuery(\"input[placeholder]\").placeholder();\n\t\n\t $('#e_footercol8 a').attr('target', '_blank');\n}", "function onReady() {\n console.log('JQ');\n //jquery to handle button clicks\n $('#equalsButton').on('click', computeMath);\n $('#clearButton').on('click', clearNums);\n //NOTE FROM LIVE SOLVE: could have used 'this' to simplify\n $('#addButton').on('click', addNums);\n $('#subtractButton').on('click', subtractNums);\n $('#multiplyButton').on('click', multiplyNums);\n $('#divideButton').on('click', divideNums);\n\n keepHistory();\n}", "function ready() {\n\n\tif(!Modernizr.csstransforms3d) $('body').prepend('<div class=\"alert\"><div class=\"box\"><h2>Fatti un regalo.</h2><p>Questo sito usa tecnologie moderne non compatibili con il tuo vecchissimo browser.</p><p>Fatti un regalo, impiega due minuti a installare gratuitamente un browser recente, tipo <a href=\"http://www.google.it/intl/it/chrome/browser/\">Google Chrome</a>. Scoprirai che il web è molto più bello!</p></div></div>');\n\tloader.init();\n\t$('nav').addClass('hidden');\n\t//particles.init();\n\twork.init();\n\tnewhash.change(true);\n\textra();\n\tskillMng.init();\n\tcomponentForm.init();\n\tresponsiveNav();\n\tmaterial_click();\n\tcuul.init();\n\tdisableHover();\n\tscroll_down.init();\n}", "function pageReady(){\n handleUTM();\n legacySupport();\n initModals();\n initScrollMonitor();\n initVideos();\n _window.on('resize', debounce(initVideos, 200))\n initSmartBanner();\n initTeleport();\n initMasks();\n }", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function pageReady() {\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n setLogDefaultState();\n setStepsClasses();\n _window.on('resize', debounce(setStepsClasses, 200))\n\n initMasks();\n initValidations();\n initSelectric();\n initDatepicker();\n\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "function qodefOnDocumentReady() {\n\t qodefSideArea();\n\t qodefSideAreaScroll();\n }", "function qodeOnWindowLoad() {\n qodeInitElementorCoverBoxes();\n }", "function qodefOnDocumentReady() {\n qodefThemeRegistration.init();\n\t qodefInitDemosMasonry.init();\n\t qodefInitDemoImportPopup.init();\n }", "function lightboxDocumentReady() {\n registerAjaxLogin();\n registerAjaxSaveRecord();\n registerAjaxListEdit();\n registerAjaxEmailRecord();\n registerAjaxSMSRecord();\n registerAjaxTagRecord();\n registerAjaxEmailSearch();\n registerAjaxBulkEmail();\n registerAjaxBulkExport();\n registerAjaxBulkDelete();\n $('.mainFocus').focus();\n}", "function mkdOnDocumentReady() {\n\t mkdIconWithHover().init();\n\t mkdIEversion();\n\t mkdInitAnchor().init();\n\t mkdInitBackToTop();\n\t mkdBackButtonShowHide();\n\t mkdInitSelfHostedVideoPlayer();\n\t mkdSelfHostedVideoSize();\n\t mkdFluidVideo();\n\t mkdOwlSlider();\n\t mkdPreloadBackgrounds();\n\t mkdPrettyPhoto();\n mkdInitCustomMenuDropdown();\n }", "function mkdfOnDocumentReady() {\n mkdfCompareHolder();\n mkdfCompareHolderScroll();\n mkdfHandleAddToCompare();\n }", "static ready() { }", "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n PlannTo.jQuery = jQuery;\n\n // Call our main function\n\n main();\n }", "function onLoaded()\n\t{\n\t\twindow.initExhibitorsList();\n\t\twindow.initFloorPlans();\n\t\twindow.initConciege();\n\t\twindow.initAmenities();\n\t\twindow.initVisas();\n\t}", "function onReadyDocument() {\n// detect touch screen\n $.support.touchEvents = (function () {\n return (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);\n })();\n\n if ($.support.touchEvents) {\n $('html').addClass('touch');\n }\n\n $.fn.doOnce = function (func) {\n this.length && func.apply(this);\n return this;\n }\n\n $('#nav-main').doOnce(function () {\n this.navmain();\n });\n\n $('input[placeholder]').doOnce(function () {\n this.placeholder();\n });\n\n $('textarea[placeholder]').doOnce(function () {\n this.placeholder();\n });\n\n $('#hdr-article ul.authors').doOnce(function () {\n this.authorDisplay();\n });\n\n $pagebdy.find('div.tab-block').doOnce(function () {\n this.tabs();\n });\n\n $('#nav-toc').doOnce(function () {\n this.buildNav({\n content:$('#toc-block').find('div.col-2')\n });\n });\n\n // enable the floating nav for non-touch-enabled devices due to issue with\n // zoom and position:fixed.\n // FIXME: temp patch; needs more refinement.\n if (!$.support.touchEvents) {\n\n $('#nav-toc').doOnce(function () {\n this.floatingNav({\n sections:$('#toc-block').find('div.section')\n });\n });\n }\n\n $('.authors').doOnce(function () {\n this.authorsMeta();\n })\n\n $('.article-kicker').doOnce(function () {\n this.articleType();\n })\n\n var collapsible = $('.collapsibleContainer');\n if (collapsible) {\n collapsible.collapsiblePanel();\n }\n}", "function initialPages($) {\n\t\t$('.select2').select2();\n\t\tdisabledInput();\n\t\tentityHandler();\n\t\texpiryDateRange('#expiry');\n\t\textendEXpiryDatePicker('#extend_expiry');\n\t\tclickConfirmExtend();\n\t\tclickConfirmTerminate();\n\t\tclickConfirmChangeStatus();\n\t\tclickConfirmChangeGroup();\n\t\tclickConfirmChangePassword();\n\t\tclickConfirmResetPassword();\n\t\tclickModalCloseBtnDone();\n\t}", "function qodeOnDocumentReady() {\n \tqodeInitNewsShortcodesFilter();\n qodeNewsInitFitVids();\n qodeInitSelfHostedVideoAudioPlayer();\n qodeSelfHostedVideoSize();\n }", "function initScripts() {\n breakpoint();\n lazyload();\n heroSlider();\n categoriesMobile();\n asideLeftMobile();\n scrollRevealInit();\n seoSpoiler();\n mobileMenuOverflowScroll();\n}", "function pageDocReady () {\n\n}", "function sc_BindReady () {\n\n\t\t\t\t// Catch cases where $(document).ready() is called after the\n\t\t\t\t// browser event has already occurred.\n\t\t\t\tif (document.readyState === \"complete\") {\n\t\t\t\t\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\t\t\t\t\treturn setTimeout(omesnapCart.init, 1);\n\t\t\t\t}\n\n\t\t\t\t// Mozilla, Opera and webkit nightlies currently support this event\n\t\t\t\tif (document.addEventListener) {\n\t\t\t\t\t// Use the handy event callback\n\t\t\t\t\tdocument.addEventListener(\"DOMContentLoaded\", DOMContentLoaded, false);\n\n\t\t\t\t\t// A fallback to window.onload, that will always work\n\t\t\t\t\twindow.addEventListener(\"load\", omesnapCart.init, false);\n\n\t\t\t\t// If IE event model is used\n\t\t\t\t} else if (document.attachEvent) {\n\t\t\t\t\t// ensure firing before onload,\n\t\t\t\t\t// maybe late but safe also for iframes\n\t\t\t\t\tdocument.attachEvent(\"onreadystatechange\", DOMContentLoaded);\n\n\t\t\t\t\t// A fallback to window.onload, that will always work\n\t\t\t\t\twindow.attachEvent(\"onload\", omesnapCart.init);\n\n\t\t\t\t\t// If IE and not a frame\n\t\t\t\t\t// continually check to see if the document is ready\n\t\t\t\t\tvar toplevel = false;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttoplevel = window.frameElement === null;\n\t\t\t\t\t} catch (e) {}\n\n\t\t\t\t\tif (document.documentElement.doScroll && toplevel) {\n\t\t\t\t\t\tdoScrollCheck();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function edgtfOnDocumentReady() {\n\t edgtfSearchSlideFromHB();\n }", "function qodefOnWindowLoad() {\n qodefInitProductListMasonryShortcode();\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if(!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if(readyList) {\n for(var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "function domReady() {\r\n\t\t// Make sure that the DOM is not already loaded\r\n\t\tif(!isReady) {\r\n\t\t\t// Remember that the DOM is ready\r\n\t\t\tisReady = true;\r\n \r\n\t if(readyList) {\r\n\t for(var fn = 0; fn < readyList.length; fn++) {\r\n\t readyList[fn].call(window, []);\r\n\t }\r\n \r\n\t readyList = [];\r\n\t }\r\n\t\t}\r\n\t}", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if (readyList) {\n for (var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if (readyList) {\n for (var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "function qodeOnWindowLoad() {\n qodeInitElementorCardsSlider();\n }", "onPageReady () {}", "function ready() {\n run();\n}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function runAfterjQueryLoads() {\r\n if (typeof jQuery == 'undefined') {\r\n setTimeout('runAfterjQueryLoads()', 100);\r\n }\r\n else {\r\n if (window.jqueryNoConflict) {\r\n jQuery.noConflict();\r\n }\r\n if (jQuery.isReady) {\r\n jQueryDependencies();\r\n }\r\n else {\r\n jQuery(document).ready(function () {\r\n jQueryDependencies();\r\n });\r\n }\r\n }\r\n}", "function scriptLoadHandler() {\n\t\t// Restore jQuery and window.jQuery to their previous values and store the\n\t\t// new jQuery in our local jQuery variable\n\t\tjQuery = window.jQuery.noConflict(true);\n\t\t$ = window.jQuery;\n\t\t// Call our main function\n\t\tmain(); \n\t}", "onReady() {}", "function edgtfOnDocumentReady() {\n\t edgtfSearchSlideFromWT();\n }", "function documentReady () {\n\tcontentDiv = $('#contentDiv');\n\n\t// When first loaded (after function definitions), check to see if it needs to redirect you because of a hash\n\tdealWithHash();\n}", "function callScripts() {\n\t\"use strict\";\n\tjsReady = true;\n\tsetTotalSlides();\n\tsetPreviousSlideNumber();\n\tsetCurrentSceneNumber();\n\tsetCurrentSceneSlideNumber();\n\tsetCurrentSlideNumber();\n}", "function onPageLoad() {\n $('button[data-button-cerca]').click(ricercaConciliazione.bind(undefined, false));\n $(\"#buttonNuovaConciliazione\").click(apriCollapseNuovaConciliazione);\n $('#inserimento_buttonSalva').click(gestisciConciliazione.bind(undefined, 'inserimento', 'gestioneConciliazionePerTitolo_inserisci.do'));\n $('#aggiornamento_buttonSalva').click(gestisciConciliazione.bind(undefined, 'aggiornamento', 'gestioneConciliazionePerTitolo_aggiornamento.do'));\n\n definisciRadioEntrataSpesa();\n definisciCaricamentoSelectViaAjax();\n definisciPulsantiAnnullamento();\n definisciRicercaGuidataConto();\n\n $(document).on('contoCaricato', gestioneContoCaricato);\n }", "function ready() {\n $button.on('click', function (e) {\n e.preventDefault();\n\n localClicks++;\n incrementClick();\n });\n }", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "function main() {\n initBurgerMenu();\n setScrollAnimationTargets(); // init homepage nav\n\n if ($('#home').length === 1) {\n initHomepageNav();\n } else {\n console.log('not home');\n } // init lightboxes\n\n\n initVideoLightbox();\n initTCsLightbox();\n}", "function qodeOnWindowLoad() {\n\t qodeInitNewsShortcodesPagination().init();\n }", "function ready() {\n if (!isReady) {\n triggerEvent(document, \"ready\");\n isReady = true;\n }\n }", "function initialPages($) {\n\t\t$('.select2').select2();\n\t\tdatePicker('#date_range');\n\t\tonChangeLoanTypeHandler();\n\t\tdateRangeHandler();\n\t}", "function init() {\n\t\t\t\n\t\t\t// Is there any point in continuing?\n\t\t\tif (allElments.length == 0) {\n\t\t\t\tdebug('page contains no elements');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Replace images\n\t\t\treplaceImgboxes();\n\t\t\t\n\t\t\t// Listen for window resize events\n\t\t\t$(window).on('resize', windowResizeImgbox);\n\n\t\t\t// Add mouse listeners if we are in edit mode\n\t\t\tif (settings.command == 'edit') {\n\t\t\t\tdebug('settings.command:edit');\n\t\t\t\t$(allElments).on('click', editClick);\n\t\t\t\t$(allElments).on('mousemove', editMousemove);\n\t\t\t}\n\t\t}", "function initializePage() {\n handleGlobalEvent();\n handleSideBar();\n handleMessageBar();\n handleCollapsibleController();\n handleResetButton();\n handleDisabledSubmit();\n handleAjaxError();\n handleAjaxSetup();\n }", "function init() {\n if (!ready) {\n ready = true;\n initElements();\n }\n }", "function fireReady() {\n\t\tvar i;\n\t\tdomready = true;\n\t\tfor (i = 0; i < readyfn.length; i += 1) {\n\t\t\treadyfn[i]();\n\t\t}\n\t\treadyfn = [];\n\t}", "function qodeOnWindowLoad() {\n qodeInitElementorAdvancedImageGalleryMasonry();\n }", "function qodeOnDocumentReady() {\n\t\tqodePortfolioProjectSlider();\n\t}", "function init() {\n setDomEvents();\n }", "function salientPageBuilderElInit() {\r\n\t\t\t\t\tflexsliderInit();\r\n\t\t\t\t\tsetTimeout(flickityInit, 100);\r\n\t\t\t\t\ttwentytwentyInit();\r\n\t\t\t\t\tstandardCarouselInit();\r\n\t\t\t\t\tproductCarouselInit();\r\n\t\t\t\t\tclientsCarouselInit();\r\n\t\t\t\t\tcarouselfGrabbingClass();\r\n\t\t\t\t\tsetTimeout(tabbedInit, 60);\r\n\t\t\t\t\taccordionInit();\r\n\t\t\t\t\tlargeIconHover();\r\n\t\t\t\t\tnectarIconMatchColoring();\r\n\t\t\t\t\tcoloredButtons();\r\n\t\t\t\t\tteamMemberFullscreen();\r\n\t\t\t\t\tflipBoxInit();\r\n\t\t\t\t\towlCarouselInit();\r\n\t\t\t\t\tmouseParallaxInit();\r\n\t\t\t\t\tulCheckmarks();\r\n\t\t\t\t\tmorphingOutlinesInit();\r\n\t\t\t\t\tcascadingImageInit();\r\n\t\t\t\t\timageWithHotspotEvents();\r\n\t\t\t\t\tpricingTableHeight();\r\n\t\t\t\t\tpageSubmenuInit();\r\n\t\t\t\t\tnectarLiquidBGs();\r\n\t\t\t\t\tnectarTestimonialSliders();\r\n\t\t\t\t\tnectarTestimonialSlidersEvents();\r\n\t\t\t\t\trecentPostsTitleOnlyEqualHeight();\r\n\t\t\t\t\trecentPostsInit();\r\n\t\t\t\t\tparallaxItemHoverEffect();\r\n\t\t\t\t\tfsProjectSliderInit();\r\n\t\t\t\t\tpostMouseEvents();\r\n\t\t\t\t\tmasonryPortfolioInit();\r\n\t\t\t\t\tmasonryBlogInit();\r\n\t\t\t\t\tportfolioCustomColoring();\r\n\t\t\t\t\tsearchResultMasonryInit();\r\n\t\t\t\t\tstickySidebarInit();\r\n\t\t\t\t\tportfolioSidebarFollow();\r\n\t\t\t\t}", "function scriptLoadHandler()\n {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n\n // Call widgets init function\n init(); \n }", "function HeaderDocumentReadyScripts() {\n\n\tif ($.trim(SearchPageUrl).length > 0) {\n\t\tsessionStorage.setItem('SearchPageUrl', SearchPageUrl);\n\t}\n\n\t$(\"body\").find(\"div\").click(function () {\n\t\tif ($(this).hasClass(\"village-cinema-bg\") == false && $(this).hasClass(\"wrapper\") == false) { //#5322 - To Allow click on main div or body.\n\t\t\tisBodyClicked = false;\n\t\t}\n\t});\n\n\tif ($('#LoginTexthWidget').length > 0) {\n\t\t$('#LoginTexthWidget').hover(function () {\n\t\t\treturn false;\n\t\t});\n\n\t\t$('#LoginTexthWidget').click(function () {\n\t\t\treturn false;\n\t\t});\n\n\t}\n\n\tSetPasswordDefaultText();\n\tWidgetStateChange();\n\tWidgetByMovieFilterChange('All');\n\tWidgetByCinemaFilterChange('All');\n\n\tstyleFormElements();\n\n\tEnableDisableControl('ddlByMovieCinemas', true);\n\tEnableDisableControl('ddlByMovieSessions', true);\n\tEnableDisableControl('ddlByCinemaMovies', true);\n\tEnableDisableControl('ddlByCinemaSessions', true);\n\n\t$('#ddlByMovieCinemas').parent().find('span').html('Select cinema');\n\t$('#ddlByMovieSessions').parent().find('span').html('Select session');\n\t$('#ddlByCinemaMovies').parent().find('span').html('Select movie');\n\t$('#ddlByCinemaSessions').parent().find('span').html('Select session');\n\n\t//code for call cinema page on enter press in CinemaMegaMenu \n\t/* fix for defect #643 */\n\t$('#Cinema-Search').bind('keypress', function (e) {\n\t\tvar code = (e.keyCode ? e.keyCode : e.which);\n\t\tif (code == 13) {\n\t\t\t$('#imgCinemaNavFindCinema').trigger('click');\n\t\t\treturn false;\n\t\t}\n\t});\n\n\t$('#QuickTicketsMenu ul.tabs a').click(function () {\n\n\t\tif ($(this).attr('href') == '#CinemaTab') {\n\t\t\tWidgetTab('bycinema');\n\t\t}\n\t\telse {\n\t\t\tWidgetTab('bymovie');\n\t\t}\n\n\t\t$('#txtCurrentWidgetTab').val($(this).attr('href'));\n\n\t});\n\n\t$('#divHeaderForgotPwdContent').html($('#hidForgotPasswordText').val());\n\t$('#divHeaderMailSentContent').html($('#hidMailSentText').val());\n\n}", "function letsJQuery() {\n get_layout();\n}", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if ( !doc.body ) {\n return setTimeout( domReady, 1 );\n }\n // Remember that the DOM is ready\n isReady = true;\n // If there are functions bound, to execute\n domReadyCallback();\n // Execute all of them\n }\n} // /ready()", "function qodefOnDocumentReady() {\n\t\tqodefInitItemShowcase();\n\t}", "function eltdfOnDocumentReady() {\n\t\teltdfInitVerticalSplitSlider();\n\t}", "function womOn()\r\n{\r\n\twindow.wom_old_onload = (typeof(window.onload) != 'undefined') ? window.onload : function(){ };\r\n window.onload = womGoReal;\r\n $(document).ready(function()\r\n {\r\n \twomGo();\r\n });\r\n}", "function ready() {\n\tfixedHeader();\n\tburgerNav('aside nav', 'left');\n\t$(\"#cfp-tabs\").tabs();\n\tgooglemap.load();\n\tajaxContactForm('form#ajaxCtForm');\n\t/*\n\t$('.slick.gallery').slick({\n\t\tdots: false,\n\t\tinfinite: true,\n\t\tspeed: 500,\n\t\tfade: false,\n\t\tcssEase: 'linear'\n\t});\n\t*/\n\tif ($(document).width() > 1000) $('aside').css('min-height', $('aside nav').outerHeight());\n\t$(window).on('scroll resize', function(e) {\n\t\tif ($(document).width() > 1000\n\t\t\t&& $(window).scrollTop() >= $('.container').offset().top - $('header').height()\n\t\t\t&& $('.container').height() > $('aside nav').outerHeight()) {\n\t\t\t$('aside').css('min-height', $('aside nav').outerHeight());\n\t\t\tvar bottom = $('footer').offset().top - $(window).scrollTop() - $(window).height();\n\t\t\tif ($('footer').offset().top - $(window).scrollTop() - $('header').height() < $('aside').height()) {\n\t\t\t\t$('aside nav').css({ 'position': 'fixed', 'top': '', 'bottom': -bottom, 'width': $('aside').width() });\n\t\t\t} else {\n\t\t\t\t$('aside nav').css({ 'position': 'fixed', 'top': $('header').height(), 'bottom': '', 'width': $('aside').width() });\n\t\t\t}\n\t\t} else {\n\t\t\t$('aside nav').css({ 'position': '', 'top': '' });\n\t\t\t$('aside').css('min-height', '');\n\t\t}\n\t});\n\t$('a[href^=\"#\"]:not(.ui-tabs-anchor)').click(function (event) {\n\t\t event.preventDefault();\n\t\tconsole.log('anchor link');\n\t\t $('html, body').animate({\n\t\t\t scrollTop: $($(this).attr('href')).offset().top - $('header').height()\n\t\t }, 500);\n\t});\n}", "function onReady() {\n\t// TODO\n}", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}", "function runOnloadIfWidgetsEnabled () {\n\t\t// Init these widgets on the elements that tell us they want to be converted to a widget, but that aren't disabled.\n\t\t// They are in A-Z order, except certain ones have been shuffled to the bottom b/c they can be used in other widget.\n\n\t\tif (IBM.common.widget.dyntabs) {\n\t\t\t$(\"div[data-widget=dyntabs]:not([data-init=false])\").dyntabs();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.expertise) {\n\t\t\tIBM.common.widget.expertise.autoInit();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.formvalidator) {\n\t\t\t$(\"form[data-formvalidator=enable]:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.formvalidator.init(this);\n\t\t\t});\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.hiresimageswap) {\n\t\t\t$(\"[data-widget=hiresimageswap]:not([data-init=false])\").hiresimageswap();\n\t\t}\n\n\t\t// Map old jumpform to this for existing users. Remove legacy mapping soon.\n\t\tif (IBM.common.widget.selectlistnav) {\n\t\t\t$(\"[data-widget=selectlistnav]:not([data-init=false]), [data-widget=jumpform]:not([data-init=false])\").selectlistnav();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.leavingibm) {\n\t\t\t$(\"[data-widget=leavingibm]:not([data-init=false])\").leavingibm();\t\n\t\t}\n\n\t\tif (IBM.common.widget.masonry) {\n\t\t\t$(\"[data-widget=masonry]:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.masonry.init(this);\n\t\t\t});\n\t\t}\n\n\t\tif (IBM.common.widget.overlay) {\n\t\t\t$(\"[data-widget=overlay]:not([data-init=false])\").overlay();\n\t\t}\n\n\t\t// Checkbox has to come AFTER overlay b/c there's some binding issue going on and checkbox no workie (for now until we sort it out).\n\t\t// Checkbox has to be BEFORE datatable else only the first page of paginated table results get init'd.\n\t\tif (IBM.common.widget.checkboxradio) {\n\t\t\t$(\"form input:checkbox:not([data-init=false]), form input:radio:not([data-init=false]), table input:checkbox:not([data-init=false]), table input:radio:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.checkboxradio.init(this);\n\t\t\t});\n\t\t}\n\n\t\tif (IBM.common.widget.datatable) {\n\t\t\t$(\"table[data-widget=datatable]:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.datatable.init(this);\n\t\t\t});\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.parallaxscroll) {\n\t\t\t$(\"[data-widget=parallaxscroll]:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.parallaxscroll.init(this);\n\t\t\t});\n\t\t}\n\n\t\tif (IBM.common.widget.rssdisplay) {\n\t\t\t$(\"[data-widget=rssdisplay]:not([data-init=false])\").rssdisplay();\n\t\t}\n\n\t\tif (IBM.common.widget.scrollable) {\n\t\t\t$(\"[data-widget=scrollable]:not([data-init=false])\").scrollable();\n\t\t}\n\n\t\tif (IBM.common.widget.setsameheight) {\n\t\t\t$(\"[data-widget=setsameheight]:not([data-init=false])\").setsameheight();\n\t\t}\n\n\t\tif (IBM.common.widget.showhide) {\n\t\t\t$(\"[data-widget=showhide]:not([data-init=false])\").showhide();\n\t\t}\n\n\t\tif (IBM.common.widget.stepindicator) {\n\t\t\t$(\"div[data-widget=stepindicator]:not([data-init=false])\").stepindicator();\n\t\t}\n\n\t\tif (typeof window.SyntaxHighlighter !== \"undefined\") {\n\t\t\t$(\"[data-widget=syntaxhighlighter]:not([data-init=false])\").syntaxhighlighter();\n\t\t}\n\n\t\tif (IBM.common.widget.tooltip) {\n\t\t\t$(\"[data-widget=tooltip]:not([data-init=false])\").tooltip();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.twisty) {\n\t\t\t$(\"[data-widget=twisty]:not([data-init=false])\").twisty();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.videoplayer) {\n\t\t\t$(\"[data-widget=videoplayer]:not([data-init=false])\").videoplayer();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.videolooper) {\n\t\t\t$(\"[data-widget=videolooper]:not([data-init=false])\").videolooper();\n\t\t}\n\n\t\t// Putting carousel last since it's a container that can hold other widget and should init after they have.\n\t\tif (IBM.common.widget.carousel) {\n\t\t\t$(\"div[data-widget=carousel]:not([data-init=false])\").carousel();\n\t\t}\n\n\t\t// Form widgets that can be used in some of the widgets above, wait until the widgets above have init'd and\n\t\t// possible created some of these form elements, so we can then turn them into widgets.\n\n\t\tif (IBM.common.widget.selectlist) {\n\t\t\t$(\"div.dataTables_length > label > select:not([data-init=false]), form select:not([data-init=false]), table select:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.selectlist.init(this);\n\t\t\t});\n\t\t}\n\n\t\tif (IBM.common.widget.fileinput) {\n\t\t\t$(\"input:file[data-widget=fileinput]:not([data-init=false])\").fileinput();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.tablesrowselector) {\n\t\t\t$(\"table[data-tablerowselector=enable]:not([data-init=false])\").tablesrowselector();\n\t\t}\n\t\t\n\t\t// END runOnloadIfWidgetsEnabled\n\t}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n $ = jQuery;\n // Call our main function\n main();\n }", "function autoInit () {\n\t\tvar ddPageinfo = IBMCore.common.meta.page.pageInfo,\n\t\t\tncForm = \"\";\n\n\t\t// Check if they have the proper settings before we .getscript the NC JS file.\n\t\t// First they need the proper NC and ID object that tells us where the form and the placeholder div is.\n\t\tif (ddPageinfo.nc && ddPageinfo.nc.id) {\n\t\t\t// Onload, check if the form and placeholder exists, then include extra JS if so.\n\t\t\t$(function(){\n\t\t\t\tncForm = ddPageinfo.nc.id.form ? $(\"#\" + ddPageinfo.nc.id.form) : ($(\".nc_register_form\")[0] || $(\"#registerform\"));\n\n\t\t\t\t// Validate that the form and the placeholder div exist on the page\n\t\t\t\tif (ncForm.length === 0 || $(\"#\" + ddPageinfo.nc.id.privacyDiv).length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: \"//1.www.s81c.com/common/v18/js/notice-choice.js\",\n\t\t\t\t\t//url: \"/v18/js/notice-choice.js\",\n\t\t\t\t\tdataType: \"script\",\n\t\t\t\t\tcache: true\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "function ready(fn) {\n if (document.readyState != 'loading') {\n fn();\n } else {\n document.addEventListener('DOMContentLoaded', fn);\n }\n }", "ready() {\n const that = this;\n\n super.ready();\n\n that._isParentPositionStatic = window.getComputedStyle(that.parentElement || document.querySelector('body')).position === 'static';\n that._handleSelector(that.selector);\n\n if (that.visible) {\n that._applyPosition();\n }\n\n that._handleEventListeners();\n that._handleResize();\n\n that.value = that.$.content.innerHTML = that.value ? that.value : that.innerHTML;\n that._handleTemplate();\n }", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function initializePage() {\r\n\t$('.deletingTask').click(remove);\r\n $('.notification').click(analytics);\r\n $('.edit').click(editTask);\r\n $('#addTaskk').click(showAdd);\r\n   \r\n\t\r\n\t//$('#colorBtn').click(randomizeColors);\r\n}", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n } // Catch cases where $(document).ready() is called", "function loadUp(){\n\tif (globalDebug) {console.group(\"LoadUp\");}\n\n\t//load web fonts\n\t//loadWebFonts();\n\n\t// always\n\tniceScrollInit();\n\n\troyalSliderInit();\n\n\tisotopeInit();\n\n\tif($(\".classic-infinitescroll-wrapper\").length) classicInfiniteScrollingInit($(\".classic-infinitescroll-wrapper\"));\n\n\tprogressbarInit();\n\tmenusHover();\n\n\n\tmagnificPopupInit();\n\n\tinitVideos();\n\tresizeVideos();\n\n\tsearchTrigger();\n\t// sidebarHeight();\n\n\t//Set textarea from contact page to autoresize\n\tif($(\"textarea\").length) { $(\"textarea\").autosize(); }\n\n\t$(\".pixcode--tabs\").organicTabs();\n\n\tif (globalDebug) {console.groupEnd();}\n}", "function completed(){// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\nif(document.addEventListener||window.event.type===\"load\"||document.readyState===\"complete\"){detach();jQuery.ready();}}" ]
[ "0.7637316", "0.7295945", "0.72917986", "0.7147366", "0.70661527", "0.6997775", "0.69576925", "0.69490075", "0.69365877", "0.68800694", "0.6833077", "0.682541", "0.682541", "0.682541", "0.682541", "0.67614293", "0.6753088", "0.672049", "0.6687089", "0.6669767", "0.6669577", "0.66573805", "0.665173", "0.6650126", "0.6627484", "0.65976936", "0.6568107", "0.6538719", "0.65226674", "0.6498826", "0.64844596", "0.6481395", "0.644925", "0.64387023", "0.6428178", "0.6423512", "0.64184034", "0.6407927", "0.6401657", "0.63985664", "0.638637", "0.634168", "0.63183755", "0.6291688", "0.62886566", "0.628534", "0.628534", "0.6283812", "0.6281851", "0.62715626", "0.6263964", "0.6263964", "0.62638634", "0.6256272", "0.6247234", "0.6241161", "0.6240798", "0.62403643", "0.6240289", "0.62396", "0.62361234", "0.6229993", "0.6227248", "0.6225781", "0.62090015", "0.62088513", "0.6190889", "0.6189342", "0.61872506", "0.6183386", "0.61799854", "0.61738795", "0.61673635", "0.6167197", "0.6165704", "0.6162861", "0.61431587", "0.613872", "0.6135765", "0.61267143", "0.6126331", "0.6119911", "0.6119798", "0.6119798", "0.611388", "0.6113349", "0.61117536", "0.61116064", "0.6108749", "0.6106827", "0.61059", "0.61034983", "0.61034983", "0.61034983", "0.61034983", "0.61034983", "0.61034983", "0.61034983", "0.61034983", "0.60924596", "0.60868067" ]
0.0
-1
Rotate Memory or Accumulator Left Absolute 0x2E
function _rotateLeftAbsolute() { this.name = "Rotate Memory or Accumulator Left Absolute" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.ABSOLUTE; this.mnemonic = 'ROL' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateLeftAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Left Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Right Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsolute() {\n this.name = \"Rotate Memory or Accumulator Right Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftDP() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROL'\n}", "function _rotateRightDPX() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftDPX() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function _rotateRightDP() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROR'\n}", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "rotate(rotateAmount) {\n }", "function rotateSwap(){\n rotFactor *= -1;\n}", "function rotateInPlace(mat){\n\n}", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "dobuleRotateLeft(N){\n N.right = this.singleRightRotate(N.right);// agacin \"solunu\" saga donderme yapar\n return this.singleLeftRotate(N); // agaci sola donderir.\n }", "rotateLeft(value){\n let rotation = value / 90;\n this.facing = (this.facing + rotation) % 4\n }", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function rotateLeft(array){\n var x = array.shift()\n array.push(x)\n console.log(array)\n}", "function bitRotateLeft (num, cnt) {\r\n return (num << cnt) | (num >>> (32 - cnt))\r\n }", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "leftTurn() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "rotateLeft(n) {\n if (n < 32) {\n\n var lower = ((this.lower << n | this.upper >>> (32 - n))) & (0xFFFFFFFF);\n var upper = ((this.upper << n | this.lower >>> (32 - n))) & (0xFFFFFFFF);\n return new jsLong(upper, lower);\n }\n\n if (n >= 32) {\n n -= 32;\n var lower = ((this.upper << n | this.lower >>> (32 - n))) & (0xFFFFFFFF);\n var upper = ((this.lower << n | this.upper >>> (32 - n))) & (0xFFFFFFFF);\n return new jsLong(upper, lower);\n }\n }", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function leftRotateByOne(arr) {\n let temp = arr[0], i;\n for (i = 1; i < arr.length; i++) {\n arr[i-1] = arr[i];\n }\n arr[i-1] = temp;\n return arr;\n}", "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "singleLeftRotate(N){\n let rr = N.right;// N'nin sagi rr \n let T2 = rr.left;// N'nin sagin'a rr'nin solunu ekle\n rr.left = N; // N artik rr'nin sol durumu oldu\n N.right = T2;\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n rr.height = Math.max(this.height(rr.left) - this.height(rr.right))+1; \n }", "turnLeft(){\n this.orientation--;\n if(this.orientation < 0){\n this.orientation = 3;\n }\n this.graphicalObject.rotateY(Math.PI/2);\n }", "function rightRotate(arr, outofplace, cur) {\n let tmp = arr[cur];\n\n for (let i = cur; i > outofplace; i--) {\n arr[i] = arr[i - 1];\n }\n arr[outofplace] = tmp;\n}", "function bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function fornitureLeftRotate() {\n\tif (fornSelected == null)\n\t\treturn ;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(-3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "rotateRight() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction < Constants.SKIER_DIRECTIONS.RIGHT) {\n this.setDirection(this.direction + 1);\n }\n }", "rotateLeft() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction > Constants.SKIER_DIRECTIONS.LEFT) {\n this.setDirection(this.direction - 1);\n }\n }", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "rotateLeft() {\n let valueBefore = this.value;\n let rightBefore = this.right;\n this.value = this.left.value;\n\n this.right = this.left;\n this.left = this.left.left;\n this.right.left = this.right.right;\n this.right.right = rightBefore;\n this.right.value = valueBefore;\n\n this.right.getDepthFromChildren();\n this.getDepthFromChildren();\n }", "leftRotate(node) {\n if (node.right) {\n const rightNode = node.right;\n node.right = rightNode.left;\n rightNode.left = node;\n \n node.height = Math.max(this.getHeight(node.left), this.getHeight(node.right)) + 1;\n rightNode.height = Math.max(this.getHeight(rightNode.left), this.getHeight(rightNode.right)) + 1;\n \n return rightNode;\n }\n }", "singleRightRotate(N){\n let ll = N.left; // N'nin solu ll oldu\n let T2 = ll.right;// N'nin soluna' ll'nin sagini ekle \n ll.right = N; // N artik ll'nin sag dugumu oldu\n N.left = T2\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n ll.height = Math.max(this.height(ll.left) - this.height(ll.right))+1;\n return ll;\n }", "function rotateRight(arr) {\n let end = arr.pop()\n arr.unshift(end)\n}", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "function rotate() {\r\n const top = this.stack.pop();\r\n this.stack.splice(this.stack.length - 2, 0, top);\r\n}", "function rotate(array) {\n let movingNum = array.shift()\n array.push(movingNum)\n return array\n}", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rotate(L, R) {\n const lengthL = L.length\n R = R % lengthL\n if (R === 0 || lengthL === 0) {\n return L\n } else {\n return L.slice(lengthL - R).concat(L.slice(0, -R))\n }\n}", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "function rol(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "function rotLeft(a, d) {\r\n\tlet rslt = a.slice(d).concat(a.slice(0,d));\r\n\treturn rslt;\r\n}", "doubleRotateRight(N){\n N.left = this.singleLeftRotate(N.left);// agacin \"sagini\" sola donerme yapar\n return this.singleRightRotate(N); // \"agaci\" saga donderme yapar\n }", "leftrotate(root) {\n var temp = root.right;\n root.right = temp.left;\n temp.left = root;\n return temp;\n }", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n }", "function rotateLeft(x, n){\n\tif(n != Math.floor(n) || n < 0){\n\t\tthrow 'Invalid argument (n): requires positive integer'\n\t}\n\n\treturn ((x << n) | (x >>> (32 - n))) >>> 0;\n}", "function rol(num, cnt) \n{ \n return (num << cnt) | (num >>> (32 - cnt)) \n}", "rotateLeft() {\n // a b\n // / \\ / \\\n // c b -> a.rotateLeft() -> a e\n // / \\ / \\\n // d e c d\n const other = this.right;\n this.right = other.left;\n other.left = this;\n this.height = Math.max(this.leftHeight, this.rightHeight) + 1;\n other.height = Math.max(other.rightHeight, this.height) + 1;\n return other;\n }", "static rotate(value, bits) {\r\n return (value << bits) | (value >>> (32 - bits));\r\n }", "*directionHorizontalRight() {\n yield this.sendEvent({ type: 0x03, code: 0x00, value: 255 });\n }", "function rotate(v){\n\t\treturn $M([[0, -1],[1, 0]]).x(v)\n\t}", "function int64revrrot(dst, x, shift) {\n\t dst.l = (x.h >>> shift) | (x.l << (32 - shift));\n\t dst.h = (x.l >>> shift) | (x.h << (32 - shift));\n\t }", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n}", "function rotate2_90 (){\n angleRot2 += 90;\n cube2.style.transform = \"translateZ(-170px) rotateY(\"+ angleRot2 + \"deg)\";}", "incrementRotor(){if(this.bias<25){this.bias+=1;}else{this.bias=0;}}" ]
[ "0.74343175", "0.7421901", "0.73863924", "0.7303731", "0.68298024", "0.68284976", "0.68062663", "0.6724552", "0.65210956", "0.64577603", "0.6437752", "0.6413913", "0.63327265", "0.6285353", "0.62688637", "0.62613565", "0.62381095", "0.62231946", "0.62231946", "0.6216956", "0.6201757", "0.6201757", "0.6201757", "0.6201757", "0.6162346", "0.6151219", "0.6149012", "0.61345917", "0.61255056", "0.60948926", "0.60831714", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.60729295", "0.6055509", "0.6036659", "0.6030178", "0.5993069", "0.59646094", "0.59547466", "0.5950859", "0.59238076", "0.59170663", "0.59013957", "0.589794", "0.5846668", "0.58246946", "0.58151174", "0.5795318", "0.57881856", "0.5780787", "0.5780126", "0.5780126", "0.5757707", "0.5749642", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5745782", "0.5721124", "0.5693696", "0.5680943", "0.5678543", "0.5674074", "0.5665331", "0.56633395", "0.56615484", "0.5646419", "0.56433386", "0.56369114", "0.5631925", "0.5625408", "0.56229454", "0.56221724", "0.56182426" ]
0.76143837
0
Rotate Memory or Accumulator Left Direct Page 0x26
function _rotateLeftDP() { this.name = "Rotate Memory or Accumulator Left Direct Page" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.DIRECT_PAGE; this.mnemonic = 'ROL' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateLeftDPX() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function _rotateRightDP() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROR'\n}", "function _rotateRightDPX() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftAbsolute() {\n this.name = \"Rotate Memory or Accumulator Left Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROL'\n}", "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Left Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function _rotateRightAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Right Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsolute() {\n this.name = \"Rotate Memory or Accumulator Right Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROR'\n}", "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "dobuleRotateLeft(N){\n N.right = this.singleRightRotate(N.right);// agacin \"solunu\" saga donderme yapar\n return this.singleLeftRotate(N); // agaci sola donderir.\n }", "function fornitureLeftRotate() {\n\tif (fornSelected == null)\n\t\treturn ;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(-3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "rotateLeft(value){\n let rotation = value / 90;\n this.facing = (this.facing + rotation) % 4\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "rotateLeft() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction > Constants.SKIER_DIRECTIONS.LEFT) {\n this.setDirection(this.direction - 1);\n }\n }", "function bitRotateLeft (num, cnt) {\r\n return (num << cnt) | (num >>> (32 - cnt))\r\n }", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "leftTurn() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "rotate(dir) {\n\n if (dir === 'rotateright') {\n\n if (this.rotation === 3){\n this.rotation = -1\n }\n this.rotation ++;\n this.checkGhost();\n this.render();\n\n } else {\n\n if (this.rotation === 0){\n this.rotation = 4;\n }\n this.rotation --;\n this.checkGhost();\n this.render();\n\n }\n\n }", "rotate(rotateAmount) {\n }", "function rotateInPlace(mat){\n\n}", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "turnLeft(){\n this.orientation--;\n if(this.orientation < 0){\n this.orientation = 3;\n }\n this.graphicalObject.rotateY(Math.PI/2);\n }", "function bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rotateSwap(){\n rotFactor *= -1;\n}", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function rotateLeft(array){\n var x = array.shift()\n array.push(x)\n console.log(array)\n}", "function leftRotation(arr, rotationCount) {\n const reducedRotationCount = rotationCount % arr.length;\n const doubledArr = arr.concat(arr);\n const startIndex = reducedRotationCount;\n const endIndex = reducedRotationCount + arr.length;\n\n const rotatedArr = doubledArr.slice(startIndex, endIndex);\n\n return rotatedArr;\n}", "function rotLeft(a, d) {\n return a.map((_, i) => a[(i + d) % a.length]);\n}", "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function rotLeft(a, d) {\r\n\tlet rslt = a.slice(d).concat(a.slice(0,d));\r\n\treturn rslt;\r\n}", "function leftRotateByOne(arr) {\n let temp = arr[0], i;\n for (i = 1; i < arr.length; i++) {\n arr[i-1] = arr[i];\n }\n arr[i-1] = temp;\n return arr;\n}", "singleLeftRotate(N){\n let rr = N.right;// N'nin sagi rr \n let T2 = rr.left;// N'nin sagin'a rr'nin solunu ekle\n rr.left = N; // N artik rr'nin sol durumu oldu\n N.right = T2;\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n rr.height = Math.max(this.height(rr.left) - this.height(rr.right))+1; \n }", "function rotLeft(a, d) {\n if(a.length<2)\n return a;\n \n const arr=a;\n let shiftMember=null;\n for(let i=0; i<d; i++){\n shiftMember=arr.shift();\n arr.push(shiftMember);\n }\n \n return arr;\n}", "rotateLeft() {\n let valueBefore = this.value;\n let rightBefore = this.right;\n this.value = this.left.value;\n\n this.right = this.left;\n this.left = this.left.left;\n this.right.left = this.right.right;\n this.right.right = rightBefore;\n this.right.value = valueBefore;\n\n this.right.getDepthFromChildren();\n this.getDepthFromChildren();\n }", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "*directionHorizontalLeft() {\n yield this.sendEvent({ type: 0x03, code: 0x00, value: 0 });\n }", "rotateRight() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction < Constants.SKIER_DIRECTIONS.RIGHT) {\n this.setDirection(this.direction + 1);\n }\n }", "move() {\n this._offset = (this._offset + 1) % plainAlphabet.length\n }", "rotateLeft(n) {\n if (n < 32) {\n\n var lower = ((this.lower << n | this.upper >>> (32 - n))) & (0xFFFFFFFF);\n var upper = ((this.upper << n | this.lower >>> (32 - n))) & (0xFFFFFFFF);\n return new jsLong(upper, lower);\n }\n\n if (n >= 32) {\n n -= 32;\n var lower = ((this.upper << n | this.lower >>> (32 - n))) & (0xFFFFFFFF);\n var upper = ((this.lower << n | this.upper >>> (32 - n))) & (0xFFFFFFFF);\n return new jsLong(upper, lower);\n }\n }", "function rotateSector(i, q) {\n return q < 8 && q >= 0 ? (q + 8 - i * 2) % 8 : q;\n }", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "rotateHorizontal() {\r\n\t\tvar x = this.length;\r\n\t\tthis.length = this.width;\r\n\t\tthis.width = x;\r\n\t\treturn;\r\n\t}", "function rotateCounterClockwise() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.activePiece.rotateCounterClockwise();\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "rotateBasedOnPositionOfLetter( letter, oppositeDay ) {\n var index = this.positionOfLetter( this.target, letter );\n\n if (oppositeDay) {\n // rotate back left based on where the letter used to be. how?\n if (index === 0) {\n index = 1;\n } else if (index === 1) {\n index = 1;\n } else {\n index = 4;\n }\n this.rotateSteps(\"left\", index );\n\n } else {\n if (index >= 4) {\n index++;\n }\n index++;\n this.rotateSteps(\"right\", index );\n }\n }", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotLeft(a, d) {\n for(let i = 0; i < d; i++) {\n a.push(a[0]);\n a.shift();\n }\n return a;\n}", "function shift_barriers(x, y) {\n // simply decrease the direction of the tile (keeping it between [0,3]) because the check_tile\n // function takes the tile's rotation into account when figuring out where its barriers are located\n map[y][x]['dir'] = (parseInt(map[y][x]['dir']) + 1) % 4\n //console.log(map[y][x]['dir']);\n}", "function rotateHeadLeft() {\n return pulseMotor(motorHead);\n}", "function rotateArrowLeft(adiv) {\n adiv.select('g')\n .attr('transform', 'translate(0 50) rotate(-90)');\n }", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "function FlexTable_stacks_in_5390_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5390_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5390_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotLeft(a, d) {\n while (d > 0) {\n let element = a.shift(); //will get the 1st element of the array a\n a.push(element); //this adds the element we shifted back to the array\n d--; //decrease counter\n }\n return a;\n}", "turnLeft() {\n this.direction++;\n this.direction = this.direction.mod(4);\n }", "function rotateLeft(x, n){\n\tif(n != Math.floor(n) || n < 0){\n\t\tthrow 'Invalid argument (n): requires positive integer'\n\t}\n\n\treturn ((x << n) | (x >>> (32 - n))) >>> 0;\n}", "function rotLeft(a, d) {\n d -= a.length * Math.floor(d / a.length)\n a.push.apply(a, a.splice(0, d))\n return a\n}", "static rotateLeft(array, n) {\n let modifiedArray = [];\n for (let i = 0; i < array.length; i++){\n let newPosition = (i + n) % array.length;\n modifiedArray[i] = array[newPosition]\n }\n return modifiedArray\n }", "function rotLeft(a, d) {\n let temp;\n for (let i = 0; i < d; i++) {\n temp = a.shift();\n a.push(temp);\n }\n return a;\n}", "leftrotate(root) {\n var temp = root.right;\n root.right = temp.left;\n temp.left = root;\n return temp;\n }", "function FlexTable_stacks_in_2565_page20_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_2565_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_2565_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "leftRotate(node) {\n if (node.right) {\n const rightNode = node.right;\n node.right = rightNode.left;\n rightNode.left = node;\n \n node.height = Math.max(this.getHeight(node.left), this.getHeight(node.right)) + 1;\n rightNode.height = Math.max(this.getHeight(rightNode.left), this.getHeight(rightNode.right)) + 1;\n \n return rightNode;\n }\n }", "function rotate() {\n $('#next').click();\n }", "function FlexTable_stacks_in_4904_page24_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4904_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4904_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "_applyRotation() {\n let start = 0;\n let end = this.pageCount;\n let leftOffset = Math.floor(this.maxSize / 2);\n let rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n if (this.page <= leftOffset) {\n // very beginning, no rotation -> [0..maxSize]\n end = this.maxSize;\n }\n else if (this.pageCount - this.page < leftOffset) {\n // very end, no rotation -> [len-maxSize..len]\n start = this.pageCount - this.maxSize;\n }\n else {\n // rotate\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n return [start, end];\n }", "function FlexTable_stacks_in_5389_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5389_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5389_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotLeft( a, d ) {\n if ( d < 1 || d > a.length ) {\n throw ( \"shift bounds out of scope\" );\n }\n const Rest = a.slice( d, a.length );\n const Slice = a.slice( 0, d );\n return [ ...Rest, ...Slice ]\n\n}", "function FlexTable_stacks_in_4911_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4911_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4911_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "rotate(direction) {\n // let current_heading = []\n // let last_element = current_heading.concat(heading).concat(direction).slice(-1);\n // return this.rotateMap[last_element][direction];\n this.state.heading = this.rotateMap[this.state.heading][direction];\n }", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "function rotateLeft(node){\n var grandparent = node.parent.parent;\n var left = node.left;\n node.parent.right = left;\n node.parent.parent = node;\n node.left = node.parent;\n node.parent = grandparent;\n }", "function FlexTable_stacks_in_5392_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5392_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5392_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotate() {\n $('#next').click();\n }", "function startRotate() {\n\t\t\tcreateProgressBar();\n\t\t\tcreateNavigation();\n\t\t\tgoToImage(0,next,false);\n\t\t}", "rotate() {\n let c = this._cellMap;\n\n return new CellBox4(\n [\n c[12], c[8], c[4], c[0],\n c[13], c[9], c[5], c[1],\n c[14], c[10], c[6], c[2],\n c[15], c[11], c[7], c[3],\n ],\n this._state,\n this._offsetX,\n this._offsetY\n );\n }", "function FlexTable_stacks_in_4912_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4912_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4912_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function updateRotorOffsets(){\n\tlet x = enigmaMachine.readRingOffset(\"all\");\n\tvar i; \n\tfor(i=1;i<=3;i++){\n\t\tdocument.getElementById(\"offset_\"+i).innerHTML=String.fromCharCode(x[i-1]+65);\n\t}\n}", "incrementRotor(){if(this.bias<25){this.bias+=1;}else{this.bias=0;}}", "function rotate(L, R) {\n const lengthL = L.length\n R = R % lengthL\n if (R === 0 || lengthL === 0) {\n return L\n } else {\n return L.slice(lengthL - R).concat(L.slice(0, -R))\n }\n}", "function rotLeft(a, d) {\n //cut down d so that we don't repeat steps\n // remove first element in array and place it at end\n //however many times d is\n d = d % a.length;\n while (d--) {\n const end = a.shift();\n a.push(end);\n }\n return a;\n}" ]
[ "0.763694", "0.7465139", "0.73501825", "0.66468763", "0.6616651", "0.651152", "0.63243204", "0.61665314", "0.6058135", "0.5943482", "0.58843964", "0.5882576", "0.5870193", "0.5856959", "0.5856959", "0.5856959", "0.5856959", "0.5847049", "0.5834506", "0.58283377", "0.5827183", "0.57945514", "0.5793393", "0.5789127", "0.576713", "0.57328", "0.57252765", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.5714991", "0.56581205", "0.563779", "0.5631371", "0.56126994", "0.56097424", "0.56060904", "0.5579543", "0.55532956", "0.55329055", "0.5512599", "0.5499868", "0.5498727", "0.54874927", "0.5479289", "0.54679966", "0.5464072", "0.5442165", "0.5428183", "0.5427358", "0.54187757", "0.54112375", "0.5402019", "0.53936005", "0.5371392", "0.5360608", "0.5355796", "0.5355796", "0.5355085", "0.535474", "0.53402984", "0.53319407", "0.5329576", "0.53288114", "0.53234124", "0.53153515", "0.5313894", "0.5310206", "0.5305251", "0.53050196", "0.5288124", "0.5286681", "0.52749664", "0.52714777", "0.5265754", "0.52654445", "0.52633053", "0.52529514", "0.5252351", "0.52481794", "0.5247062", "0.5246069", "0.52452904", "0.5237968", "0.52358097", "0.5235091", "0.52340233", "0.52329624", "0.52328765", "0.5230219", "0.522957" ]
0.787481
0
Rotate Memory or Accumulator Left Absolute Indexed X 0x3E
function _rotateLeftAbsoluteX() { this.name = "Rotate Memory or Accumulator Left Absolute Indexed X" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X; this.mnemonic = 'ROL' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateRightAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Right Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftAbsolute() {\n this.name = \"Rotate Memory or Accumulator Left Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROL'\n}", "function _rotateLeftDPX() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function _rotateRightDPX() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsolute() {\n this.name = \"Rotate Memory or Accumulator Right Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROR'\n}", "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "function _rotateLeftDP() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROL'\n}", "function rotateInPlace(mat){\n\n}", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "function _rotateRightDP() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROR'\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "rotate(rotateAmount) {\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "rotateLeft(n) {\n if (n < 32) {\n\n var lower = ((this.lower << n | this.upper >>> (32 - n))) & (0xFFFFFFFF);\n var upper = ((this.upper << n | this.lower >>> (32 - n))) & (0xFFFFFFFF);\n return new jsLong(upper, lower);\n }\n\n if (n >= 32) {\n n -= 32;\n var lower = ((this.upper << n | this.lower >>> (32 - n))) & (0xFFFFFFFF);\n var upper = ((this.lower << n | this.upper >>> (32 - n))) & (0xFFFFFFFF);\n return new jsLong(upper, lower);\n }\n }", "rotateIndex(){\n switch (this.index){\n case 0:\n this.index = 2\n break;\n case 1:\n this.index = 0;\n break;\n case 2:\n this.index =1;\n break;\n \n }\n }", "function rotateSwap(){\n rotFactor *= -1;\n}", "dobuleRotateLeft(N){\n N.right = this.singleRightRotate(N.right);// agacin \"solunu\" saga donderme yapar\n return this.singleLeftRotate(N); // agaci sola donderir.\n }", "function rotateLeft(array){\n var x = array.shift()\n array.push(x)\n console.log(array)\n}", "function bitRotateLeft (num, cnt) {\r\n return (num << cnt) | (num >>> (32 - cnt))\r\n }", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function leftRotateByOne(arr) {\n let temp = arr[0], i;\n for (i = 1; i < arr.length; i++) {\n arr[i-1] = arr[i];\n }\n arr[i-1] = temp;\n return arr;\n}", "function rightRotate(arr, outofplace, cur) {\n let tmp = arr[cur];\n\n for (let i = cur; i > outofplace; i--) {\n arr[i] = arr[i - 1];\n }\n arr[outofplace] = tmp;\n}", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "rotateLeft(value){\n let rotation = value / 90;\n this.facing = (this.facing + rotation) % 4\n }", "function bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "static rotateLeft(array, n) {\n // todo: 🙌 do magic !\n // get the desired shifted elements in separate array \n let shiftedElements = []\n for (let i = 0; i < n; i++) {\n shiftedElements[i] = array[i]\n }\n // do the shifts here \n let arrayLength = array.length\n let shiftedArrayIndex = 0\n for (let j = 0; j < arrayLength; j++) {\n if (j < arrayLength - n) {\n array[j] = array[j + n]\n }\n else {\n array[j] = shiftedElements[shiftedArrayIndex]\n shiftedArrayIndex++\n }\n }\n return array\n }", "function fornitureLeftRotate() {\n\tif (fornSelected == null)\n\t\treturn ;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(-3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "rotateRowBits( row, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[this.width-1][row]; // save last item in row\n for (var x=this.width-1; x > 0; x--) {\n this.grid[x][row] = this.grid[x-1][row];\n }\n this.grid[0][row] = last; // rotate around the corner\n }\n }", "singleLeftRotate(N){\n let rr = N.right;// N'nin sagi rr \n let T2 = rr.left;// N'nin sagin'a rr'nin solunu ekle\n rr.left = N; // N artik rr'nin sol durumu oldu\n N.right = T2;\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n rr.height = Math.max(this.height(rr.left) - this.height(rr.right))+1; \n }", "function rotateLeft(x, n){\n\tif(n != Math.floor(n) || n < 0){\n\t\tthrow 'Invalid argument (n): requires positive integer'\n\t}\n\n\treturn ((x << n) | (x >>> (32 - n))) >>> 0;\n}", "function rotate(array) {\n let movingNum = array.shift()\n array.push(movingNum)\n return array\n}", "function rotate(v){\n\t\treturn $M([[0, -1],[1, 0]]).x(v)\n\t}", "static rotateLeft(array, n) {\n let modifiedArray = [];\n for (let i = 0; i < array.length; i++){\n let newPosition = (i + n) % array.length;\n modifiedArray[i] = array[newPosition]\n }\n return modifiedArray\n }", "function ShiftArrayValsLeft(arr){\n}", "function rotLeft(a, d) {\r\n\tlet rslt = a.slice(d).concat(a.slice(0,d));\r\n\treturn rslt;\r\n}", "function rotLeft(a, d) {\n if(a.length<2)\n return a;\n \n const arr=a;\n let shiftMember=null;\n for(let i=0; i<d; i++){\n shiftMember=arr.shift();\n arr.push(shiftMember);\n }\n \n return arr;\n}", "function get_rotate_index(index) {\n switch (index) {\n case 0:\n return 0;\n case 1:\n return 1;\n case 2:\n return 2;\n case 3:\n return 3;\n case -1:\n return 4;\n case -2:\n return 5;\n case -3:\n return 6;\n }\n return 0;\n }", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "rotateColumnBits( col, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[col][this.height-1]; // save last item in col\n for (var y=this.height-1; y > 0; y--) {\n this.grid[col][y] = this.grid[col][y-1];\n }\n this.grid[col][0] = last; // rotate around the corner\n }\n }", "function leftRotation(arr, rotationCount) {\n const reducedRotationCount = rotationCount % arr.length;\n const doubledArr = arr.concat(arr);\n const startIndex = reducedRotationCount;\n const endIndex = reducedRotationCount + arr.length;\n\n const rotatedArr = doubledArr.slice(startIndex, endIndex);\n\n return rotatedArr;\n}", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "leftrotate(root) {\n var temp = root.right;\n root.right = temp.left;\n temp.left = root;\n return temp;\n }", "function rotLeft(a, d) {\n let rotatedArray = a\n\n for (let i = 0; i < d; i++) {\n let rotatingValue = rotatedArray[0]\n rotatedArray.shift() //This removes the item from the beginning of the array\n rotatedArray.push(rotatingValue) //This adds it to the end of the array\n }\n\n return rotatedArray\n}", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "transform(e3v) {\nreturn (this._r.rotate(e3v)).setAdd(this._t);\n}", "function rotLeft(a, d) {\n for(let i = 0; i < d; i++) {\n a.push(a[0]);\n a.shift();\n }\n return a;\n}", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function rol(num, cnt) \n{ \n return (num << cnt) | (num >>> (32 - cnt)) \n}", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "function rol(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "function updateRotorOffsets(){\n\tlet x = enigmaMachine.readRingOffset(\"all\");\n\tvar i; \n\tfor(i=1;i<=3;i++){\n\t\tdocument.getElementById(\"offset_\"+i).innerHTML=String.fromCharCode(x[i-1]+65);\n\t}\n}", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "function int64revrrot(dst, x, shift) {\n\t dst.l = (x.h >>> shift) | (x.l << (32 - shift));\n\t dst.h = (x.l >>> shift) | (x.h << (32 - shift));\n\t }", "function rotLeft(a, d) {\n return a.map((_, i) => a[(i + d) % a.length]);\n}", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n }", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n}", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "function rotLeft(a, d) {\n for(let j = 1; j <= d; j++){\n a.push(a.shift());\n }\n\n return a;\n}", "function xlabel_rotate (xx) {\n\t return \"rotate(\"+[90,x(xx),(hh+3)].join(\",\")+\")\"\n\t }", "static rotate(value, bits) {\r\n return (value << bits) | (value >>> (32 - bits));\r\n }", "function rotLeft( a, d ) {\n if ( d < 1 || d > a.length ) {\n throw ( \"shift bounds out of scope\" );\n }\n const Rest = a.slice( d, a.length );\n const Slice = a.slice( 0, d );\n return [ ...Rest, ...Slice ]\n\n}" ]
[ "0.74959373", "0.7276008", "0.7002946", "0.68736386", "0.68279", "0.6760987", "0.6574002", "0.6554996", "0.6518214", "0.63686377", "0.62289166", "0.6228141", "0.62104076", "0.62104076", "0.61825615", "0.6167251", "0.6167251", "0.6167251", "0.6167251", "0.61502266", "0.6143089", "0.61429137", "0.61374474", "0.61227727", "0.6113894", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.6088871", "0.60553336", "0.6047404", "0.60101867", "0.5942438", "0.59412956", "0.59107757", "0.58867615", "0.5871257", "0.5865356", "0.5840502", "0.58183527", "0.5784835", "0.5772521", "0.57679397", "0.57595515", "0.5758394", "0.57531184", "0.5751328", "0.57459944", "0.57277757", "0.57277757", "0.5722631", "0.5715789", "0.5707704", "0.5702185", "0.5697703", "0.5685115", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.5681866", "0.56801134", "0.56513274", "0.56447893", "0.5643027", "0.56356424", "0.5629371", "0.5618704", "0.56162953", "0.56152546", "0.5615231", "0.5591142", "0.5586299", "0.55856967", "0.5584747", "0.5582945", "0.5571134", "0.556443" ]
0.7733791
0
Rotate Memory or Accumulator Left Direct Page Indexed X 0x36
function _rotateLeftDPX() { this.name = "Rotate Memory or Accumulator Left Direct Page Indexed X" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X; this.mnemonic = 'ROL' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateLeftDP() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROL'\n}", "function _rotateRightDPX() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightDP() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftAbsolute() {\n this.name = \"Rotate Memory or Accumulator Left Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROL'\n}", "function _rotateLeftAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Left Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function _rotateRightAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Right Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsolute() {\n this.name = \"Rotate Memory or Accumulator Right Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROR'\n}", "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "rotateLeft(n) {\n if (n < 32) {\n\n var lower = ((this.lower << n | this.upper >>> (32 - n))) & (0xFFFFFFFF);\n var upper = ((this.upper << n | this.lower >>> (32 - n))) & (0xFFFFFFFF);\n return new jsLong(upper, lower);\n }\n\n if (n >= 32) {\n n -= 32;\n var lower = ((this.upper << n | this.lower >>> (32 - n))) & (0xFFFFFFFF);\n var upper = ((this.lower << n | this.upper >>> (32 - n))) & (0xFFFFFFFF);\n return new jsLong(upper, lower);\n }\n }", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "dobuleRotateLeft(N){\n N.right = this.singleRightRotate(N.right);// agacin \"solunu\" saga donderme yapar\n return this.singleLeftRotate(N); // agaci sola donderir.\n }", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "rotateLeft(value){\n let rotation = value / 90;\n this.facing = (this.facing + rotation) % 4\n }", "rotate(rotateAmount) {\n }", "rotate(dir) {\n\n if (dir === 'rotateright') {\n\n if (this.rotation === 3){\n this.rotation = -1\n }\n this.rotation ++;\n this.checkGhost();\n this.render();\n\n } else {\n\n if (this.rotation === 0){\n this.rotation = 4;\n }\n this.rotation --;\n this.checkGhost();\n this.render();\n\n }\n\n }", "function rotateInPlace(mat){\n\n}", "function rotLeft(a, d) {\n return a.map((_, i) => a[(i + d) % a.length]);\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function rotateSwap(){\n rotFactor *= -1;\n}", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "function fornitureLeftRotate() {\n\tif (fornSelected == null)\n\t\treturn ;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(-3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "function rotateSector(i, q) {\n return q < 8 && q >= 0 ? (q + 8 - i * 2) % 8 : q;\n }", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "function rotLeft(a, d) {\n if(a.length<2)\n return a;\n \n const arr=a;\n let shiftMember=null;\n for(let i=0; i<d; i++){\n shiftMember=arr.shift();\n arr.push(shiftMember);\n }\n \n return arr;\n}", "static rotateLeft(array, n) {\n let modifiedArray = [];\n for (let i = 0; i < array.length; i++){\n let newPosition = (i + n) % array.length;\n modifiedArray[i] = array[newPosition]\n }\n return modifiedArray\n }", "function bitRotateLeft (num, cnt) {\r\n return (num << cnt) | (num >>> (32 - cnt))\r\n }", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function leftRotateByOne(arr) {\n let temp = arr[0], i;\n for (i = 1; i < arr.length; i++) {\n arr[i-1] = arr[i];\n }\n arr[i-1] = temp;\n return arr;\n}", "function rotLeft(a, d) {\r\n\tlet rslt = a.slice(d).concat(a.slice(0,d));\r\n\treturn rslt;\r\n}", "function rotateLeft(array){\n var x = array.shift()\n array.push(x)\n console.log(array)\n}", "function rotateLeft(x, n){\n\tif(n != Math.floor(n) || n < 0){\n\t\tthrow 'Invalid argument (n): requires positive integer'\n\t}\n\n\treturn ((x << n) | (x >>> (32 - n))) >>> 0;\n}", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "singleLeftRotate(N){\n let rr = N.right;// N'nin sagi rr \n let T2 = rr.left;// N'nin sagin'a rr'nin solunu ekle\n rr.left = N; // N artik rr'nin sol durumu oldu\n N.right = T2;\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n rr.height = Math.max(this.height(rr.left) - this.height(rr.right))+1; \n }", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}", "turnLeft(){\n this.orientation--;\n if(this.orientation < 0){\n this.orientation = 3;\n }\n this.graphicalObject.rotateY(Math.PI/2);\n }", "_applyRotation() {\n let start = 0;\n let end = this.pageCount;\n let leftOffset = Math.floor(this.maxSize / 2);\n let rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n if (this.page <= leftOffset) {\n // very beginning, no rotation -> [0..maxSize]\n end = this.maxSize;\n }\n else if (this.pageCount - this.page < leftOffset) {\n // very end, no rotation -> [len-maxSize..len]\n start = this.pageCount - this.maxSize;\n }\n else {\n // rotate\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n return [start, end];\n }", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "function leftRotation(arr, rotationCount) {\n const reducedRotationCount = rotationCount % arr.length;\n const doubledArr = arr.concat(arr);\n const startIndex = reducedRotationCount;\n const endIndex = reducedRotationCount + arr.length;\n\n const rotatedArr = doubledArr.slice(startIndex, endIndex);\n\n return rotatedArr;\n}", "function rotLeft(a, d) {\n for(let i = 0; i < d; i++) {\n a.push(a[0]);\n a.shift();\n }\n return a;\n}", "leftTurn() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "function FlexTable_stacks_in_5390_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5390_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5390_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotLeft(a, d) {\n let temp;\n for (let i = 0; i < d; i++) {\n temp = a.shift();\n a.push(temp);\n }\n return a;\n}", "rotateLeft() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction > Constants.SKIER_DIRECTIONS.LEFT) {\n this.setDirection(this.direction - 1);\n }\n }", "function rotLeft(a, d) {\n d -= a.length * Math.floor(d / a.length)\n a.push.apply(a, a.splice(0, d))\n return a\n}", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "function FlexTable_stacks_in_2836_page20_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_2836_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_2836_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "rotateIndex(){\n switch (this.index){\n case 0:\n this.index = 2\n break;\n case 1:\n this.index = 0;\n break;\n case 2:\n this.index =1;\n break;\n \n }\n }", "function bitRotateLeft(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "leftrotate(root) {\n var temp = root.right;\n root.right = temp.left;\n temp.left = root;\n return temp;\n }", "function rotLeft(a, d) {\n let rotatedArray = a\n\n for (let i = 0; i < d; i++) {\n let rotatingValue = rotatedArray[0]\n rotatedArray.shift() //This removes the item from the beginning of the array\n rotatedArray.push(rotatingValue) //This adds it to the end of the array\n }\n\n return rotatedArray\n}", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "function FlexTable_stacks_in_5389_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5389_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5389_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotLeft(a, d) {\n while (d > 0) {\n let element = a.shift(); //will get the 1st element of the array a\n a.push(element); //this adds the element we shifted back to the array\n d--; //decrease counter\n }\n return a;\n}", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "function rotLeft(a, d) {\n let tempArray = a;\n for (let i = 0; i < d; i++) {\n let temp = tempArray.shift();\n tempArray.push(temp);\n }\n return tempArray;\n}", "function FlexTable_stacks_in_2838_page20_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_2838_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_2838_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_4904_page24_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4904_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4904_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "function FlexTable_stacks_in_4039_page20_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4039_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4039_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_2565_page20_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_2565_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_2565_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_5392_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5392_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5392_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function leftRotation (n,d,a) {\n let endArray = [];\n let modArray = [];\n\n //Gets elements to be shifted:\n endArray = a.slice(0,d); \n //Removes elements to be shifted from original array and concatenates them at the end:\n endArray = a.splice(d).concat(endArray); \n //Converts array to string:\n endArray = endArray.toString();\n //Replaces the commas with spaces:\n endArray = endArray.split(',').join(' ');\n\n return endArray;\n}", "function rotLeft(a, d) {\n //cut down d so that we don't repeat steps\n // remove first element in array and place it at end\n //however many times d is\n d = d % a.length;\n while (d--) {\n const end = a.shift();\n a.push(end);\n }\n return a;\n}", "function rotLeft( a, d ) {\n if ( d < 1 || d > a.length ) {\n throw ( \"shift bounds out of scope\" );\n }\n const Rest = a.slice( d, a.length );\n const Slice = a.slice( 0, d );\n return [ ...Rest, ...Slice ]\n\n}", "function FlexTable_stacks_in_3586_page20_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_3586_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_3586_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_1741_page20_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_1741_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_1741_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rightRotate(arr, outofplace, cur) {\n let tmp = arr[cur];\n\n for (let i = cur; i > outofplace; i--) {\n arr[i] = arr[i - 1];\n }\n arr[outofplace] = tmp;\n}", "function FlexTable_stacks_in_5397_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5397_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5397_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_4912_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4912_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4912_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_4911_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4911_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4911_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_3574_page20_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_3574_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_3574_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotLeft(a, d) {\n for(let j = 1; j <= d; j++){\n a.push(a.shift());\n }\n\n return a;\n}", "function FlexTable_stacks_in_5093_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5093_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5093_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotate(array) {\n let movingNum = array.shift()\n array.push(movingNum)\n return array\n}", "static rotateLeft(array, n) {\n // todo: 🙌 do magic !\n // get the desired shifted elements in separate array \n let shiftedElements = []\n for (let i = 0; i < n; i++) {\n shiftedElements[i] = array[i]\n }\n // do the shifts here \n let arrayLength = array.length\n let shiftedArrayIndex = 0\n for (let j = 0; j < arrayLength; j++) {\n if (j < arrayLength - n) {\n array[j] = array[j + n]\n }\n else {\n array[j] = shiftedElements[shiftedArrayIndex]\n shiftedArrayIndex++\n }\n }\n return array\n }", "function updateRotorOffsets(){\n\tlet x = enigmaMachine.readRingOffset(\"all\");\n\tvar i; \n\tfor(i=1;i<=3;i++){\n\t\tdocument.getElementById(\"offset_\"+i).innerHTML=String.fromCharCode(x[i-1]+65);\n\t}\n}", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "function FlexTable_stacks_in_4031_page20_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4031_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4031_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_5654_page24_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5654_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5654_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_4914_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_4914_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_4914_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_3573_page20_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_3573_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_3573_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotate() {\r\n undraw();\r\n currentRotation++;\r\n if (currentRotation === current.length) {\r\n // if end of the array is reached then go back to the start.\r\n currentRotation = 0;\r\n }\r\n current = theTetriminos[random][currentRotation];\r\n checkRotatedPosition()\r\n draw();\r\n }" ]
[ "0.780992", "0.747796", "0.7469967", "0.6591143", "0.6552049", "0.6551099", "0.62893796", "0.60578746", "0.5895792", "0.58441675", "0.57939506", "0.57722104", "0.5734263", "0.5716874", "0.5713662", "0.56871134", "0.5649602", "0.5645618", "0.5620337", "0.5620337", "0.55897045", "0.55897045", "0.55897045", "0.55897045", "0.5589289", "0.55865276", "0.55848897", "0.55831194", "0.5581432", "0.5567871", "0.55656946", "0.5542208", "0.55289376", "0.5525551", "0.55210435", "0.5520301", "0.5505317", "0.54992205", "0.5472949", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5469651", "0.5449717", "0.54493666", "0.5441174", "0.5438525", "0.54313254", "0.54305965", "0.5416192", "0.541588", "0.5409963", "0.5408775", "0.54016834", "0.538829", "0.5380619", "0.53780115", "0.53724754", "0.53639483", "0.53624916", "0.53609514", "0.5360824", "0.53590244", "0.53573906", "0.5355739", "0.5353686", "0.5351546", "0.5347492", "0.5345146", "0.53450114", "0.5344837", "0.5331196", "0.5327326", "0.5324598", "0.53227955", "0.5318922", "0.53181833", "0.5316748", "0.5315872", "0.5312103", "0.5309404", "0.5308913", "0.5305926", "0.53036094", "0.53000647", "0.52955323", "0.52933174", "0.5291438", "0.5289773", "0.5289003", "0.52888095" ]
0.76863647
1
Rotate Memory or Accumulator Right Accumulator 0x6A
function _rotateRightAccumulator() { this.name = "Rotate Memory or Accumulator Right Accumulator" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.ACCUMULATOR; this.mnemonic = 'ROR' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateRightAbsolute() {\n this.name = \"Rotate Memory or Accumulator Right Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Right Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightDPX() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightDP() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftAbsolute() {\n this.name = \"Rotate Memory or Accumulator Left Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROL'\n}", "function _rotateLeftAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Left Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "rotateRight() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction < Constants.SKIER_DIRECTIONS.RIGHT) {\n this.setDirection(this.direction + 1);\n }\n }", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rightRotate(arr, outofplace, cur) {\n let tmp = arr[cur];\n\n for (let i = cur; i > outofplace; i--) {\n arr[i] = arr[i - 1];\n }\n arr[outofplace] = tmp;\n}", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "doubleRotateRight(N){\n N.left = this.singleLeftRotate(N.left);// agacin \"sagini\" sola donerme yapar\n return this.singleRightRotate(N); // \"agaci\" saga donderme yapar\n }", "function _rotateLeftDP() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROL'\n}", "function _rotateLeftDPX() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function rotateRight(arr) {\n let end = arr.pop()\n arr.unshift(end)\n}", "rotate(rotateAmount) {\n }", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "function int64revrrot(dst, x, shift) {\n\t dst.l = (x.h >>> shift) | (x.l << (32 - shift));\n\t dst.h = (x.l >>> shift) | (x.h << (32 - shift));\n\t }", "rightrotate(root) {\n var temp = root.left;\n root.left = temp.right;\n temp.right = root;\n return temp;\n }", "function rotateSwap(){\n rotFactor *= -1;\n}", "function rightRotate(array, k) {\n let L = array.length;\n return array.slice(L - k).concat(array.slice(0, L - k));\n}", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "singleRightRotate(N){\n let ll = N.left; // N'nin solu ll oldu\n let T2 = ll.right;// N'nin soluna' ll'nin sagini ekle \n ll.right = N; // N artik ll'nin sag dugumu oldu\n N.left = T2\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n ll.height = Math.max(this.height(ll.left) - this.height(ll.right))+1;\n return ll;\n }", "function rotateInPlace(mat){\n\n}", "function int64rrot(dst, x, shift) {\n\t dst.l = (x.l >>> shift) | (x.h << (32 - shift));\n\t dst.h = (x.h >>> shift) | (x.l << (32 - shift));\n\t }", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "function int64revrrot(dst, x, shift) {\r\n dst.l = (x.h >>> shift) | (x.l << (32 - shift));\r\n dst.h = (x.l >>> shift) | (x.h << (32 - shift));\r\n}", "function rotateRight(matrix){\n var copy = createMatrix(matrix.length, matrix[0].length);\n var width = copy.length - 1;\n for(let j = 0; j < matrix.length; j++){\n for(let i = 0; i < matrix[j].length; i++){\n let value = matrix[j][i];\n copy[i][width] = value;\n }\n width--;\n } \n \n return copy;\n}", "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "function rotRight(a, d) {\r\n\tfor (let i = 0; i < d; i++) {\r\n\t\tlet last = a.pop(); // remove last element\r\n\t\ta.unshift(last); // unshift adds one or more elements to the beginning of an array and returns the new length of the array\r\n\t}\r\n\treturn a;\r\n}", "function rotateArr(arr, shiftBy){\n  // to rotate to the right once, create temp var that holds the last value, then move all items in the array to the right one index, and then put the temp value at the beginning of the array\n// handles to the right\nif(shiftBy > 0){\n // loops through rotations\n for(var i = 0; i < shiftBy; i++){\n var temp = arr[arr.length - 1];\n // loop moves items to the right one idx\n for(var r = arr.length - 2; r >= 0; r--){\n arr[r+1] = arr[r];\n }\n // put temp val at the beginning\n arr[0] = temp;\n }\n} else {\n var numRotate = Math.abs(shiftBy);\n for(var i = 0; i < numRotate; i++){\n var temp = arr[0];\n for(var r = 0; r < arr.length; r++){\n arr[r-1] = arr[r];\n }\n arr[arr.length - 1] = temp;\n }\n }\n}", "function rotate(L, R) {\n const lengthL = L.length\n R = R % lengthL\n if (R === 0 || lengthL === 0) {\n return L\n } else {\n return L.slice(lengthL - R).concat(L.slice(0, -R))\n }\n}", "rotateRight() {\n // b a\n // / \\ / \\\n // a e -> b.rotateRight() -> c b\n // / \\ / \\\n // c d d e\n const other = this.left;\n this.left = other.right;\n other.right = this;\n this.height = Math.max(this.leftHeight, this.rightHeight) + 1;\n other.height = Math.max(other.leftHeight, this.height) + 1;\n return other;\n }", "rot() {\nreturn this._r;\n}", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "function rltshift () {\n}", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function rotateRight(){\n\n // Subtract 90 from current angle to rotate by 90 in anti-clockwise direction.\n angle +=90;\n\n // Rotate the jcrop-holder div by angle value\n $(\".jcrop-holder\").rotate(angle);\n jcrop_api.setOptions({rotate : angle}); \n \n // Wrap around the angle to 0 because angle can be max 360 or min 0 for rotation.\n if(angle>=360) \n angle=0;\n }", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "function rotateLeft(array){\n var x = array.shift()\n array.push(x)\n console.log(array)\n}", "function rightRotate(arr,n) {\n const shift = arr.splice(arr.length -n)\n return [...shift, ...arr]\n}", "turnRight() {\n this.direction--;\n this.direction = this.direction.mod(4);\n }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rotateRight(node){ \n var grandparent = node.parent.parent;\n var right = node.right;\n node.parent.left = right;\n node.parent.parent = node;\n node.right = node.parent;\n node.parent = grandparent;\n }", "rotateRight() {\r\n if (this.actual.rotateRight()) {\r\n this.sounds.play(\"rotate\");\r\n }\r\n }", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function int64rrot(dst, x, shift) {\r\n dst.l = (x.l >>> shift) | (x.h << (32 - shift));\r\n dst.h = (x.h >>> shift) | (x.l << (32 - shift));\r\n}", "function rightRotate (arr, d) {\n let j, k, t, t2,\n n = arr.length,\n _gcd = gcd(d, n),\n jumps = n / _gcd\n for (let i = 0; i < _gcd; i++) {\n t = arr[i]\n for (let z = i, j = 0;\n j <= jumps;\n j++, z = (z + d) % n) {\n t2 = arr[z]\n arr[z] = t\n t = t2\n\n // info(arr+\" \"+t+\" \"+t2+\" \"+z+\" \"+j);\n }\n }\n return arr\n}", "*directionHorizontalRight() {\n yield this.sendEvent({ type: 0x03, code: 0x00, value: 255 });\n }", "function customRotate(ourElement) { //ourelement is a local variable only being used in the function here below\n\t\t\trSoFar = parseInt( $(ourElement).attr(\"data-rotate\") ); //grabs element title 1 and reads the arttribute data-rotate and turns it into an integer\n\n\t\t\trSoFar = rSoFar+90; //adds 90 to that variavle\n\t\t\t\n\t\t\tif (rSoFar==360) { rSoFar = 0} //if the rsofar reaches 360, set it to zero\n\n\t\t\t\tvar $rotateCss = \"rotate(\"+rSoFar+\"deg)\"\n\n\t\t\t$(ourElement) //grabs ourelement \n\t\t\t\t.attr(\"data-rotate\",rSoFar) //changes the attribute i HTML\n\t\t\t\t.css({\n\t\t\t\t\t\"transform\":$rotateCss //rotates the element by rsofar\n\t\t\t\t})\n\t\t\t}", "function rotate1(){\r\n var rotor2prev = []; // temporary container for data that is to be overwritten\r\n\r\n // getting the temporary data for the rotor 2 prev\r\n for (i = 0; i < 26; i++) {\r\n if(rotor2[i].prev == 26){\r\n rotor2prev.push(1);\r\n }else {\r\n rotor2prev.push((rotor2[i].prev) + 1);\r\n }\r\n }\r\n\r\n\r\n // changing posiiton of the letters and next values\r\n for (i = 0; i < 26; i++) {\r\n if(rotor1[i].next == 26){\r\n rotor1[i].next = 1;\r\n }else {\r\n rotor1[i].next ++;\r\n }\r\n if(rotor1[i].pos == 26){\r\n rotor1[i].pos = 1;\r\n }else {\r\n rotor1[i].pos ++;\r\n }\r\n }\r\n\r\n // changing the position of the prev on rotor 2\r\n\r\n for (i = 0; i < 26; i++) {\r\n if(i == 0){\r\n rotor2[i].prev = parseInt(rotor2prev[25]);\r\n }else {\r\n rotor2[i].prev = parseInt(rotor2prev[i - 1]);\r\n }\r\n }\r\n}", "function rotate(array) {\n let movingNum = array.shift()\n array.push(movingNum)\n return array\n}", "function rol(num, cnt) \n{ \n return (num << cnt) | (num >>> (32 - cnt)) \n}", "rotateRowBits( row, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[this.width-1][row]; // save last item in row\n for (var x=this.width-1; x > 0; x--) {\n this.grid[x][row] = this.grid[x-1][row];\n }\n this.grid[0][row] = last; // rotate around the corner\n }\n }", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n }", "right(deg) {\n this.direction = (this.direction + toInt(deg)) % 360;\n }", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n}", "function gen_op_iwmmxt_rorl_M0_T0()\n{\n gen_opc_ptr.push({func:op_iwmmxt_rorl_M0_T0});\n}", "function rotate2(){\r\n var rotor3prev = []; // temporary containers for data that is to be overwritten\r\n var rotor2prev = [];\r\n\r\n // getting the temporary data for the rotor 3 prev\r\n for (i = 0; i < 26; i++) {\r\n if(rotor3[i].prev == 26){\r\n rotor3prev.push(1);\r\n }else {\r\n rotor3prev.push((rotor3[i].prev) + 1);\r\n }\r\n }\r\n\r\n // getting temporary date for the prev column in rotor 2\r\n for (i = 0; i < 26; i++) {\r\n rotor2prev.push(rotor2[i].prev);\r\n }\r\n\r\n // changing posiiton of the letters and next values\r\n for (i = 0; i < 26; i++) {\r\n if(rotor2[i].next == 26){\r\n rotor2[i].next = 1;\r\n }else {\r\n rotor2[i].next ++;\r\n }\r\n if(rotor2[i].pos == 26){\r\n rotor2[i].pos = 1;\r\n }else {\r\n rotor2[i].pos ++;\r\n }\r\n\r\n }\r\n\r\n // adding 1 to the value of prev on rotor 3\r\n for (i = 0; i < 26; i++) {\r\n if(i == 25){\r\n rotor2[i].prev = parseInt(rotor2prev[0]);\r\n\r\n }else {\r\n rotor2[i].prev = parseInt(rotor2prev[i + 1]);\r\n }\r\n }\r\n // changing the position of the prev on rotor 3\r\n\r\n for (i = 0; i < 26; i++) {\r\n if(i == 0){\r\n rotor3[i].prev = parseInt(rotor3prev[25]);\r\n }else {\r\n rotor3[i].prev = parseInt(rotor3prev[i - 1]);\r\n }\r\n }\r\n\r\n for (var i = 0; i < 26; i++) {\r\n if(rotor2[i].pos == 2){\r\n if(rotor2[i].val == 'v'){\r\n rotate1();\r\n console.log(\"1 has been triggered\");\r\n break;\r\n }\r\n }\r\n }\r\n\r\n\r\n}", "function rotate() {\r\n const top = this.stack.pop();\r\n this.stack.splice(this.stack.length - 2, 0, top);\r\n}", "function rol(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "dobuleRotateLeft(N){\n N.right = this.singleRightRotate(N.right);// agacin \"solunu\" saga donderme yapar\n return this.singleLeftRotate(N); // agaci sola donderir.\n }", "incrementRotor(){if(this.bias<25){this.bias+=1;}else{this.bias=0;}}", "function rol(num, cnt)\r\n {\r\n return (num << cnt) | (num >>> (32 - cnt));\r\n }", "function rol(num, cnt) {\r\n return (num << cnt) | (num >>> (32 - cnt));\r\n }", "rightRotate(y) {\n var x = y.left;\n var T2 = x.right;\n\n // Perform rotation\n x.right = y;\n y.left = T2;\n\n // Update heights\n y.height = this.max(this.height(y.left),\n this.height(y.right)) + 1;\n x.height = this.max(this.height(x.left),\n this.height(x.right)) + 1;\n\n // Return new root\n return x;\n }", "static rotate(value, bits) {\r\n return (value << bits) | (value >>> (32 - bits));\r\n }", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}" ]
[ "0.7301488", "0.729129", "0.70738417", "0.70512545", "0.65957963", "0.64361584", "0.63505715", "0.63399667", "0.63057214", "0.63057214", "0.62479144", "0.61860484", "0.61491376", "0.6098807", "0.6088369", "0.6042117", "0.60115093", "0.58827204", "0.5880513", "0.5857465", "0.58042246", "0.57625014", "0.5739607", "0.57292503", "0.5723551", "0.5709741", "0.56632656", "0.5637957", "0.561523", "0.5596889", "0.55958176", "0.5592579", "0.5586499", "0.5576608", "0.55631113", "0.5533661", "0.5532776", "0.552791", "0.552552", "0.55242103", "0.55141205", "0.5513043", "0.55118877", "0.54989046", "0.5478459", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.547528", "0.5473552", "0.5473443", "0.54452956", "0.54452956", "0.5444806", "0.54407084", "0.54391414", "0.5438877", "0.54309326", "0.54289395", "0.5425142", "0.5405649", "0.5401131", "0.53997314", "0.538785", "0.53861505", "0.5365446", "0.5352041", "0.5341296", "0.5335216", "0.53351516", "0.5329802", "0.53297937", "0.5326687", "0.5322406", "0.53191626", "0.53165567", "0.53152454", "0.53152454", "0.53152454", "0.53152454", "0.53152454", "0.53152454", "0.53152454", "0.53152454", "0.53152454", "0.53152454" ]
0.8431012
0
Rotate Memory or Accumulator Right Absolute 0x6E
function _rotateRightAbsolute() { this.name = "Rotate Memory or Accumulator Right Absolute" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.ABSOLUTE; this.mnemonic = 'ROR' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Right Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightDPX() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightDP() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftAbsolute() {\n this.name = \"Rotate Memory or Accumulator Left Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROL'\n}", "function _rotateLeftAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Left Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rightRotate(arr, outofplace, cur) {\n let tmp = arr[cur];\n\n for (let i = cur; i > outofplace; i--) {\n arr[i] = arr[i - 1];\n }\n arr[outofplace] = tmp;\n}", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "rotateRight() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction < Constants.SKIER_DIRECTIONS.RIGHT) {\n this.setDirection(this.direction + 1);\n }\n }", "function rotateSwap(){\n rotFactor *= -1;\n}", "rotate(rotateAmount) {\n }", "function int64revrrot(dst, x, shift) {\n\t dst.l = (x.h >>> shift) | (x.l << (32 - shift));\n\t dst.h = (x.l >>> shift) | (x.h << (32 - shift));\n\t }", "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "function rotateInPlace(mat){\n\n}", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "function _rotateLeftDP() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROL'\n}", "function _rotateLeftDPX() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function int64revrrot(dst, x, shift) {\r\n dst.l = (x.h >>> shift) | (x.l << (32 - shift));\r\n dst.h = (x.l >>> shift) | (x.h << (32 - shift));\r\n}", "doubleRotateRight(N){\n N.left = this.singleLeftRotate(N.left);// agacin \"sagini\" sola donerme yapar\n return this.singleRightRotate(N); // \"agaci\" saga donderme yapar\n }", "function rotateRight(arr) {\n let end = arr.pop()\n arr.unshift(end)\n}", "function int64rrot(dst, x, shift) {\n\t dst.l = (x.l >>> shift) | (x.h << (32 - shift));\n\t dst.h = (x.h >>> shift) | (x.l << (32 - shift));\n\t }", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "singleRightRotate(N){\n let ll = N.left; // N'nin solu ll oldu\n let T2 = ll.right;// N'nin soluna' ll'nin sagini ekle \n ll.right = N; // N artik ll'nin sag dugumu oldu\n N.left = T2\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n ll.height = Math.max(this.height(ll.left) - this.height(ll.right))+1;\n return ll;\n }", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "rot() {\nreturn this._r;\n}", "function int64rrot(dst, x, shift) {\r\n dst.l = (x.l >>> shift) | (x.h << (32 - shift));\r\n dst.h = (x.h >>> shift) | (x.l << (32 - shift));\r\n}", "function rightRotate(array, k) {\n let L = array.length;\n return array.slice(L - k).concat(array.slice(0, L - k));\n}", "function MIRROR64(sq) {\n return Mirror64[sq];\n}", "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "static rotate(value, bits) {\r\n return (value << bits) | (value >>> (32 - bits));\r\n }", "function rotate(L, R) {\n const lengthL = L.length\n R = R % lengthL\n if (R === 0 || lengthL === 0) {\n return L\n } else {\n return L.slice(lengthL - R).concat(L.slice(0, -R))\n }\n}", "rotateRowBits( row, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[this.width-1][row]; // save last item in row\n for (var x=this.width-1; x > 0; x--) {\n this.grid[x][row] = this.grid[x-1][row];\n }\n this.grid[0][row] = last; // rotate around the corner\n }\n }", "rightrotate(root) {\n var temp = root.left;\n root.left = temp.right;\n temp.right = root;\n return temp;\n }", "function rotate() {\r\n const top = this.stack.pop();\r\n this.stack.splice(this.stack.length - 2, 0, top);\r\n}", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function rightRotate (arr, d) {\n let j, k, t, t2,\n n = arr.length,\n _gcd = gcd(d, n),\n jumps = n / _gcd\n for (let i = 0; i < _gcd; i++) {\n t = arr[i]\n for (let z = i, j = 0;\n j <= jumps;\n j++, z = (z + d) % n) {\n t2 = arr[z]\n arr[z] = t\n t = t2\n\n // info(arr+\" \"+t+\" \"+t2+\" \"+z+\" \"+j);\n }\n }\n return arr\n}", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "function updateRotorOffsets(){\n\tlet x = enigmaMachine.readRingOffset(\"all\");\n\tvar i; \n\tfor(i=1;i<=3;i++){\n\t\tdocument.getElementById(\"offset_\"+i).innerHTML=String.fromCharCode(x[i-1]+65);\n\t}\n}", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "rotateColumnBits( col, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[col][this.height-1]; // save last item in col\n for (var y=this.height-1; y > 0; y--) {\n this.grid[col][y] = this.grid[col][y-1];\n }\n this.grid[col][0] = last; // rotate around the corner\n }\n }", "rotateRight() {\n // b a\n // / \\ / \\\n // a e -> b.rotateRight() -> c b\n // / \\ / \\\n // c d d e\n const other = this.left;\n this.left = other.right;\n other.right = this;\n this.height = Math.max(this.leftHeight, this.rightHeight) + 1;\n other.height = Math.max(other.leftHeight, this.height) + 1;\n return other;\n }", "function rotateRight(node){ \n var grandparent = node.parent.parent;\n var right = node.right;\n node.parent.left = right;\n node.parent.parent = node;\n node.right = node.parent;\n node.parent = grandparent;\n }", "function rotate(array) {\n let movingNum = array.shift()\n array.push(movingNum)\n return array\n}", "*directionHorizontalRight() {\n yield this.sendEvent({ type: 0x03, code: 0x00, value: 255 });\n }", "turnRight() {\n this.direction--;\n this.direction = this.direction.mod(4);\n }", "rotarx(angulo){\n this.helicoptero.rotar(angulo - this.rotx,[1.0,0.0,0.0]);\n this.rotx = angulo;\n }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rotateRight(){\n\n // Subtract 90 from current angle to rotate by 90 in anti-clockwise direction.\n angle +=90;\n\n // Rotate the jcrop-holder div by angle value\n $(\".jcrop-holder\").rotate(angle);\n jcrop_api.setOptions({rotate : angle}); \n \n // Wrap around the angle to 0 because angle can be max 360 or min 0 for rotation.\n if(angle>=360) \n angle=0;\n }", "function rotRight(a, d) {\r\n\tfor (let i = 0; i < d; i++) {\r\n\t\tlet last = a.pop(); // remove last element\r\n\t\ta.unshift(last); // unshift adds one or more elements to the beginning of an array and returns the new length of the array\r\n\t}\r\n\treturn a;\r\n}", "right(deg) {\n this.direction = (this.direction + toInt(deg)) % 360;\n }", "function rotateRight(matrix){\n var copy = createMatrix(matrix.length, matrix[0].length);\n var width = copy.length - 1;\n for(let j = 0; j < matrix.length; j++){\n for(let i = 0; i < matrix[j].length; i++){\n let value = matrix[j][i];\n copy[i][width] = value;\n }\n width--;\n } \n \n return copy;\n}", "function rightRotate(arr,n) {\n const shift = arr.splice(arr.length -n)\n return [...shift, ...arr]\n}", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "function rotateLeft(array){\n var x = array.shift()\n array.push(x)\n console.log(array)\n}", "function rol(num, cnt) \n{ \n return (num << cnt) | (num >>> (32 - cnt)) \n}", "function customRotate(ourElement) { //ourelement is a local variable only being used in the function here below\n\t\t\trSoFar = parseInt( $(ourElement).attr(\"data-rotate\") ); //grabs element title 1 and reads the arttribute data-rotate and turns it into an integer\n\n\t\t\trSoFar = rSoFar+90; //adds 90 to that variavle\n\t\t\t\n\t\t\tif (rSoFar==360) { rSoFar = 0} //if the rsofar reaches 360, set it to zero\n\n\t\t\t\tvar $rotateCss = \"rotate(\"+rSoFar+\"deg)\"\n\n\t\t\t$(ourElement) //grabs ourelement \n\t\t\t\t.attr(\"data-rotate\",rSoFar) //changes the attribute i HTML\n\t\t\t\t.css({\n\t\t\t\t\t\"transform\":$rotateCss //rotates the element by rsofar\n\t\t\t\t})\n\t\t\t}", "function rotateArr(arr, shiftBy){\n  // to rotate to the right once, create temp var that holds the last value, then move all items in the array to the right one index, and then put the temp value at the beginning of the array\n// handles to the right\nif(shiftBy > 0){\n // loops through rotations\n for(var i = 0; i < shiftBy; i++){\n var temp = arr[arr.length - 1];\n // loop moves items to the right one idx\n for(var r = arr.length - 2; r >= 0; r--){\n arr[r+1] = arr[r];\n }\n // put temp val at the beginning\n arr[0] = temp;\n }\n} else {\n var numRotate = Math.abs(shiftBy);\n for(var i = 0; i < numRotate; i++){\n var temp = arr[0];\n for(var r = 0; r < arr.length; r++){\n arr[r-1] = arr[r];\n }\n arr[arr.length - 1] = temp;\n }\n }\n}", "rotateLeft(value){\n let rotation = value / 90;\n this.facing = (this.facing + rotation) % 4\n }", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n}", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n }", "function crop_rotate_right(id)\n\t{\n\t\tvar x1, y1, x2, y2, c = ImageStore[id].crop;\n\t\t//\t{x1: 1-c.y2, y1: c.x1,\t x2: 1-c.y1, y2: c.x2}\n\t\tx1 = 1 - c.y2;\n\t\ty1 = c.x1;\n\t\tx2 = 1 - c.y1;\n\t\ty2 = c.x2;\n\t\t\n\t\tImageStore[id].crop = {'x1': x1, 'y1': y1, 'x2': x2, 'y2': y2};\n\t}", "incrementRotor(){if(this.bias<25){this.bias+=1;}else{this.bias=0;}}", "rotate() {\n let c = this._cellMap;\n\n return new CellBox4(\n [\n c[12], c[8], c[4], c[0],\n c[13], c[9], c[5], c[1],\n c[14], c[10], c[6], c[2],\n c[15], c[11], c[7], c[3],\n ],\n this._state,\n this._offsetX,\n this._offsetY\n );\n }", "function rol(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "function rltshift () {\n}", "function rotate() {\n\n var newOrient = active.orientation + 1;\n undrawPiece();\n\n if (newOrient >= active.type.length) {\n newOrient = 0;\n }\n var test = active.type[newOrient];\n for (var i = 0; i < test.length; i++) {\n active.location[i][0] =test[i][0] + active.pivot.r;\n active.location[i][1] = test[i][1] + active.pivot.c;\n }\n if (check(active.location)) {\n active.orientation = newOrient;\n\n }\n\n else {\n var orig = active.type[active.orientation];\n for (var i = 0; i < orig.length; i++) {\n active.location[i][0] =orig[i][0] + active.pivot.r;\n active.location[i][1] =orig[i][1] + active.pivot.c;\n }}\n piece2Grid();\n drawBoard();\n return false;\n}", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "dobuleRotateLeft(N){\n N.right = this.singleRightRotate(N.right);// agacin \"solunu\" saga donderme yapar\n return this.singleLeftRotate(N); // agaci sola donderir.\n }", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}" ]
[ "0.7658909", "0.745342", "0.6927619", "0.6870383", "0.67823464", "0.6642205", "0.64832926", "0.64832926", "0.62943846", "0.62934655", "0.6185984", "0.6174134", "0.61561877", "0.61384267", "0.6127303", "0.6108802", "0.61074764", "0.59991443", "0.5984363", "0.59635574", "0.5940146", "0.59393644", "0.5924", "0.5922784", "0.5819986", "0.5816138", "0.5769517", "0.576286", "0.5738991", "0.5715848", "0.5711032", "0.56846666", "0.56744593", "0.5663994", "0.5652781", "0.56416655", "0.5617795", "0.56010556", "0.5600568", "0.5600418", "0.55835456", "0.55796313", "0.5561391", "0.5556955", "0.5535661", "0.5534805", "0.55338156", "0.55325073", "0.5528268", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.5519569", "0.55171454", "0.55092406", "0.5508948", "0.550622", "0.5505788", "0.5505766", "0.54997295", "0.54997295", "0.5498734", "0.5474848", "0.54586005", "0.5455927", "0.54546994", "0.54543465", "0.54496896", "0.54475063", "0.54423106", "0.5439322", "0.54371506", "0.54277736", "0.5423434", "0.54189074", "0.5418449", "0.5414788", "0.54004514", "0.5399858", "0.5399858", "0.5399858", "0.5399858", "0.5399858", "0.5399858", "0.5399858", "0.5399858" ]
0.7432865
2
Rotate Memory or Accumulator Right Direct Page 0x66
function _rotateRightDP() { this.name = "Rotate Memory or Accumulator Right Direct Page" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.DIRECT_PAGE; this.mnemonic = 'ROR' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateRightDPX() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsolute() {\n this.name = \"Rotate Memory or Accumulator Right Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftDP() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROL'\n}", "function _rotateRightAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Right Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftDPX() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "function _rotateLeftAbsolute() {\n this.name = \"Rotate Memory or Accumulator Left Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROL'\n}", "function rightRotate(arr, outofplace, cur) {\n let tmp = arr[cur];\n\n for (let i = cur; i > outofplace; i--) {\n arr[i] = arr[i - 1];\n }\n arr[outofplace] = tmp;\n}", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "function _rotateLeftAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Left Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "rotateRight() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction < Constants.SKIER_DIRECTIONS.RIGHT) {\n this.setDirection(this.direction + 1);\n }\n }", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "right(deg) {\n this.direction = (this.direction + toInt(deg)) % 360;\n }", "doubleRotateRight(N){\n N.left = this.singleLeftRotate(N.left);// agacin \"sagini\" sola donerme yapar\n return this.singleRightRotate(N); // \"agaci\" saga donderme yapar\n }", "function rotateInPlace(mat){\n\n}", "rotate(dir) {\n\n if (dir === 'rotateright') {\n\n if (this.rotation === 3){\n this.rotation = -1\n }\n this.rotation ++;\n this.checkGhost();\n this.render();\n\n } else {\n\n if (this.rotation === 0){\n this.rotation = 4;\n }\n this.rotation --;\n this.checkGhost();\n this.render();\n\n }\n\n }", "function crop_rotate_right(id)\n\t{\n\t\tvar x1, y1, x2, y2, c = ImageStore[id].crop;\n\t\t//\t{x1: 1-c.y2, y1: c.x1,\t x2: 1-c.y1, y2: c.x2}\n\t\tx1 = 1 - c.y2;\n\t\ty1 = c.x1;\n\t\tx2 = 1 - c.y1;\n\t\ty2 = c.x2;\n\t\t\n\t\tImageStore[id].crop = {'x1': x1, 'y1': y1, 'x2': x2, 'y2': y2};\n\t}", "function rotateSwap(){\n rotFactor *= -1;\n}", "rotate(rotateAmount) {\n }", "singleRightRotate(N){\n let ll = N.left; // N'nin solu ll oldu\n let T2 = ll.right;// N'nin soluna' ll'nin sagini ekle \n ll.right = N; // N artik ll'nin sag dugumu oldu\n N.left = T2\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n ll.height = Math.max(this.height(ll.left) - this.height(ll.right))+1;\n return ll;\n }", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function rightRotate (arr, d) {\n let j, k, t, t2,\n n = arr.length,\n _gcd = gcd(d, n),\n jumps = n / _gcd\n for (let i = 0; i < _gcd; i++) {\n t = arr[i]\n for (let z = i, j = 0;\n j <= jumps;\n j++, z = (z + d) % n) {\n t2 = arr[z]\n arr[z] = t\n t = t2\n\n // info(arr+\" \"+t+\" \"+t2+\" \"+z+\" \"+j);\n }\n }\n return arr\n}", "function int64revrrot(dst, x, shift) {\n\t dst.l = (x.h >>> shift) | (x.l << (32 - shift));\n\t dst.h = (x.l >>> shift) | (x.h << (32 - shift));\n\t }", "_applyRotation() {\n let start = 0;\n let end = this.pageCount;\n let leftOffset = Math.floor(this.maxSize / 2);\n let rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n if (this.page <= leftOffset) {\n // very beginning, no rotation -> [0..maxSize]\n end = this.maxSize;\n }\n else if (this.pageCount - this.page < leftOffset) {\n // very end, no rotation -> [len-maxSize..len]\n start = this.pageCount - this.maxSize;\n }\n else {\n // rotate\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n return [start, end];\n }", "function rotate() {\n\n var newOrient = active.orientation + 1;\n undrawPiece();\n\n if (newOrient >= active.type.length) {\n newOrient = 0;\n }\n var test = active.type[newOrient];\n for (var i = 0; i < test.length; i++) {\n active.location[i][0] =test[i][0] + active.pivot.r;\n active.location[i][1] = test[i][1] + active.pivot.c;\n }\n if (check(active.location)) {\n active.orientation = newOrient;\n\n }\n\n else {\n var orig = active.type[active.orientation];\n for (var i = 0; i < orig.length; i++) {\n active.location[i][0] =orig[i][0] + active.pivot.r;\n active.location[i][1] =orig[i][1] + active.pivot.c;\n }}\n piece2Grid();\n drawBoard();\n return false;\n}", "turnRight() {\n this.direction--;\n this.direction = this.direction.mod(4);\n }", "function rotateRight(matrix){\n var copy = createMatrix(matrix.length, matrix[0].length);\n var width = copy.length - 1;\n for(let j = 0; j < matrix.length; j++){\n for(let i = 0; i < matrix[j].length; i++){\n let value = matrix[j][i];\n copy[i][width] = value;\n }\n width--;\n } \n \n return copy;\n}", "function rotateRight(arr) {\n let end = arr.pop()\n arr.unshift(end)\n}", "pieceRotate(matrix, dir) {\n\n // Transpose Step\n for (let y = 0; y < matrix.length; ++y) {\n for (let x = 0; x < y; ++x) {\n // Swap (tubble switch)\n [matrix[x][y], matrix[y][x]] = [matrix[y][x], matrix[x][y]];\n }\n }\n\n // Reverse Step\n if (dir > 0) {\n // if direciton is positive\n matrix.forEach(row => {\n row.reverse()\n });\n } else {\n // if direciton is negative\n matrix.reverse();\n }\n\n }", "rotate() {\n let c = this._cellMap;\n\n return new CellBox4(\n [\n c[12], c[8], c[4], c[0],\n c[13], c[9], c[5], c[1],\n c[14], c[10], c[6], c[2],\n c[15], c[11], c[7], c[3],\n ],\n this._state,\n this._offsetX,\n this._offsetY\n );\n }", "function rotateRight(){\n\n // Subtract 90 from current angle to rotate by 90 in anti-clockwise direction.\n angle +=90;\n\n // Rotate the jcrop-holder div by angle value\n $(\".jcrop-holder\").rotate(angle);\n jcrop_api.setOptions({rotate : angle}); \n \n // Wrap around the angle to 0 because angle can be max 360 or min 0 for rotation.\n if(angle>=360) \n angle=0;\n }", "*directionHorizontalRight() {\n yield this.sendEvent({ type: 0x03, code: 0x00, value: 255 });\n }", "function rightRotate(array, k) {\n let L = array.length;\n return array.slice(L - k).concat(array.slice(0, L - k));\n}", "function rotateRight(node){ \n var grandparent = node.parent.parent;\n var right = node.right;\n node.parent.left = right;\n node.parent.parent = node;\n node.right = node.parent;\n node.parent = grandparent;\n }", "rotateRight() {\n // b a\n // / \\ / \\\n // a e -> b.rotateRight() -> c b\n // / \\ / \\\n // c d d e\n const other = this.left;\n this.left = other.right;\n other.right = this;\n this.height = Math.max(this.leftHeight, this.rightHeight) + 1;\n other.height = Math.max(other.leftHeight, this.height) + 1;\n return other;\n }", "right() {\n if (!this.isOnTabletop()) return;\n if (!this.facing) return;\n let degree=FacingOptions.facingToDegree(this.facing);\n degree+=90;\n this.facing=FacingOptions.degreeToFacing(degree);\n }", "function int64rrot(dst, x, shift) {\n\t dst.l = (x.l >>> shift) | (x.h << (32 - shift));\n\t dst.h = (x.h >>> shift) | (x.l << (32 - shift));\n\t }", "function int64revrrot(dst, x, shift) {\r\n dst.l = (x.h >>> shift) | (x.l << (32 - shift));\r\n dst.h = (x.l >>> shift) | (x.h << (32 - shift));\r\n}", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "rotateRowBits( row, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[this.width-1][row]; // save last item in row\n for (var x=this.width-1; x > 0; x--) {\n this.grid[x][row] = this.grid[x-1][row];\n }\n this.grid[0][row] = last; // rotate around the corner\n }\n }", "function rotate() {\n $('#next').click();\n }", "function updateRotorOffsets(){\n\tlet x = enigmaMachine.readRingOffset(\"all\");\n\tvar i; \n\tfor(i=1;i<=3;i++){\n\t\tdocument.getElementById(\"offset_\"+i).innerHTML=String.fromCharCode(x[i-1]+65);\n\t}\n}", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "function rotRight(a, d) {\r\n\tfor (let i = 0; i < d; i++) {\r\n\t\tlet last = a.pop(); // remove last element\r\n\t\ta.unshift(last); // unshift adds one or more elements to the beginning of an array and returns the new length of the array\r\n\t}\r\n\treturn a;\r\n}", "function rightRotate(arr,n) {\n const shift = arr.splice(arr.length -n)\n return [...shift, ...arr]\n}", "rightrotate(root) {\n var temp = root.left;\n root.left = temp.right;\n temp.right = root;\n return temp;\n }", "function rotateSector(i, q) {\n return q < 8 && q >= 0 ? (q + 8 - i * 2) % 8 : q;\n }", "function rotateit(deg)\n\t{\n\t\treturn ((deg + rotval) + 360) % 360;\n\t}", "rotateColumnBits( col, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[col][this.height-1]; // save last item in col\n for (var y=this.height-1; y > 0; y--) {\n this.grid[col][y] = this.grid[col][y-1];\n }\n this.grid[col][0] = last; // rotate around the corner\n }\n }", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "function MIRROR64(sq) {\n return Mirror64[sq];\n}", "function rotate() {\n $('#next').click();\n }", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function shift_barriers(x, y) {\n // simply decrease the direction of the tile (keeping it between [0,3]) because the check_tile\n // function takes the tile's rotation into account when figuring out where its barriers are located\n map[y][x]['dir'] = (parseInt(map[y][x]['dir']) + 1) % 4\n //console.log(map[y][x]['dir']);\n}", "function shiftRight() {\n\tright_video = current_video - 1;\n\tif(right_video < 1) {\n\t\tright_video = vid_array.length-1;\n\t}\n\tswitchToVideo(right_video);\n}", "function flipRe(idx) {return {row: Math.floor(idx/numRows), ele: idx%numRows}}", "static get FREE_ROTATION() { return 1; }", "function rotateArr(arr, shiftBy){\n  // to rotate to the right once, create temp var that holds the last value, then move all items in the array to the right one index, and then put the temp value at the beginning of the array\n// handles to the right\nif(shiftBy > 0){\n // loops through rotations\n for(var i = 0; i < shiftBy; i++){\n var temp = arr[arr.length - 1];\n // loop moves items to the right one idx\n for(var r = arr.length - 2; r >= 0; r--){\n arr[r+1] = arr[r];\n }\n // put temp val at the beginning\n arr[0] = temp;\n }\n} else {\n var numRotate = Math.abs(shiftBy);\n for(var i = 0; i < numRotate; i++){\n var temp = arr[0];\n for(var r = 0; r < arr.length; r++){\n arr[r-1] = arr[r];\n }\n arr[arr.length - 1] = temp;\n }\n }\n}", "function rotate(matrix, dir) {\n for(let y = 0; y < matrix.length; y++) {\n for (let x = 0; x < y; x++) {\n [matrix[x][y], matrix[y][x]] = [matrix[y][x], matrix[x][y]];\n }\n }\n if (dir>0) {\n matrix.forEach(row => row.reverse());\n }\n else {\n matrix.reverse();\n }\n}", "leftTurn() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "incrementRotor(){if(this.bias<25){this.bias+=1;}else{this.bias=0;}}", "WheelRotation (inner, outer, wp, i, wheel, r){\n if(!r){\n for(let j = 1; j < wp[wheel]; j++){\n inner.push(inner.shift());\n }\n }\n return this.WheelOutput(inner, outer, i, r);\n }", "rot() {\nreturn this._r;\n}", "function rotate() {\r\n undraw();\r\n currentRotation++;\r\n if (currentRotation === current.length) {\r\n // if end of the array is reached then go back to the start.\r\n currentRotation = 0;\r\n }\r\n current = theTetriminos[random][currentRotation];\r\n checkRotatedPosition()\r\n draw();\r\n }", "function rotate(L, R) {\n const lengthL = L.length\n R = R % lengthL\n if (R === 0 || lengthL === 0) {\n return L\n } else {\n return L.slice(lengthL - R).concat(L.slice(0, -R))\n }\n}", "function int64rrot(dst, x, shift) {\r\n dst.l = (x.l >>> shift) | (x.h << (32 - shift));\r\n dst.h = (x.h >>> shift) | (x.l << (32 - shift));\r\n}", "rotateRender() { \n push();\n imageMode(CENTER);\n translate(this.x + this.width / 2, this.y + this.height / 2);\n angleMode(DEGREES);\n rotate(this.angle);\n image(this.images[this.index], 0, 0, this.width, this.height);\n pop();\n }", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "function rotate() {\n $('#next').click();\n}", "rotateLeft(value){\n let rotation = value / 90;\n this.facing = (this.facing + rotation) % 4\n }", "reverseInPlace() { const a = this._radians0; this._radians0 = this._radians1; this._radians1 = a; }", "function rotateCounterClockwise() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.activePiece.rotateCounterClockwise();\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function rotate(arr, shiftBy){\n var temp;\n //Shift Left\n if (shiftBy < 0){\n for (var i = shiftBy; i < 0; i++){\n for (var j = 0; j < arr.length-1; j++){\n if (j == 0){\n temp = arr[j];\n arr[j] = arr[j+1];\n }\n else{\n arr[j] = arr[j+1];\n }\n // console.log(arr[i]);\n }\n arr[arr.length-1] = temp;\n }\n }\n //Shift Right\n else{\n for (var i = shiftBy; i > 0; i--){\n for (var j = arr.length-1; j > 0; j--){\n if (j == arr.length-1){\n temp = arr[j];\n arr[j] = arr[j-1];\n }\n else{\n arr[j] = arr[j-1];\n }\n // console.log(arr[i]);\n }\n arr[0] = temp;\n }\n }\n console.log(arr);\n}", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "rotateRight() {\r\n if (this.actual.rotateRight()) {\r\n this.sounds.play(\"rotate\");\r\n }\r\n }", "singleLeftRotate(N){\n let rr = N.right;// N'nin sagi rr \n let T2 = rr.left;// N'nin sagin'a rr'nin solunu ekle\n rr.left = N; // N artik rr'nin sol durumu oldu\n N.right = T2;\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n rr.height = Math.max(this.height(rr.left) - this.height(rr.right))+1; \n }", "function turnRight(degree) {\n if (degree === undefined) degree = 90;\n $._turn(degree);\n}", "function m(e,t,n){for(var r=0;r<D.length;r++)if(!isFinite(e)||D[r]._index===e){t=isFinite(e)&&r===e?t:Q(D[r]._index);var o=be(D[r],t);if(o){var i=S.getSourcePageSize(D[r]._index,t?t.rotation:0);o.clearRect(0,0,i.width,i.height),n&&w(o,t)}}}", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "function rotate(matrix, dir) {\n for(let y = 0; y < matrix.length; ++y) {\n for(let x = 0; x < y; ++x) {\n [matrix[x][y], matrix[y][x]]\n =\n [matrix[y][x], matrix[x][y]]\n }\n }\n if(dir > 0) {\n matrix.forEach(row => row.reverse());\n } else {\n matrix.reverse();\n }\n}", "function rotate() {\n $('#next').click();\n\n\n\n}", "dobuleRotateLeft(N){\n N.right = this.singleRightRotate(N.right);// agacin \"solunu\" saga donderme yapar\n return this.singleLeftRotate(N); // agaci sola donderir.\n }", "function rotate() {\n $('#next').click();\n}", "function rotate() {\n $('#next').click();\n}", "function rotate() {\n $('#next').click();\n}", "rotate(side) {\n var temp = this.children[side];\n\n // Rotate\n this.children[side] = temp.children[1 - side];\n temp.children[1 - side] = this;\n\n this.resize();\n temp.resize();\n\n return temp;\n }", "function rotate(block, dir) {\n var c_x = tetromino.center[0];\n var c_y = tetromino.center[1];\n var offset_x = tetromino.cells[block][0] - c_x;\n var offset_y = tetromino.cells[block][1] - c_y;\n offset_y = -offset_y; // Adjust for the JS coordinates system instead of Cartesian\n var new_offset_x = ((dir == \"clockwise\")) ? offset_y : -offset_y;\n var new_offset_y = ((dir == \"clockwise\")) ? -offset_x : offset_x;\n new_offset_y = -new_offset_y;\n var new_x = c_x + new_offset_x;\n var new_y = c_y + new_offset_y;\n return [new_x, new_y];\n}", "rotateRight(tree){\n const child = this.left;\n this.swapWithChild(tree, child);\n this.parent = child;\n this.left = child.right;\n if(child.right) child.right.parent = this;\n child.right = this;\n this.rotateCommon(child);\n return child;\n }", "function panToRight(){\n\tgainL.gain.value = 0;\n\tgainR.gain.value = 1;\n}", "slide(row, dir) {\n\t\tlet nonzero = row.filter(val => val);\n\t\tnonzero = nonzero.concat(new Array(row.length - nonzero.length).fill(0));\n\t\treturn dir > 0 ? nonzero : nonzero.reverse();\n\t}", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "rotateVertical() {\r\n\t\tif (this.isUpright) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar x = this.height\r\n\t\t\tthis.height = this.length;\r\n\t\t\tthis.length = x;\r\n\t\t\treturn;\r\n\t\t}\r\n }", "function main() {\n var n_temp = readLine().split(' ');\n var size = parseInt(n_temp[0]);\n var rotations = parseInt(n_temp[1]);\n array = readLine().split(' ');\n array = array.map(Number);\n \n \n //left rotation\n var firstPart = reverse(array.slice(0,rotations));\n var secondPart = reverse(array.slice(rotations,size));\n \n var res = reverse(firstPart.concat(secondPart))\n \n console.log(res.join(' '));\n \n \n \n \n function reverse(array) {\n \n var initialPos = 0;\n var endPos = array.length -1;\n\n while (initialPos < endPos) {\n \n var temp = array[initialPos];\n array[initialPos] = array[endPos];\n array[endPos] = temp;\n initialPos++;\n endPos--;\n }\n \n return array;\n \n }\n \n \n \n\n}", "function rotate (buffer, offset) {\n validate(buffer);\n\n for (var channel = 0; channel < buffer.numberOfChannels; channel++) {\n var cData = buffer.getChannelData(channel);\n var srcData = cData.slice();\n for (var i = 0, l = cData.length, idx; i < l; i++) {\n idx = (offset + (offset + i < 0 ? l + i : i )) % l;\n cData[idx] = srcData[i];\n }\n }\n\n return buffer;\n}", "rotateIndex(){\n switch (this.index){\n case 0:\n this.index = 2\n break;\n case 1:\n this.index = 0;\n break;\n case 2:\n this.index =1;\n break;\n \n }\n }" ]
[ "0.7542031", "0.7105379", "0.69513595", "0.67965776", "0.67398393", "0.64333797", "0.62827593", "0.6184053", "0.607957", "0.6031022", "0.5983472", "0.59147984", "0.585667", "0.58494437", "0.5706723", "0.5706723", "0.5685161", "0.564845", "0.56215155", "0.5583932", "0.5549265", "0.5522295", "0.55148286", "0.5506063", "0.55026805", "0.55017996", "0.54816943", "0.54670215", "0.54458153", "0.54452175", "0.54263675", "0.54155856", "0.5388446", "0.53643835", "0.5351586", "0.534459", "0.53149503", "0.5300334", "0.5299146", "0.5296081", "0.52924925", "0.5238892", "0.52386856", "0.52209216", "0.5201839", "0.52006453", "0.51993835", "0.5195743", "0.5192632", "0.51907474", "0.5190428", "0.51881295", "0.5176408", "0.5170245", "0.51640636", "0.51619333", "0.5158422", "0.5139677", "0.5123759", "0.5111916", "0.50988406", "0.5095649", "0.5080012", "0.5079181", "0.50746906", "0.5067874", "0.50669765", "0.50598675", "0.5058773", "0.5057815", "0.50378513", "0.5037695", "0.50228983", "0.5013686", "0.50111884", "0.5008045", "0.50070584", "0.49977893", "0.49909365", "0.49905774", "0.4985312", "0.49844393", "0.4974649", "0.49736947", "0.49732876", "0.49645197", "0.49631378", "0.4961833", "0.4961833", "0.4961833", "0.49612004", "0.4953558", "0.49504212", "0.49501505", "0.49451962", "0.4942447", "0.49403456", "0.49394435", "0.49365634", "0.49360496" ]
0.78634083
0
Rotate Memory or Accumulator Right Absolute Indexed X 0x7E
function _rotateRightAbsoluteX() { this.name = "Rotate Memory or Accumulator Right Absolute Indexed X" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X; this.mnemonic = 'ROR' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsolute() {\n this.name = \"Rotate Memory or Accumulator Right Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROR'\n}", "function _rotateRightDPX() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Left Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function _rotateRightDP() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftAbsolute() {\n this.name = \"Rotate Memory or Accumulator Left Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROL'\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rightRotate(arr, outofplace, cur) {\n let tmp = arr[cur];\n\n for (let i = cur; i > outofplace; i--) {\n arr[i] = arr[i - 1];\n }\n arr[outofplace] = tmp;\n}", "function _rotateLeftDPX() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function rotateInPlace(mat){\n\n}", "function int64revrrot(dst, x, shift) {\n\t dst.l = (x.h >>> shift) | (x.l << (32 - shift));\n\t dst.h = (x.l >>> shift) | (x.h << (32 - shift));\n\t }", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "function rotateRight(arr) {\n let end = arr.pop()\n arr.unshift(end)\n}", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "function _rotateLeftDP() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROL'\n}", "rotateIndex(){\n switch (this.index){\n case 0:\n this.index = 2\n break;\n case 1:\n this.index = 0;\n break;\n case 2:\n this.index =1;\n break;\n \n }\n }", "function int64revrrot(dst, x, shift) {\r\n dst.l = (x.h >>> shift) | (x.l << (32 - shift));\r\n dst.h = (x.l >>> shift) | (x.h << (32 - shift));\r\n}", "function rotateSwap(){\n rotFactor *= -1;\n}", "function rightRotate (arr, d) {\n let j, k, t, t2,\n n = arr.length,\n _gcd = gcd(d, n),\n jumps = n / _gcd\n for (let i = 0; i < _gcd; i++) {\n t = arr[i]\n for (let z = i, j = 0;\n j <= jumps;\n j++, z = (z + d) % n) {\n t2 = arr[z]\n arr[z] = t\n t = t2\n\n // info(arr+\" \"+t+\" \"+t2+\" \"+z+\" \"+j);\n }\n }\n return arr\n}", "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "function int64rrot(dst, x, shift) {\n\t dst.l = (x.l >>> shift) | (x.h << (32 - shift));\n\t dst.h = (x.h >>> shift) | (x.l << (32 - shift));\n\t }", "function rightRotate(array, k) {\n let L = array.length;\n return array.slice(L - k).concat(array.slice(0, L - k));\n}", "rotateRowBits( row, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[this.width-1][row]; // save last item in row\n for (var x=this.width-1; x > 0; x--) {\n this.grid[x][row] = this.grid[x-1][row];\n }\n this.grid[0][row] = last; // rotate around the corner\n }\n }", "rotateRight() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction < Constants.SKIER_DIRECTIONS.RIGHT) {\n this.setDirection(this.direction + 1);\n }\n }", "rotate(rotateAmount) {\n }", "doubleRotateRight(N){\n N.left = this.singleLeftRotate(N.left);// agacin \"sagini\" sola donerme yapar\n return this.singleRightRotate(N); // \"agaci\" saga donderme yapar\n }", "function rotRight(a, d) {\r\n\tfor (let i = 0; i < d; i++) {\r\n\t\tlet last = a.pop(); // remove last element\r\n\t\ta.unshift(last); // unshift adds one or more elements to the beginning of an array and returns the new length of the array\r\n\t}\r\n\treturn a;\r\n}", "rotateColumnBits( col, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[col][this.height-1]; // save last item in col\n for (var y=this.height-1; y > 0; y--) {\n this.grid[col][y] = this.grid[col][y-1];\n }\n this.grid[col][0] = last; // rotate around the corner\n }\n }", "static rotate(value, bits) {\r\n return (value << bits) | (value >>> (32 - bits));\r\n }", "singleRightRotate(N){\n let ll = N.left; // N'nin solu ll oldu\n let T2 = ll.right;// N'nin soluna' ll'nin sagini ekle \n ll.right = N; // N artik ll'nin sag dugumu oldu\n N.left = T2\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n ll.height = Math.max(this.height(ll.left) - this.height(ll.right))+1;\n return ll;\n }", "function int64rrot(dst, x, shift) {\r\n dst.l = (x.l >>> shift) | (x.h << (32 - shift));\r\n dst.h = (x.h >>> shift) | (x.l << (32 - shift));\r\n}", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "function rightRotate(arr,n) {\n const shift = arr.splice(arr.length -n)\n return [...shift, ...arr]\n}", "rightrotate(root) {\n var temp = root.left;\n root.left = temp.right;\n temp.right = root;\n return temp;\n }", "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function exchangeLR(offset,mask){var t=(this._lBlock>>>offset^this._rBlock)&mask;this._rBlock^=t;this._lBlock^=t<<offset;}", "function exchangeLR(offset,mask){var t=(this._lBlock>>>offset^this._rBlock)&mask;this._rBlock^=t;this._lBlock^=t<<offset;}", "function rotateRight(matrix){\n var copy = createMatrix(matrix.length, matrix[0].length);\n var width = copy.length - 1;\n for(let j = 0; j < matrix.length; j++){\n for(let i = 0; i < matrix[j].length; i++){\n let value = matrix[j][i];\n copy[i][width] = value;\n }\n width--;\n } \n \n return copy;\n}", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "function flipGetIdx(rei) {return rei.row*numRows + rei.ele}", "function updateRotorOffsets(){\n\tlet x = enigmaMachine.readRingOffset(\"all\");\n\tvar i; \n\tfor(i=1;i<=3;i++){\n\t\tdocument.getElementById(\"offset_\"+i).innerHTML=String.fromCharCode(x[i-1]+65);\n\t}\n}", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "function get_rotate_index(index) {\n switch (index) {\n case 0:\n return 0;\n case 1:\n return 1;\n case 2:\n return 2;\n case 3:\n return 3;\n case -1:\n return 4;\n case -2:\n return 5;\n case -3:\n return 6;\n }\n return 0;\n }", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "function rotr(x, n) {\n return x << (32 - n) | x >>> n;\n}", "function rotateArr(arr, shiftBy){\n  // to rotate to the right once, create temp var that holds the last value, then move all items in the array to the right one index, and then put the temp value at the beginning of the array\n// handles to the right\nif(shiftBy > 0){\n // loops through rotations\n for(var i = 0; i < shiftBy; i++){\n var temp = arr[arr.length - 1];\n // loop moves items to the right one idx\n for(var r = arr.length - 2; r >= 0; r--){\n arr[r+1] = arr[r];\n }\n // put temp val at the beginning\n arr[0] = temp;\n }\n} else {\n var numRotate = Math.abs(shiftBy);\n for(var i = 0; i < numRotate; i++){\n var temp = arr[0];\n for(var r = 0; r < arr.length; r++){\n arr[r-1] = arr[r];\n }\n arr[arr.length - 1] = temp;\n }\n }\n}", "function MIRROR64(sq) {\n return Mirror64[sq];\n}", "function rotate(array) {\n let movingNum = array.shift()\n array.push(movingNum)\n return array\n}", "function shiftRight(_bytes, right, inplace) {\n const wright = Math.floor(right / 32);\n right %= 32;\n\n let idx;\n\n const blen = _bytes.length;\n\n const left = 32 - right;\n\n let mask_f = (1 << (1 + right)) - 1;\n\n let _rbytes;\n\n let tmp;\n\n if (right === 31) mask_f = 0xffffffff;\n\n if (inplace === true) {\n _rbytes = _bytes;\n } else {\n _rbytes = new Uint32Array(blen);\n }\n\n _rbytes[0] = _bytes[0] >>> right;\n for (idx = 1; idx < blen; idx++) {\n tmp = _bytes[idx] & mask_f;\n\n _rbytes[idx] = _bytes[idx] >>> right;\n _rbytes[idx - 1] |= tmp << left;\n }\n\n if (wright === 0) return _rbytes;\n\n for (idx = 0; idx < blen; idx++) {\n _rbytes[idx] = _rbytes[idx + wright] || 0;\n }\n\n return _rbytes;\n}", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "function rol(num, cnt) {\n\t return num << cnt | num >>> 32 - cnt;\n\t }", "*directionHorizontalRight() {\n yield this.sendEvent({ type: 0x03, code: 0x00, value: 255 });\n }", "function rotate(L, R) {\n const lengthL = L.length\n R = R % lengthL\n if (R === 0 || lengthL === 0) {\n return L\n } else {\n return L.slice(lengthL - R).concat(L.slice(0, -R))\n }\n}", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function rol(num, cnt) {\n\t return (num << cnt) | (num >>> (32 - cnt));\n\t }", "function flipRe(idx) {return {row: Math.floor(idx/numRows), ele: idx%numRows}}", "rot() {\nreturn this._r;\n}", "function rotateLeft(array){\n var x = array.shift()\n array.push(x)\n console.log(array)\n}", "function shift_barriers(x, y) {\n // simply decrease the direction of the tile (keeping it between [0,3]) because the check_tile\n // function takes the tile's rotation into account when figuring out where its barriers are located\n map[y][x]['dir'] = (parseInt(map[y][x]['dir']) + 1) % 4\n //console.log(map[y][x]['dir']);\n}", "function rol64(_a, count) {\n var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__read\"])(_a, 2), hi = _b[0], lo = _b[1];\n var h = (hi << count) | (lo >>> (32 - count));\n var l = (lo << count) | (hi >>> (32 - count));\n return [h, l];\n}", "function rol64(_a, count) {\n var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__read\"])(_a, 2), hi = _b[0], lo = _b[1];\n var h = (hi << count) | (lo >>> (32 - count));\n var l = (lo << count) | (hi >>> (32 - count));\n return [h, l];\n}", "function rol64(_a, count) {\n var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__read\"])(_a, 2), hi = _b[0], lo = _b[1];\n var h = (hi << count) | (lo >>> (32 - count));\n var l = (lo << count) | (hi >>> (32 - count));\n return [h, l];\n}", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "function rol(num, cnt) \n{ \n return (num << cnt) | (num >>> (32 - cnt)) \n}", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "function rotl( x, n ) {\n return ( x >>> ( 32 - n ) ) | ( x << n );\n }", "function rotate(data) {\n return data[0].map((x, i) => data.map(x => x[data.length - i - 1]));\n}", "pieceRotate(matrix, dir) {\n\n // Transpose Step\n for (let y = 0; y < matrix.length; ++y) {\n for (let x = 0; x < y; ++x) {\n // Swap (tubble switch)\n [matrix[x][y], matrix[y][x]] = [matrix[y][x], matrix[x][y]];\n }\n }\n\n // Reverse Step\n if (dir > 0) {\n // if direciton is positive\n matrix.forEach(row => {\n row.reverse()\n });\n } else {\n // if direciton is negative\n matrix.reverse();\n }\n\n }", "function leftRotateByOne(arr) {\n let temp = arr[0], i;\n for (i = 1; i < arr.length; i++) {\n arr[i-1] = arr[i];\n }\n arr[i-1] = temp;\n return arr;\n}", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n}", "rotate() {\n let c = this._cellMap;\n\n return new CellBox4(\n [\n c[12], c[8], c[4], c[0],\n c[13], c[9], c[5], c[1],\n c[14], c[10], c[6], c[2],\n c[15], c[11], c[7], c[3],\n ],\n this._state,\n this._offsetX,\n this._offsetY\n );\n }", "function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n }", "function rol(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "function bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n }", "rightleftrotate(root) {\n root.right = this.rightrotate(root.right);\n return this.leftrotate(root);\n }", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function rol(num, cnt)\r\n {\r\n return (num << cnt) | (num >>> (32 - cnt));\r\n }", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}", "function rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}" ]
[ "0.72784024", "0.7242633", "0.721157", "0.70793945", "0.6726225", "0.6678231", "0.66013414", "0.66013414", "0.6499178", "0.63041914", "0.61889285", "0.6124849", "0.6048723", "0.5944712", "0.5929002", "0.5923633", "0.5921155", "0.5914576", "0.5908073", "0.5898166", "0.5894169", "0.5877598", "0.58757806", "0.58519393", "0.5815405", "0.5810808", "0.5787156", "0.57465965", "0.5737153", "0.57097775", "0.56996566", "0.56868726", "0.56739026", "0.56733704", "0.566457", "0.56507736", "0.5645006", "0.5624775", "0.5624775", "0.55941826", "0.55922526", "0.55729586", "0.5563498", "0.5561167", "0.5549749", "0.55390155", "0.55274713", "0.55268794", "0.5519834", "0.5516283", "0.5505167", "0.5502885", "0.5502885", "0.5496009", "0.5494174", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.54924893", "0.5487986", "0.5485819", "0.5483435", "0.54743993", "0.54708856", "0.54708856", "0.54708856", "0.5469566", "0.54674983", "0.5448026", "0.5444196", "0.5442451", "0.54213923", "0.5417689", "0.5415773", "0.5408304", "0.5407301", "0.5406395", "0.5405888", "0.5398837", "0.53802073", "0.53708774", "0.5365513", "0.5356252", "0.5356252", "0.5356252", "0.5356252" ]
0.782805
0
Rotate Memory or Accumulator Right Direct Page Indexed X 0x76
function _rotateRightDPX() { this.name = "Rotate Memory or Accumulator Right Direct Page Indexed X" this.argCount = 0; this.size = Size.MEMORY_A; this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X; this.mnemonic = 'ROR' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _rotateRightDP() {\n this.name = \"Rotate Memory or Accumulator Right Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Right Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROR'\n}", "function _rotateRightAccumulator() {\n this.name = \"Rotate Memory or Accumulator Right Accumulator\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ACCUMULATOR;\n this.mnemonic = 'ROR'\n}", "function _rotateLeftDP() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE;\n this.mnemonic = 'ROL'\n}", "function _rotateLeftDPX() {\n this.name = \"Rotate Memory or Accumulator Left Direct Page Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.DIRECT_PAGE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function _rotateRightAbsolute() {\n this.name = \"Rotate Memory or Accumulator Right Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROR'\n}", "returnFromRight() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "function _rotateLeftAbsoluteX() {\n this.name = \"Rotate Memory or Accumulator Left Absolute Indexed X\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE_INDEXED_X;\n this.mnemonic = 'ROL'\n}", "function _rotateLeftAbsolute() {\n this.name = \"Rotate Memory or Accumulator Left Absolute\"\n this.argCount = 0;\n this.size = Size.MEMORY_A;\n this.addrMode = AddressingMode.ABSOLUTE;\n this.mnemonic = 'ROL'\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rotateRight(n, x) {\n return x >>> n | x << 32 - n;\n}", "function rightRotate(arr, outofplace, cur) {\n let tmp = arr[cur];\n\n for (let i = cur; i > outofplace; i--) {\n arr[i] = arr[i - 1];\n }\n arr[outofplace] = tmp;\n}", "function fornitureRightRotate() {\n\tif (fornSelected == null)\n\t\treturn 0;\n\t\n\tfornSelected.m= fornSelected.m.translate(fornSelected.currSize.width/2, fornSelected.currSize.height/2);\n\tfornSelected.m= fornSelected.m.rotate(3);\n\tfornSelected.m= fornSelected.m.translate(-fornSelected.currSize.width/2, -fornSelected.currSize.height/2);\n\t\n\tinvalidated= true;\n\t\n\treturn 1;\n}", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "function int64revrrot(dst, x, shift) {\n\t dst.l = (x.h >>> shift) | (x.l << (32 - shift));\n\t dst.h = (x.l >>> shift) | (x.h << (32 - shift));\n\t }", "rotateRight() {\n if (this.direction !== Constants.SKIER_DIRECTIONS.CRASH && this.direction < Constants.SKIER_DIRECTIONS.RIGHT) {\n this.setDirection(this.direction + 1);\n }\n }", "function rotateSector(i, q) {\n return q < 8 && q >= 0 ? (q + 8 - i * 2) % 8 : q;\n }", "function shift_barriers(x, y) {\n // simply decrease the direction of the tile (keeping it between [0,3]) because the check_tile\n // function takes the tile's rotation into account when figuring out where its barriers are located\n map[y][x]['dir'] = (parseInt(map[y][x]['dir']) + 1) % 4\n //console.log(map[y][x]['dir']);\n}", "rotate(dir) {\n\n if (dir === 'rotateright') {\n\n if (this.rotation === 3){\n this.rotation = -1\n }\n this.rotation ++;\n this.checkGhost();\n this.render();\n\n } else {\n\n if (this.rotation === 0){\n this.rotation = 4;\n }\n this.rotation --;\n this.checkGhost();\n this.render();\n\n }\n\n }", "doubleRotateRight(N){\n N.left = this.singleLeftRotate(N.left);// agacin \"sagini\" sola donerme yapar\n return this.singleRightRotate(N); // \"agaci\" saga donderme yapar\n }", "function rotateInPlace(mat){\n\n}", "function int64rrot(dst, x, shift) {\n\t dst.l = (x.l >>> shift) | (x.h << (32 - shift));\n\t dst.h = (x.h >>> shift) | (x.l << (32 - shift));\n\t }", "rotateRowBits( row, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[this.width-1][row]; // save last item in row\n for (var x=this.width-1; x > 0; x--) {\n this.grid[x][row] = this.grid[x-1][row];\n }\n this.grid[0][row] = last; // rotate around the corner\n }\n }", "_applyRotation() {\n let start = 0;\n let end = this.pageCount;\n let leftOffset = Math.floor(this.maxSize / 2);\n let rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n if (this.page <= leftOffset) {\n // very beginning, no rotation -> [0..maxSize]\n end = this.maxSize;\n }\n else if (this.pageCount - this.page < leftOffset) {\n // very end, no rotation -> [len-maxSize..len]\n start = this.pageCount - this.maxSize;\n }\n else {\n // rotate\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n return [start, end];\n }", "rotateColumnBits( col, shift ) {\n for (var i = 0; i < shift; i++) {\n var last = this.grid[col][this.height-1]; // save last item in col\n for (var y=this.height-1; y > 0; y--) {\n this.grid[col][y] = this.grid[col][y-1];\n }\n this.grid[col][0] = last; // rotate around the corner\n }\n }", "function rightRotate (arr, d) {\n let j, k, t, t2,\n n = arr.length,\n _gcd = gcd(d, n),\n jumps = n / _gcd\n for (let i = 0; i < _gcd; i++) {\n t = arr[i]\n for (let z = i, j = 0;\n j <= jumps;\n j++, z = (z + d) % n) {\n t2 = arr[z]\n arr[z] = t\n t = t2\n\n // info(arr+\" \"+t+\" \"+t2+\" \"+z+\" \"+j);\n }\n }\n return arr\n}", "function rightRotate(array, k) {\n let L = array.length;\n return array.slice(L - k).concat(array.slice(0, L - k));\n}", "function rotateSwap(){\n rotFactor *= -1;\n}", "function int64revrrot(dst, x, shift) {\r\n dst.l = (x.h >>> shift) | (x.l << (32 - shift));\r\n dst.h = (x.l >>> shift) | (x.h << (32 - shift));\r\n}", "rotate(rotateAmount) {\n }", "rotateIndex(){\n switch (this.index){\n case 0:\n this.index = 2\n break;\n case 1:\n this.index = 0;\n break;\n case 2:\n this.index =1;\n break;\n \n }\n }", "returnFromLeft() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "static rot_4bit_left( shift, v ){ return ((v << shift) & 15) | (v & 15) >> (4-shift); }", "rotate() {\n let c = this._cellMap;\n\n return new CellBox4(\n [\n c[12], c[8], c[4], c[0],\n c[13], c[9], c[5], c[1],\n c[14], c[10], c[6], c[2],\n c[15], c[11], c[7], c[3],\n ],\n this._state,\n this._offsetX,\n this._offsetY\n );\n }", "right(deg) {\n this.direction = (this.direction + toInt(deg)) % 360;\n }", "*directionHorizontalRight() {\n yield this.sendEvent({ type: 0x03, code: 0x00, value: 255 });\n }", "singleRightRotate(N){\n let ll = N.left; // N'nin solu ll oldu\n let T2 = ll.right;// N'nin soluna' ll'nin sagini ekle \n ll.right = N; // N artik ll'nin sag dugumu oldu\n N.left = T2\n N.height = Math.max(this.height(N.left) - this.height(N.right))+1;\n ll.height = Math.max(this.height(ll.left) - this.height(ll.right))+1;\n return ll;\n }", "function int64rrot(dst, x, shift) {\r\n dst.l = (x.l >>> shift) | (x.h << (32 - shift));\r\n dst.h = (x.h >>> shift) | (x.l << (32 - shift));\r\n}", "function updateRotorOffsets(){\n\tlet x = enigmaMachine.readRingOffset(\"all\");\n\tvar i; \n\tfor(i=1;i<=3;i++){\n\t\tdocument.getElementById(\"offset_\"+i).innerHTML=String.fromCharCode(x[i-1]+65);\n\t}\n}", "function flipRe(idx) {return {row: Math.floor(idx/numRows), ele: idx%numRows}}", "function gen_op_iwmmxt_rorl_M0_T0()\n{\n gen_opc_ptr.push({func:op_iwmmxt_rorl_M0_T0});\n}", "function rotate (buffer, offset) {\n validate(buffer);\n\n for (var channel = 0; channel < buffer.numberOfChannels; channel++) {\n var cData = buffer.getChannelData(channel);\n var srcData = cData.slice();\n for (var i = 0, l = cData.length, idx; i < l; i++) {\n idx = (offset + (offset + i < 0 ? l + i : i )) % l;\n cData[idx] = srcData[i];\n }\n }\n\n return buffer;\n}", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "function rightRotate(arr,n) {\n const shift = arr.splice(arr.length -n)\n return [...shift, ...arr]\n}", "function rotate() {\n\n var newOrient = active.orientation + 1;\n undrawPiece();\n\n if (newOrient >= active.type.length) {\n newOrient = 0;\n }\n var test = active.type[newOrient];\n for (var i = 0; i < test.length; i++) {\n active.location[i][0] =test[i][0] + active.pivot.r;\n active.location[i][1] = test[i][1] + active.pivot.c;\n }\n if (check(active.location)) {\n active.orientation = newOrient;\n\n }\n\n else {\n var orig = active.type[active.orientation];\n for (var i = 0; i < orig.length; i++) {\n active.location[i][0] =orig[i][0] + active.pivot.r;\n active.location[i][1] =orig[i][1] + active.pivot.c;\n }}\n piece2Grid();\n drawBoard();\n return false;\n}", "turnRight() {\n this.direction--;\n this.direction = this.direction.mod(4);\n }", "function crop_rotate_right(id)\n\t{\n\t\tvar x1, y1, x2, y2, c = ImageStore[id].crop;\n\t\t//\t{x1: 1-c.y2, y1: c.x1,\t x2: 1-c.y1, y2: c.x2}\n\t\tx1 = 1 - c.y2;\n\t\ty1 = c.x1;\n\t\tx2 = 1 - c.y1;\n\t\ty2 = c.x2;\n\t\t\n\t\tImageStore[id].crop = {'x1': x1, 'y1': y1, 'x2': x2, 'y2': y2};\n\t}", "function rotateRight(arr) {\n let end = arr.pop()\n arr.unshift(end)\n}", "function rotateRight(matrix){\n var copy = createMatrix(matrix.length, matrix[0].length);\n var width = copy.length - 1;\n for(let j = 0; j < matrix.length; j++){\n for(let i = 0; i < matrix[j].length; i++){\n let value = matrix[j][i];\n copy[i][width] = value;\n }\n width--;\n } \n \n return copy;\n}", "function flipGetIdx(rei) {return rei.row*numRows + rei.ele}", "static get FREE_ROTATION() { return 1; }", "pieceRotate(matrix, dir) {\n\n // Transpose Step\n for (let y = 0; y < matrix.length; ++y) {\n for (let x = 0; x < y; ++x) {\n // Swap (tubble switch)\n [matrix[x][y], matrix[y][x]] = [matrix[y][x], matrix[x][y]];\n }\n }\n\n // Reverse Step\n if (dir > 0) {\n // if direciton is positive\n matrix.forEach(row => {\n row.reverse()\n });\n } else {\n // if direciton is negative\n matrix.reverse();\n }\n\n }", "static rotWord(w) {\n const tmp = w[0];\n for (let i = 0; i < 3; i++) w[i] = w[i + 1];\n w[3] = tmp;\n return w;\n }", "function rotateArr(arr, shiftBy){\n  // to rotate to the right once, create temp var that holds the last value, then move all items in the array to the right one index, and then put the temp value at the beginning of the array\n// handles to the right\nif(shiftBy > 0){\n // loops through rotations\n for(var i = 0; i < shiftBy; i++){\n var temp = arr[arr.length - 1];\n // loop moves items to the right one idx\n for(var r = arr.length - 2; r >= 0; r--){\n arr[r+1] = arr[r];\n }\n // put temp val at the beginning\n arr[0] = temp;\n }\n} else {\n var numRotate = Math.abs(shiftBy);\n for(var i = 0; i < numRotate; i++){\n var temp = arr[0];\n for(var r = 0; r < arr.length; r++){\n arr[r-1] = arr[r];\n }\n arr[arr.length - 1] = temp;\n }\n }\n}", "function rotRight(a, d) {\r\n\tfor (let i = 0; i < d; i++) {\r\n\t\tlet last = a.pop(); // remove last element\r\n\t\ta.unshift(last); // unshift adds one or more elements to the beginning of an array and returns the new length of the array\r\n\t}\r\n\treturn a;\r\n}", "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "rotateRender() { \n push();\n imageMode(CENTER);\n translate(this.x + this.width / 2, this.y + this.height / 2);\n angleMode(DEGREES);\n rotate(this.angle);\n image(this.images[this.index], 0, 0, this.width, this.height);\n pop();\n }", "function exchangeLR(offset,mask){var t=(this._lBlock>>>offset^this._rBlock)&mask;this._rBlock^=t;this._lBlock^=t<<offset;}", "function exchangeLR(offset,mask){var t=(this._lBlock>>>offset^this._rBlock)&mask;this._rBlock^=t;this._lBlock^=t<<offset;}", "rot() {\nreturn this._r;\n}", "rightrotate(root) {\n var temp = root.left;\n root.left = temp.right;\n temp.right = root;\n return temp;\n }", "rotate() {\n this.direction < 3 ? this.direction++ : (this.direction = 0);\n return RESULTS.DANGER;\n }", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "function shiftRight() {\n\tright_video = current_video - 1;\n\tif(right_video < 1) {\n\t\tright_video = vid_array.length-1;\n\t}\n\tswitchToVideo(right_video);\n}", "_rol(_num, _cnt){\n return (_num << _cnt) | (_num >>> (32 - _cnt));\n }", "function rotateBy(current) {\n if (!stop) {\n var rotateNumber = current;\n map.rotateTo(rotateNumber + 90, { duration: 2000, easing: function (t) { return t; } });\n }\n }", "function rotate() {\n $('#next').click();\n }", "function rotate(arr, shiftBy){\n var temp;\n //Shift Left\n if (shiftBy < 0){\n for (var i = shiftBy; i < 0; i++){\n for (var j = 0; j < arr.length-1; j++){\n if (j == 0){\n temp = arr[j];\n arr[j] = arr[j+1];\n }\n else{\n arr[j] = arr[j+1];\n }\n // console.log(arr[i]);\n }\n arr[arr.length-1] = temp;\n }\n }\n //Shift Right\n else{\n for (var i = shiftBy; i > 0; i--){\n for (var j = arr.length-1; j > 0; j--){\n if (j == arr.length-1){\n temp = arr[j];\n arr[j] = arr[j-1];\n }\n else{\n arr[j] = arr[j-1];\n }\n // console.log(arr[i]);\n }\n arr[0] = temp;\n }\n }\n console.log(arr);\n}", "function m(e,t,n){for(var r=0;r<D.length;r++)if(!isFinite(e)||D[r]._index===e){t=isFinite(e)&&r===e?t:Q(D[r]._index);var o=be(D[r],t);if(o){var i=S.getSourcePageSize(D[r]._index,t?t.rotation:0);o.clearRect(0,0,i.width,i.height),n&&w(o,t)}}}", "rotate(side) {\n var temp = this.children[side];\n\n // Rotate\n this.children[side] = temp.children[1 - side];\n temp.children[1 - side] = this;\n\n this.resize();\n temp.resize();\n\n return temp;\n }", "incrementRotor(){if(this.bias<25){this.bias+=1;}else{this.bias=0;}}", "function rotateRight(){\n\n // Subtract 90 from current angle to rotate by 90 in anti-clockwise direction.\n angle +=90;\n\n // Rotate the jcrop-holder div by angle value\n $(\".jcrop-holder\").rotate(angle);\n jcrop_api.setOptions({rotate : angle}); \n \n // Wrap around the angle to 0 because angle can be max 360 or min 0 for rotation.\n if(angle>=360) \n angle=0;\n }", "function rotateLeftRight(node){\n node.left = rotateLeftLeft(node.left); \n return rotateRightRight(node); \n}", "function rotateCounterClockwise() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.activePiece.rotateCounterClockwise();\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function rotate() {\n $('#next').click();\n }", "function rotateRightLeft(node) { \n node.right = rotateRightRight(node.right); \n return rotateLeftLeft(node); \n}", "function shiftRight(_bytes, right, inplace) {\n const wright = Math.floor(right / 32);\n right %= 32;\n\n let idx;\n\n const blen = _bytes.length;\n\n const left = 32 - right;\n\n let mask_f = (1 << (1 + right)) - 1;\n\n let _rbytes;\n\n let tmp;\n\n if (right === 31) mask_f = 0xffffffff;\n\n if (inplace === true) {\n _rbytes = _bytes;\n } else {\n _rbytes = new Uint32Array(blen);\n }\n\n _rbytes[0] = _bytes[0] >>> right;\n for (idx = 1; idx < blen; idx++) {\n tmp = _bytes[idx] & mask_f;\n\n _rbytes[idx] = _bytes[idx] >>> right;\n _rbytes[idx - 1] |= tmp << left;\n }\n\n if (wright === 0) return _rbytes;\n\n for (idx = 0; idx < blen; idx++) {\n _rbytes[idx] = _rbytes[idx + wright] || 0;\n }\n\n return _rbytes;\n}", "static rotate(value, bits) {\r\n return (value << bits) | (value >>> (32 - bits));\r\n }", "function rotate(data) {\n return data[0].map((x, i) => data.map(x => x[data.length - i - 1]));\n}", "function rotate(srcimage,direction){\rn=n+direction;\rif (n==allImages) n=0;\rif (n==-1) n=allImages-1;\rdocument.images[srcimage].src=imgObjects[n].src;\r}", "function gen_op_iwmmxt_rorw_M0_T0()\n{\n gen_opc_ptr.push({func:op_iwmmxt_rorw_M0_T0});\n}", "function rotate(L, R) {\n const lengthL = L.length\n R = R % lengthL\n if (R === 0 || lengthL === 0) {\n return L\n } else {\n return L.slice(lengthL - R).concat(L.slice(0, -R))\n }\n}", "function rotateit(deg)\n\t{\n\t\treturn ((deg + rotval) + 360) % 360;\n\t}", "function rotate(array) {\n let movingNum = array.shift()\n array.push(movingNum)\n return array\n}", "function rotateRight(node){ \n var grandparent = node.parent.parent;\n var right = node.right;\n node.parent.left = right;\n node.parent.parent = node;\n node.right = node.parent;\n node.parent = grandparent;\n }", "function gen_op_iwmmxt_rorq_M0_T0()\n{\n gen_opc_ptr.push({func:op_iwmmxt_rorq_M0_T0});\n}", "function MIRROR64(sq) {\n return Mirror64[sq];\n}", "WheelRotation (inner, outer, wp, i, wheel, r){\n if(!r){\n for(let j = 1; j < wp[wheel]; j++){\n inner.push(inner.shift());\n }\n }\n return this.WheelOutput(inner, outer, i, r);\n }", "function rotate(){\t\n \t\tvar triggerID = $active.prevAll().length; //Get number of times to slide\n \t\tvar image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide\n\n \t\t$(settings.pager).find(\"li\").removeClass('active'); //Remove all active class\n \t\t$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)\n\n \t\t//Slider Animation\n \t\t$slidereel.animate({ \n \t\t\tleft: -image_reelPosition\n \t\t}, 500);\n \n \t}", "rotateRight() {\n // b a\n // / \\ / \\\n // a e -> b.rotateRight() -> c b\n // / \\ / \\\n // c d d e\n const other = this.left;\n this.left = other.right;\n other.right = this;\n this.height = Math.max(this.leftHeight, this.rightHeight) + 1;\n other.height = Math.max(other.leftHeight, this.height) + 1;\n return other;\n }", "move() {\n this._offset = (this._offset + 1) % plainAlphabet.length\n }", "function FlexTable_stacks_in_5390_page24_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_5390_page24');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_5390_page24');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotatearr(arr, delta){\n console.assert(arr.length == 4, 'in rotatearr, array length not 4');\n let res = [undefined, undefined, undefined, undefined];\n for (let i = 0; i < 4; i ++ )\n res[(i + delta) % 4] = arr[i];\n return res;\n}", "rotate(direction) {\n // let current_heading = []\n // let last_element = current_heading.concat(heading).concat(direction).slice(-1);\n // return this.rotateMap[last_element][direction];\n this.state.heading = this.rotateMap[this.state.heading][direction];\n }", "function rotateArrL(arr,shiftBy){\n var len = arr.length;\n arr.length = arr.length + shiftBy;\n \n for (var i = 0; i < shiftBy; i++){\n arr[len+i] = arr[i];\n }\n for (var i = 0; i < arr.length; i++){\n arr[i] = arr[i+shiftBy];\n }\n arr.length = len;\n return arr\n}", "function rotr(x, n) {\n return x << (32 - n) | x >>> n;\n}", "function FlexTable_stacks_in_2565_page20_SetRotHeader() {\n\n\tif (1 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_2565_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_2565_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function FlexTable_stacks_in_2836_page20_SetRotHeader() {\n\n\tif (0 != 1) { return; }\n\n\tvar table = document.getElementById('FlexTable_stacks_in_2836_page20');\n\tvar rtable = document.getElementById('FlexTableRot_stacks_in_2836_page20');\n\tif (!table || !rtable) { return; }\n\n\tfor (i=0; i<table.rows[0].cells.length; i++) {\n\t\trtable.rows[i].cells[0].innerHTML = table.rows[0].cells[i].innerHTML;\n\t\t}\n\t}", "function rotate() {\r\n undraw();\r\n currentRotation++;\r\n if (currentRotation === current.length) {\r\n // if end of the array is reached then go back to the start.\r\n currentRotation = 0;\r\n }\r\n current = theTetriminos[random][currentRotation];\r\n checkRotatedPosition()\r\n draw();\r\n }" ]
[ "0.77308357", "0.6866606", "0.6806523", "0.6764412", "0.67368245", "0.6629825", "0.60565335", "0.60262495", "0.5934687", "0.59247136", "0.59247136", "0.5909182", "0.5857056", "0.5799374", "0.5730875", "0.5659945", "0.56086606", "0.5555327", "0.5534251", "0.5532459", "0.55276525", "0.5518212", "0.5490519", "0.54778486", "0.54771394", "0.5471999", "0.5449203", "0.5432492", "0.5428725", "0.54285276", "0.5407567", "0.5344785", "0.531471", "0.5309033", "0.5299651", "0.52857876", "0.52766764", "0.5273402", "0.5266857", "0.5262369", "0.52529514", "0.523822", "0.5215674", "0.5206607", "0.5203974", "0.52008575", "0.518173", "0.5178945", "0.5161161", "0.5147796", "0.51431096", "0.5143082", "0.5141731", "0.51406753", "0.51295507", "0.5128201", "0.5100922", "0.50960374", "0.5088661", "0.5088661", "0.5085119", "0.50764865", "0.50759333", "0.5059261", "0.50558376", "0.50491494", "0.50365245", "0.5032408", "0.50266254", "0.50252014", "0.50167143", "0.5004469", "0.49939698", "0.49924573", "0.49911675", "0.49882892", "0.49697757", "0.496855", "0.49683875", "0.49633908", "0.4957851", "0.49519828", "0.4941985", "0.4932316", "0.4930497", "0.49285555", "0.49265468", "0.49260843", "0.49113423", "0.490707", "0.49049693", "0.49009308", "0.4893577", "0.4891197", "0.4876731", "0.48762426", "0.4874875", "0.48685217", "0.4863714", "0.48625293" ]
0.7789457
0
click a slide in slide thumbnails > change slide
function showSlide(id) { // changing slide -> reset selected element selectedElement = null; if (selectedSlide != null) { selectedSlide.classList.remove('uiSlideSelected'); } selectedSlide = $('#' + id); selectedSlide.classList.add('uiSlideSelected'); var action = "changeSlide"; var data = {}; data.action = action; data.id = id; data.handler = "slide"; Ajax.post(data, "ajax.php", function (json) { if (json.error) { $('#activeSlideContainer').innerHTML = json.error; } else { $('#activeSlideContainer').innerHTML = json.html; } }); data = {}; data.handler = 'slide'; data.action = 'getSlideIndex'; var url = "ajax.php"; console.log("get slide index"); Ajax.post(data, url, function (json) { console.log("got slide index: " + json.index); $('#indexPicker').value = json.index; }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function switchSlide () {\n grabNextSlide();\n loadSlide();\n }", "function showSlides() {\n slideIndex++;\n showSlidesByClick(slideIndex);\n}", "function slideShow() {\n $thumbArray\n .eq(index) // eq selects the element at the given index\n .trigger('click'); // trigger a psuedo click event\n\n // If the last thumbnail is passed, go the beginning\n if (++index >= $thumbArray.length) {\n index = 0;\n }\n }", "function changeSlide() {\n\n mainSlide.setAttribute(\"src\", slideArray[slideIndex]['url']);\n slideIndex++;\n if (slideIndex >= slideArray.length) {\n slideIndex = 0;\n }\n }", "function chosenSlide(clickedSlide) {\n // change slideIndex num to clickedSlide argument num\n slideIndex = clickedSlide;\n //pass slideIndex new value into displaySlides function\n displaySlides(slideIndex);\n}", "function leftClick() {\n\tvar slideUrl = getBackgroundImage($photoBox);\n\tvar slideNum = slideNumber(slideUrl);\n\tif (slideNum - 1 === 0 ) {\n\t\tslideNum = total_num_slides;\n\t}\n\telse {\n\t\tslideNum -= 1;\n\t}\n\tchangeImage(slideNum);\n}", "function goToSlide(choice) {\n slideIndex = choice;\n\n updateCurrentSlide(slideIndex);\n}", "function changeSlide(change){\n slideIndex += change;\n\n updateCurrentSlide(slideIndex);\n}", "function handleClick(event) {\n //console.log( $(event).attr('data-slide'));\n currentSlide = Number($(event).attr('data-slide'));\n // console.log(\"setting the currentSlide to \", currentSlide)\n}", "function changeSlide() {\n var active = $(\".full-screen-slider img.active\");\n var next = active.next();\n if(next.length == 0) {\n next = $(\".full-screen-slider img:first\");\n }\n setTimeout(function() {\n fadeInSlide(next);\n }, 1);\n setTimeout(function() {\n fadeOutSlide(active, next);\n }, 1);\n }", "function changeSlide (slideshow)\n{\n var slides = getChildren(slideshow);\n\n for (var i = 0; i < slides.length; i++)\n {\n if (hasClass(slides[i], 'slide-active'))\n {\n delClass(slides[i], 'slide-active');\n addClass(slides[(i + 1) % slides.length], 'slide-active');\n return;\n }\n }\n}", "_handleClickOnSlide() {\n this.$slidesContainer.addEventListener(\"pointerup\", (e) => {\n for (let [i, $slide] of this.$slides.entries()) {\n if ($slide.contains(e.target) || $slide === e.target) {\n if (this.currentSlide !== $slide) {\n const slide = this.getSlide($slide);\n this.goTo(slide.idx);\n }\n }\n }\n });\n }", "function slide(e){\n var indices, background, video;\n\n // Loop background vid\n indices = Reveal.getIndices(Reveal.getCurrentSlide());\n background = Reveal.getSlideBackground(indices.h, 0);\n video = background.querySelector('video');\n if (video) {\n video.loop = true;\n }\n\n // Also play slide vid\n var slideVid = e.currentSlide.querySelector('video');\n if (slideVid) {\n setTimeout(function(){\n slideVid.play();\n }, 500);\n }\n }", "function selectSlide() {\n let selectedElement = selectorSlide.value;\n let slideID = parseInt(selectedElement, 10);\n\n goToSlide(slideID);\n}", "function chooseSlide( event ) {\n var selected = $(this);\n var index = selected.index();\n var offset = index - selected.siblings(\".active\").index();\n\n for(var i = Math.abs(offset); i--; ) {\n var row = LG[ state.get() === \"info\" ? \"Info\" : \"List\" ].getCurrent();\n row[ offset < 0 ? \"previous\" : \"next\" ]( i !== 0 );\n }\n }", "function moveToSlide() {\n $('.menu li').click(function (e) {\n e.preventDefault();\n var slideIndex = $(this).attr('data-link-id');\n console.log(slideIndex);\n slickWrapper.slickElement.slick('slickGoTo', parseInt(slideIndex));\n });\n }", "function clickThumb(x) {\n\tvar slider = document.getElementById(\"slider\");\n\tvar slideList = document.getElementById(\"sliderWrap\");\n\t\tcount = x;\n\t\tsetActive(count);\n\t\tslideList.style.left = \"-\" + (count * 960) + \"px\" ;\n\t}", "function setControls(slides,speed){\n \n $( \".pointer\" ).click(function() {\n var point = $(this).attr('data-sl');\n point = point - 1\n if(point >= slides){ point = 1; }\n if(point < 0){ point = slides; }\n count = point;\n clicked = 1;\n startSlide(slides,speed);\n console.log(\"clicked point:\"+point);\n });\n\n }", "function changeSlide(d){\n //slide to next image\n if (d===\"n\"){\n $(\"#slides\").animate({\n top: \"-=42vh\"},1000); \n curr++;\n //slide to previous image\n } else if (d===\"p\") {\n $(\"#slides\").animate({\n top: \"+=41vh\"},1000); \n curr--; \n //slide to beginning \n } else {\n $(\"#slides\").animate({top: \"0\"},500);\n curr=0;\n }\n }", "function changeSlide(e) {\n // console.log(e);\n\n nextSlide = e.target.dataset.name;\n // if the statement is true\n if ( lastSlide == nextSlide) {\n // return exits (ends) the function\n // the code after (show, hide,..) doesn't get executed\n return;\n }\n\n // SHOW\n document.getElementById(nextSlide).style.display = 'grid';\n document.getElementById('btn-'+nextSlide).style.backgroundColor = \"#2896E0\";\n // HIDE\n document.getElementById(lastSlide).style.display = 'none';\n document.getElementById('btn-'+lastSlide).style.backgroundColor = \"#BEFCFE\";\n //SAVE\n lastSlide = nextSlide;\n \n \n playTimeLine(lastSlide);\n playTimeline(nextSlide);\n}", "function goToSlide(num) {\n myPresentation.goToSlide(num);\n displayNumberCurrentSlide();\n}", "function handlePagerClick(evt) {\n evt = checkEvent(evt);\n var caller = getCallerFromEvent(evt);\n makeActiveSlide(parseInt(caller.getAttribute('slide-ref')));\n\n if ($conf.autoslide) {\n resetAutoslide();\n }\n }", "function nextSlide() {\n \n}", "function goToSlide() {\n var found = false;\n // if already has slide param\n if ( urlParams[\"s\"] != null) {\n // for safety, make sure index exists \n var param = urlParams[\"s\"];\n for (var i=0; i<flow.length; i++) {\n if ( param == flow[i].descriptor ) {\n currentIndex = i; \n found = true;\n }\n }\n } else {\n // if there is no slide param\n currentIndex = 0;\n }\n if (!found) {\n currentIndex = 0;\n }\n window.history.pushState(urlParams, \"\", \"?s=\" + flow[currentIndex].descriptor);\n // cycleItems();\n showItem();\n}", "function switch_slides () {\n // Animate to next slide by facing opacity of foreground from 100% to 0%\n foreground_element.animate({ opacity: 0 }, that.options.speed, function () {\n load_slide(foreground_element, that.options.slides[current_slide_id]);\n foreground_element.css('opacity', 1); // turn foreground on full opacity\n load_slide(background_element, that.options.slides[next_slide_id]); // load next slide into background\n });\n\n // Update slide_id's\n current_slide_id += 1; //next_slide_id - 1;\n if (current_slide_id >= slide_count) {\n current_slide_id = 0;\n }\n next_slide_id = current_slide_id + 1;\n if (next_slide_id >= slide_count) {\n next_slide_id = 0;\n }\n }", "function slideit() {\n x = document.getElementsByTagName(\"img\").item(0);\n v = x.getAttribute(\"src\");\n\n if(!document.images)\n return;\n\n v = slideImages[step].src;\n\n // gets the current image object from html file\n document.getElementById('slide').src = slideImages[step].src;\n\n whichimage = step;\n\n if (step<2) {\n step++;\n }\n else {\n step = 0;\n }\n\n // sets the slideit functions current image object in html file\n x.setAttribute(\"src\", v);\n\n // timing delay for 2.5 seconds before transition to new image\n setTimeout(\"slideit()\",2500);\n }", "function currentSlide(n) {\n // Set slideIndex based on dot clicked and display\n showSlides(slideIndex = n);\n}", "function first_slide(ev)\n {\n ev.preventDefault();\n activate(0); // Move the \"active\" class\n // console.log(\"first: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function selectOtherSlide(e) {\n\n var clickedThing = e.target;\n\n // <li> element, if clickedThing was a side slide's <img>\n var clickedThingGrandparent = clickedThing.parentNode.parentNode; // !!! FULLSCREEN BUTTON MAY AFFECT THIS DOM NAVIGATION !!!\n\n if (clickedThingGrandparent.hasAttribute('data-sideslide')) {\n\n var imgToShow = clickedThing;\n\n // declare variables needed for named function\n var clickedSideSlide = clickedThingGrandparent;\n var dotsContainer = clickedSideSlide.parentNode.lastElementChild;// !!! FULLSCREEN BUTTON MAY AFFECT THIS DOM NAVIGATION !!!\n var gallery = clickedSideSlide.parentNode;// !!! FULLSCREEN BUTTON MAY AFFECT THIS DOM NAVIGATION !!!\n var clickedIndex = clickedSideSlide.getAttribute('data-slide-index');\n var galleryName = gallery.getAttribute('id');\n var currentSlide = document.getElementById(galleryName + '-current');\n\n // calls NAMED FUNCTION\n advanceOrRetreat(clickedSideSlide, dotsContainer, gallery, clickedIndex, galleryName, currentSlide);\n\n } // close if\n} // close function", "function onClick() {\r\n elRoot.nrmSlider.goTo(this);\r\n clearTimeout(elRoot.nrmSlider.timeout);\r\n }", "function goToSlide(n) {\n slides[currentSlide].className = 'slider-image';\n currentSlide = (n + slides.length) % slides.length;\n slides[currentSlide].className = 'slider-image showing';\n}", "function _switchSlide(){\r\n\t\tif(slide > 0){\r\n\t\t\tfor(var i = 0; i<slide; i++){\r\n\t\t\t\tTweenMax.set($('#slide_'+i),{css:{top:'-100%'}});\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(slide>3){\r\n\t\t\t$('#fake_slide_1').hide();\r\n\t\t}\r\n\r\n\t\tTweenMax.to($('#slide_'+slide),1.6,{css:{top:'-100%'},ease:Expo.easeOut});\r\n\t\tTweenMax.to($('#slide_'+(slide+1)),1.6,{delay:0.2,css:{top:'0%'},ease:Expo.easeOut, onComplete: function(){\r\n\t\t\tslide +=1;\r\n\t\t\tconsole.log('slide: '+slide);\r\n\t\t}});\r\n\t}", "function slide(){\n index = (index+1)%(bilder.length);\n imgTag.src = bilder[index];\n}", "_slideThumbnails() {\n this._slider.events.on('indexChanged', () => {\n const currentIndex = this._getCurrentIndex();\n this._thumbnailSlider.goTo(currentIndex);\n });\n\n this._thumbnailSlider.events.on('indexChanged', () => this._activateThumbnailNavigationItem());\n }", "function slideView(shortName, slide_num) { // direction is next or prev\n contentDiv = $('#ajax_wrapper'); // slide_wrapper\n var theURL = \"/connections/slideshow/slide/\" + shortName + \"/\" + slide_num + \"/\";\n getURL(theURL, contentDiv);\n}", "function sliderClick(){\n\t\tclearInterval(sliderInterval);\n\t\tsliderInterval = setInterval(automaticallySlide,4000);\n\t\tvar slideNum = $(this).data(\"slide\");\n\t\tactiveSlideNum = slideNum;\n\n\t\tactiveDot = \"dot_\" + slideNum;\n\t\tactiveSlide = \"slide_\" + slideNum;\n\n\t\t$(\".find_carousel .slide\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeSlide).addClass(\"active\");\n\n\t\t$(\".find_carousel .dot\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeDot).addClass(\"active\");\n\t}", "function superbgimage_click(img) {\n\t\t\t\t\t\t$fullsize.nextSlide();\n\t\t\t\t\t\t$fullsizetimer.startTimer( 7000 );\n\t\t\t\t\t}", "function onThumbnailsClick(e) {\n\t\t\t\te = e || window.event;\n\t\t\t\te.preventDefault ? e.preventDefault() : e.returnValue = false;\n\n\t\t\t\tvar eTarget = e.target || e.srcElement;\n\n\t\t\t\t// find root element of slide\n\t\t\t\tvar clickedListItem = closest(eTarget, function(el) {\n\t\t\t\t\treturn (el.tagName && el.tagName.toUpperCase() === 'FIGURE');\n\t\t\t\t});\n\n\t\t\t\tif(!clickedListItem) { return; }\n\n\t\t\t\tvar index = parseInt(clickedListItem.getAttribute('data-slide-index'));\n\t\t\t\tif(index >= 0) {\n\t\t\t\t\telements.addClass(elements.find('.js-img-overlay', clickedListItem)[0], 'animate-out');\n\t\t\t\t\telements.addClass(header, 'is-gallery');\n\n\t\t\t\t\twindow.setTimeout(function(){\n\t\t\t\t\t\telements.addClass(header, 'delay--5');\n\t\t\t\t\t\topenPhotoSwipe( index, galleryElements[0] );\n\t\t\t\t\t}, 400);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}", "function changeSlideImage(slideToChange, slideImage, imageLink) {\r\n slideToChange.data.image = imageLink;\r\n slideImage.src = imageLink;\r\n runUpdateTimer();\r\n displaySlide();\r\n}", "function plusSlides(num) {\n //add or minus by 1 to slideIndex depending on\n //whether the user clicks right or left on the image slides,\n //(-1 left ,+1 right)\n slideIndex += num;\n //and pass it as an arguement to displaySlides()\n displaySlides(slideIndex);\n}", "function nextSlide()\r\n{\r\n slideIndex++;\r\n showSlide();\r\n}", "function nextSlide() { showSlide(slideNumber + 1); }", "function showSlide(n){\n // Getting all images\n var slides = document.getElementsByClassName(\"mySlides\");\n // Selecting one image\n var imageElement = slides[n];\n // Displaying selected image\n lightBoxModal(imageElement);\n}", "function click(ell, ee) {\n var Parent = \"#\" + $(ee).parent().attr(\"id\");\n var slide = $(Parent).attr(\"data-slide\");\n ResCarousel(ell, Parent, slide);\n }", "changeSlide() {\n\t\tthis.activeSlide.fadeOut(this.fadeout);\n this.activeSlide = this.slide.eq(this.i);\n this.activeSlide.fadeIn(this.fadein);\n this.dot.removeClass('dot-active');\n this.activeDot = this.dot.eq(this.i);\n this.activeDot.addClass(\"dot-active\");\n\t}", "function currentSlide(n){\n slideIndex = n;\n}", "function currentSlide(n,p) {\r\n showSlides(slideIndex = n,p);\r\n \r\n}", "function hdrMain_onclick(e, id) {\nif(id == 'btnNext_1'){\n\t\n\t\t$.davinci.changePage(\"#pgSecond\",{\"transition\":\"slide\"});\n\t\t\n\t}\n\n}", "function showSlide(number) {\n if (storyLength <= 0)\n return;\n \n number = number % storyLength;\n\n if (number < 0)\n number += storyLength;\n\n slideNumber = number;\n\n storyFrame.src = storyList[number];\n newtabLink.href = storyList[number];\n slideDropdown.selectedIndex = number;\n}", "function moveSlide(n) { //moveSlide untuk button prev dan next\r\n index = index+n\r\n showSlides(index);\r\n}", "function changeSlidesAutomatically() {\n if (indexOfCurrentSlide > maxNumberOfSlides) {\n indexOfCurrentSlide %= maxNumberOfSlides;\n }\n\n removeCurrentClass();\n\n switch (indexOfCurrentSlide) {\n case 1:\n createFirstSlide();\n break;\n case 2:\n createSecondSlide();\n break;\n case 3:\n createThirdSlide();\n break;\n case 4:\n createForthSlide();\n break;\n case 5:\n createFifthSlide();\n break;\n default:\n break;\n }\n\n setCurrentClass();\n indexOfCurrentSlide += 1;\n // resetTimer();\n }", "function navigationOfThumbnailsByMainSLider() {\n\n\t\t\tsetTimeout(function() {\n\t\t\t\t// get index\n\t\t\t\tvar number = sliderMain.find(\".js-property-slider-item.active\").index();\n\t\t\t\t\n\t\t\t\t// go to slide\n\t\t\t\t// sliderMain.goToSlide(number);\n\n\t\t\t\t// change active thumbnail\n\t\t\t\t// sliderThumbnails.find(\".js-property-slider-thumbnails-item\").eq(number).addClass(\"active\").siblings().removeClass(\"active\");\n\n\t\t\t\t// go to slide\n\t\t\t\tsliderThumbnails.goToSlide(number);\n\t\t\t\t\n\t\t\t}, 400);\n\t\t}", "revealSlide () {\n this.slides[this.current].reveal()\n }", "function choiceClick(counter) {\n $('#picture .slick-next').trigger('click');\n $('.img-overlay').find('.click-overlay').parent().next().find('.overlay').addClass('click-overlay');\n $('#picture-array .slick-next').trigger('click');\n $('.image_number').html(counter + 1 + ' of 46');\n}", "function initGalleryCarousel() {\n $('#gallery .carousel').slick({\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n autoplay: false\n });\n $('#gallery .thumbnails .thumb').click(function () {\n $('#gallery .carousel').slick('slickGoTo', $(this).attr('data-thumb'));\n });\n}", "changePage(e) {\n e.preventDefault();\n // const page = e.target.dataset.id;\n const page = e.target.dataset.id;\n console.log(page);\n\n // Buttons Active class change\n [...this.$buttonsContainer.children].forEach(btn => btn.firstElementChild.classList.remove(\"active\"));\n page.classList.add(\"active\");\n\n // Current slide\n this.currentSlide = page.parentElement.dataset.id;\n\n // Slides active class change\n this.$slidesContainers.forEach(el => {\n el.classList.remove(\"active\");\n\n if (el.dataset.id === this.currentSlide) {\n el.classList.add(\"active\");\n }\n });\n\n }", "function changeSlide(elem, n) {\r\n var carousel_container = elem.parentElement.parentElement.parentElement;\r\n showSlide(carousel_container, n);\r\n}", "nextImage(){\r\n\t\tthis.changeSlide(this.currentSlide+1);\r\n\t}", "function specificSlide (slideNumber) {\r\n hideSlide();\r\n deactivate();\r\n currentSlide = slideNumber;\r\n showSlide(currentSlide);\r\n}", "function initThumbs() {\n showtheSlide();//hide all but the first entry after build\n $(\".thumbR\").on('click', function () {\n var t = $(this).attr('id').replace('thumb', '');\n currPage = t;//keep track of the page we just loaded\n showtheSlide();//hide all but they page we want\n });\n}", "function selectSlide(slideElm) {\n var contentElm = slideElm.parentElement;\n // update the classes of slides\n for (let slide of contentElm.children)\n slide.classList.remove('shown');\n slideElm.classList.add('shown');\n // update the nav bar\n var slideIndex = Array.from(contentElm.children).indexOf(slideElm);\n // nElm is from the outer context (bad)\n for (let b of nElm.children)\n b.classList.remove('shown');\n nElm.children[1+slideIndex].classList.add('shown');\n updateUrl(slideIndex);\n}", "nextSlide() {\n this.index = this.index + 1;\n if (this.index === this.tab.length) {\n this.index = 0;\n }\n this.img.src = this.tab[this.index];\n }", "slideTo(event) {\n main = this.findElement('.carousel__body__main');\n this.imageIndex = Number(event.target.alt);\n this.currentProduct = this.products[this.imageIndex];\n this.setDetails();\n this.setDotActive(event.target);\n main.style.backgroundImage = `url(${this.products[event.target.alt].image_url})`;\n }", "function demopage_switchslider()\n{\n\tvar param = window.location.href.substring(window.location.href.indexOf('?')+8);\n\t\n\t\n\tif(param != undefined && param != '' && window.location.href.indexOf('?') > 0)\n\t{\n\t\t$('.aviaslider').attr('id',param); //change the id of the slideshow depending on the url, so another slideshow gets applied\n\t}\n}", "function simpleSlideshow() {\n $('.slideshow--simple, .slideshow--research').on('init', (e, slick) => {\n $('.slick-dots, .slick-arrow').on('click', function() {\n $('.slideshow--simple, .slideshow--research').slick('slickPause');\n });\n });\n $('.slideshow--simple, .slideshow--research').slick({\n dots: true,\n arrows: false,\n fade: true,\n lazyLoad: true,\n autoplay: !reducedMotionState,\n autoplaySpeed: 7000,\n focusOnSelect: true\n });\n }", "function next()\n{\t\n\tnewSlide = sliderint+1;\n\tshowSlide(newSlide);\n}", "function imgSlider(img) {\n slide.src = img;\n}", "function imgSlider(img) {\n slide.src = img;\n}", "change() {\n let activeSlide = this.selector.querySelector('.active'),\n nextSlide = !activeSlide.nextElementSibling ? this.selectorInner.children[0] : activeSlide.nextElementSibling;\n activeSlide.classList.remove('active');\n nextSlide.classList.add('active');\n }", "on_button(evt)\n\t{\n\t\tlet i = parseInt(evt.currentTarget.getAttribute(\"data-slide-idx\"));\n\t\t(i == this.current) || this.show(i);\n\t}", "function changeRealThumb(slider,newIndex){\n var $thumbS=$(\"#bxslider-pager\");\n $thumbS.find('.active').removeClass(\"active\");\n $thumbS.find('li[data-slide-index=\"'+newIndex+'\"]').addClass(\"active\");\n if(slider.getSlideCount()-newIndex>=4){\n slider.goToSlide(newIndex);\n }\n else{\n slider.goToSlide(slider.getSlideCount()-4);\n }\n }", "changeSlides(change) {\n window.clearTimeout(this.changeTO);\n const { length } = this.slides;\n const prevSlide = this.state.activeSlide;\n let activeSlide = prevSlide + change;\n if (activeSlide < 0) activeSlide = length - 1;\n if (activeSlide >= length) activeSlide = 0;\n this.setState({ activeSlide, prevSlide });\n }", "function nextImg(){\n currentSlide++\n if (currentSlide > slides.length){\n currentSlide = 1\n }\n slideShow();\n}", "function slideTo($url){\n\n function addCurrent($num){\n $('.slider').attr('data-slide', $num);\n }\n slider.css({\n marginLeft: 0\n });\n if($url === '#1'){\n slider.css({\n marginLeft: 0\n });\n\n addCurrent('1');\n }\n else if($url === '#2'){\n slider.css({\n marginLeft: '-'+slideWidth + 'px'\n });\n\n addCurrent('2');\n }\n else{\n slider.css({\n marginLeft: '-'+slideWidth*2 + 'px'\n });\n addCurrent('3'); \n }\n\n }", "goto(slideId){\n this.stopAudio();\n window.location.hash = slideId;\n }", "function goToNextSlide(){\n myPresentation.goToNextSlide();\n displayNumberCurrentSlide();\n selectOptionInSelector(myPresentation.getCurrentSlideIndex());\n}", "function showSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n updateNav();\n}", "function slideChanged(evt)\n {\n if ( !printMode ) {\n slideIndices = Reveal.getIndices();\n closeWhiteboard();\n playbackEvents( 0 );\n }\n }", "function slideit() {\n //------Função, sem variáveis, para executar slide show; \n //Atribui ao atributo src do elemento img o valor que estiver \n //aqui \"_imagens/pub_image\" + step + \".jpg\";\n document.getElementById('pub_image').src = \"_imagens/pub_image\" + step_slideit + \".jpg\";\n //Se o valor da variável step for menor que o número limite de imagens (6) \n //então soma mais um ao número;\n if (step_slideit < 6)\n step_slideit++;\n //Caso seja igual iguala o valor da variável step a 1, para começar de novo;\n else\n step_slideit = 1;\n //Temporizador para executar a função slideit(), auto se executa a \n //cada 2,5 segundos;\n setTimeout(\"slideit()\", 2500);\n}", "function changeSlide(i) {\n //0;\n // if i == 0 then / deactivate slide 3 / activate slide 0\n if (i == 0) {\n activateSlide(i);\n deactivateSlide(3);\n }\n\n // if i == 1,2,3 then / deactivate i-1 / activate i\n if (i > 0) {\n activateSlide(i);\n deactivateSlide(i - 1);\n }\n}", "function setActiveSlide(e) {\n\n // Safety net to prevent hijacking normal links\n if (e && !$(this).parent().is('dt')) return;\n\n // Get target panel and remove active class from all siblings\n var active = $(this).parent('dt').siblings($(this).attr('href'));\n active.siblings('.active').removeClass('active');\n\n // If we clicked the currently open panel, toggle it shut, else close siblings and activate current panel\n if (active.height() > 1) {\n active.height(0);\n } else {\n active.siblings('dd').height(0);\n giveActiveClass(active);\n }\n }", "function click(ell, ee) {\r\n var Parent = \"#\" + $(ee).parent().attr(\"id\");\r\n var slide = $(Parent).attr(\"data-slide\");\r\n ResCarousel(ell, Parent, slide);\r\n }", "function clickOnThumbnail() {\n\tgetPhotoUrl($(this));\n\t$container.append($photoviewer.append($photoBox).append($caption));\n\t$photoBox.after($leftClick);\n\t$photoBox.before($rightClick);\n\t$(\"html\").css(\"background\",\"gray\");\n\t//All other images are not visible\n\t$(\".thumbnail\").addClass(\"greyed-out\");\n\t$(\".small-img\").hide();\n\t$leftClick.on(\"click\",leftClick);\n\t$rightClick.on(\"click\",rightClick);\n}", "function showSlide(n) {\n\tvar thumbnailImage = document.querySelectorAll('img.thumbnail');\n\tif (n >= thumbnailImage.length) {\n\t\tslideIndex = 0;\n\t}\n\tif (n < 0) {\n\t\tslideIndex = thumbnailImage.length - 1;\n\t}\n\n\toutlineClearing();\n\n\tthumbnailImage[slideIndex].className += ' active';\n\tdisplayImage(thumbnailImage[slideIndex]);\n}", "function changeImg(){\r\ndocument.slide.src=images[i]\r\nif(i<images.length - 1){\r\n i++\r\n}else{\r\n i=0;\r\n}\r\nsetTimeout(\"changeImg()\",time);\r\n}", "function slideFunction(slide) {\n //setNextButton(true)\n // console.log(slide);\n // i++;\n // if (i == 4) {\n // setActiveButton(false);\n // setNextButton(true);\n // }\n // if (i < 5) {\n // setSlide(props.slides[i].title);\n // setNextSlide(props.slides[i].text);\n // setNextButton(true);\n // }\n var found1 = props.slides;\n var index1 = found1.findIndex((fruit1) => fruit1.title === slide);\n // console.log(index1)\n if (index1 == 3) {\n setActiveButton(false);\n }\n if (index1 < 4) {\n setSlide(found1[index1 + 1].title);\n setNextSlide(found1[index1 + 1].text);\n setNextButton(true);\n setAgainStart(true);\n }\n }", "function currentSlide(n){\r\n\t\tshowSlide(slideIndex = n);\r\n\t}", "function next() {\n changeSlide($nextel);\n }", "function currentSlide(n) {\r\n showSlides(slideIndex = n);\r\n}", "function nextSlide(){\n goToSlide(currentSlide+1);\n}", "function soloImagesSection() {\n // alert(\"solo images clicked\");\n $(\"#solo_images\").addClass(\"actively_selected\");\n $(\"#all_panel, #effects, #videos\").removeClass(\"actively_selected\").slideUp();\n $(\".actively_selected\").slideDown();\n\n}", "function click(ell, ee) {\n var Parent = \"#\" + $(ee).parent().attr(\"id\");\n var slide = $(Parent).attr(\"data-slide\");\n ResCarousel(ell, Parent, slide);\n }", "function click(ell, ee) {\n var Parent = \"#\" + $(ee).parent().attr(\"id\");\n var slide = $(Parent).attr(\"data-slide\");\n ResCarousel(ell, Parent, slide);\n }", "function click(ell, ee) {\n var Parent = \"#\" + $(ee).parent().attr(\"id\");\n var slide = $(Parent).attr(\"data-slide\");\n ResCarousel(ell, Parent, slide);\n }", "function click(ell, ee) {\n var Parent = \"#\" + $(ee).parent().attr(\"id\");\n var slide = $(Parent).attr(\"data-slide\");\n ResCarousel(ell, Parent, slide);\n }", "function goToNextSlide() {\n\t\t\tvar hash = window.location.hash;\n\t\t\tvar slideNum = slideNumFromHash(hash) + 1;\n\t\t\tif (slideNum > endSlide) slideNum = endSlide;\n\t\t\t$('.slideshow').cycle( slideNum );\n\t\t}", "function changePic() {\n\t\t\t\tif (active[0].complete) {\n\t\t\t\t\tgo();\n\t\t\t\t} else {\n\t\t\t\t\tactive.load(go);\n\t\t\t\t}\n\n\t\t\t\tfunction go() {\n\t\t\t\t\tvar l = active.offset().left - pc.offset().left - (w - active.width())/2;\n\n\t\t\t\t\tpics.removeClass('active');\n\t\t\t\t\tactive.addClass('active');\n\t\t\t\t\tcheckDisabled();\n\t\t\t\t\tframe\n\t\t\t\t\t\t.height(active.height())\n\t\t\t\t\t\t.scrollTo({top: 0, left: l}, 500);\n\n\t\t\t\t\tif(history.pushState) {\n\t\t\t\t\t\thistory.pushState(null, null, '#' + active.attr('id'));\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}", "function constrolSlides(ele) {\n // select controls ul element\n const ul=controls.children;\n // select ul chidren li element\n const li=ul[0].children;\n var active;\n for(let i=0;i<li.length;i++){\n if(li[i].className==\"active\"){\n // find who is now active\n active=i;\n // remove active class from all li element\n li[i].className=\"\";\n }\n }\n // add active class ro current slide\n ele.className=\"active\";\n\n var numb=(ele.id-1)-active;\n jumpSlideWidth=jumpSlideWidth+(slicktrackWidth*numb);\n slicktrack.style.marginLeft=-jumpSlideWidth + \"px\";\n}", "function changeSlideYoutubeLink(slideToChange, youtubeLink){\r\n slideToChange.data.link = youtubeLink;\r\n runUpdateTimer();\r\n displaySlide();\r\n}", "function previousSlide() {\n \n}", "function mb_arrowClick(e) {\n var target = e.target;\n if (target == mb_leftArrow) {\n clearInterval(mb_imageSlideshowInterval);\n mb_hideImages();\n mb_removeDots();\n if (mb_counter == 1) {\n mb_counter = (mb_imageSlides.length - 1);\n mb_imageLoop();\n mb_imageSlideshowInterval = setInterval(mb_slideshow, 5000);\n } else {\n mb_counter--;\n mb_counter--;\n mb_imageLoop();\n mb_imageSlideshowInterval = setInterval(mb_slideshow, 5000);\n }\n } \n else if (target == mb_rightArrow) {\n clearInterval(mb_imageSlideshowInterval);\n mb_hideImages();\n mb_removeDots();\n if (mb_counter == mb_imageSlides.length) {\n mb_counter = 0;\n mb_imageLoop();\n mb_imageSlideshowInterval = setInterval(mb_slideshow, 5000);\n } else {\n mb_imageLoop();\n mb_imageSlideshowInterval = setInterval(mb_slideshow, 5000);\n }\n }\n}" ]
[ "0.7284267", "0.72596025", "0.718012", "0.7054175", "0.7038622", "0.68316835", "0.67867446", "0.6740162", "0.6681874", "0.6622672", "0.65616906", "0.6557785", "0.6517414", "0.65035224", "0.6490582", "0.64894557", "0.64516205", "0.644501", "0.64433914", "0.64309144", "0.6429238", "0.63955986", "0.6382674", "0.63658947", "0.63379985", "0.6330391", "0.63206863", "0.63040227", "0.6293389", "0.6269941", "0.6256496", "0.62550503", "0.6231924", "0.6222543", "0.6219755", "0.62135494", "0.62112004", "0.62087655", "0.62058204", "0.6202039", "0.6183898", "0.6180221", "0.6178286", "0.6170937", "0.6167691", "0.6155323", "0.61473024", "0.61348516", "0.6134006", "0.6133937", "0.61292976", "0.61290246", "0.6121842", "0.6110706", "0.6108341", "0.61077696", "0.6104167", "0.60826886", "0.6067679", "0.6062778", "0.606132", "0.6059971", "0.60593104", "0.6055436", "0.60486424", "0.6045033", "0.60431856", "0.60431856", "0.6037037", "0.6029324", "0.6027586", "0.601021", "0.6008739", "0.6007263", "0.6005118", "0.5989272", "0.59880495", "0.59802073", "0.5974941", "0.59680986", "0.5968076", "0.596334", "0.5961884", "0.59583324", "0.5957321", "0.5956054", "0.5955088", "0.59535265", "0.59527266", "0.5951961", "0.5941856", "0.5938475", "0.5938475", "0.5938475", "0.5938475", "0.5935069", "0.5931803", "0.59294677", "0.5927012", "0.59267616", "0.59226906" ]
0.0
-1
select an element in a slide > make editable
function selectElement(element) { console.log('new element selected'); // change class of selected (and unselected element) for styling // and make / unmake content editable // and save to database if (selectedElement != null) { selectedElement.classList.remove('uiSelected'); selectedElement.classList.add('drag'); // set selectedElement to uneditable, then saving the changed contents selectedElement.setAttribute("contentEdiatable", false); changeText(selectedElement); } selectedElement = element; element.classList.add("uiSelected"); selectedElement.classList.remove('drag'); element.setAttribute("contentEditable", true); console.log(element); //var elementText = element.getElementsByClassName('textnode')[0].innerHTML; var elementText = element.innerHTML; console.log(elementText); var elementId = element.dataset.id; console.log(elementId); $('#elementText').value = elementText; $('#elementId').value = elementId; // widthPicker, heightPicker, xPicker, yPicker $('#widthPicker').value = element.offsetWidth; $('#heightPicker').value = element.offsetHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editable(el) {\n // set the clicked list element as editable\n el.target.contentEditable = true;\n //set the focus on this element in order to be able to change the text\n // and to keep the drag functionality working\n el.target.focus();\n}", "function toggleEditMode(mode) {\n var slides = document.querySelectorAll('section');\n _.each(slides, function(s) {\n s.setAttribute('contentEditable', mode);\n });\n}", "set editable(value) {}", "get editable() {}", "function selectSlide() {\n let selectedElement = selectorSlide.value;\n let slideID = parseInt(selectedElement, 10);\n\n goToSlide(slideID);\n}", "function editPresentation (e) {\n\tlet idText = e.currentTarget.id;\n\tif (!idText.includes('image') && !idText.includes('edit')) {\n\t\tidText = e.currentTarget.parentNode.id;\n\t}\n\tidNum = parseInt(idText);\n\thandlePresentation(idNum);\n}", "function edit() {\n\tconst self = this;\n\tthis.graph.getCells().forEach(function (cell) {\n\t\tconst c = cell.findView(self.paper);\n\t\tif (editMode == false) {\n\t\t\tc.setInteractivity(true);\n\t\t\teditMode = true;\n\t\t} else {\n\t\t\tc.setInteractivity(false);\n\t\t\teditMode = false;\n\t\t}\n\t})\n}", "editCommand(){const richtext=this.shadowRoot.getElementById(\"richtext\"),editmode=richtext.contentDocument;editmode.designMode=\"on\"}", "function commitChanges() {\n if (editingSlide) {\n editingSlide.querySelector('.kreator-slide-content').innerHTML = editor.getHTML();\n }\n}", "function contentEdit(id) {\n const content = document.getElementById(id);\n content.setAttribute(\"contenteditable\", \"true\");\n}", "selectIt() {\n var index = 1,\n text,\n modIndex,\n modLength;\n text = this.selected.text;\n modIndex = this.mod.indexOf(text);\n modLength = this.mod.slice(0, modIndex).length;\n var modEnd = this.mod.slice(modIndex + text.length, this.mod.length);\n if (this.modded) {\n index = this.selected.start + modLength;\n } else {\n index = this.selected.start - modLength;\n }\n this.el.focus();\n // el.selectionStart = index;\n // el.selectionEnd = selected.text.length + index;\n var ending = this.selected.text.length + index;\n this.setSelectionRange(this.el, index, ending);\n }", "saveSelection(){\n this.selected = this.model.document.selection.getSelectedElement()\n }", "handleDrinkClick(e){\n const li = e.target\n li.contentEditable = true\n li.focus();\n li.classList.add(\"editable\")\n }", "function edit() {\n clickTaskEdit(requireCursor());\n }", "[mutation.EDIT_CONTENT] (state, editableNode) {\n const element = NodeHelpers.getElementObjectByNode(editableNode, state.snapshot)\n if (element && element.editable) {\n element.dataObject.attrs.contenteditable = true\n setTimeout(() => NodeHelpers.setCursorPosition(false)(editableNode), 0)\n }\n }", "function editOnDragStart(){this._internalDrag=true;this.setMode('drag');}", "function editPage() {\n $(\"[key]\").each(\n function () {\n $(this).attr('contenteditable', 'true');\n }\n );\n }", "edit() {\n this._enterEditMode();\n }", "function edit() {\n this.focus();\n this.setSelectionRange(0, this.value.length);\n}", "function selectControlElements() {\n\t\t\teditor.on('click', function(e) {\n\t\t\t\tvar target = e.target;\n\n\t\t\t\t// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\n\t\t\t\t// WebKit can't even do simple things like selecting an image\n\t\t\t\t// Needs to be the setBaseAndExtend or it will fail to select floated images\n\t\t\t\tif (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== \"false\") {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.getSel().setBaseAndExtent(target, 0, target, 1);\n\t\t\t\t\teditor.nodeChanged();\n\t\t\t\t}\n\n\t\t\t\tif (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.select(target);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "select() {\n\t\tthis.inputView.select();\n\t}", "function editClicked() {\n edit = true;\n}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "edit() {\n\t\tthis.$el.addClass('editing');\n\t\tthis.input.focus();\n\t}", "function onEdit() {\n transition(EDIT);\n }", "function ToggleEdit(){\n\t\n}", "function showEditableField (e, ContainerInputArray) {\n var inputs = new Array();\n var inputArea = YAHOO.util.Dom.get(ContainerInputArray[1]); \n if ( ! inputArea ){\n YAHOO.util.Event.preventDefault(e);\n return;\n }\n YAHOO.util.Dom.addClass(ContainerInputArray[0], 'bz_default_hidden');\n YAHOO.util.Dom.removeClass(inputArea, 'bz_default_hidden');\n if ( inputArea.tagName.toLowerCase() == \"input\" ) {\n inputs.push(inputArea);\n } else if (ContainerInputArray[2]) {\n inputs.push(document.getElementById(ContainerInputArray[2]));\n } else {\n inputs = inputArea.getElementsByTagName('input');\n }\n if ( inputs.length > 0 ) {\n // Change the first field's value to ContainerInputArray[2]\n // if present before focusing.\n var type = inputs[0].tagName.toLowerCase();\n if (ContainerInputArray[3]) {\n if ( type == \"input\" ) {\n inputs[0].value = ContainerInputArray[3];\n } else {\n for (var i = 0; inputs[0].length; i++) {\n if ( inputs[0].options[i].value == ContainerInputArray[3] ) {\n inputs[0].options[i].selected = true;\n break;\n }\n }\n }\n }\n var elementToFocus = YAHOO.util.Dom.get(ContainerInputArray[4]);\n if (elementToFocus) {\n // focus on the requested field\n elementToFocus.focus();\n if ( elementToFocus.tagName.toLowerCase() == \"input\" ) {\n elementToFocus.select();\n }\n } else {\n // focus on the first field, this makes it easier to edit\n inputs[0].focus();\n if ( type == \"input\" ) {\n inputs[0].select();\n }\n }\n }\n YAHOO.util.Event.preventDefault(e);\n}", "function editFunction() {\n document.designMode = \"on\";\n}", "function view(preview){\n\tvar p = preview || false;\n\tlib.foreach(lib.sel('#toolbar,#container, #slide_main,#slidespreview'),function(el){\n\t\tif (el.dataset)\n\t\t\tel.dataset.edit=false\n\t\telse\n\t\t\tel.setAttribute('data-edit',\"false\");\n\t})\n\tborders(false);\n\tlib.foreach(active.children,function(child,i){\n\t\tUI.resizeable(child,'remove');\n\t\tUI.draggable(child,'remove');\n\t\tvar ce = child.querySelector(\".content-editable\");\n\t\t\tif(!!ce){\n\t\t\t\tce.setAttribute('contenteditable',false);\n\t\t\t\tce.spellcheck = false;\n\t\t\t}\n\t});\n\tif (!p){\n\t\tactive.removeEventListener('contextmenu',addItemMenu);\n\t\tslideshow.start(active);\n\t\tnavigation(true);// add navigation listeners\n\t\tedit = false;\n\t\tresize();\n\t}\n}", "function editOnDragStart() {\n\t this._internalDrag = true;\n\t this.setMode('drag');\n\t}", "function editSlide() {\n var slide = $(\"span#slideFile\").text().replace(/:\\d+$/, '');\n var link = editUrl + slide + \".md\";\n window.open(link);\n}", "function selectControlElements() {\n\t\t\teditor.on('click', function(e) {\n\t\t\t\tvar target = e.target;\n\n\t\t\t\t// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\n\t\t\t\t// WebKit can't even do simple things like selecting an image\n\t\t\t\t// Needs to be the setBaseAndExtend or it will fail to select floated images\n\t\t\t\tif (/^(IMG|HR)$/.test(target.nodeName)) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.getSel().setBaseAndExtent(target, 0, target, 1);\n\t\t\t\t\teditor.nodeChanged();\n\t\t\t\t}\n\n\t\t\t\tif (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.select(target);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "_setToEditingMode() {\n this._hasBeenEdited = true\n this._setUiEditing()\n }", "select() {\n this.getInput().select();\n }", "function twitKisminaTikla(){\n let nelerOluor = document.getElementsByClassName(\"public-DraftEditorPlaceholder-inner\");\n nelerOluor[0].click();\n\n}", "function slides_edit()\r\n{\r\n\tdocument.getElementById(\"slides_input\").style.display=\"inline\";\r\n\tdocument.getElementById(\"text_input\").style.display=\"none\";\r\n\tdocument.getElementById(\"layout_edit\").style.display=\"none\";\r\n\tdocument.getElementById(\"modpro_txt\").style.display=\"none\";\r\n\r\n\tdocument.getElementById(\"slides_img\").src = \"img/slides_down.gif\";\r\n\tdocument.getElementById(\"text_img\").src = \"img/tekst_up.gif\";\r\n\tdocument.getElementById(\"layout_img\").src = \"img/layout_up.gif\";\r\n\t\r\n}", "function fieldOnClick(e) {\r\n\tvar obj = targetElement(e);\r\n\tvar iarray = new Array();\r\n\tiarray = obj.name.split(\"_\");\r\n\tsetCursorPosition(iarray[1]);\r\n}", "doEditMode() {\n\n }", "function setEditableTrue() {\n var contentEditable = document.getElementsByClassName('editable');\n for (var i = 0; i < contentEditable.length; i++) {\n contentEditable[i].setAttribute('contenteditable', true);\n }\n}", "function editElementPosition(selectedElement) {\r\n var left = selectedElement.getBoundingClientRect().left;\r\n var top = selectedElement.getBoundingClientRect().top;\r\n\r\n\r\n var data = {};\r\n data.action = \"editElementPosition\";\r\n data.id = selectedElement.dataset.id;\r\n data.left = left;\r\n data.top = top;\r\n data.handler = \"slide\";\r\n var url = \"ajax.php\";\r\n\r\n Ajax.post(data, url, function (json) {\r\n\r\n if (json.error) {\r\n $('#activeSlideContainer').innerHTML = json.error;\r\n }\r\n else {\r\n // only updates database document, no callback action required\r\n }\r\n });\r\n}", "function xEditable(container,trigger){\r\n\r\nvar editElement = null;\r\nvar container = xGetElementById(container);\r\nvar trigger = xGetElementById(trigger);\r\nvar newID = container.id + \"_edit\";\r\nxAddEventListener(container, 'click', BeginEdit);\r\n\r\nfunction BeginEdit(){\r\n if(!editElement){\r\n // create the input box\r\n editElement = xCreateElement('input');\r\n editElement.setAttribute('id', newID);\r\n editElement.setAttribute('name', newID);\r\n // prep the inputbox with the current value\r\n editElement.setAttribute('value', container.innerHTML);\r\n // kills small gecko bug\r\n editElement.setAttribute('autocomplete','OFF');\r\n // setup events that occur when editing is done\r\n xAddEventListener(editElement, 'blur', EndEditClick);\r\n xAddEventListener(editElement, 'keypress', EndEditKey);\r\n // make room for the inputbox, then add it\r\n container.innerHTML = '';\r\n container.appendChild(editElement);\r\n editElement.select();\r\n editElement.focus();\r\n }else{\r\n editElement.select();\r\n editElement.focus();\r\n }\r\n}\r\nfunction EndEditClick(){\r\n // save the entered value, and kill the input field\r\n container.innerHTML = editElement.value;\r\n editElement = null;\r\n}\r\nfunction EndEditKey(evt){\r\n // save the entered value, and kill the input field, but ONLY on an enter\r\n var e = new xEvent(evt);\r\n if(e.keyCode == 13){\r\n container.innerHTML = editElement.value;\r\n editElement = null;\r\n }\r\n}\r\n}", "function selectControlElements() {\n\t\t\teditor.on('click', function(e) {\n\t\t\t\tvar target = e.target;\n\n\t\t\t\t// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\n\t\t\t\t// WebKit can't even do simple things like selecting an image\n\t\t\t\tif (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== \"false\") {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.select(target);\n\t\t\t\t\teditor.nodeChanged();\n\t\t\t\t}\n\n\t\t\t\tif (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tselection.select(target);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function editable($el, data) {\n \n $el.data('cms', data);\n\n $el.on('render', function () {\n var $el = $(this);\n var data = $el.data('cms');\n elements[data.type].render($el, data.data);\n $el.trigger('rendered');\n });\n\n //add css edit styles\n $el.addClass('cms-edit-' + data.type);\n\n $el.on('click', function (e) {\n e.preventDefault();\n e.stopPropagation();\n var $el = $(this);\n var data = $el.data('cms');\n elements[data.type].edit($el, data);\n });\n\n }", "function SelectionChange() { }", "function SelectionChange() { }", "change() {\n let activeSlide = this.selector.querySelector('.active'),\n nextSlide = !activeSlide.nextElementSibling ? this.selectorInner.children[0] : activeSlide.nextElementSibling;\n activeSlide.classList.remove('active');\n nextSlide.classList.add('active');\n }", "function UISelection(){\n\n }", "function removeEditSlideEditor() {\n\t\t$('#edit_slide_wrapper').html('');\n\t\t$('li.editing').removeClass('editing');\n\t}", "function EnableEdit(element) \n{\n\tdocument.getElementById(element + \"_ro\").toggle(); \n\tdocument.getElementById(element + \"_rw\").toggle();\n}", "edit() {\n }", "function chooseSlide( event ) {\n var selected = $(this);\n var index = selected.index();\n var offset = index - selected.siblings(\".active\").index();\n\n for(var i = Math.abs(offset); i--; ) {\n var row = LG[ state.get() === \"info\" ? \"Info\" : \"List\" ].getCurrent();\n row[ offset < 0 ? \"previous\" : \"next\" ]( i !== 0 );\n }\n }", "handleOnSelectGfx(item, e) {\n // check option button\n try {\n const list = document.getElementsByClassName(\"menu-option\");\n for (let item of list) {\n if (item.contains(e.target)) return;\n }\n if (isDescendant(document.getElementById(`thumbnail-slider-${_.get(item, 'id')}`), e.target)) {\n return;\n }\n\n const { gfxEdit } = this.props\n\n if (gfxEdit === _.get(item, 'id')) {\n // close if click on gfx card title\n let cardId = `gfx-card-id-${_.get(item, 'id')}`;\n if (\n isDescendant(document.getElementById(cardId), e.target) ||\n cardId == e.target.id\n ) {\n this.showEdit(null);\n }\n return\n }\n const element = _.get(item, 'elements[0]')\n if (element) {\n // show edit\n this.showEdit(_.get(item, 'id'))\n\n this.props.event.emit(ON_EDITOR_SET_MY_CURSOR, {\n range: {\n index: _.get(item, 'index'),\n length: 0,\n },\n source: 'silent',\n })\n\n }\n } catch(err) {\n \n }\n\n }", "selectText(){\r\n this.getRef('input').selectText();\r\n }", "function editOnInput(){var domSelection=global.getSelection();var anchorNode=domSelection.anchorNode;var isCollapsed=domSelection.isCollapsed;if(anchorNode.nodeType!==Node.TEXT_NODE){return;}var domText=anchorNode.textContent;var editorState=this.props.editorState;var offsetKey=nullthrows(findAncestorOffsetKey(anchorNode));var _DraftOffsetKey$decod=DraftOffsetKey.decode(offsetKey);var blockKey=_DraftOffsetKey$decod.blockKey;var decoratorKey=_DraftOffsetKey$decod.decoratorKey;var leafKey=_DraftOffsetKey$decod.leafKey;var _editorState$getBlock=editorState.getBlockTree(blockKey).getIn([decoratorKey,'leaves',leafKey]);var start=_editorState$getBlock.start;var end=_editorState$getBlock.end;var content=editorState.getCurrentContent();var block=content.getBlockForKey(blockKey);var modelText=block.getText().slice(start,end);// Special-case soft newlines here. If the DOM text ends in a soft newline,\r\n\t// we will have manually inserted an extra soft newline in DraftEditorLeaf.\r\n\t// We want to remove this extra newline for the purpose of our comparison\r\n\t// of DOM and model text.\r\n\tif(domText.endsWith(DOUBLE_NEWLINE)){domText=domText.slice(0,-1);}// No change -- the DOM is up to date. Nothing to do here.\r\n\tif(domText===modelText){return;}var selection=editorState.getSelection();// We'll replace the entire leaf with the text content of the target.\r\n\tvar targetRange=selection.merge({anchorOffset:start,focusOffset:end,isBackward:false});var entityKey=block.getEntityAt(start);var entity=entityKey&&Entity.get(entityKey);var entityType=entity&&entity.getMutability();var preserveEntity=entityType==='MUTABLE';// Immutable or segmented entities cannot properly be handled by the\r\n\t// default browser undo, so we have to use a different change type to\r\n\t// force using our internal undo method instead of falling through to the\r\n\t// native browser undo.\r\n\tvar changeType=preserveEntity?'spellcheck-change':'apply-entity';var newContent=DraftModifier.replaceText(content,targetRange,domText,block.getInlineStyleAt(start),preserveEntity?block.getEntityAt(start):null);var anchorOffset,focusOffset,startOffset,endOffset;if(isGecko){// Firefox selection does not change while the context menu is open, so\r\n\t// we preserve the anchor and focus values of the DOM selection.\r\n\tanchorOffset=domSelection.anchorOffset;focusOffset=domSelection.focusOffset;startOffset=start+Math.min(anchorOffset,focusOffset);endOffset=startOffset+Math.abs(anchorOffset-focusOffset);anchorOffset=startOffset;focusOffset=endOffset;}else{// Browsers other than Firefox may adjust DOM selection while the context\r\n\t// menu is open, and Safari autocorrect is prone to providing an inaccurate\r\n\t// DOM selection. Don't trust it. Instead, use our existing SelectionState\r\n\t// and adjust it based on the number of characters changed during the\r\n\t// mutation.\r\n\tvar charDelta=domText.length-modelText.length;startOffset=selection.getStartOffset();endOffset=selection.getEndOffset();anchorOffset=isCollapsed?endOffset+charDelta:startOffset;focusOffset=endOffset+charDelta;}// Segmented entities are completely or partially removed when their\r\n\t// text content changes. For this case we do not want any text to be selected\r\n\t// after the change, so we are not merging the selection.\r\n\tvar contentWithAdjustedDOMSelection=newContent.merge({selectionBefore:content.getSelectionAfter(),selectionAfter:selection.merge({anchorOffset:anchorOffset,focusOffset:focusOffset})});this.update(EditorState.push(editorState,contentWithAdjustedDOMSelection,changeType));}", "static get tag(){return\"rich-text-editor-selection\"}", "function showSlideEdit(id) {\n\t\t// Create our ajax promise\n\t\tvar promise = $.ajax({\n\t\t\turl: mobile_kiosk.template_url + '/fq/admin/mobile-kiosk/slide-edit',\n\t\t\tmethod: 'GET',\n\t\t\tdata: {\n\t\t\t\tid: id\n\t\t\t}\n\t\t});\n\t\tpromise.done(function(html) {\n\t\t\tremoveSlideEditor();\n\t\t\tremoveAddSlideUI();\n\t\t\t\n\t\t\t// Add the template\n\t\t\t$('#edit_slide_wrapper').html(html);\n\t\t\t\n\t\t\t// Initialize the featured image piece\n\t\t\tfeaturedImageInit();\n\t\t\t\n\t\t\t// Initialize functionality for removing featured image\n\t\t\tremoveFeaturedImageInit();\n\t\t\t\n\t\t\t// Initialize the TinyMCE Editor\n\t\t\ttinymce.EditorManager.editors = [];\n\t\t\ttinymce.init({ selector: 'slide_content', theme:'modern', skin:'lightgray', menubar: false }); tinyMCE.execCommand('mceAddEditor', true, 'slide_content');\n\t\t});\n\t\t\n\t\t$('body').on('click', '#fq_gallery_kiosk_cancel_slide', function(e) {\n\t\t\tremoveEditSlideEditor();\n\t\t});\n\t\t\n\t\t$('body').on('click', '#fq_gallery_kiosk_update_slide', function(e) {\n\t\t\tupdateSlide();\n\t\t});\n\t}", "function enableEditMode() {\n richTextField.document.designMode = \"On\";\n}", "function selectThis(selected) {\n if(!selected || isNaN(selected)) { selected = 1; return; }\n\n let selEl = document.querySelector('.paste[data-selected=true]');\n let elToChange = document.querySelector(`#opt_${selected}`);\n\n if(!selEl || !elToChange) return;\n\n selEl.dataset.selected = false;\n elToChange.parentNode.dataset.selected = true;\n scrollIntoView(elToChange.parentNode)\n}", "function editContent (step, widget, title) {\n\t \n\t\tremoveEditGizmos (stepOverlay);\n\t\t// Replace the contents of the current slide with its own html to be edited\n\t\tvar ownHtml = $(step).html(),\n\t\t\toptions = {\n\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\"Apply\": function() {saveContent(step)}\n\t\t\t\t\t},\n\t\t\t\t\tresizable: false,\n\t\t\t\t\twidth: 500,\n\t\t\t\t\tbeforeClose: function () {$(widget).children('.impress_slide_content').remove()},\n\t\t\t\t\ttitle: title + $(step).attr('id')\n\t\t\t\t};\n\t\t\t\t\n\t\t// Disable click handle\n\t\t$(step).off(\"click\");\n\t\t\n\t\tdocument.removeEventListener(\"keydown\", document.filterKeys, false);\n\t\t\n\t\t$(widget).children('.impress_slide_content').remove();\n\t\t$(widget).dialog('option', options);\n\t\t$('.widget.edit-content').append('<textarea class=\"impress_slide_content\" cols=\"75\" row=\"35\">' + ownHtml + '</textarea>');\n\t}", "function makeEditable($container) {\n var $fields = $container.find(\"[data-content-attr]\");\n $fields.addClass(\"activated\").hallo({\n editable: true,\n toolbar: \"halloToolbarContextual\", // halloToolbarFixed\n toolbarCssClass: \"ui-widget-header\",\n toolbarPositionAbove: true,\n plugins: {\n \"halloformat\": {},\n \"halloheadings\": {headers: [2,3,4]},\n // \"hallojustify\": {},\n \"hallolists\": {},\n \"hallolink\": {},\n \"halloimage\": {}\n }\n });\n }", "function slideDropdownBehavior() {\n showSlide(slideDropdown.selectedIndex);\n}", "set editing(value) {\n\t\tif (value) {\n\t\t\tthis.classList.add('editing');\n\t\t\tthis.query('.edit').focus();\n\t\t} else {\n\t\t\tthis.classList.remove('editing');\n\t\t}\n\t}", "function select() {\n getElements()[selection].getElementsByTagName('a')[0].click();\n\n}", "function fieldOnFocus(e) {\r\n\tvar obj = targetElement(e);\r\n\tvar iarray = new Array();\r\n\tiarray = obj.id.split(\"_\");\r\n\tsetCursorPosition(iarray[1]);\r\n\tsetFocusFieldIntoGlobal(obj);\r\n}", "selectItem (i) { this.toggSel(true, i); }", "selectNode() {\n if (this.nodeDOM.nodeType == 1)\n this.nodeDOM.classList.add(\"ProseMirror-selectednode\");\n if (this.contentDOM || !this.node.type.spec.draggable)\n this.dom.draggable = true;\n }", "function openEditor() {\n var slide = $(\"span#slideFile\").text().replace(/:\\d+$/, '');\n var link = 'edit/' + slide + \".md\";\n $.get(link);\n}", "function allow_modif(id){\n $(\"#nom\"+id).attr(\"contenteditable\",\"true\").css(\"background\",\"#eee\");\n $(\"#desc\"+id).attr(\"contenteditable\",\"true\").css(\"background\",\"#eee\");\n $(\"#action\"+id).hide();\n $(\"#edit\"+id).show();\n}", "function handlenoteEdit() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n editnote(currentnote);\n }", "function enablePointSelection(){\r\n\taddPointMode = true;\r\n}", "insertEditRangeElement(user) {\n if (this.viewer.isDocumentProtected || this.viewer.selection.isEmpty) {\n return;\n }\n this.initComplexHistory('RestrictEditing');\n this.selection.skipEditRangeRetrieval = true;\n let selection = this.viewer.selection;\n let startPos = this.selection.start;\n let endPos = this.selection.end;\n if (!this.selection.isForward) {\n startPos = this.selection.end;\n endPos = this.selection.start;\n }\n if (selection.start.paragraph.isInsideTable && selection.end.paragraph.isInsideTable\n && selection.start.paragraph.associatedCell.ownerTable.contains(selection.end.paragraph.associatedCell)) {\n let startCell = this.getOwnerCell(this.selection.isForward);\n let endCell = this.getOwnerCell(!this.selection.isForward);\n if (startCell.rowIndex === endCell.rowIndex) {\n let startIndex = startCell.ownerRow.childWidgets.indexOf(startCell);\n let endIndex = startCell.ownerRow.childWidgets.indexOf(endCell);\n let startElement = [];\n let endElement = [];\n for (let i = startIndex; i <= endIndex; i++) {\n let editStart = this.addEditElement(user);\n editStart.columnFirst = i;\n editStart.columnLast = i;\n editStart.line = selection.start.currentWidget;\n let editEnd = editStart.editRangeEnd;\n editEnd.line = selection.end.currentWidget;\n startElement.push(editStart);\n endElement.push(editEnd);\n }\n this.insertElements(endElement, startElement);\n let offset = startElement[0].line.getOffset(startElement[0], 1);\n this.selection.start.setPositionParagraph(startElement[0].line, offset);\n offset = endElement[0].line.getOffset(endElement[0], 1);\n this.selection.end.setPositionParagraph(endElement[0].line, offset);\n this.selection.fireSelectionChanged(true);\n this.fireContentChange();\n }\n else {\n this.insertEditRangeInsideTable(startCell, endCell, user);\n let startLine = this.selection.getFirstParagraphInCell(startCell).childWidgets[0];\n let endLine = this.selection.getLastParagraph(endCell).childWidgets[0];\n let offset = startLine.getOffset(startLine.children[0], 1);\n this.selection.start.setPositionParagraph(startLine, offset);\n offset = endLine.getOffset(endLine.children[0], 1);\n this.selection.end.setPositionParagraph(endLine, offset);\n this.selection.fireSelectionChanged(true);\n this.fireContentChange();\n }\n }\n else {\n this.addRestrictEditingForSelectedArea(user);\n }\n this.selection.skipEditRangeRetrieval = false;\n }", "function editImage(selImg) {\n initEditor(selImg);\n}", "function update(){\n\tvar el=document.getElementById('content');\n\tvar savedSel = saveSelection(el);\n\tdocument.getElementById(\"content\").innerHTML=''+wave.getState().get(\"content\");\n\trestoreSelection(el, savedSel);\n}", "function focusActiveSlide() {\n var root = state.get() === \"info\" ? info : playlistsElem;\n root.find(\".item.active\").focus().addClass(\"focus\");\n }", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function editOnDragStart(editor) {\n editor._internalDrag = true;\n editor.setMode('drag');\n}", "function makeSelectable(e) {\n e.setStyle('user-select', 'text');\n e.setStyle('-webkit-user-select', 'text');\n e.setStyle('-moz-user-select', 'text');\n e.setStyle('-o-user-select', 'text');\n e.setStyle('-khtml-user-select', 'text');\n }", "select() { this.selected = true; }", "function openTaskEditor() {\n const taskInput = this.parentNode.parentNode.querySelector('input');\n const taskName = this.parentNode.parentNode.querySelector('span');\n\n\n taskName.classList.add('d-none');\n\n taskInput.classList.remove('d-none');\n taskInput.classList.add('active-input');\n taskInput.value = taskName.textContent;\n\n\n window.addEventListener('keydown', editTask.bind(this));\n\n\n}", "enableUserSelection() {\n this[addDivListener]('mousedown', this[userSelectionDragListenerSym]);\n }", "select() {\n\t\tthis.element.select();\n\t}", "select() {\n\t\tthis.element.select();\n\t}", "editWorkAndEducation(){\n\t\tresources.workAndEducationTab().click();\n\t}", "function scribblePoser() {\n\tvar $elt = $(\"#poser_chooser\");\n\t$elt.click();\n}", "function copyFromSlides()\r\n{\r\n\tdoit = true;\r\n\tif (trim(document.getElementById('editArea').value) != \"\")\r\n\t{\r\n\t\tdoit = confirm('Dette vil slette al eksisterende sangtekst, er du sikker?');\r\n\t}\r\n\t\r\n\tif (doit) {\r\n\t\ttext = \"\";\r\n\t\tif (document.getElementById('slideA').value != \"\") text += document.getElementById('slideA').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideB').value != \"\") text += document.getElementById('slideB').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideC').value != \"\") text += document.getElementById('slideC').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideD').value != \"\") text += document.getElementById('slideD').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideE').value != \"\") text += document.getElementById('slideE').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideF').value != \"\") text += document.getElementById('slideF').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideG').value != \"\") text += document.getElementById('slideG').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideH').value != \"\") text += document.getElementById('slideH').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideI').value != \"\") text += document.getElementById('slideI').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideJ').value != \"\") text += document.getElementById('slideJ').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideK').value != \"\") text += document.getElementById('slideK').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideL').value != \"\") text += document.getElementById('slideL').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideM').value != \"\") text += document.getElementById('slideM').value + \"\\n\\n\";\r\n\t\tif (document.getElementById('slideN').value != \"\") text += document.getElementById('slideN').value + \"\\n\\n\";\r\n\r\n\t\tdocument.getElementById('editArea').value = text;\r\n\t\tupdate();\r\n\t}\r\n\t\r\n\t\r\n}", "function chosenSlide(clickedSlide) {\n // change slideIndex num to clickedSlide argument num\n slideIndex = clickedSlide;\n //pass slideIndex new value into displaySlides function\n displaySlides(slideIndex);\n}", "function handleClick(localized) {\n\n if (!element.canEdit() || !localized || !localized.subElem || element.isHiddenBFB) {\n return false;\n }\n\n function onMarkdownChanged( newValue ) {\n setCellValue( newValue, selRow, selCol );\n }\n\n var\n subElem = localized.subElem,\n selRow = subElem.hasOwnProperty( 'tableRow' ) ? subElem.tableRow : -1,\n selCol = subElem.hasOwnProperty( 'tableCol' ) ? subElem.tableCol : -1;\n //cellValue = getCellValue( selRow, selCol );\n\n if ( subElem && subElem.isButton ) {\n if ( ':btnMinus.png' === subElem.imgId || ':btnTrash.png' === subElem.imgId ) {\n return removeDataRow( selRow );\n }\n if ( ':btnPlus.png' === subElem.imgId ) {\n return addNewDataRow( selRow );\n }\n }\n\n if ( !subElem.saved || 0 === subElem.saved.fixed ) {\n // re-render in progress, cannot select\n return;\n }\n\n element.page.form.setSelected( 'fixed', element );\n if ( !element.useMarkdownEditor || element.page.form.isFromToolbox ) {\n // TODO: fix this editor MOJ-\n //element.page.form.valueEditor = Y.dcforms.createTableValueEditor('fixed', element, selRow, selCol, onCellValueChanged);\n element.currentRow = selRow;\n element.currentCol = selCol;\n element.selectedSubElem = subElem;\n element.page.form.valueEditor = Y.dcforms.createMarkdownValueEditor('fixed', element, onMarkdownChanged );\n } else {\n if ( element.page.form.mode !== 'edit' ) {\n /*\n Y.doccirrus.modals.editFormText.show( {\n 'value': cellValue,\n 'showDocTree': true,\n 'onUpdate': element.page.form.raise( 'requestMarkdownModal', element );\n\n } );\n */\n\n element.selRow = selRow;\n element.selCol = selCol;\n element.page.form.raise( 'requestMarkdownModal', element );\n\n }\n\n }\n\n }", "function clickNoteEditor(e){\n self.focus_manager.setFocusObject(self.focus_manager.NOTE_EDITOR);\n }", "function editView(element) {\n var viewIndex = indexInClass(element, document.getElementsByClassName(\"tabContent\")[currentViewingTab])\n var currentView = config.tabs[currentViewingTab].views[viewIndex]\n var type = currentView.class\n var typeName = type.replace(/(Depiction)|(View)/g,\"\");\n createAlert(\n \"Edit \" + typeName,\n \"Customize \" + typeName + \" Content\",\n \"edit\" + type,\n \"alert('sorry no work yet')\"\n )\n // Focus View Position\n document.getElementById(\"previewElementFocuser\").style.display = \"inline\"\n element.classList.add(\"focused\")\n}", "enableObjectSelection() {\n const state = this.canvasStates[this.currentStateIndex];\n const scribbles = this.getFabricObjectsFromJson(state);\n\n this.rehydrateCanvas(scribbles, (scribble) => {\n if (scribble.type === 'i-text') {\n scribble.setControlsVisibility({\n bl: false,\n br: false,\n mb: false,\n ml: false,\n mr: false,\n mt: false,\n tl: false,\n tr: false,\n });\n }\n });\n }" ]
[ "0.66210043", "0.66047364", "0.6248892", "0.62122303", "0.6202468", "0.61109245", "0.6036614", "0.5968051", "0.5952249", "0.5946495", "0.5910861", "0.5908027", "0.590312", "0.5888018", "0.5873248", "0.58478695", "0.5843096", "0.5824763", "0.57590777", "0.5709005", "0.5696458", "0.5691729", "0.5690385", "0.5690385", "0.5690385", "0.5690385", "0.5668655", "0.5658764", "0.5657532", "0.5654088", "0.56530225", "0.56524193", "0.56379026", "0.5636725", "0.56335545", "0.563086", "0.5625097", "0.5623734", "0.5621396", "0.5612191", "0.56028134", "0.55976", "0.5595812", "0.55844104", "0.5584096", "0.55767846", "0.5541951", "0.5541951", "0.5504119", "0.5488236", "0.5478652", "0.5475542", "0.5465276", "0.54607904", "0.54516447", "0.54508144", "0.54482275", "0.5441525", "0.5440311", "0.54341763", "0.54334575", "0.54313904", "0.5428157", "0.54243106", "0.5421274", "0.5415095", "0.5406481", "0.53979033", "0.53943014", "0.5394227", "0.5380834", "0.5369039", "0.53688484", "0.5362555", "0.5351361", "0.53457344", "0.5340964", "0.5339774", "0.5339774", "0.5339774", "0.5339774", "0.5339774", "0.5339774", "0.5339774", "0.5339774", "0.5339774", "0.53259194", "0.53220665", "0.5321202", "0.5315104", "0.53144145", "0.53144145", "0.53074473", "0.53066236", "0.5296885", "0.5288251", "0.5283109", "0.5276898", "0.5265706", "0.5264996" ]
0.59652174
8
triggered by a click on a slide call function to update selected item and unselect it
function unselectElement() { console.log('element unselected!'); if (selectedElement != null) { selectedElement.classList.remove('uiSelected'); selectedElement.classList.add('drag'); // set selectedElement to uneditable, then saving the changed contents selectedElement.setAttribute("contentEditable", false); changeText(selectedElement); } selectedElement = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unSelectItem (i) { this.toggSel(false, i); }", "doUnselectItem() {\n if (this.selected) {\n this.selected.set('selected', false);\n this.set('selected',null);\n }\n }", "function updateSelection(elem) {\n\n jQuery('.flex-item').attr(\"data-is-selected\", \"false\");\n\n jQuery(elem).attr(\"data-is-selected\", \"true\");\n var active = jQuery(elem).attr(\"id\");\n\n updateSortCSS();\n updateSortVisible(active);\n\n return;\n}", "selected(item){\n this._selected = true;\n this._prev = item;\n }", "clickAction(item) {\n this.selected = item.template;\n this.selected.args = [...item.args];\n }", "selectItem (i) { this.toggSel(true, i); }", "toggleSelected() {\n\t\t\tthis._selected = !this._selected;\n\t\t}", "function chooseSlide( event ) {\n var selected = $(this);\n var index = selected.index();\n var offset = index - selected.siblings(\".active\").index();\n\n for(var i = Math.abs(offset); i--; ) {\n var row = LG[ state.get() === \"info\" ? \"Info\" : \"List\" ].getCurrent();\n row[ offset < 0 ? \"previous\" : \"next\" ]( i !== 0 );\n }\n }", "function unselectSelectedAssessment() {\n if (selectedAssessment != null) {\n $(selectedAssessment).removeClass('selected');\n $(selectedAssessment).children('#select-badge').remove();\n selectedAssessment = null;\n $('.bank-item').draggable('disable');\n }\n hideAssessItems();\n\n}", "function selectItem(e) {\n\n for (var i = 0; i < e.currentTarget.parentNode.children.length; i++) {\n e.currentTarget.parentNode.children[i].classList.remove(\"selected\");\n }\n\n e.currentTarget.classList.add(\"selected\");\n console.log($(e.currentTarget).children().eq(1).text());\n updateP1Moves($(e.currentTarget).children().eq(1).text());\n \n}", "function clickItem()\n{\n\tvar item = this.item;\n\n\tif (null == item) item = this.parent.item\n\tif (null == item) item = this.parent.parent.item;\n\n\timage_list.toggleSelect(item.index);\n}", "function toggleSelection(item) {\n var idx = vm.selectedSizes.indexOf(item);\n // is currently selected\n if (idx > -1) {\n vm.selectedSizes.splice(idx, 1);\n }\n // is newly selected\n else {\n vm.selectedSizes.push(item);\n }\n console.log(\"Selected sizes: \" + vm.selectedSizes);\n\n selectionData.setSizes(vm.selectedSizes);\n }", "function update_selection(cellView,paper,graph) {\n deselect_all_elements(paper,graph);\n select_element(cellView,graph);\n}", "activeClick() {\n var $_this = this;\n var action = this.options.dblClick ? 'dblclick' : 'click';\n\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\n $_this.select($(this).data('SELECT-value'));\n });\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\n $_this.deselect($(this).data('SELECT-value'));\n });\n\n }", "function clickedItem(e) {\n\t\tvar $li = $(e.target);\n\t\tvar label = $li.attr('data-label');\n\t\tvar value = $li.attr('data-value');\n\n\t\t// Forward to update function\n\t\tselectUpdateValue(e.data,$li);\n\n\t\tselectClose(e.data);\n\t}", "function remove_selected(){\n\tfoodlst = SELECTED_DAY_ID == \"R\" ? MY_EXPRESS_PLAN : MY_CURRENT_PLAN[SELECTED_DAY_ID] ;\n\tvar j = 0;\n\t$(\".food_list_item\").each(function(){\n\t\tif(this.checked) { foodlst.splice( parseInt(this.getAttribute(\"id_tag\")) - j , 1 ); j++;}\n\t});\n\tdisplay_grocery_list();\n\tselect_day();\n\tupload();\n}", "function thumb_select_delete() {\n\tvar $elem = $('.thumb_current');\n\t\n\tremove_watermark();\n\t$('#container').find('.selected').removeClass('selected');\n\t$elem.addClass('selected');\n\t$elem.addClass('delete_watermark');\n\t$('#container').isotope('reLayout', thumb_adjust_container_position);\n }", "revertSelected() {\n this.getSelectedIds().forEach(id => {\n this.get(id).revert();\n this.get(id).deselect();\n });\n this.render();\n }", "onDeselect() {\n // Do something when a section instance is selected\n }", "onDeselect() {\n // Do something when a section instance is selected\n }", "clearSelection(){\n this.selected = null\n }", "[symbols.itemSelected](item, selected) {\n if (super[symbols.itemSelected]) { super[symbols.itemSelected](item, selected); }\n item.classList.toggle('selected', selected);\n }", "function deselect(e) {\n $('.pop').slideFadeToggle(function() {\n e.removeClass('selected');\n }); \n }", "function setButton(_id,_v){ // update slider\n myselect = $(\"#\"+_id);\n myselect.val(_v);\n myselect.slider('refresh');\n}", "set selectedItem(aItem) {\n // A predicate is allowed to select a specific item.\n // If no item is matched, then the current selection is removed.\n if (typeof aItem == \"function\") {\n aItem = this.getItemForPredicate(aItem);\n }\n\n // A falsy item is allowed to invalidate the current selection.\n let targetElement = aItem ? aItem._target : null;\n let prevElement = this._widget.selectedItem;\n\n // Make sure the selected item's target element is focused and visible.\n if (this.autoFocusOnSelection && targetElement) {\n targetElement.focus();\n }\n if (this.maintainSelectionVisible && targetElement) {\n // Some methods are optional. See the WidgetMethods object documentation\n // for a comprehensive list.\n if (\"ensureElementIsVisible\" in this._widget) {\n this._widget.ensureElementIsVisible(targetElement);\n }\n }\n\n // Prevent selecting the same item again and avoid dispatching\n // a redundant selection event, so return early.\n if (targetElement != prevElement) {\n this._widget.selectedItem = targetElement;\n let dispTarget = targetElement || prevElement;\n let dispName = this.suppressSelectionEvents ? \"suppressed-select\" : \"select\";\n ViewHelpers.dispatchEvent(dispTarget, dispName, aItem);\n }\n }", "function setCurrentItem(item)\n{\n selectedObject = item;\n}", "function selectSlide() {\n let selectedElement = selectorSlide.value;\n let slideID = parseInt(selectedElement, 10);\n\n goToSlide(slideID);\n}", "function removeSelection(item) {\n //reset this item's grabbed state\n item.setAttribute('aria-grabbed', 'false');\n\n //then find and remove this item from the existing items array\n for (var len = selections.items.length, i = 0; i < len; i++) {\n if (selections.items[i] == item) {\n selections.items.splice(i, 1);\n break;\n }\n }\n}", "function deselect(e) {\n $('.pop').slideFadeToggle(function() {\n e.removeClass('selected');\n });\n}", "function moveSelected() {\n viewModel.waitRelease(true)\n viewModel.moveItems = viewModel.selectedItems().slice()\n viewModel.itemList.removeAll(viewModel.moveItems)\n viewModel.selectedItems.removeAll()\n viewModel.moveParent = viewModel.parent()\n}", "function chosenSlide(clickedSlide) {\n // change slideIndex num to clickedSlide argument num\n slideIndex = clickedSlide;\n //pass slideIndex new value into displaySlides function\n displaySlides(slideIndex);\n}", "function selectItem(event) {\n if (event.target.checked) {\n //adding\n for (let i = 0; i < allcat.length; i++) {\n for (let j = 0; j < allcat[i].length; j++) {\n if (allcat[i][j].id == event.target.id) {\n selected.push(allcat[i][j]);\n break;\n }\n }\n }\n } else {\n //deleting\n let delpos = -1;\n for (let i = 0; i < selected.length; i++) {\n if (selected[i].id == event.target.id) {\n delpos = i;\n break;\n }\n }\n if (delpos >= 0) {\n selected.splice(delpos, 1);\n }\n }\n diagram();\n}", "resetSelection () {\n this.currentSelection = null\n }", "function deselectDropdownItem (item) {\r\n\t\t \titem.removeClass(\"input-img-selected-item\");\r\n\t\t selected_dropdown_item = null;\r\n\t\t }", "function deselect() {\n if(!selectedElement) return;\n selectedElement.classList.remove('editor-selected');\n document.getElementById('current-element-container').innerHTML = '';\n document.getElementById('breadcrumbs').innerHTML = '';\n selectedElement = null;\n resetSliders();\n}", "function unselectByClick() {\n const points = this.getSelectedPoints();\n\n if (points.length > 0) {\n Highcharts.each(points, function(point) {\n if (selectedFlag.get() !== null) {\n point.update({\n color: flagsHash[selectedFlag.get()].color,\n name: flagsHash[selectedFlag.get()].val\n }, true);\n }\n point.select(false);\n });\n }\n}", "triggerSelected() {\n let cachedValues = this.cachedValues\n let self = this\n let values = new Array()\n this.iterateChecks((index, line, box, span) => {\n if (box.prop(\"checked\")) {\n // Update the \"selected\" property\n cachedValues[index][1] = true\n values.push(cachedValues[index])\n }\n })\n this.model.SetSelected(values)\n super.triggerSelected()\n }", "_active() {\n this._sequence = [];\n this.tag(\"Items\").childList.clear();\n\n this._setState(\"Buttons\");\n }", "select() { this.selected = true; }", "select(id) { this._updateActiveId(id, false); }", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function selected(d){\n\tcount = d;\n\tupdateImage();\n\tdots();\n}", "function choiceMouseUp (d, i) {\n var xIndex = cf.length() // index for use in x scales below\n var note = d.val\n if (d3.select(this).attr('selected') === 'true') {\n resetYTextSize(note) // un-highlight y-axis note name\n d3.select(this)\n .transition()\n .duration(250)\n .call(choiceActivePosition)\n .each('end', function () {\n d3.select(this)\n .attr('animating', 'no')\n })\n }\n }", "function deselect(e) {\n $('.pop').slideFadeToggle(function() {\n try {\n e.removeClass('selected'); \n } catch (exception) {\n e.classList.remove('selected');\n }\n \n });\n}", "selectItem(listItemsId) {\n this.setState({ currentList: listItemsId } );\n }", "switchSelected(index) {\n\n if (typeof index == 'number') {\n this.current = index;\n return;\n }\n\n let nextInd = travelArray(this.items, this.current);\n\n if (this.items[nextInd].hidden)\n nextInd = travelArray(this.items, nextInd)\n\n this.current = nextInd;\n }", "handleHighlightClick() {\n const { onNewSelection } = this.props;\n const { selection } = this.state;\n onNewSelection(selection);\n this.setState({ selection: null });\n }", "function selectChannel() {\n //remove selected class\n $(\"#channels li\").removeClass(\"selected\");\n $(event.currentTarget).addClass(\"selected\");\n}", "function unselectPreviousFeaturesPointClick() {\n var i;\n for(i=0; i< selectedFeatures.length; i++) {\n selectedFeatures[i].setStyle(null);\n }\n selectedFeatures = [];\n\n }", "function clearSelected() {\n var selected = getSelected();\n while (selected.length > 0) removeFromSelected(selected[0]);\n document.getElementById(\"eMalButtons\").classList.remove(\"emActive\");\n}", "function buttonClicked(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "select() {\n this._stepper.selected = this;\n }", "selectedClickListener(d, i){\n var self = this;\n // ID Is selected from the the element tag field\n var id = self.selectedExtractID(d).split(\" \").join(\"-\");\n self.boxZoom(self.path.bounds(d), self.path.centroid(d), 20);\n self.applyStateSelection(id);\n self.ui.setDistrictInfo(id);\n self.ui.addLabel(); \n self.ui.retrievePoliticianImages(id);\n }", "function doOnSlideChanged() {\r\n\t\t\tvar index = $navLi.index($(this));\r\n\t\t\tif(currentIndex === index) {\r\n\t\t\t\t$(this).addClass(o.selectedClass);\r\n\t\t\t} else {\r\n\t\t\t\t$(this).removeClass(o.selectedClass);\r\n\t\t\t}\r\n\t\t}", "function selectDropdownItem (item) {\r\n\t\t if(item) {\r\n\t\t \tif(selected_dropdown_item) {\r\n\t\t deselectDropdownItem($(selected_dropdown_item));\r\n\t\t }\r\n \t\titem.addClass(\"input-img-selected-item\");\r\n\t\t selected_dropdown_item = item;\r\n\t\t }\r\n\t\t }", "select () {\n this.selected = true;\n }", "function SelectionChange() { }", "function SelectionChange() { }", "toggle() {\n this.selected = !this.selected;\n }", "toggle() {\n this.selected = !this.selected;\n }", "function selectItem(elt, select) {\n if (select != null) {\n if (select === true) {\n elt.find(\"input\")[0].checked = true;\n if (elt.hasClass(\"selected\") === false)\n elt.addClass(\"selected\");\n }\n else {\n elt.find(\"input\")[0].checked = false;\n if (elt.hasClass(\"selected\"))\n elt.removeClass(\"selected\");\n }\n }\n else // toggle\n select(elt, ! elt.find(\"input\")[0].checked);\n}", "activeSelect(e,itemIndex) {\n this.state.active === itemIndex ? \n this.setState({active: null}) : \n this.setState({active: itemIndex})\n }", "removeSelected() {\n\n Model.clearSelected(this.currentCartItems);\n }", "clearSelection() {\n this.currentlySelected = '';\n }", "unselect(item) {\n const that = this;\n\n if (!that.$.listBox) {\n return;\n }\n\n that.$.listBox.unselect(item);\n }", "function UISelection(){\n\n }", "_clearSelection(eventPrevented) {\n const that = this;\n\n if (that._selectedCells) {\n that._selectedCells.map(cell => {\n that._setCellState(cell, 'selected', false);\n });\n }\n\n that.selectedDates = [];\n that._selectedCells = [];\n\n if (that.selectionMode === 'many') {\n const months = that.$.monthsContainer.children;\n\n for (let m = 0; m < months.length; m++) {\n that._getMonthCells(months[m]).map(cell => {\n that._setCellState(cell, 'hover', false);\n });\n }\n }\n\n that._refreshFooter();\n\n //Update the hidden input\n that.$.hiddenInput.value = that.selectedDates.toString();\n\n if (!eventPrevented) {\n that.$.fireEvent('change', {\n 'value': []\n });\n }\n\n that._refreshTitle();\n }", "function deselect(e) {\n\t$('.pop').slideFadeToggle(function() {\n\t\te.removeClass('selected');\n\t});\n}", "function clearSelection(){\n pieceSelected = false;\n selectedPieceArray = [];\n}", "function handleButtonClick(e){\n\tdeselectAll();\n\tmarkAsSelected(e);\n\tsetPosibleMoves();\n}", "function deselect() {\n if (!_selected || _element === undefined || !_visible || _animating) {\n return;\n }\n _selected = false;\n\n if (_fancyEffects) {\n TweenLite.to(_element, 0.5, {\n rotationY: 0,\n scale: 1,\n ease: Back.easeOut\n });\n TweenLite.to(_imageEl, 0.5, {\n alpha: _imageAlphaTarget,\n scale: 1,\n ease: Circ.easeOut\n });\n } else {\n TweenLite.to(_element, 0.5, {scale: 1, ease: Back.easeOut});\n TweenLite.to(_imageEl, 0.5, {\n alpha: _imageAlphaTarget,\n scale: 1,\n ease: Circ.easeOut\n });\n }\n\n }", "function cancelSelected(id,id2){\n scope.plan.current[id].isSelected = false;\n scope.plan.selected.splice(id2,1);\n }", "function rightSelect() {\n vm.selectedIndex = (vm.selectedIndex + 1) % vm.duplexOptionsArray.length;\n updateSeletecItem();\n // show how to pass params to parentFunc\n // @author zhaxi\n vm.trigger({'itemClass': vm.optionKeys[0], 'selectedItem': vm.duplexOptionsArray[vm.selectedIndex]});\n\n }", "deselectCurrentPiece() {\n if (this.selectedPiece != null) {\n this.selectedPiece.selected = false;\n this.selectedPiece.swapText();\n this.selectedPiece = null;\n }\n }", "function deleteSelection() {\n tempSelectedDates.forEach(function (e) {\n dateRangeChart.dispatchAction({\n type: 'downplay',\n dataIndex: e[1],\n seriesIndex: e[2]\n });\n });\n tempSelectedDates = new Set([]);\n //update the selection date list\n var $ul = createSelectionUl(tempSelectedDates);\n $(\"#daysSelectedList\").empty().append($ul);\n }", "selectItem(index) {\n\t\tthis.checklistItem = this.company.checklist[index];\n\t\tthis.removeItem(index);\n\t}", "selectItemEvent(event) {\n\n var name = event.target.getAttribute('data-name')\n var boxid = event.target.getAttribute('id')\n var client = event.data.client\n var items = client.items\n var index = items.selected.indexOf(name);\n\n // If selected, we want to unselect it\n if ($(event.target).hasClass(client.selectedClass)) {\n $(event.target).removeClass(client.selectedClass);\n $(event.target).attr(\"style\", \"\");\n client.items.selected.splice(index, 1);\n\n // If unselected, we want to select it\n } else {\n $(event.target).attr(\"style\", \"background:\" + client.selectedColor);\n $(event.target).addClass(client.selectedClass);\n client.items.selected.push(name)\n }\n client.bingoCheck()\n }", "onSelect() {\n // Do something when a section instance is selected\n }", "onSelect() {\n // Do something when a section instance is selected\n }", "onUpKey() {\n\t\tthis.moveSelected(-1);\n\t}", "function _destroy() {\n selected = null;\n}", "function _destroy() {\n selected = null;\n}", "function _destroy() {\n selected = null;\n}", "onClick(item) {\n const selected = this.state.selected.slice()\n const { key } = item\n const arrIndex = selected.indexOf(key)\n\n if (arrIndex === -1) {\n selected.push(key)\n } else {\n selected.splice(arrIndex, 1)\n }\n\n this.setState({\n selected\n }, () => {\n this.props.onSelect(item)\n })\n }", "selectItem() {\n if (this.selectedItem !== this.item.Name) {\n const selectEvent = new CustomEvent(\"buttonclick\", {\n bubbles: true,\n detail: this.item\n });\n this.dispatchEvent(selectEvent);\n }\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "_selectionHandler(activeProject) {\n for (projectElement of this.projects) {\n projectElement.markUnchecked();\n }\n activeProject.markChecked();\n this.emitter.emit('did-change-path-selection', activeProject.path);\n }", "clearSelection() {\n if (this._selected >= 0) {\n const item = this.items[this._selected];\n const tag = Array.from(this.container.children).filter(child => child.classList.contains('tag'))[this._selected];\n\n if (this.emit('before.unselect', {\n item,\n tag\n })) {\n if (tag) {\n tag.classList.remove('is-selected');\n }\n\n this._selected = -1;\n\n this.emit('after.unselect', {\n item,\n tag\n });\n }\n }\n\n return this;\n }", "function toggleSelection() {\r\n // we want to update our UI to make it look like\r\n //we're making a selection\r\n //debugger;\r\n // toggle CSS class to the element with JavaScript\r\n this.classList.toggle(\"selected\");\r\n console.log(this.id);\r\n }", "function unselectElem( svgElem ) {\n if ( typeof svgElem === 'object' && ! ( svgElem instanceof jQuery ) )\n svgElem = $(svgElem);\n if ( typeof svgElem === 'undefined' ) {\n svgElem = $(svgRoot).find('.selected');\n if ( svgElem.length === 0 )\n return;\n }\n else if( ! svgElem.hasClass('selected') )\n return;\n svgElem.removeClass('selected');\n //for ( var n=0; n<self.cfg.onUnselect.length; n++ )\n // svgElem.each( function () { self.cfg.onUnselect[n](this); } );\n svgElem.each( function () {\n for ( var n=0; n<self.cfg.onUnselect.length; n++ )\n self.cfg.onUnselect[n](this);\n } );\n }", "function handleToggleSelection(e) {\n\t\tif (e.target.classList.contains(\"canva\")) {\n\t\t\tstore.removeSelection();\n\t\t}\n\t}", "function slideDropdownBehavior() {\n showSlide(slideDropdown.selectedIndex);\n}", "function toggleSelection() {\n\t\t//we want uodate our UI to look like we are making a selection\n\t\t//debugger;\n\t\t//toggle a css class to the element with JavaScript\n\t\tthis.classList.toggle(\"selected\");\n\t\tconsole.log(this.id);\n\t}", "select(item) {\n const that = this;\n\n if (typeof item === 'string') {\n item = that.getItem(item);\n if (!item) {\n return;\n }\n }\n if (typeof item === 'number') {\n item = that.getItem(item);\n if (!item) {\n return;\n }\n }\n\n if (item.grouped || item.readonly) {\n return;\n }\n\n if (that.selectionMode === 'none') {\n that.selectedIndexes = [];\n that.selectedValues = [];\n return;\n }\n\n if (!that._focusedItem !== item && that.selectionMode !== 'none') {\n if (that._focusedItem) {\n that._focusedItem._focused = false;\n }\n\n that._focusedItem = item;\n item._focused = true;\n }\n\n switch (that.selectionMode) {\n case 'one':\n if (that.selectedIndexes.length === 1 && that.selectedIndexes[0] === that._indexOf(item)) {\n return false;\n }\n\n that._previouslySelectedIndexes = that.selectedIndexes;\n\n if (that.selectedIndexes.length >= 1) {\n that.clearSelection();\n }\n\n that._select(item);\n delete that._previouslySelectedIndexes;\n return true;\n case 'zeroOrOne':\n if (that.selectedIndexes.length === 1 && that.selectedIndexes[0] === that._indexOf(item)) {\n that.unselect(item);\n return true;\n }\n\n that._previouslySelectedIndexes = that.selectedIndexes;\n\n if (that.selectedIndexes.length >= 1) {\n that.clearSelection();\n }\n\n that._select(item);\n delete that._previouslySelectedIndexes;\n return true;\n case 'radioButton':\n that._previouslySelectedIndexes = that.selectedIndexes;\n\n if (that.$.itemsInnerContainer.querySelectorAll('jqx-list-items-group').length > 0) {\n const group = item.parentNode;\n\n\n if (!item.selected) {\n for (let index in group.children) {\n const item = group.children[index];\n\n if (item.selected) {\n that.unselect(item);\n }\n }\n\n that._select(item);\n }\n\n delete that._previouslySelectedIndexes;\n return true;\n }\n else if (that.isVirtualized && that._groups.length > 0) {\n const group = item.group;\n\n if (!item.selected) {\n for (let index in group.items) {\n const item = group.items[index];\n\n if (item.selected) {\n that.unselect(item);\n }\n }\n\n that._select(item);\n }\n\n delete that._previouslySelectedIndexes;\n return true;\n }\n\n\n if (!item.selected) {\n if (that.selectedIndexes.length >= 1) {\n that.clearSelection();\n }\n\n that._select(item);\n }\n\n delete that._previouslySelectedIndexes;\n return true;\n case 'oneOrMany':\n if (!item.selected) {\n that._select(item);\n }\n else if (that.selectedIndexes.length > 1) {\n that.unselect(item);\n }\n return true;\n case 'zeroOrMany':\n case 'checkBox':\n if (!item.selected) {\n that._select(item);\n }\n else {\n that.unselect(item);\n }\n return true;\n case 'oneOrManyExtended': {\n const selectedValues = that.selectedValues;\n\n if (that._keysPressed['Control']) {\n if (that.selectedIndexes.length > 1) {\n if (item.selected) {\n that.unselect(item);\n that._focus(that._items[that.selectedIndexes[0]]);\n }\n else {\n that._select(item);\n }\n }\n else {\n that._select(item);\n }\n return true;\n }\n\n if (that._keysPressed['Shift']) {\n const selectedItem = that._items[that.selectedIndexes[0]];\n let index;\n\n that.clearSelection();\n\n const preventEvent = selectedValues.indexOf(selectedItem.value) >= 0 || selectedItem.selected;\n\n that._select(selectedItem, preventEvent);\n\n if (that._indexOf(selectedItem) > that._indexOf(item)) {\n index = that._indexOf(selectedItem) - 1;\n while (index >= that._indexOf(item)) {\n const item = that._items[index];\n const preventEvent = selectedValues.indexOf(item.value) >= 0 || item.selected;\n\n that._select(item, preventEvent);\n index--;\n }\n }\n else {\n index = that._indexOf(selectedItem) + 1;\n while (index <= that._indexOf(item)) {\n const item = that._items[index];\n const preventEvent = selectedValues.indexOf(item.value) >= 0 || item.selected;\n\n that._select(item, preventEvent);\n index++;\n }\n }\n\n const unselectedItems = [];\n\n for (let i = 0; i < selectedValues.length; i++) {\n unselectedItems.push(that.getItem(selectedValues[i]));\n }\n\n if (unselectedItems.length > 0 && !that._propertyChanging) {\n let selectedItems = [];\n\n for (let i = 0; i < that.selectedValues.length; i++) {\n const previousSelectedValue = that.selectedValues[i];\n\n if (selectedValues.indexOf(previousSelectedValue) < 0) {\n selectedItems.push(that.getItem(previousSelectedValue));\n }\n }\n\n that.$.fireEvent('change', {\n 'addedItems': selectedItems,\n 'removedItems': unselectedItems,\n 'selected': item.selected,\n 'disabled': item.disabled,\n 'index': that._indexOf(item),\n 'label': item.label,\n 'value': item.value\n });\n }\n\n return true;\n }\n\n for (let i = 0; i < selectedValues.length; i++) {\n const value = selectedValues[i];\n const selectedItem = that.getItem(value)\n\n if (item !== selectedItem) {\n that.unselect(selectedItem);\n }\n }\n\n that.clearSelection();\n that._select(item, selectedValues.indexOf(item.value) >= 0);\n return true;\n\n }\n }\n\n return false;\n }", "function unselect(){\r\n answerEls.forEach((answerEl)=>{\r\n answerEl.checked = false\r\n })\r\n}", "function onSelect()\n\t{\n\t\tunit.div.toggleClass(\"selected\", unit.movePoints > 0);\n\t}" ]
[ "0.6982529", "0.6892198", "0.68837166", "0.68206745", "0.6402647", "0.6366176", "0.6349188", "0.6330962", "0.63260204", "0.6303552", "0.62812376", "0.62789905", "0.6269649", "0.621414", "0.62036866", "0.6192106", "0.61791366", "0.61774963", "0.61719656", "0.61719656", "0.616168", "0.6134416", "0.6127715", "0.6115991", "0.60927117", "0.608345", "0.6074453", "0.6055972", "0.60498464", "0.6049308", "0.6043654", "0.6029583", "0.60216635", "0.6021091", "0.6014808", "0.601249", "0.60059696", "0.59901625", "0.59850866", "0.5983465", "0.59742576", "0.59742576", "0.59742576", "0.59742576", "0.59698725", "0.59652025", "0.5959868", "0.5959839", "0.5958149", "0.5943309", "0.59151876", "0.59118634", "0.5909916", "0.5905197", "0.59010637", "0.5897114", "0.5896134", "0.5892154", "0.58896947", "0.5889652", "0.5889652", "0.5889635", "0.5889635", "0.58818114", "0.58686733", "0.5863209", "0.5860886", "0.5860617", "0.586035", "0.5853995", "0.5850528", "0.5848428", "0.5842144", "0.5841131", "0.58288753", "0.5826112", "0.58226377", "0.5819569", "0.5819345", "0.5815231", "0.5811666", "0.5811666", "0.5807288", "0.58044404", "0.58044404", "0.58044404", "0.5803866", "0.5796582", "0.5793732", "0.5793732", "0.57899123", "0.5786667", "0.5784559", "0.57845074", "0.5777471", "0.57714945", "0.5771194", "0.5763803", "0.57635057", "0.5760004" ]
0.580751
82
triggered by elementdimension number picker ajax request to update dimensions in databse
function editElementDimensions() { console.log("edit element dimensions"); var elementId = $('#elementId').value; console.log(elementId); var element = $('#' + elementId); console.log(element); element.style.width = $('#widthPicker').value + "px"; console.log(element); var data = {}; data.action = "editElementDimensions"; data.id = element.dataset.id; data.width = element.offsetWidth; data.handler = "slide"; var url = "ajax.php"; Ajax.post(data, url, function (json) { if (json.error) { $('#activeSlideContainer').innerHTML = json.error; } else { refreshEditorSlide(json.id); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateDimensionHandler() {\n\n // Get the current NAtural Unit\n var unit = new NaturalUnit();\n\n var id;\n\n id = $(\"#NaturalUnitList\").find('option:selected').val();\n\n unit = getReferenceUnit(id);\n if (unit.ID == -1) {\n // this is a new NAtural Unit and needs to be added to the collection\n }\n\n // get the current Dimension\n var dim = new Dimension();\n\n var id = $(this).val();\n // Check to see if the dimension is already in the Unit collection\n dim = getDimension(unit, id);\n if (dim.ID != undefined) {\n // The dimension exists so just update it\n dim.isActive = $(this).prop('checked');\n }\n else {\n // Search for the currnt dimesnion in the referece set\n dim = getReferenceDimension(id, currentOrg.Dimensions);\n dim.isActive = $(this).prop('checked');\n unit.Dimensions.push(dim);\n }\n // Set the dimensions dirty flag since at least one dimension has been edited\n dimensionsIsDirty = true;\n\n }", "function addDimension(element_id) {\n\tvar idArray = []\n\tformID.push([]);\n\tidArray[0] = formID.length - 1;\n\t$.ajax({\n\t\tdataType: \"json\",\n\t\ttype: \"post\",\n\t\turl: '/newelement',\n\t\tdata: ({\n\t\t\t'type': 'dimension',\n\t\t\t'id_array': String(idArray),\n\t\t\t'element_id': String(element_id),\n\t\t\t'input_value': $( \"input#\" + element_id ).val(),\n\t\t}),\n\t\tsuccess: writeElement,\n\t});\n}", "update() {\n return this.saveDimensions().process();\n }", "function onDimensionChanged(selectElement) {\n var selectedVal = selectElement.val();\n var dimType = typesInfo[dimTypes[selectedVal]];\n var fieldset = selectElement.closest(\"fieldset\");\n var higherValue = fieldset.find(\".dim-range-high\").parent().find('label');\n var lowerValue = fieldset.find(\".dim-range-low\").parent().find('label');\n a = fieldset\n if (dimType == 'unit_progress' || dimType == 'lesson_progress') {\n setProgressDimensionRange(fieldset);\n return;\n }\n setNonProgressDimensionRage(fieldset);\n if (dimType == 'unit_visit') {\n higherValue.text('Maximum number of visits to the page');\n lowerValue.text('Minimum number of visits to the page');\n } else {\n higherValue.text('Higher Score');\n lowerValue.text('Lower Score');\n }\n}", "function updateAll(){refreshSliderDimensions();ngModelRender();}", "function unitSelectHandler() {\n var unit = new NaturalUnit();\n\n var ID;\n\n // Get ID of the currently selected dimension\n ID = $(\"#NaturalUnitList\").find('option:selected').val();\n\n // Check to see if this is a current Dimension or a new dimension\n if (ID > 0) {\n // Get the current dimension ID value\n unit = getReferenceUnit(ID);\n\n\n // enable the dimension collection since this is an existing unit\n $('#DimensionRow :input').prop('disabled', false);\n $('#DimensionRow').css({ 'pointer-events': 'all' });\n // Set the active values\n setActiveNaturalUnit(unit);\n setEditMode(true,true);\n $(\"#btnUpdate\").show();\n $(\"#btnSave\").hide();\n // Update the current navigatino controls\n }\n else if (ID == -1) {\n // Process the new unit reuqest\n clearUnitDetails();\n setEditMode(true,true);\n\n $('#activeFlag').prop('checked', true);\n // Update the current navigatino controls\n $(\"#btnUpdate\").hide();\n $(\"#btnSave\").show();\n }\n else { // PRocess the selection of no Unit\n clearUnitDetails();\n setEditMode(false,false);\n // Disable the dimension collection since you cannot set this on new units\n $('#DimensionRow :input').prop('disabled', true);\n $('#DimensionRow').css({ 'pointer-events': 'none' });\n// $(\"#DimensionRow\").hide();\n // Update the current navigatino controls\n $(\"#btnUpdate\").hide();\n $(\"#btnSave\").show();\n // $(\"#btnSave\").click(saveDimensionHandler);\n }\n // Enable the save button\n $(\"#btnSave\").prop('disabled', false);\n }", "function editDimensions(formdata, callback) {\n var pubKey = formdata.pubKey;\n var oldPubKey = formdata.oldPubKey;\n var hashedPubKey = keccak_256(pubKey);\n var oldHashedPubKey = keccak_256(oldPubKey);\n var ownedAssets;\n var controlledAssets;\n var delegatedAssets;\n //var dimCtrlAddress = formdata.dimCtrlAddr;\n\n\n console.log(\"Edit dimensions JSON\");\n\n theNotifier.GetAllControlledDimensions(oldPubKey, function (result) {\n if (result) {\n controlledAssets = result.data;\n theNotifier.GetAllDelegatedDimensions(oldPubKey, function (result) {\n if (result) {\n delegatedAssets = result.data;\n //looping vars\n var max = Math.max(delegatedAssets.length, controlledAssets.length);\n var total = controlledAssets.length + delegatedAssets.length;\n var t = 0;\n if (total > 0) {\n //get the owner for each asset, get the asset, edit the asset, under owner name call writeAllAssets()\n for (var x = 0; x < max; x++) {\n\n if (x < controlledAssets.length && controlledAssets[x] != 'undefined') {\n //var controllerkey = controlledAssets[x].pubKey;\n var fileNameC = controlledAssets[x];\n var flag = 1;\n theNotifier.GetDimension(oldHashedPubKey, fileNameC, flag, function (results) {\n if (results) {\n flag = 0;\n theNotifier.GetDimension(results.dimension.owners[0], fileNameC, flag, function (results2) {\n if (results2) {\n var asset = results2;\n console.log(\"Controlled Dimension: \" + JSON.stringify(asset));\n if (asset.dimension.owners.indexOf(oldHashedPubKey) >= 0 && asset.dimension.controllers.indexOf(oldHashedPubKey) >= 0) {\n t++;\n if (x >= max - 1 && t == total) { callback(true) }\n }\n else {\n var ownerDimCtrlContract = contractMgr.newContractFactory(dimCtrlAbi).at(asset.dimension.dimensionCtrlAddr);\n ownerDimCtrlContract.replaceTokenOwnerController(oldHashedPubKey, hashedPubKey, function (error, result) {\n if (result) { console.log(\"replacedTokenOwnerController: \" + result) }\n else { console.log(\"errorTokenOwnerController: \" + error) }\n })\n ownerDimCtrlContract.replaceTokenDelegatee(oldHashedPubKey, hashedPubKey, function (error, result) { })\n if (asset.dimension.pubKey == oldPubKey) { asset.dimension.pubKey = pubKey }\n var indexO = asset.dimension.owners.indexOf(oldHashedPubKey);\n var indexC = asset.dimension.controllers.indexOf(oldHashedPubKey);\n var indexDC = asset.dimension.dim_controllers_keys.indexOf(oldHashedPubKey);\n if (indexO != -1) { asset.dimension.owners[indexO] = hashedPubKey }\n if (indexC != -1) { asset.dimension.controllers[indexC] = hashedPubKey }\n if (indexDC != -1) { asset.dimension.controllers[indexDC] = hashedPubKey }\n for (var y = 0; y < asset.dimension.delegations.length; y++) {\n if (asset.dimension.delegations[y].delegatee == oldHashedPubKey) { asset.dimension.delegations[y].delegatee = hashedPubKey }\n if (asset.dimension.delegations[y].owner == oldHashedPubKey) { asset.dimension.delegations[y].owner = hashedPubKey }\n }\n writeAllDimensions(asset, function () {\n t++;\n if (x >= max - 1 && t == total) { callback(true) }\n })\n }//else\n }\n })\n }\n })\n }//end controlled\n if (x < delegatedAssets.length && delegatedAssets[x] != 'undefined') {\n var fileName = delegatedAssets[x];\n var flag = 2;\n console.log(\"filename: \" + fileName);\n theNotifier.GetDimension(oldHashedPubKey, fileName, flag, function (results) {\n if (results) {\n console.log(result)\n flag = 0;\n theNotifier.GetDimension(results.dimension.owners[0], fileName, flag, function (results2) {\n if (results2) {\n var asset = results2;\n //var dimCtrlAddress = asset.dimCtrlAddr;//may need to change\n var ownerDimCtrlContract = contractMgr.newContractFactory(dimCtrlAbi).at(asset.dimension.dimensionCtrlAddr);\n ownerDimCtrlContract.replaceTokenDelegatee(oldHashedPubKey, hashedPubKey, function (error, result) {\n if (result) { console.log(\"replacedTokenDelegatee: \" + result) }\n else { console.log(\"errorTokenDelegatee: \" + error) }\n })\n if (asset.dimension.pubKey == oldPubKey) { asset.pubKey = pubKey }\n for (var y = 0; y < asset.dimension.delegations.length; y++) {\n if (asset.dimension.delegations[y].delegatee == oldHashedPubKey) { asset.dimension.delegations[y].delegatee = hashedPubKey }\n }\n console.log(\"asset: \\n\" + asset)\n //write dimension to all owners controllers and delegatees\n writeAllDimensions(asset, function () {\n t++;\n if (x >= max - 1 && t == total) { callback(true) }\n })\n }\n })\n }\n })\n }//end delegated\n\n }//for loop\n } else { callback(true) }\n\n }\n\n })\n }\n\n })\n\n\n }", "function updateUnitDimensions(ID) {\n var targetUrl;\n var unit;\n\n unit = getCurrentNaturalUnit(ID, currentOrg.NaturalUnits);\n\n // Loop over the Natural Units for the current project\n// var unitIndex = 0;\n // Check to see if the dimensions have been updated\n if (dimensionsIsDirty) {\n // Loop over the dimensions for the current Natural Unit\n var dimIndex = 0;\n while (dimIndex < unit.Dimensions.length) {\n var unitDim = new UnitDimension();\n unitDim.OrganizationID = currentOrg.ID;\n unitDim.UnitID = ID;\n unitDim.DimensionID = unit.Dimensions[dimIndex].ID;\n unitDim.isActive = unit.Dimensions[dimIndex].isActive;\n // unitDim.isActive = 1;\n unitDim.UserID = c_UserID;\n\n targetUrl = UnitDimensionUrl + \"/\" + unitDim.OrganizationID;\n // Call the AJAX PUT method\n deferredArray.push($.ajax({\n url: targetUrl,\n type: \"PUT\",\n dataType: \"json\",\n data: unitDim,\n }).done(function (data, txtStatus, jqXHR) {\n // alert(\"Insert Success\");\n }).fail(function (xhr, textStatus, errorThrown) {\n alert(\"Insert Error\");\n }));\n\n dimIndex++;\n }\n// unitIndex++;\n }\n\n\n $.when.apply(this, deferredArray).then(function () {\n // clear the dimensions dirty flag since they have been updated\n dimensionsIsDirty = false;\n refreshForm();\n });\n }", "function onchange()\r\n{\r\n window.updateHeatmap();\r\n window.updateBar();\r\n window.updateLine();\r\n}", "function refreshMasterDimensions(data) {\n var index = 0;\n\n // reset the Dimensions array\n currentOrg.Dimensions.length = 0;\n\n // Empty the current contents of the list box\n $(\"#checkboxCollection\").empty();\n\n while (index < data.length) {\n // Add a list item for the organization.\n var dim = new Dimension();\n dim.ID = data[index].ID;\n dim.Name = data[index].Name;\n dim.Description = data[index].Description;\n dim.isActive = data[index].isActive;\n // Add the current dimension to the reference array for the current organization\n currentOrg.Dimensions.push(dim);\n // Only add dimensions which are active\n if (data[index].isActive) {\n $(\"<input type='checkbox' id='dim\" + data[index].ID + \"' value='\" + data[index].ID + \"'/>\" + data[index].Name + \"<br />\").on(\"click\", updateDimensionHandler).appendTo($('#checkboxCollection'));\n }\n index++;\n }\n\n// updateReady.resolve();\n }", "_onChangeSize() {\n\t\t\t\tthis.collection.changeSize(this.model.get('width'), this.model.get('height'));\n\t\t\t\tthis._saveSize(this.model.get('width'), this.model.get('height'));\n\t\t\t\tthis.render();\n\t\t\t}", "function onResize(){\n\t// Update new dimensions\n\tvar width = $(window).width();\n\tvar height = $(window).height();\n\t\n\t// Dispatch a resize event to all the elements\n\tdispatch.resize(width, height);\n\t\n\t// If a region was selected, updates also each chart\n//\tif(regionSelected.name)\n//\t\tdispatch.regionChange();\n\t\n\t//TODO: completare\n}", "function saveNewDimensions(ID) {\n var targetUrl;\n var unit;\n\n unit = getCurrentNaturalUnit(ID, currentOrg.NaturalUnits);\n\n // Check to see if the dimensions have been updated\n if (dimensionsIsDirty) {\n // Loop over the dimensions for the current Natural Unit\n var dimIndex = 0;\n while (dimIndex < currentOrg.Dimensions.length) {\n var unitDim = new UnitDimension();\n unitDim.OrganizationID = currentOrg.ID;\n unitDim.UnitID = ID;\n unitDim.DimensionID = currentOrg.Dimensions[dimIndex].ID;\n unitDim.isActive = $(\"#dim\" + currentOrg.Dimensions[dimIndex].ID).prop('checked');\n // unitDim.isActive = 1;\n unitDim.UserID = c_UserID;\n\n targetUrl = UnitDimensionUrl + \"/\" + unitDim.OrganizationID;\n // Call the AJAX PUT method\n deferredArray.push($.ajax({\n url: targetUrl,\n type: \"PUT\",\n dataType: \"json\",\n data: unitDim,\n }).done(function (data, txtStatus, jqXHR) {\n // alert(\"Insert Success\");\n }).fail(function (xhr, textStatus, errorThrown) {\n alert(\"UnitDim Insert Error\");\n }));\n\n dimIndex++;\n }\n // unitIndex++;\n }\n\n\n $.when.apply(this, deferredArray).then(function () {\n // clear the dimensions dirty flag since they have been updated\n dimensionsIsDirty = false;\n refreshForm();\n });\n }", "function refreshInteractiveElements(){\r\n $.logEvent('[dataVisualization.core.refreshInteractiveElements]');\r\n \r\n var interactiveTypeObj;\r\n \r\n $.each(dataVisualization.configuration.loadSequence,function(){\r\n interactiveTypeObj = this.id.split('-');\r\n \r\n if(typeof(window[this.id]) == 'object'){ \r\n // window[this.id].validateNow();\r\n \r\n // Re-draw the centre percentage value for all instances of donut charts\r\n //if(interactiveTypeObj[0] == 'donut'){\r\n // $('#' + this.id).donutChart('createCentreValue');\r\n //}\r\n }\r\n });\r\n }", "function setMapSize() {\n detail = +document.getElementById(\"detail\").value;\n ctx.canvas.width = document.getElementById(\"width_slider\").value;\n ctx.canvas.height = document.getElementById(\"height_slider\").value;\n}", "function loadSizes() {\n var id = $(\"#colors\").attr(\"data-id\");\n var element = document.getElementById(\"colors\");\n var color = element.options[element.selectedIndex].text\n $.post(\"/SafeRideStore/products/sizesAjax/\" + color + \"/\" + id, {}, function (data) {\n $(\".sizes\").html(data);\n });\n return false;\n\n}", "function addDimensionOptions() {\n var i,\n iMax,\n dimensionsArray = [],\n j,\n jMax,\n option,\n input,\n label,\n text,\n br,\n half;\n // clear existing dimension checkboxes\n dimensionsCol1.innerHTML = '';\n dimensionsCol2.innerHTML = '';\n // add the return field options\n dimensionsArray = aapi_model.dimensions;\n i = dimensionsArray.length;\n while (i > 0) {\n i--;\n if (isItemInArray(aapi_model.combinations.video.incompatible_dimensions, dimensionsArray[i].name)) {\n dimensionsArray.splice(i, 1);\n }\n }\n iMax = dimensionsArray.length;\n half = Math.ceil(iMax / 2);\n for (i = 0; i < half; i += 1) {\n input = document.createElement('input');\n label = document.createElement('lable');\n input.setAttribute('name', 'dimensionsChk');\n input.setAttribute('id', 'dim' + dimensionsArray[i].name);\n input.setAttribute('data-index', 'i');\n input.setAttribute('type', 'checkbox');\n input.setAttribute('value', dimensionsArray[i].name);\n label.setAttribute('for', 'dim' + dimensionsArray[i].name);\n text = document.createTextNode(' ' + dimensionsArray[i].name);\n br = document.createElement('br');\n dimensionsCol1.appendChild(input);\n dimensionsCol1.appendChild(label);\n label.appendChild(text);\n dimensionsCol1.appendChild(br);\n }\n for (i = half; i < iMax; i += 1) {\n input = document.createElement('input');\n label = document.createElement('lable');\n input.setAttribute('name', 'dimensionsChk');\n input.setAttribute('id', 'dim' + dimensionsArray[i].name);\n input.setAttribute('data-index', 'i');\n input.setAttribute('type', 'checkbox');\n input.setAttribute('value', dimensionsArray[i].name);\n label.setAttribute('for', 'dim' + dimensionsArray[i].name);\n text = document.createTextNode(' ' + dimensionsArray[i].name);\n br = document.createElement('br');\n dimensionsCol2.appendChild(input);\n dimensionsCol2.appendChild(label);\n label.appendChild(text);\n dimensionsCol2.appendChild(br);\n }\n // get a reference to the checkbox collection\n dimensionCheckboxes = document.getElementsByName('dimensionsChk');\n }", "function autoScale()\n{\n var dataBounds = bbox;\n if ($('tValues')) {\n tValue = $('tValues').value;\n }\n if (newVariable) {\n newVariable = false; // This will be set true when we click on a different variable name\n } else {\n // Use the intersection of the viewport and the layer's bounding box\n dataBounds = getIntersectionBBOX();\n }\n // Get the minmax metadata item. This gets a grid of 50x50 data points\n // covering the BBOX and finds the min and max values\n downloadUrl('wms', 'REQUEST=GetMetadata&item=minmax&layers=' +\n layerName + '&BBOX=' + dataBounds + '&WIDTH=50&HEIGHT=50'\n + '&CRS=CRS:84&ELEVATION=' + getZValue() + '&TIME=' + tValue,\n function(req) {\n var xmldoc = req.responseXML;\n // set the size of the panel to match the number of variables\n $('scaleMin').value = toNSigFigs(parseFloat(xmldoc.getElementsByTagName('min')[0].firstChild.nodeValue), 4);\n $('scaleMax').value = toNSigFigs(parseFloat(xmldoc.getElementsByTagName('max')[0].firstChild.nodeValue), 4);\n validateScale(); // This calls updateMap()\n }\n );\n}", "function getMatrixSize() {\r\n\tchosenSize = document.getElementById(\"matrixSize\").value;\r\n}", "function dimChange() {\n dimDash(this.selectedIndex);\n for (var key in gauges) {\n gauges[key].dimDisplay(this.selectedIndex);\t// just use the index; could use the indexed entry value.\n }\n }", "function updateSizeValues(){\n\tswitch (runDialog.sizeConfig.outputPresetInput.selection.index){\n\t\tcase 0:\n\t\t\tsetSizeValues(8.5, 11, 6, 9, 150);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tsetSizeValues(11, 8.5, 9, 6, 150);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tsetSizeValues(11, 14, 8, 12, 150);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tsetSizeValues(14, 11, 12, 8, 150);\n\t\t\tbreak;\n\t}\n}", "function handleUpdate() {\n // 2.1 Create a suffix to select the dimention of the var e.g. px or ''\n const suffix = this.dataset.sizing || '' ;\n // console.log(this.dataset);\n // console.log(suffix);\n\n // 2.2 Select a variable\n // console.log(this.name);\n document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix);\n}", "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz.update();\n}", "function changeSize(val) {\n\tvar s = String(val).split(\",\");\n\td3.select('#viz_container').style('width', s[0] + 'px').style('height', s[1] + 'px');\n\tviz.update();\n}", "function updateFromElement() {\n if ( !isRendered ) { return; }\n\n var chartOpts = element.renderer.chartOpts;\n\n var k;\n for ( k in BIND_ELEMENTS ) {\n if ( BIND_ELEMENTS.hasOwnProperty( k ) ) {\n jq[k].val( chartOpts[ BIND_ELEMENTS[k] ] );\n }\n }\n }", "function HUI_updateImgInfo( inStep, inRes, inCd, inLimit )\r\n{\r\n \"use strict\";\r\n document.getElementById('stepSize').innerHTML = inStep;\r\n document.getElementById('res').innerHTML = inRes;\r\n document.getElementById('cDepth').innerHTML = inCd;\r\n document.getElementById('limit').innerHTML = inLimit + \" combinations\";\r\n}", "function memInit(attachmentId, curSize, curAlign){\n $.ajax({\n type: \"GET\",\n url: `/${dashboard}/media/info/${attachmentId}`, \n success: function(rs) {\n if (rs.code == 1) {\n var img = rs.data;\n var size = curSize.replace(/px$/g,\"\");\n size = Number(size) || img.imgwidth;\n var imgTag = mmRenderImageTag(img, size, curAlign);\n var sizeArr = img.childsizes || \"\";\n sizeArr = sizeArr.split(\",\");\n var sizeDomArr = [];\n sizeArr.map(s => {\n let widths = s.split(\"x\");\n let width = (widths.length > 1) ? widths[0] : 0;\n sizeDomArr.push(`<option value=\"${width}\" ${(width == size) ? \"selected\" : \"\"}>${s}</option>`)\n })\n var sizeDom = \"\";\n if(sizeDomArr.length > 0){\n sizeDom = `<div class=\"form-group\">\n <label class=\"td\" for=\"size\">Size</label>\n <select name=\"size\" class=\"form-control td\">${sizeDomArr.join(\"\")}</select>\n </div>`;\n }\n \n var html = `<div class=\"mmModal mediaEditModal show\">\n <div class=\"mm-wrapper\">\n <button type=\"button\" class=\"btn btn-close-mm\"><span>×</span></button>\n <div class=\"mm-content\">\n <div class=\"mmc-header\">\n <h5 class=\"text-title\">Edit Image</h5>\n </div>\n <div class=\"mmc-body\">\n <div class=\"memContent\">\n <div class=\"row\">\n <div class=\"col col-left\">\n <form action=\"\" class=\"memForm\">\n <div class=\"form-group\">\n <label class=\"td\" for=\"title\">Alt</label> \n <input value=\"${img.id}\" type=\"hidden\" name=\"id\">\n <input value=\"${img.note}\" type=\"hidden\" name=\"note\">\n <input value=\"${img.childsizes}\" type=\"hidden\" name=\"childsizes\">\n <input value=\"${img.imgwidth}\" type=\"hidden\" name=\"imgwidth\">\n <input value=\"${img.url}\" type=\"hidden\" name=\"url\">\n <input value=\"${img.urlicon}\" type=\"hidden\" name=\"urlicon\">\n <input value=\"${img.imgwidth}\" type=\"hidden\" name=\"imgwidth\">\n <input class=\"input-change-mm form-control td\" value=\"${img.title}\" type=\"text\" name=\"title\" placeholder=\"Alt\">\n </div>\n <div class=\"form-group\">\n <label class=\"td\" for=\"seotitle\">Title</label>\n <input class=\"input-change-mm form-control td\" value=\"${img.seotitle}\" type=\"text\" name=\"seotitle\" placeholder=\"Title\">\n </div>\n <div class=\"form-group\">\n <label class=\"td\" for=\"description\">Caption</label>\n <textarea class=\"input-change-mm form-control td\" name=\"description\" cols=\"30\" rows=\"3\" placeholder=\"Caption\">${img.description}</textarea>\n </div>\n ${sizeDom}\n <div class=\"form-group\">\n <label class=\"td\" for=\"align\">Align</label>\n <select name=\"align\" class=\"form-control td\">\n <option value=\"left\" ${(curAlign==\"left\")?\"selected\":\"\"}>Left</option>\n <option value=\"center\" ${(curAlign==\"center\")?\"selected\":\"\"}>Center</option>\n <option value=\"right\" ${(curAlign==\"right\")?\"selected\":\"\"}>Right</option>\n </select>\n </div>\n <div class=\"form-group\">\n <div class=\"td\"></div>\n <div class=\"td\">\n <button class=\"btn btn-primary btn-mem-aplly\">Apply</button>\n <button class=\"btn btn-outline-primary btn-mem-change\">Other image</button>\n <button class=\"btn btn-outline-danger btn-mem-close\">Cancel</button>\n </div>\n </div>\n </form>\n </div>\n <div class=\"col\">\n <div class=\"memImageView\">\n ${imgTag}\n </div>\n </div>\n </div>\n </div>\n </div> \n </div>\n </div>\n <div class=\"mm-backdrop\"></div>\n </div>`;\n $(\"body\").append(html);\n }else{\n swal.fire({\n icon: \"error\",\n text: (rs.message) ? rs.message : \"Error\",\n showConfirmButton: true\n }).then(() => {\n $curImageEdit = null;\n $(\".mediaEditModal\").remove();\n })\n }\n },\n error: function(error){\n swal.fire({\n icon: \"error\",\n text: (error.reponseJSON.message) ? error.reponseJSON.message : \"Error\",\n showConfirmButton: true\n }).then(() => {\n $curImageEdit = null;\n $(\".mediaEditModal\").remove();\n })\n }\n });\n}", "function sample_form_update(extent, total_samples, total_patients, sample_list){\n var plot_id = $(svg[0]).parents('.plot').attr('id').split('-')[1];\n\n $(svg[0]).parents('.plot').find('.selected-samples-count').html('Number of Samples: ' + total_samples);\n $(svg[0]).parents('.plot').find('.selected-patients-count').html('Number of Participants: ' + total_patients);\n $('#save-cohort-' + plot_id + '-modal input[name=\"samples\"]').attr('value', sample_list);\n $(svg[0]).parents('.plot')\n .find('.save-cohort-card').show()\n .attr('style', 'position:absolute; top: '+ (y(extent[1][1]) + 180)+'px; left:' +(extent[1][0] + 90)+'px;');\n\n if (total_samples > 0){\n $(svg[0]).parents('.plot')\n .find('.save-cohort-card').find('.btn').prop('disabled', false);\n } else {\n $(svg[0]).parents('.plot')\n .find('.save-cohort-card').find('.btn').prop('disabled', true);\n }\n\n }", "function _update_window_dimensions() {\n var uwidth;\n var uheight;\n if (main_outer_ref && main_outer_ref.current) {\n uheight = window.innerHeight - main_outer_ref.current.offsetTop;\n uwidth = window.innerWidth - main_outer_ref.current.offsetLeft;\n } else {\n uheight = window.innerHeight - USUAL_TOOLBAR_HEIGHT;\n uwidth = window.innerWidth - 2 * MARGIN_SIZE;\n }\n mDispatch({\n type: \"change_multiple_fields\",\n newPartialState: {\n usable_height: uheight,\n usable_width: uwidth\n }\n });\n }", "function editor_tools_handle_size()\n{\n editor_tools_store_range();\n\n // Create the size picker on first access.\n if (!editor_tools_size_picker_obj)\n {\n // Create a new popup.\n var popup = editor_tools_construct_popup('editor-tools-size-picker','l');\n editor_tools_size_picker_obj = popup[0];\n var content_obj = popup[1];\n\n // Populate the new popup.\n for (var i = 0; i < editor_tools_size_picker_sizes.length; i++)\n {\n var size = editor_tools_size_picker_sizes[i];\n var a_obj = document.createElement('a');\n a_obj.href = 'javascript:editor_tools_handle_size_select(\"' + size + '\")';\n a_obj.style.fontSize = size;\n a_obj.innerHTML = editor_tools_translate(size);\n content_obj.appendChild(a_obj);\n\n var br_obj = document.createElement('br');\n content_obj.appendChild(br_obj);\n }\n\n // Register the popup with the editor tools.\n editor_tools_register_popup_object(editor_tools_size_picker_obj);\n }\n\n // Display the popup.\n var button_obj = document.getElementById('editor-tools-img-size');\n editor_tools_toggle_popup(editor_tools_size_picker_obj, button_obj);\n}", "function updateRenderDimension(dimension) {\n if (!structureControl || !dimension) {\n return;\n }\n\n var alias;\n\n if (dimension === dimensions.horizontal && structureControl.control.renderingHorizontalResizeMode) {\n alias = structureControl.control.renderingHorizontalResizeMode._id.getAlias();\n } else if (dimension === dimensions.vertical && structureControl.control.renderingVerticalResizeMode) {\n alias = structureControl.control.renderingVerticalResizeMode._id.getAlias();\n }\n\n var value;\n\n if (alias) {\n switch (alias) {\n case 'resizeHundred':\n value = 100;\n break;\n case 'resizeTwentyFive':\n value = 25;\n break;\n case 'resizeThirtyThree':\n value = 33;\n break;\n case 'resizeFifty':\n value = 50;\n break;\n case 'resizeSixtySix':\n value = 66;\n break;\n case 'resizeSeventyFive':\n value = 75;\n break;\n }\n }\n\n if (value) {\n if (dimension === dimensions.horizontal) {\n structureControl.control.renderingWidth = value;\n } else {\n structureControl.control.renderingHeight = value;\n }\n }\n }", "function populatetireDimensions() {\n let manufactureDropdown = document.getElementsByName('tireManufacture')[0];\n let modelDropdown = document.getElementsByName('tireModel')[0];\n let dimensionsDropdown = document.getElementsByName('tireDimensions')[0];\n\n modelDropdown.addEventListener('click', function() {\n\n // Empty dropdown\n dimensionsDropdown.innerHTML = '';\n\n jsonRequest('jr_tires.php', function(payload) {\n let selectedModel = modelDropdown.options[modelDropdown.selectedIndex];\n let selectedManufacture = manufactureDropdown.options[manufactureDropdown.selectedIndex];\n\n let dimensions = [];\n\n for (var i = 0; i < payload.length; i++) {\n if(selectedModel.value === payload[i].tireModel && selectedManufacture.value === payload[i].tireManufacture) {\n dimensions.push(payload[i].tireDimensions);\n }\n }\n\n // Get unique dimensions\n dimensions = Array.from(new Set(dimensions));\n console.log(dimensions);\n\n for (var j = 0; j < dimensions.length; j++) {\n let option = document.createElement('option');\n option.innerHTML = dimensions[j];\n option.value = dimensions[j];\n dimensionsDropdown.appendChild(option);\n }\n });\n });\n}", "function getBoxSize(length,breadth,cope_height,drag_height)\r\n{\r\n var div_box_dimension_start=\"<div class='disp_content' \";\r\n var div_box_dimension_end=\"</div>\";\r\n casting_length=$(\"#casting_length\").val();\r\n casting_breadth=$(\"#casting_breadth\").val();\r\n casting_height=$(\"#casting_height\").val();\r\n // box_dimension=$(\"#length_size\").val()+\"X\"+$(\"#breadth_size\").val()+\"X\"+$(\"#cope_height_size\").val()+\"X\"+$(\"#drag_height_size\").val();\r\n box_dimension = length+\"X\"+breadth+\"X\"+cope_height+\"X\"+drag_height;\r\n var dimension=box_dimension.split('X').map(Number);\r\n avl_length=$(\"#length_size\").find(':selected').attr(\"data-avl-length\");\r\n avl_breadth=$(\"#breadth_size\").find(':selected').attr(\"data-avl-breadth\");\r\n casting_length=parseInt(casting_length);\r\n casting_breadth=parseInt(casting_breadth);\r\n avl_length=parseInt(avl_length);\r\n avl_breadth=parseInt(avl_breadth);\r\n\r\n\r\n cavity = calcualteCavity(parseInt(casting_length),parseInt(casting_breadth),parseInt(avl_length),parseInt(avl_breadth));\r\n console.log(\"avl_length \"+avl_length);\r\n console.log(\"avl_breadth \"+avl_breadth);\r\n console.log(\"casting_length \"+casting_length);\r\n console.log(\"casting_breadth \"+casting_breadth);\r\n console.log(\"cavity \"+cavity);\r\n drawDiagram(casting_length,casting_breadth,avl_length,avl_breadth,dimension[0],dimension[1],row_count,column_count,cavity);\r\n sand_requirement=sandRequirement(casting_length,casting_breadth,casting_height,dimension);\r\n sand_requirement=parseInt(sand_requirement);\r\n new_sand = getPercentage(sand_requirement,2);\r\n bentonite = getPercentage(sand_requirement,0.8);\r\n lustron = getPercentage(sand_requirement,0.4);\r\n // console.log(sand_requirement);\r\n return_sand = (sand_requirement -(new_sand+bentonite+lustron));\r\n $(\"#display_jumbotron\").show();\r\n $(\"#preview_button\").show();\r\n /*var table_start=\"<table id='box_table' class='table table-bordered table-hover jumbotron shadow-z-2'>\";\r\n var table_heading=\"<tr><th>New Sand</th><th>Bentonite</th><th>Lustron</th><th>Return Sand</th><th>Preview</th></tr>\"\r\n var table_end=\"</table>\";\r\n var icon = \"<a style='text-decoration:none'><i id='preview'class='glyphicon glyphicon-picture' style='font-size:25px;' data-toggle='modal' data-target='.bs-example-modal-lg'></i></a>\"\r\n $(\"#display_content\").append(table_start+table_heading);\r\n printRequirementTable(\"#box_table\",new_sand,bentonite,lustron,return_sand,icon);\r\n $(\"#box_table\").append(table_end);*/\r\n $(\"#get_box_dimension\").append(div_box_dimension_start+\" data-casting-length='\"+casting_length+\"'\"+\"data-casting-breadth='\"+casting_breadth+\"'\"+\"data-casting-height='\"+casting_height+\"'\"+\"data-box-length='\"+dimension[0]+\"'\"+\"data-box-breadth='\"+dimension[1]+\"'\"+\"data-cope-height='\"+dimension[2]+\"'\"+\"data-drag-height='\"+dimension[3]+\"'\"+\"data-cavity='\"+cavity+\"'\"+\"data-sand-requirement='\"+sand_requirement+\"'\"+\"data-new-sand='\"+new_sand+\"'\"+\"data-bentonite='\"+bentonite+\"'\"+\"data-lustron='\"+lustron+\"'\"+\"data-return-sand='\"+return_sand+\"' data-box-size-requirement='\"+box_size_requirement+\"' >\"+div_box_dimension_end);\r\n}", "function _calculateSize() {\r\n contentWidth = parseInt($(\"#\" + divid).width());\r\n contentHeight = parseInt($(\"#\" + divid).height());\r\n $(\"#\" + divid).remove();\r\n sizeGetCallback(contentOrJQObj, _getLayerPos(clientSize, { Width: contentWidth, Height: contentHeight }));\r\n }", "function refreshForm() {\n // Clear any current Dimension detail values\n clearUnitDetails();\n // Clear the current dimensions listbox\n clearUnits();\n // reload the current dimension values\n var targetUrl = DimensionUrl;\n\n // Clear the NAtural Unit and Dimension collections\n var index = 0;\n while (index < currentOrg.NaturalUnits.length) {\n currentOrg.NaturalUnits[index].Dimensions.length = 0;\n index++;\n }\n currentOrg.NaturalUnits.length = 0;\n currentOrg.Dimensions.length = 0;\n\n // reload the current data\n loadFormData();\n\n }", "function newNumGrids() {\r\n numG = $(\"#numGrid\").eq(0).val()\r\n log(\"Number of grids updated to: \" + numG.toString())\r\n recalc()\r\n}", "updateDimensions() {\n const network = this._network;\n if( network ) {\n network.setSize(window.innerWidth, window.innerHeight);\n network.redraw();\n }\n const { dispatch } = this.props;\n // if(window.innerWidth<=1000)\n // dispatch(drawerStatusChange(false));\n }", "function updateGridDimensions() \n{\n\tvar squareSize = $('.square').css('width');\n\tvar squareSizePx = parseInt(squareSize);\n\t$('.square').css('height', squareSize);\n\t$('.square').css('width', squareSize);\n\t$('.square').css('font-size', (squareSizePx * 0.5) + 'px');\n\t$('.square').css('border', (squareSizePx * 0.06) + 'px solid #baad9e');\n\t$('#grid').css('border', (squareSizePx * 0.06) + 'px solid #baad9e');\n}", "function hse_areaInfoReadyCB(dim) {\n jqeltBannerConstraint = $(\"#banner_dragging_area\");\n jqeltWorkingArea = $(\"#working_area\");\n jqeltWorkingArea.css(\"left\", dim.left);\n jqeltWorkingArea.css(\"top\", dim.top);\n jqeltWorkingArea.width(dim.width);\n jqeltWorkingArea.height(dim.height);\n if (dimensions == null) {\n dimensions = dim.videoWidth + \"x\" + dim.videoHeight;\n //still do not save it yet. need to save to database record\n //Wait till user saves first hotspot\n }\n jqeltWorkingArea.show();\n \n jqeltWorkingAreaAR = dim.width/dim.height;\n\n}", "function handleUpdate() {\n const dataSize = this.dataset.sizing || '';\n document.documentElement.style.setProperty(`--${this.name}`, this.value + dataSize)\n}", "function updateSize()\n{\n\ttry\n {\n $(svgParent).width($(\"#view\").width());\n viewWidth=$('#svg').width();\n viewHeight=$('#svg').height();\n updateViewBox();\n }\n catch(e)\n {\n\n }\n}", "function updateInfo(e) {\n\t\t$('#x1').val(e.x);\n\t\t$('#y1').val(e.y);\n\t\t$('#x2').val(e.x2);\n\t\t$('#y2').val(e.y2);\n\t\t$('#w').val(e.w);\n\t\t$('#h').val(e.h);\n}", "function resizeEntity() {\r\n if (uploadInProgress || downloadInProgress)\r\n return;\r\n // get the preview container for the entity\r\n var container = $(\"#\" + currentEntity.id);\r\n // set the entities width and height to those of the container\r\n console.log(\"TEST\");\r\n currentEntity.width = container.width();\r\n currentEntity.height = container.height();\r\n}", "function changeDimension() {\n document.querySelector('paper-slider').addEventListener('change', function (event) {\n\n minor = event.target.value < graphDimension\n console.log('minor: ', minor)\n graphDimension = event.target.value;\n console.log(event.target.value);\n });\n}", "function assignElements(){\n document.getElementById(\"processContainer\").appendChild(app.view);\n document.getElementById(\"uploadImage\").addEventListener(\"change\", readFile);\n\n warpSlider = document.getElementById(\"warpRange\");\n warpValue = document.getElementById(\"warpValue\");\n\n stretchSlider = document.getElementById(\"stretchRange\");\n stretchValue = document.getElementById(\"stretchValue\");\n\n sizeSlider = document.getElementById(\"sizeRange\");\n sizeValue = document.getElementById(\"sizeValue\");\n\n baseSpeedSlider = document.getElementById(\"baseSpeedRange\");\n baseSpeedValue = document.getElementById(\"baseSpeedValue\");\n\n amountSlider = document.getElementById(\"amountRange\");\n amountValue = document.getElementById(\"amountValue\");\n setSliderValues();\n}", "requestQuality(e) {\n //Do AJAX HERE, cant be an object must be a string sent to store\n Actions.fetchData(\"AJAX\");\n }", "function getChartInvetnoryInfo(data) {\n var givenStorageID = data;\n $(function () {\n\n $.ajax({\n type: 'POST',\n url: '?request=chartProduct', // given request to controller \n data: {givenStorageID: givenStorageID}, // passed data to controller \n dataType: 'json',\n success: function (data) {\n drawChart(data); // generate chart\n }\n });\n });\n}", "function OnThicknessOfTheTiles_Change( e )\r\n{\r\n Alloy.Globals.ShedModeInfrastructure[\"THICKNESS_OF_THE_TILES\"] = e.id ;\r\n}", "function Customize_Dashboard_Layout(dashboard_id) {\n $.ajax({\n url: '../Dashboard/Customize_Dashboard_Layout',\n //data: { 'dashboard_Id': dashboard_id },\n type: \"GET\",\n dataType: \"html\",\n cache: false,\n success: function (data) {\n $('#customize_layout').html(data); //write the dialog content into the diaog container\n //set the dahboard_id in the hiddin field\n $(\"#Dashboard_Id\").val(dashboard_id);\n },\n error: function (xhr, ajaxOptions, thrownError) {\n alert('Error');\n }\n });\n}", "function updateContainers() {\n\n\t\tvar width = editor.duration * scale;\n\n\t\telements.setWidth( width + 'px' );\n\t\t// curves.setWidth( width + 'px' );\n\n\t}", "function updateInfo(e) {\n $('#x1').val(e.x);\n $('#y1').val(e.y);\n $('#x2').val(e.x2);\n $('#y2').val(e.y2);\n $('#w').val(e.w);\n $('#h').val(e.h);\n}", "function updateInfo(e) {\n $('#x1').val(e.x);\n $('#y1').val(e.y);\n $('#x2').val(e.x2);\n $('#y2').val(e.y2);\n $('#w').val(e.w);\n $('#h').val(e.h);\n}", "updateSizeOutput(val) {\n $('output.size').val(val);\n }", "addDimension(changeValueDimensions) {\n const that = this;\n\n if (that._suppressDimensionChange !== true && that.dimensions === 32) {\n return;\n }\n\n const indexer = document.createElement('jqx-numeric-text-box');\n\n indexer.className = 'jqx-array-indexer';\n indexer.style.height = that.indexerHeight + 'px';\n indexer.inputFormat = 'integer';\n indexer.spinButtons = true;\n indexer.min = 0;\n indexer.max = 4294967295;\n indexer.disabled = that.disabled;\n indexer.animation = that.animation;\n indexer.validation = 'interaction';\n indexer.wordLength = 'uint64';\n indexer.onReady = function () {\n indexer.$upButton.addClass('jqx-array-indexer-increment');\n indexer.$downButton.addClass('jqx-array-indexer-decrement');\n }\n\n that.$.indexerContainer.insertBefore(indexer, that.$.indexerContainer.children ? that.$.indexerContainer.children[0] : null);\n\n indexer.$.listen('change', that._indexerChangeHandler.bind(that));\n\n that._dimensions.push({ index: that._dimensions.length, indexer: indexer });\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._indexers.unshift(indexer);\n that._coordinates.unshift(0);\n }\n else {\n that._indexers.push(indexer);\n that._coordinates.push(0);\n }\n\n indexer.dimension = that._indexers.length - 1;\n\n if (that._suppressDimensionChange !== true) {\n that.dimensions += 1;\n that.$.fireEvent('dimensionChange', { 'type': 'add' });\n }\n\n if (that._initialDimensions !== true && changeValueDimensions !== false) {\n that._validateValueArrayDimensions();\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._filledUpTo.unshift(0);\n }\n else {\n that._filledUpTo.push(0);\n }\n\n if (that._oneDimensionSpecialCase === true) {\n that._oneDimensionSpecialCase = false;\n that.$.verticalScrollbar.value = 0;\n that._scroll();\n }\n }\n\n if (that._absoluteSelectionStart !== undefined) {\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._absoluteSelectionStart.unshift(0);\n }\n else {\n that._absoluteSelectionStart.push(0);\n }\n }\n\n if (that._absoluteSelectionEnd !== undefined) {\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._absoluteSelectionEnd.unshift(0);\n }\n else {\n that._absoluteSelectionEnd.push(0);\n }\n }\n\n if (!that._initialDimensions) {\n that._refreshSelection();\n }\n\n if (that._suppressDimensionChange === false && that.showIndexDisplay === true && (that.dimensions * (that.indexerHeight + 4) - 2 > that._cachedHeight)) {\n that._updateWidgetHeight('dimensions');\n }\n }", "_changeSliderSize() {\n\t\t\t\tlet width = this.model.get('width'),\n\t\t\t\t\theight = this.model.get('height');\n\n\t\t\t\tthis.$el.css({width, height});\n\t\t\t}", "function chartInventory(data) {\n var givenStorageID = data;\n $(function () {\n $.ajax({\n type: 'POST', \n url: '?request=chartProduct', // request given to controller\n data: {givenStorageID: givenStorageID}, // post data\n dataType: 'json',\n success: function (data) {\n drawChart(data); // create chart\n }\n });\n });\n}", "function refreshDataFromBackend(d)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(d.depth ==999){\r\n\t\t\t\t \tapp.clearAll();\r\n\t\t\t\t\t//self.backendApi.selectValues(2,window.dimKeyArr,true);\r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\t //set node click to Qlik Sense to select dimension in app for only leaf node\r\n\t\t\t\t else if(d.dim_key !== 'undefined' && d.depth > 0){// maxDepthEx-(maxDepth -1){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar dimValKey = parseInt(d.dim_key, 0);\r\n\t\t\t\t\tvar dimParentValKey = parseInt(d.parent.dim_key, 0);\r\n\t\t\t\t\t//var dimParentValKey = parseInt(d.parent.dim_key, 0);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Clear all selections before selecting clicked leaf node and its parent\r\n\t\t\t\t\tapp.clearAll();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//console.log((d.depth-1) + \" \" + d.dim_key);\r\n\t\t\t\t\tif(!isNaN(dimParentValKey))\r\n\t\t\t\t\tself.backendApi.selectValues(d.depth-2,[dimParentValKey],true);\r\n\t\t\t\t\tself.backendApi.selectValues(d.depth-1,[dimValKey],true);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//app.field('Brand').selectValues([globalAllBrands], true, true);\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t //else if(d.name == \"Global\" && d.parent.length < 1){\r\n\t\t\t\t else if(d.depth ==0){\r\n\t\t\t\t \tapp.clearAll();\r\n\t\t\t\t\tself.backendApi.selectValues(2,window.dimKeyArr,true);\r\n\t\t\t\t }\r\n\t\t\t\r\n}", "function handleUpdate() {\n // in a function declaration, this is undefined ... (?)\n const suffix = this.dataset.sizing || \"\";\n // dataset is an object returning DOMstringMap {sizing: \"px\"}\n // which is the custom data attribute we created in the html\n // the pipe || prevents us to see \"undefined\" for the color picker which has no suffix (no custom data-thing)\n console.log(\"name\", this.name);\n // console.log(\"documentelement\", document.documentElement);\n document.documentElement.style.setProperty(\n `--${this.name}`,\n this.value + suffix\n );\n //Document.documentElementrenvoie l'Element qui est l'élément racine du document (par exemple, l'élément <html> pour les documents HTML).\n // ici c'est bien ce qu'on veut : les variables :root en début de CSS qui s'appliquent à tout le html\n // object.setProperty (propertyName, propertyValue, priority);\n // If a property with the same name exists on the current style object, then it modifies its value.\n console.log(\"value\", this.value);\n //\n}", "function handleUpdate() {\n const suffix = this.dataset.sizing || ''; // const suffix gets the suffix for our CSS variables. These value is link to data-sizing in our HTML\n document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix); //Sets the property to our element (--spacing, --blur), sets the value (10,20,) + and the suffix (px)\n}", "function handleUpdate() {\n const suffix = this.dataset.sizing || '';\n document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix );\n console.log(document.documentElement.style, 'document element');\n console.log('name', this.name);\n console.log('value', this.value);\n \n}", "function im_size_callback() {\n console.log('im_size_callback');\n var size = parseFloat($(\"#im-size\").val());\n var msg = new ROSLIB.Message({\n data: size\n });\n\n if ($('input[name=\"manip\"]:radio')[0].checked == true && $('#start_state').is(':checked')) {\n im_size_pub.publish(msg);\n start_im_client.hideIntMarker('start');\n setTimeout(function() {\n start_im_client.showIntMarker('start');\n }, 500);\n }\n else if($('input[name=\"manip\"]:radio')[1].checked == true && $('#goal_state').is(':checked')){\n im_size_pub.publish(msg);\n goal_im_client.hideIntMarker('goal');\n setTimeout(function() {\n goal_im_client.showIntMarker('goal');\n }, 500);\n }\n}", "function loadFormData() {\n\n\n updateReady = new $.Deferred();\n unitDimensionSynch = new $.Deferred();\n // Load the master dimension data for the organization\n// document.body.style.cursor = \"wait\";\n updateReady = loadDimensionsByOrg(currentOrg.ID, refreshMasterDimensions, pmmodaErrorHandler);\n updateReady.done(function () {\n var myUnits = new NaturalUnit();\n unitDimensionSynch = loadNaturalUnitsByOrg(currentOrg.ID, refreshNaturalUnits, pmmodaErrorHandler);\n unitDimensionSynch.done(function () {\n dimReady = new $.Deferred();\n dimReady = loadUnitDimensions();\n dimReady.done(function () {\n setEditMode(false,false);\n });\n\n })\n })\n\n }", "function updateElementSize() {\n\t\tconst size = window.innerWidth / (seriesHidden ? 20 : 35.7);\n\t\tdocument.documentElement.style.setProperty(\"--element-size\", size + \"px\");\n\t}", "function social_curator_grid_post_loaded(data, element){}", "function dataSourceUpdated(webbleID) {\n\t\t$timeout(function() {\n\t\t\t$scope.getWebbleByInstanceId(loadedChildren[\"DigitalDashboard\"][0]).scope().set(\"Mapping\",\n\t\t\t\t{\"plugins\":[{\"name\":\"Density Plot Advanced\",\"grouping\":true,\"sets\":[{\"fields\":[{\"name\":\"3D Density Data\",\"assigned\":[{\"sourceName\":\"SMART Data Source\",\"dataSetName\":\"SMART Data Source: \",\"dataSetIdx\":0,\"fieldName\":\"3D Array\"}],\"template\":false,\"added\":false}]}]}]}\n\t\t\t)},\n\t\t1);\n\t}", "function changeValues(){\n MAX_NUM_GENERATIONS = $('#maxgenerations').find(\":selected\").val();\n MAX_NUM_POPULATION_MEMBERS = $('#popSize').find(\":selected\").val();\n MUTATE_PERCENTAGE = $('#mutatePercentage').find(\":selected\").val();\n KNAPSACK_SIZE = (MIN * MIN * MIN) * MAX_NUM_POPULATION_MEMBERS;\n main();\n}", "function checkDeviceSizeClicked(){\n\t//save the project in the API\n\ttry{\n\t\t//load project info from API\n\t\t$.post(\"/api/1/flash/getDeviceCapacityAndDestroyFS\",\n\t\t\tfunction(data,status){\n\t\t\t\t//if return success and has data\n\t\t\t\tif(status=='success' && data.ok){\n\t\t\t\t\t//set capacity\n\t\t\t\t\t$('#capacitySelect').val(data.ok);\n\t\t\t\t}\n\n\t\t\t\tif(data.err){\n\t\t\t\t\talert(data.err);\n\t\t\t\t}\n\t\t\t});\n\t}\n\tcatch(e){\n\t\talert(\"Error Creating File\");\t\t\n\t}\t\t\t\n}", "removeDimension(propertyChangedHandler, changeValueDimensions) {\n const that = this,\n index = that._dimensions.length - 1;\n\n if (that._dimensions.length < 2) {\n return;\n }\n\n if (that._dimensions.length === 2) {\n const oldRowsCount = that.rows;\n\n that.rows = 1;\n that._changeRowsColumns('rows', oldRowsCount, 1, undefined, true);\n }\n\n that.$.indexerContainer.removeChild(that._dimensions[index].indexer);\n that._dimensions.pop();\n\n let indexerValue;\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n indexerValue = that._coordinates[0];\n that._indexers.splice(0, 1);\n that._coordinates.splice(0, 1);\n }\n else {\n indexerValue = that._coordinates[index];\n that._indexers.pop();\n that._coordinates.pop();\n }\n\n if (that._suppressDimensionChange !== true) {\n that.dimensions -= 1;\n that.$.fireEvent('dimensionChange', { 'type': 'remove' });\n }\n\n if (changeValueDimensions !== false) {\n that._removeDimensionFromJSArray();\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._filledUpTo.splice(0, 1);\n }\n else {\n that._filledUpTo.pop();\n }\n }\n\n if (that._absoluteSelectionStart !== undefined) {\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._absoluteSelectionStart.splice(0, 1);\n }\n else {\n that._absoluteSelectionStart.pop();\n }\n }\n\n if (that._absoluteSelectionEnd !== undefined) {\n if (that.arrayIndexingMode === 'LabVIEW') {\n that._absoluteSelectionEnd.splice(0, 1);\n }\n else {\n that._absoluteSelectionEnd.pop();\n }\n }\n\n if (indexerValue > 0) {\n that._scroll();\n }\n\n if ((that.dimensions > 1 && that._suppressDimensionChange === false && that.showIndexDisplay === true && ((that.dimensions + 1) * (that.indexerHeight + 4) - 2 >= that._cachedHeight)) || that.dimensions === 1 && propertyChangedHandler !== true) {\n that._updateWidgetHeight('dimensions');\n if (that.dimensions === 1 && that.showVerticalScrollbar) {\n that._showVerticalScrollbar(false);\n }\n }\n }", "updated () {\n this.dispatchSizeChange()\n }", "setDimensions(newDimensions) {\n super.setDimensions(newDimensions);\n const visibleAndFetched = this.visibleAndFetchedTiles();\n visibleAndFetched.map(a => this.initTile(a));\n }", "function handleUpdate() {\r\n const suffix = this.dataset.sizing || \"\";\r\n document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix);\r\n }", "function changeSettings(){\n var elementID = $(\"#settingsElementId\").val();\n for (var i = 0; i < diagram.length; i++) {\n var node= diagram[i];\n if (node._id == elementID) {\n // Change Values in the array\n diagram[i].animation_name=$(\"#selectAnimation\").val();\n diagram[i].opacity=$(\"#selectOpacity\").val();\n diagram[i].shadow=$(\"#selectShadow\").val();\n diagram[i].height=$(\"#selectHeight\").val();\n diagram[i].width=$(\"#selectWidth\").val();\n\n //Change values in the canvas\n //Set Width\n var width=$(\"#selectWidth\").val();\n if (width == '') {\n width = \"auto\";\n }\n $(\"#\"+elementID).css(\"width\", width);\n //set Height\n var height=$(\"#selectHeight\").val();\n if (height == '') {\n height = \"auto\";\n }\n $(\"#\"+elementID).css(\"height\", height);\n $(\"#\"+elementID).css(\"opacity\", diagram[i].opacity);\n $(\"#settings-container\").hide(100);\n $(\"#openEditText\").css(\"display\",\"none\");\n break;\n }\n}\n}", "function changeSize() {\n var select = document.getElementById(\"sizeList\");\n var size = select.value;\n return size;\n } // end function", "get dimensions() { return this._dimensions; }", "function update() {\n \n // data\n var key = Object.keys(ids).find( key => ids[key] == this.value) ;\n var newId = data.id[key];\n var newValue = data.value[key];\n var newDemo = data.demographics[key];\n \n // bar chart\n Plotly.restyle('bar', 'x', [newValue.slice(0,10).reverse()]);\n Plotly.restyle('bar', 'y', [newId.slice(0,10).reverse().map( i => 'OTU ' + i.toString() )]);\n\n // bubble chart\n Plotly.restyle('bubble', 'x', [newId]);\n Plotly.restyle('bubble', 'y', [newValue]);\n\n // info panel\n d3.selectAll('#sample-metadata text').remove();\n Object.entries(newDemo).forEach( v => {\n d3.select('#sample-metadata')\n .append('text')\n .text(`${v[0]} : ${v[1]}`)\n .append('br');\n });\n\n // gauge\n Plotly.restyle('gauge', 'value', [newDemo.wfreq]);\n Plotly.restyle('gauge', 'title', [{ text: `Scrubs per Week | Participant: ${newDemo.id}` }]);\n\n }", "function handleUpdate() {\n const suffix = this.dataset.sizing || \"\"\n document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix)\n}", "function updateUnitHandler() {\n var dim;\n\n var unit = new NaturalUnit();\n\n // update organization record\n unit.ID = $(\"#NaturalUnitList\").find('option:selected').val();\n unit.OrganizationID = currentOrg.ID;\n unit.Name = $(\"#txtName\").val();\n unit.Description = $(\"#txtDescription\").val();\n unit.isActive = 1;\n unit.isActive = $('#activeFlag').prop('checked');\n unit.UserID = UserID;\n\n updateNaturalUnit(unit, updateUnitDimensions, pmmodaErrorHandler)\n\n\n }", "function InitGraphSize(w, h) {\n document.getElementById(w).value = GetViewportWidth();\n document.getElementById(h).value = GetViewportHeight();\n}", "function loadStatus() {\n fetchStatus(function (data) {\n $(\"#zoom-slider\").val(parseInt(data.absoluteZoom));\n });\n}", "static getDimension(callBack){\n Dimensions.addEventListener('change', () => {\n width = Dimensions.get(\"screen\").width\n height = Dimensions.get(\"screen\").height \n })\n\n \n // store the orientation, height and width in an object \n \n var object={\n \"height\":parseInt(height, 10),\n \"width\":parseInt(width, 10),\n \"orientation\":orientation = (Dimensions.get(\"screen\").width<Dimensions.get(\"screen\").height)?\"PORTRAIT\":\"LANDSCAPE\"\n } \n callBack(object);\n\n }", "function optionChanged() {\n\tdropDownMenu=d3.select('#selDataset');\n\tid=dropDownMenu.property('value');\n\tconsole.log(id);\n\tbuildPlot(id);\n\n}", "function setUpForm (index) {\n $(\"#layerIndex\").text(index);\n $(\"#units\").val(importedData[index]['units']); \n}", "function setCableSize()\n{\n\tvm.design.cableSize = _orderCableSizeField.value;\n}", "function loadDropDownSize(){\n \t$.ajax({\n \t\tdataType: \"json\",\n\t\t\ttype: 'GET',\n\t\t\tdata:{},\n\t\t\tcontentType: \"application/json\",\n\t\t\turl: getAbsolutePath() + \"size/list\",\n\t\t\tsuccess: function(data){\n\t\t\t\tif(data.status == \"ok\"){\n\t\t\t\t\t$.each( data.list, function( key, value ) {\n $('#dialogEditPigriddetail').find('#txtSize').append($('<option>', {\n value: value.sizecode,\n text: value.sizename\n }));\n $('#dialogAddPigriddetail').find('#txtSize').append($('<option>', {\n value: value.sizecode,\n text: value.sizename\n }));\n \n \n });\n\t\t\t\t}else{\n\t\t\t\t\talert('This alert should never show!');\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(){\n\t\t\t\talert('Error !!');\n\t\t\t}\n \t});\n }", "_updateElementSize() {\n if (!this._pane) {\n return;\n }\n const style = this._pane.style;\n style.width = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.width);\n style.height = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.height);\n style.minWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.minWidth);\n style.minHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.minHeight);\n style.maxWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.maxWidth);\n style.maxHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.maxHeight);\n }", "function refreshdisplaySingeStorage(givenStorageID) {\nwindow.setInterval (function (){\n getChartInvetnoryInfo(givenStorageID); //pass selected storage ID to get chart info\n if (givenStorageID > 0) { // check if a storage is selected 0 = \"select a storage\" option\n $.ajax({\n type: 'POST',\n url: '?request=getStorageProduct', // given request to controller\n data: {givenStorageID: givenStorageID}, // passed data to controller\n dataType: 'json',\n success: function (data) {\n chosenStorageTemplate(data); //display inventory of selected storage\n rowColor(); // format color of inventory table\n }\n });\n }\n return false;\n }, 120000);\n}", "function saveColumnSize()\r\n{\r\n var http = AJAX_getXMLHttpObject();\r\n\r\n /* Build HTTP POST data. */\r\n var POSTData = '';\r\n POSTData += '&columnName=' + urlEncode(_columnName);\r\n POSTData += '&columnWidth=' + _objectResizing.style.width.substring(0, _objectResizing.style.width.length-2);\r\n POSTData += '&instance=' + _instance;\r\n\r\n /* Anonymous callback function triggered when HTTP response is received. */\r\n var callBack = function ()\r\n {\r\n if (http.readyState != 4)\r\n {\r\n return;\r\n }\r\n\r\n //alert(http.responseText);\r\n\r\n if (!http.responseXML)\r\n {\r\n var errorMessage = \"An error occurred while receiving a response from the server.\\n\\n\"\r\n + http.responseText;\r\n //alert(errorMessage);\r\n return;\r\n }\r\n\r\n /* Return if we have any errors. */\r\n var errorCodeNode = http.responseXML.getElementsByTagName('errorcode').item(0);\r\n var errorMessageNode = http.responseXML.getElementsByTagName('errormessage').item(0);\r\n if (!errorCodeNode.firstChild || errorCodeNode.firstChild.nodeValue != '0')\r\n {\r\n var errorMessage = \"An error occurred while receiving a response from the server.\\n\\n\"\r\n + errorMessageNode.firstChild.nodeValue;\r\n //alert(errorMessage);\r\n return;\r\n }\r\n }\r\n\r\n AJAX_callOSATSFunction(\r\n http,\r\n 'setColumnWidth',\r\n POSTData,\r\n callBack,\r\n 0,\r\n _sessionCookie,\r\n false\r\n );\r\n}", "function refreshGrid(){\n clearGrid();\n makeGrid(document.getElementById(\"input_height\").value, document.getElementById(\"input_width\").value);\n}", "function refreshImgProperties(nodeId)\n\t\t{\n\t\t\t// Keep the current img size\n\t\t\tIMG_WIDTH = domStyle.get(nodeId, \"width\");\n\t\t\tIMG_HEIGHT = domStyle.get(nodeId, \"height\");\n\t\t\n\t\t\t// Free the div properties\n\t\t\tdomConstruct.empty(\"dndItemProperties\");\n\t\t\t\n\t\t\t// Get the node\n\t\t\tvar node = dom.byId(nodeId);\n\t\t\t\n\t\t\tdomConstruct.create(\"span\", { innerHTML: nodeId + \"_properties<br/><br/>Width :<br/>\" }, \"dndItemProperties\");\n\t\t\tdomConstruct.create(\"input\", { id: nodeId + \"_width\", value: domStyle.get(nodeId, \"width\")}, \"dndItemProperties\");\n\t\t\tdomConstruct.create(\"span\", { innerHTML: \"<br/><br/>Height :<br/>\" }, \"dndItemProperties\");\n\t\t\tdomConstruct.create(\"input\", { id: nodeId + \"_height\", value: domStyle.get(nodeId, \"height\")}, \"dndItemProperties\");\n\t\t\t\n\t\t\tvar widthInput = dom.byId(nodeId + \"_width\");\n\t\t\tvar heightInput = dom.byId(nodeId + \"_height\");\n\t\t\t\n\t\t\t// Dynamic events\n\t\t\tdynEvents = {\n id: \"dynEvents\",\n width: function(evt){scaleImg(nodeId, widthInput.value, 0);},\n\t\t\t\theight: function(evt){scaleImg(nodeId, 0, heightInput.value);}\n };\n\t\t\t\n\t\t\t// Each time the properties changes in the input, the item changes\n\t\t\ton(widthInput, \"change\", dynEvents.width);\n\t\t\ton(heightInput, \"change\", dynEvents.height);\n\t\t}", "function SizeGauge()\n{\n\t// set up the speedo size\n\tlet gauge = document.getElementById(\"speedGauge\");\n\n\t// set height\n\tvar speedGaugeHeight = $(\"#speedGaugeDiv\").css('height');\n\tspeedGaugeHeight = speedGaugeHeight.substring(0, speedGaugeHeight.length - 2);\n\n\t// set width\n\tvar speedGaugeWidth = $(\"#speedGaugeDiv\").css('width');\n\tspeedGaugeWidth = speedGaugeWidth.substring(0, speedGaugeWidth.length - 2);\n\n\t// update attributes\n\tgauge.setAttribute(\"data-height\", `${speedGaugeHeight}`);\n\tgauge.setAttribute(\"data-width\", `${speedGaugeWidth}`);\n}", "updateBox () {\n // if the user haven't enabled advanced dimens' input, return.\n if (!this.enableAdvanced.checked) {\n return\n }\n\n // else, set css properties according to the data entered into the application\n let styleHeight = this.state.height == '' ? '' : this.state.height + 'px'\n let styleWidth = this.state.width == '' ? '' : this.state.width + 'px'\n this.boxContainer.style.height = styleHeight\n this.boxContainer.style.width = styleWidth\n this.heightInput.value = this.state.height\n this.widthInput.value = this.state.width\n }", "function updateSmallMultiples() {\n // Get new survey ID and update window.sID and header of overview tab\n var newSurveyIndex = $(\"#overview-area .surveyselector\").val();\n sID = newSurveyIndex;\n $(\".page-header\").text(surveyDataIndex[newSurveyIndex]+\" (\"+(surveyDataTable[newSurveyIndex].length-2)+\" respondents)\");\n\n // Remove exsited question selector and add a new one\n $(\"#overview-area .question-selector\").parent().remove();\n var nextQuestionSelector = panelsDOM.newQuestionSelectorDOM(0);\n nextQuestionSelector.appendTo(\"#overview-area .question-area\");\n\n // Scan and store values of all options of the new question selector\n // Then \"tick\" all options by assigning all option values to the selector\n var nextOptions = nextQuestionSelector.find(\"option\");\n var nextOptionValues = new Array();\n for (var i=0;i<nextOptions.length;i++) {\n nextOptionValues[i] = nextOptions[i].value;\n }\n nextQuestionSelector.children().val(nextOptionValues);\n\n // Refresh all selectpickers and add tags (tooltips)\n $(\".selectpicker\").selectpicker(\"refresh\");\n addOptionTags(nextQuestionSelector);\n\n // Remove all existed small multiples, re-create all small multiples in updateDefaultChart function\n $(\".sm-panel\").remove();\n updateDefaultChart();\n\n // Make transition effect by hiding the whole chart area (instantly) and show it in fast speed\n $(\"#overview-area .chart-area\").hide().show(\"fast\");\n\n // Make all small multiples resizable\n $(\".sm-panel\").resizable( {\n // Each chart has an embedded \".panel\" container with identical size and should be resized together\n alsoResize: $(this).find('.panel'),\n minHeight: 150,\n minWidth: 200,\n // Adjust position of se(horizontal and vertical) resize handle when resizing starts\n start: function(event, ui) {\n $(this).find(\".ui-resizable-se\").css(\"bottom\",\"1px\");\n $(this).find(\".ui-resizable-se\").css(\"right\",\"5px\");\n },\n // Make extra adjustment when the small multiple panel is being resizing\n resize: function(event, ui) {\n adjustSMPanelSize($(this).attr(\"qID\"));\n }\n });\n\n // Hide the e (horizontal) resize handle and s (vertical) resize handle (resizing on a single direction is forbidden)\n $(\"#panels\").find(\".sm-panel .ui-resizable-e\").hide();\n $(\"#panels\").find(\".sm-panel .ui-resizable-s\").hide();\n // Adjust position of se resize handle\n $(\"#panels\").find(\".sm-panel .ui-resizable-se\").css(\"right\",\"4px\");\n }", "function updateSize() {\n $svg.remove();\n var width = $element.width(),\n height = $element.height(),\n elmRatio = width/height;\n if (!height || elmRatio < ratio) {\n height = width / ratio;\n } else {\n width = height * ratio;\n }\n $svg.appendTo($element);\n $svg.css({width: width, height: height});\n }", "function updateWindowSize(contentWidth){\n $('#islands').width(contentWidth);\n islandScreenWidth = contentWidth;\n $('#droppable').width(contentWidth);\n}", "function updateShapeLabel(selectNamePrefix, genshiParam, dimensionIndex) {\n var spanId = selectNamePrefix + \"_span_shape\";\n var hiddenShapeRef = $(\"#\" + selectNamePrefix + \"_array_shape\");\n var hiddenShape = $.parseJSON(hiddenShapeRef.val());\n\n var expectedArrayDim = parseInt(($(\"#\" + selectNamePrefix + \"_expected_dim\").val()).split(\"requiredDim_\")[1]);\n var expectedSpanDimId = selectNamePrefix + \"_span_expected_dim\";\n\n var dimSelectId = \"dimId_\" + selectNamePrefix + \"_\" + genshiParam + \"_\" + dimensionIndex;\n var selectedOptionsCount = $(\"select[id='\" + dimSelectId + \"'] option:selected\").size();\n var aggSelectId = \"funcId_\" + selectNamePrefix + \"_\" + genshiParam + \"_\" + dimensionIndex;\n var aggregationFunction = $(\"select[id='\" + aggSelectId + \"'] option:selected\").val();\n aggregationFunction = aggregationFunction.split(\"func_\")[1];\n\n if (aggregationFunction != \"none\") {\n hiddenShape[dimensionIndex] = 1;\n } else if (selectedOptionsCount == 0) {\n hiddenShape[dimensionIndex] = $(\"select[id='\" + dimSelectId + \"'] option\").size();\n } else {\n hiddenShape[dimensionIndex] = selectedOptionsCount;\n }\n\n var dimension = 0;\n for (var i = 0; i < hiddenShape.length; i++) {\n if (hiddenShape[i] > 1) {\n dimension += 1;\n }\n }\n var dimLbl = \"\";\n if (dimension == 0) {\n dimLbl = \" => 1 element\";\n } else {\n dimLbl = \" => \" + dimension + \"D array\"\n }\n\n if (dimension != expectedArrayDim) {\n $(\"#\" + expectedSpanDimId).text(\"Please select a \" + expectedArrayDim + \"D array\");\n } else {\n $(\"#\" + expectedSpanDimId).text(\"\");\n }\n\n $(\"#\" + spanId).text(\"Array shape:\" + $.toJSON(hiddenShape) + dimLbl);\n hiddenShapeRef.val($.toJSON(hiddenShape));\n}", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "updateDimensions() {\n this.props.w = this.getWidth();\n this.props.h = this.getHeight();\n }", "function handleUpdate() {\n // Set CSS var (--this input's name) to input's value + suffix\n document.documentElement.style.setProperty(`--${this.name}`, this.value + this.dataset.sizing);\n}" ]
[ "0.7119299", "0.6495087", "0.6283018", "0.61688954", "0.6075968", "0.592012", "0.5852912", "0.5844542", "0.58080405", "0.5724996", "0.56657696", "0.56534666", "0.5648242", "0.56397265", "0.56374943", "0.5632622", "0.56306434", "0.5573068", "0.55637753", "0.55603683", "0.55496496", "0.5533623", "0.5525178", "0.5525178", "0.55144477", "0.5497111", "0.5494908", "0.54946", "0.54884374", "0.54833084", "0.5473108", "0.54665786", "0.5454692", "0.54528445", "0.5434716", "0.54317045", "0.5428584", "0.5420037", "0.5399121", "0.53990394", "0.5396932", "0.5380265", "0.53788626", "0.5377591", "0.5372258", "0.53707606", "0.53706634", "0.53599364", "0.5358078", "0.5352219", "0.53516984", "0.53516984", "0.53475857", "0.5339684", "0.533255", "0.532549", "0.53199255", "0.53196585", "0.53157187", "0.5302471", "0.5301313", "0.5296377", "0.52906775", "0.52893937", "0.5279586", "0.5277398", "0.52755326", "0.5263659", "0.5260651", "0.52446073", "0.5239185", "0.52390873", "0.52305347", "0.5225759", "0.5222933", "0.5215066", "0.52149993", "0.52141404", "0.52052", "0.52013457", "0.5200461", "0.52001125", "0.5196117", "0.51954496", "0.51930606", "0.5185234", "0.51847786", "0.51808465", "0.5180116", "0.5179537", "0.5179447", "0.5178851", "0.51786816", "0.51726675", "0.51706296", "0.51590115", "0.51590115", "0.51590115", "0.51563233", "0.51552296" ]
0.7309719
0
triggered from mouseup after dragging an element request element position update through ajax
function editElementPosition(selectedElement) { var left = selectedElement.getBoundingClientRect().left; var top = selectedElement.getBoundingClientRect().top; var data = {}; data.action = "editElementPosition"; data.id = selectedElement.dataset.id; data.left = left; data.top = top; data.handler = "slide"; var url = "ajax.php"; Ajax.post(data, url, function (json) { if (json.error) { $('#activeSlideContainer').innerHTML = json.error; } else { // only updates database document, no callback action required } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onMouseUp(e) {\n // we have finished dragging\n this.isMouseDown = false;\n\n // remove specific styles\n this.options.element.classList.remove(\"dragged\");\n\n // update our end position\n this.endPosition = this.currentPosition;\n\n // send our mouse/touch position to our hook\n var mousePosition = this.getMousePosition(e);\n\n // drag ended hook\n this.onDragEnded(mousePosition);\n }", "function mouseup() {\n var currentNode,\n elementIndexToAdd, elementIndexToRemove,\n addAfterElement,\n parentScopeData,\n deferred = $q.defer(),\n newCopyOfNode = {},\n promise = deferred.promise;\n\n if (isMoving) {\n // take actions if valid drop happened\n if (target.isDroppable) {\n // Scope where element should be dropped\n target.scope = target.treeview.scope();\n\n // Element where element should be dropped\n target.node = target.scope.treeData || target.scope.subnode;\n\n // Dragged element\n currentNode = scope.treedata;\n\n // Get Parent scope for element\n parentScopeData = scope.$parent.$parent.treedata;\n elementIndexToRemove = parentScopeData.subnodes.indexOf(currentNode);\n\n // Dragged element can be dropped directly to directory (via node label)\n if (target.dropToDir) {\n elementIndexToAdd = target.node.subnodes.length;\n\n // Expand directory if user want to put element to it\n if (!target.node.expanded) {\n target.node.expanded = true;\n }\n } else {\n addAfterElement = target.el.scope().treedata;\n\n // Calculate new Index for dragged node (it's different for dropping node before or after target)\n if (target.addAfterEl) {\n elementIndexToAdd = target.node.subnodes.indexOf(addAfterElement) + 1;\n } else {\n elementIndexToAdd = target.node.subnodes.indexOf(addAfterElement);\n }\n }\n target.elementIndexToAdd = elementIndexToAdd;\n\n // \"Resolve\" promise - rearrange nodes\n promise.then(function (passedObj) {\n var newElementIndex = passedObj.index || 0,\n newId;\n\n if (target.node.subnodes === parentScopeData.subnodes && newElementIndex < elementIndexToRemove) {\n parentScopeData.subnodes.splice(elementIndexToRemove, 1);\n target.node.subnodes.splice(newElementIndex, 0, currentNode);\n } else {\n // Check if node is comming from another treeview\n if (currentNode.getScope().treeid !== target.node.getScope().treeid) {\n // If node was selected and is comming from another tree we need to select parent node in old tree\n if (currentNode.selected) {\n TreeviewManager.selectNode(currentNode.getParent(), currentNode.getScope().treeid);\n currentNode.selected = false;\n }\n\n // Assigning new id for node to avoid duplicates\n // Developer can provide his own id and probably should\n newId = passedObj.newId || TreeviewManager.makeNewNodeId();\n\n if (TreeviewManager.trees[scope.treeid].scope.treeAllowCopy) {\n // makes copy of node\n newCopyOfNode = angular.copy(currentNode);\n newCopyOfNode.id = newId;\n newCopyOfNode.level = ++target.node.level;\n newCopyOfNode.getParent = function () {\n return target.node;\n };\n\n target.node.subnodes.splice(newElementIndex, 0, newCopyOfNode);\n } else {\n // cut node from one tree and put into another\n currentNode.id = newId;\n\n target.node.subnodes.splice(newElementIndex, 0, currentNode);\n parentScopeData.subnodes.splice(elementIndexToRemove, 1);\n\n currentNode.setParent(target.node);\n }\n } else {\n target.node.subnodes.splice(newElementIndex, 0, currentNode);\n parentScopeData.subnodes.splice(elementIndexToRemove, 1);\n }\n }\n });\n\n /* Custom method for DRAG END\n If there is no any custom method for Drag End - resolve promise and finalize dropping action\n */\n if (typeof scope.settings.customMethods !== 'undefined' && angular.isFunction(scope.settings.customMethods.dragEnd)) {\n scope.settings.customMethods.dragEnd(target.isDroppable, TreeviewManager.trees[scope.treeid].element, scope, target, deferred);\n } else {\n deferred.resolve({index: elementIndexToAdd});\n }\n } else {\n if (typeof scope.settings.customMethods !== 'undefined' && angular.isFunction(scope.settings.customMethods.dragEnd)) {\n scope.settings.customMethods.dragEnd(target.isDroppable, TreeviewManager.trees[scope.treeid].element, scope, target, deferred);\n }\n }\n\n // reset positions\n startX = startY = 0;\n\n // remove ghost\n elementCopy.remove();\n elementCopy = null;\n\n // remove drop area indicator\n if (typeof dropIndicator !== 'undefined') {\n dropIndicator.remove();\n }\n\n // Remove styles from old drop to directory indicator (DOM element)\n if (typeof dropToDirEl !== 'undefined') {\n dropToDirEl.removeClass('dropToDir');\n }\n\n // reset droppable\n target.isDroppable = false;\n\n // remove styles for whole treeview\n TreeviewManager.trees[scope.treeid].element.removeClass('dragging');\n\n // reset styles for dragged element\n element\n .removeClass('dragged')\n .removeAttr('style');\n }\n\n // remove events from $document\n $document\n .off('mousemove', mousemove)\n .off('mouseup', mouseup);\n\n firstMove = true;\n }", "mouseUp(pt) {}", "mouseUp(pt) {}", "function drop (e) {\r\n var note = $(e.target);\r\n var main = $(\"#main\");\r\n var id = note.attr('id');\r\n var x = note.offset().left - main.offset().left;\r\n var y = note.offset().top - main.offset().top;\r\n var params = \"id=\"+id+\"&x=\"+x+\"&y=\"+y;\r\n $.ajax({\r\n url: \"core/update.php\",\r\n type: \"POST\",\r\n dataType: \"text\",\r\n data: params\r\n });\r\n}", "function mouseUpEvent(eb){\r\n if(eb == 1){\r\n pictureArray[editingPic][0] = d3.event.pageX - pictureArray[editingPic][2]/2 - editBoxWidth/2 - 5\r\n pictureArray[editingPic][1] = d3.event.pageY - editBoxWidth/2 - 5\r\n dragging = -1\r\n }else{\r\n pictureArray[editingPic][2] = d3.event.pageX - pictureArray[editingPic][0] + editBoxWidth/2 - 5\r\n dragging = -1\r\n }\r\n update()\r\n}", "function onDragMove() {\n if (this.dragging) {\n let newPosition = this.data.getLocalPosition(this.parent);\n this.position.x = newPosition.x;\n this.position.y = newPosition.y;\n }\n}", "function mousedown(e){\n e.preventDefault();\n state.dragging = {};\n state.dragging.start = {\n x: e.pageX,\n y: e.pageY\n }\n state.dragging.original_x = state.center.x;\n state.dragging.original_y = state.center.y;\n $(document).bind(\"mousemove\", mousemove);\n $(document).bind(\"mouseup\", mouseup);\n }", "function drag(e) {\n if (active) { //check whether the drag is active\n \n //tell the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be (MDN)\n e.preventDefault();\n \n //set the value of currentX and currentY to the result of the current pointer position with an adjustment from initialX and initialY\n if (e.type === \"touchmove\") {\n currentX = e.touches[0].clientX - initialX;\n currentY = e.touches[0].clientY - initialY;\n } else {\n currentX = e.clientX - initialX;\n currentY = e.clientY - initialY;\n }\n\n //set the new Offset\n xOffset = currentX;\n yOffset = currentY;\n\n //set the new position for our dragged element\n setTranslate(currentX, currentY, dragItem);\n }\n }", "mouseUp(event) {\n if (!this.active) return;\n\n if (this.zoomSwitchPosition === true) {\n const firstPoint = this.pointToNormalizedCanvas(this.dragStart);\n const secondPoint = this.getMouseEventPosition(event);\n this.zoomOnRectangle(firstPoint, secondPoint);\n\n this.emitUpdateEvent();\n }\n this.zoomSwitchPosition = false;\n this.dragging = false;\n }", "function drag(e) {\n // If grab isn't empty, there's currently an object being dragged, do this\n if (grab !== 0) {\n // Let's find the element on the page whose data-drag=\"\" value matches the value of grab right now\n const element = document.querySelector('[data-drag=\"' + grab + '\"]');\n if (!element) {\n return;\n }\n\n // And to that element, let the new value of `top: ;` be equal to the old top position, plus the difference between the original top position and the current cursor position\n element.style.top =\n parseInt(oldTop) +\n parseInt((e.clientY || e.touches[0].clientY) - startY) +\n 'px';\n\n // And let the new value of `left: ;` be equal to the old left position, plus the difference between the original left position and the current cursor position\n element.style.left =\n parseInt(oldLeft) +\n parseInt((e.clientX || e.touches[0].clientX) - startX) +\n 'px';\n\n // That's all we do for dragging elements\n }\n}", "function DragHandler(el){el.remember('_draggable',this);this.el=el;}// Sets new parameter, starts dragging", "function DragHandler(el){el.remember('_draggable',this);this.el=el;}// Sets new parameter, starts dragging", "function _drag_init(elem) {\n // Store the object of the element which needs to be moved\n selected = elem;\n console.log(selected);\n x_elem = x_pos - selected.offsetLeft;\n y_elem = y_pos - selected.offsetTop;\n}", "function onDragMove() {\n if (this.dragging) {\n let newPosition = this.data.getLocalPosition(this.parent);\n this.x = newPosition.x;\n this.y = newPosition.y;\n }\n}", "_documentUpHandler(event) {\n const that = this;\n\n if (!that._thumbDragged) {\n return;\n }\n\n if (that.mechanicalAction === 'switchWhenReleased') {\n that._moveThumbBasedOnCoordinates(event, true, true);\n }\n else if (that.mechanicalAction === 'switchUntilReleased') {\n if (that._numericProcessor.compare(that._number, that._cachedValue._number)) {\n const oldValue = that._getEventValue();\n\n that._number = that._cachedValue._number;\n that._drawValue = that._cachedValue._drawValue;\n\n if (that._cachedValue._valueDate) {\n that._valueDate = that._cachedValue._valueDate;\n }\n\n that.value = that._cachedValue.value;\n\n that._moveThumbBasedOnValue(that._drawValue);\n\n const value = that._getEventValue();\n\n that.$.fireEvent('change', { 'value': value, 'oldValue': oldValue });\n that.$.hiddenInput.value = value;\n }\n }\n\n if (that.showTooltip) {\n that.$tooltip.addClass('jqx-hidden');\n }\n\n that._thumbDragged = false;\n that.$track.removeClass('jqx-dragged');\n that.$fill.removeClass('disable-animation');\n }", "function elementDrag(e) {\n e = e || window.event;\n // Calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos2 = pos4 - e.clientY;\n pos3 = e.clientX;\n pos4 = e.clientY;\n // Set the element's new position:\n divCont.style.marginLeft = divCont.offsetLeft - _self._ratio * pos1 + \"px\";\n divCont.style.marginTop = divCont.offsetTop - _self._ratio * pos2 + \"px\";\n }", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "function mouseDownEvent(eb){\r\n dragging = eb\r\n}", "function mup(e) {\r\n\t\t\t\t\t//remove event handler\r\n\t\t\t\t\t$(frameBody).off(\"mousemove\",mmove);\r\n\t\t\t\t\t$(frameBody).off(\"mouseleave\",mup);\r\n\t\t\t\t\t$(e.target).off(\"mouseup\",mup);\r\n\t\t\t\t\tisDrag=false;\r\n\t\t\t\t\tix=iy=\"\";\r\n\t\t\t\t}", "function mouseup(e) {\r\n fsw_state = 0;\r\n ui_modified = true;\r\n}", "function dragElement( event ) {\r\n xPosition = document.all ? window.event.clientX : event.pageX;\r\n yPosition = document.all ? window.event.clientY : event.pageY;\r\n if ( selected !== null ) {\r\n selected.style.left = ((xPosition - xElement) + selected.offsetWidth / 2) + 'px';\r\n selected.style.top = ((yPosition - yElement) + selected.offsetHeight / 2) + 'px';\r\n }\r\n }", "mouseDrag(prev, pt) {}", "mouseDrag(prev, pt) {}", "mouseDownUp(start, end) {}", "function moveHandler(e) {\n \tfunc_state = state_mouse_move;\n if (!e) e = window.event; // IE event Model\n // Move the element to the current mouse position, adjusted by the\n // position of the scrollbars and the offset of the initial click.\n var scroll = getScrollOffsets();\n var left = (e.clientX + scroll.x - deltaX);\n var top = (e.clientY + scroll.y - deltaY);\n elementToDrag.style.left = left + \"px\";\n elementToDrag.style.top = top + \"px\";\n console.log('in moveHandler: %d - %d', left, top);\n \t//console.log('element position: %s - %s', elementToDrag.style.left, elementToDrag.style.top);\n if(out_of_content_row(left, top)){\n \t//left = origX;\n //top = origY;\n \tdelete_file();\n \tupHandler(e);\n }\n // And don't let anyone else see this event.\n if (e.stopPropagation) e.stopPropagation(); // Standard\n else e.cancelBubble = true; // IE\n \tclearInterval(timer);\n }", "function draggingUp(e) {\n if (!module.isDragging) {\n return;\n }\n module.draggingMouseDown = {};\n // e.preventDefault();\n module.isDragging = false;\n // reset the mouse out state\n module.mouseOutState = 0;\n // if the area is too small, it is judged as invalid area then delete\n if (module.currentDraggingNode.getWidth() < 5 || module.currentDraggingNode.getHeight() < 5) {\n module.removeById(module.currentDraggingNode.id);\n }\n return false\n }", "function onMouseUp() {\n // sets the new location to default till moved again\n mouseDown = false;\n }", "function mouseup(e){\n\t\t// console.log(e);\n\n\t\tmouseIsDown = false;\n\n\t\tif (newFurniture == undefined) return;\n\n\t\tcurrentLayout.addFurniture(newFurniture);\n\n\t\tvar point = {\n\t\t\tx: e.offsetX,\n\t\t\ty: e.offsetY\n\t\t};\n\n\t\tvar midPoint = midPointBetweenPoints(startPoint, point);\n\n\t\tcurrentLayout.selectFurnitureAtPoint(midPoint);\n\n\t\tnewFurniture = undefined;\n\t}", "function mouseup(e){\n\t\t// console.log(e);\n\n\t\tif (mouseIsDown){\n\t\t\tvar point = {\n\t\t\t\tx: e.offsetX,\n\t\t\t\ty: e.offsetY\n\t\t\t};\n\n\t\t\tcurrentLayout.selectFurnitureAtPoint(point);\n\t\t}\n\n\t\tmouseIsDown = false;\n\t}", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "onPointerUp() {\n\t\tif (draggingEl) {\n\t\t\tthis.$clonedEl.remove();\n\t\t\tdocument.body.classList.remove(this.docBodyClass);\n\t\t\temit(draggingEl, 'dragend');\n\t\t\tdraggingEl = null;\n\t\t}\n\t\tdocument.removeEventListener(events.move, this.onPointerMove);\n\n\t\t// for auto-scroll\n\t\tthis.scrollParent.removeEventListener(events.enter, this.onPointerEnter);\n\t\tthis.scrollParent.removeEventListener(events.leave, this.onPointerLeave);\n\t\tthis.onPointerLeave();\n\t}", "onMouseUp(event) {\n event.preventDefault();\n\n if(!this.currentObject) {\n return;\n }\n\n let object = this.currentObject,\n cache = object.__draggable_cache,\n time = Date.now(),\n deltaTime = time - cache.time,\n objectBounds = cache.objectBounds,\n position = cache.position;\n\n if(deltaTime > 25 && cache.hasMoved) {\n cache.velocity.X = cache.velocity.Y = 0;\n }\n\n ['X', 'Y'].forEach((axis, index) => {\n ['min', 'max'].forEach(bound => {\n if(Math[bound](position[axis], objectBounds[bound + axis]) === position[axis])\n cache.velocity[axis] = -((position[axis] - objectBounds[bound + axis]) / 100);\n });\n });\n\n this.trigger('drag-end', [object, position]);\n\n if(\n this.settings.deceleration && (\n Math.abs(cache.velocity.X) > 0 ||\n Math.abs(cache.velocity.Y) > 0\n )\n ) {\n this.animateDeceleration(this.currentObject);\n } else {\n // If no deceleration to consider, fire stop event.\n this.trigger('stop', [object, position]);\n }\n\n this.currentObject = null;\n }", "function _maybeUpdateDraggable(el) {\n var parent = el.parentNode, container = instance.getContainer();\n while(parent != null && parent !== container) {\n if (instance.hasClass(parent, \"jtk-managed\")) {\n instance.recalculateOffsets(parent);\n return\n }\n parent = parent.parentNode;\n }\n }", "function Mouseup(e,target) {\n\t\t\t//remove event handler\n\t\t\t$(frameDocument).off(\"mousemove\",target,Mousemove);\n\t\t\t$(frameDocument).off(\"mouseleave\",target,Mouseup);\n\t\t\t$(frameDocument).off(\"mouseup\",target,Mouseup);\n\t\t\tisDrag=false;\n\t\t\tpositionX=positionY=\"\";\n\t\t\t\n\t\t\t//icon\n\t\t\t$(target).css(\"cursor\",\"default\");\n\t\t\t$(frameDocument).css(\"cursor\",\"default\");\n\t\t\ttarget=\"\";\n\t\t\t\n\t\t\teditor.updateTextArea();//update iframe\n\t\t}", "handleDrop (form, data, event) {\n event.stopImmediatePropagation()\n console.log(`FixedPositionForm.handleDrop(). form=`, form)\n console.log(`FixedPositionForm.handleDrop(), data=`, data)\n console.log(`FixedPositionForm.handleDrop(), el=`, this.$el)\n console.log(`FixedPositionForm.handleDrop(), event=`, event)\n var _fixed_x = data._fixed_x ? data._fixed_x : 0\n var _fixed_y = data._fixed_y ? data._fixed_y : 0\n\n // Work out the drop position\n let x = parseInt(_fixed_x) + (event.clientX - this.mouseDownX)\n let y = parseInt(_fixed_y) + (event.clientY - this.mouseDownY)\n console.log(`layer: x=${event.layerX}, y=${event.layerY}`)\n console.log(`mouseDown: x=${this.mouseDownX}, y=${this.mouseDownY}`)\n\n if (this.alignToGrid && this.gridSize > 1) {\n console.log('truncating position');\n x = Math.round(x / this.gridSize) * this.gridSize\n y = Math.round(y / this.gridSize) * this.gridSize\n }\n console.log(`new position: x=${x}, y=${y}`)\n\n var element = null\n\n if (data.dragtype == 'component') {\n\n // Get the element to be inserted, from the drop data.\n // let wrapper = {\n // type: 'contentservice.io',\n // version: \"1.0\",\n // layout: {\n // type: 'element-position',\n // _fixed_x: event.layerX,\n // _fixed_y: event.layerY,\n // children: [ ]\n // }\n // }\n\n // Get the layerX and layerY for components dragged from the contentservice\n x = event.layerX\n y = event.layerY\n \n console.log(`rooss 1`, data);\n let newElement = data.data\n // wrapper.layout.children.push(newElement)\n let position = this.element.children.length\n // console.error(`new wrapper is`, wrapper);\n console.error(`newElement is`, newElement);\n console.log(`rooss 2`);\n let rv = this.$content.insertLayout({ vm: this, parent: this.element, position, layout: newElement })\n console.log(`rooss 3`);\n console.log(`return from insertLayout is ${rv}`);\n this.counter++ //ZZZZZ?\n console.log(`rooss 4`);\n \n } else {\n // console.log(`Dropped non-component: '${data.type}'`)\n console.log(`Dropped element (not from toolbox)`)\n console.log(`data=`, data);\n // x: event.layerX,\n // y: event.layerY,\n // this.$content.setPropertyInElement({ vm: this, element: data, name: 'x', value: x })\n // this.$content.setPropertyInElement({ vm: this, element: data, name: 'y', value: y })\n // return\n element = data\n }\n\n this.$content.setProperty({ vm: this, element: element, name: '_fixed', value: true })\n this.$content.setProperty({ vm: this, element: element, name: '_fixed_x', value: x })\n this.$content.setProperty({ vm: this, element: element, name: '_fixed_y', value: y })\n this.$content.setProperty({ vm: this, element: element, name: 'parentIndex', value: data.parentIndex })\n\n console.log(element, data.parentIndex)\n\n\n\n // // Get the element to be inserted, from the drop data.\n // let insertContent = data.data\n\n // // Note that 'child' is the existing child, not the child being inserted.\n // if (child) {\n // // Insert before the specified child.\n // for (var i = 0; i < element.children.length; i++) {\n // if (element.children[i] === child) {\n // console.log(`Insert at position ${i}`)\n // this.$content.insertLayout({ vm: this, parent: element, position: i, layout: insertContent })\n // break\n // }\n // }\n // } else {\n // // No child specified - add at the end\n // this.$content.insertLayout({ vm: this, parent: element, position: -1, layout: insertContent })\n // }\n }", "function dragContent(){\n\t\t$('.stationInfo').draggable();\n\t}", "function updatePos(drop_m, drop_v, dx, dy){\n drop_m.x += dx;\n drop_m.y += dy;\n \n drop_v.css({\n 'left': drop_m.x + 'px',\n 'top': drop_m.y + 'px'\n });\n}", "function drag(ev){\r\n\t//console.log(ev.target.parentNode);\r\n\tvar ss = (parseInt($(ev.target.parentNode).position().left,10) - ev.clientX) + ',' + (parseInt($(ev.target.parentNode).position().top,10) - ev.clientY);\r\n\tev.dataTransfer.setData(\"text/plain\", ss + ',' + $(ev.target.parentNode).attr('id'));\r\n\t//ev.dataTransfer.setDragImage(document.getElementById(\"draggit\"), 10, 10);\r\n\t//console.log(\"drag:target\", $(ev.target).position().left + \",\" + $(ev.target).position().top);\r\n\t//console.log(\"drag:offset\", ss);\r\n\t//console.log();\r\n}", "function mouseUp() { }", "function handleDrag ( event /*: JQueryEventObject */ ) {\n var dx = event.pageX - $element[0].dragData.lastX,\n dy = event.pageY - $element[0].dragData.lastY,\n dleft = dx, dtop = dy, dright = dx, dbottom = dy;\n if ( $element[0].dragData.type != 4 ) {\n if ( $element[0].dragData.type > 2 ) dtop = 0;\n if ( $element[0].dragData.type < 6 ) dbottom = 0;\n if ( $element[0].dragData.type % 3 > 0 ) dleft = 0;\n if ( $element[0].dragData.type % 3 < 2 ) dright = 0;\n }\n reposition( dleft, dtop, dright, dbottom );\n $element[0].dragData.lastX = event.pageX;\n $element[0].dragData.lastY = event.pageY;\n }", "function handleDrag(event, ui, status) {\n\t\tui = $(ui);\n\t\tvar draggedElem = $(ui[0].helper);\n\n\t\tswitch(status) {\n\t\t\tcase DRAG:\n\t\t\t\tbreak;\n\t\t\tcase DROP:\n\t\t\t\tdraggedElem.css({\n\t\t\t\t\t\"left\" : 0,\n\t\t\t\t\t\"top\" : 0\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t}\n\t}", "function ev_mouseup(e) {\n\t//e.preventDefault();\n\t//canEl.onmousemove = null;\n\tif (dimmerUpdateId != -1)\n\t\tobjArr[dimmerUpdateId].onMouseUp();\n\tdimmerUpdateId = -1;\n}", "_handleDragging(event) {\n const p = this._getPoint(event);\n\n this._updateValue(this._currentHandle, this._getValueFromCoord(p.pageX, p.pageY));\n\n event.preventDefault();\n }", "startDrag(x, y) {}", "function mouseup(e) {\n angular.element(document).unbind('mousemove', mousemove);\n angular.element(document).unbind('mouseup', mouseup);\n dragging = false;\n }", "function _drag_init(elem) {\n\t\t\t\tselected = elem; // Store the object of the element which needs to be moved\n\t\t\t\tx_elem = x_pos - selected.offsetLeft;\n\t\t\t\ty_elem = y_pos - selected.offsetTop;\n\t\t\t}", "function _drag_init(elem) {\n\t\t\tselected = elem; // Store the object of the element which needs to be moved\n\t\t\tx_elem = x_pos - selected.offsetLeft;\n\t\t\ty_elem = y_pos - selected.offsetTop;\n\t\t}", "function _drag_init(elem) {\n\t\t\tselected = elem; // Store the object of the element which needs to be moved\n\t\t\tx_elem = x_pos - selected.offsetLeft;\n\t\t\ty_elem = y_pos - selected.offsetTop;\n\t\t}", "function _drag_init(elem) {\n\t // Store the object of the element which needs to be moved\n\t selected = elem;\n\t x_elem = x_pos - selected.offsetLeft;\n\t y_elem = y_pos - selected.offsetTop;\n\t}", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "function _move_elem(e)\n {\n\n x_pos = document.all ? window.event.clientX : e.pageX; //window.event.clientX\n y_pos = document.all ? window.event.clientY : e.pageY; //window.event.clientY\n if (selected !== null) {\n hide_infobars();\n selected.style.left =(x_pos - x_elem) + 'px'; ///(x_pos - x_elem) + 'px';\n selected.style.top = (y_pos - y_elem) + 'px';/// (y_pos - y_elem) + 'px';\n }\n }", "startDrag(e) {\n const selectedElement = e.target.parentElement,\n offset = this.getMousePosition(e, selectedElement);\n if ($(selectedElement).hasClass( \"sticker\" )) {\n offset.x -= parseFloat(selectedElement.getAttributeNS(null, \"x\")),\n offset.y -= parseFloat(selectedElement.getAttributeNS(null, \"y\"));\n this.setState({\n selectedElement:selectedElementom ,\n offset: offset\n })\n }\n }", "function mouseDragged(){\r\n inputForMDragging(mouseX, mouseY);\r\n\r\n\r\n}", "function onMouseUp(event)\n{\n onMouseMove(event); // just reusing the above code\n dragging = false; // adding one line here\n}", "mouseDownUp(start, end) {\n \n }", "function drag(e, selected) {\r\n\r\n //the name\r\n let name = \"#\" + selected;\r\n\r\n //the positions\r\n let x = e.pageX;\r\n let y = e.pageY;\r\n\r\n x *= zoomx / window.innerWidth;\r\n y *= zoomy / window.innerHeight;\r\n\r\n //updating positions\r\n set_position(name, x, y);\r\n}", "function handleDragEnd(){\n this.isMouseDown = false\n this.lastX = null\n}", "function onMouseDown(event)\n{\n dragging = true;\n var pos = getRelative(event);\n mouseDragStartX = pos.x;\n mouseDragStartY = pos.y;\n}", "function dragstart(element) {\r\n //Wird aufgerufen, wenn ein Objekt bewegt werden soll.\r\n dragobjekt = element;\r\n dragx = posx - dragobjekt.offsetLeft;\r\n dragy = posy - dragobjekt.offsetTop;\r\n}", "on_mouseup(e, localX, localY) {\n\n }", "function dragstart(element) {\r\n dragobjekt = element;\r\n dragx = posx - dragobjekt.offsetLeft;\r\n dragy = posy - dragobjekt.offsetTop;\r\n}", "function _drag_init(elem) {\n // Store the object of the element which needs to be moved\n selected = elem;\n x_elem = x_pos - selected.offsetLeft;\n y_elem = y_pos - selected.offsetTop;\n}", "function _drag_init(elem) {\n // Store the object of the element which needs to be moved\n selected = elem;\n x_elem = x_pos - selected.offsetLeft;\n y_elem = y_pos - selected.offsetTop;\n}", "function handleUp() {\n resetCard();\n $('.search-searchbox').animate({\n top: \"-249px\"\n }, 200, function() {});\n showHideToggle('show', 'hide');\n scrollSize();\n // insert the data credit into the map\n $('.gm-style').append('<div draggable=\"false\" class=\"card-cc gm-style-cc\"><div class=\"card-cc-spacer\"><div style=\"width: 1px;\"></div><div class=\"card-cc-background\"></div></div><div class=\"card-cc-data\"><a target=\"_blank\" class=\"card-cc-link data-cc\" rel=\"noopener\">Data Credit:</a></div></div>');\n}", "updateContainerDrag(event) {\n const me = this,\n context = me.context;\n\n if (!context.started || !context.targetElement) return;\n\n const containerElement = DomHelper.getAncestor(context.targetElement, me.containers, 'b-grid'),\n willLoseFocus = context.dragging && context.dragging.contains(document.activeElement);\n\n if (containerElement && DomHelper.isDescendant(context.element, containerElement)) {\n // dragging over part of self, do nothing\n return;\n }\n\n // The dragging element contains focus, and moving it within the DOM\n // will cause focus loss which might affect an encapsulating autoClose Popup.\n // Prevent focus loss handling during the DOM move.\n if (willLoseFocus) {\n GlobalEvents.suspendFocusEvents();\n }\n if (containerElement && context.valid) {\n me.moveNextTo(containerElement, event);\n } else {\n // dragged outside of containers, revert position\n me.revertPosition();\n }\n if (willLoseFocus) {\n GlobalEvents.resumeFocusEvents();\n }\n\n event.preventDefault();\n }", "_documentUpHandler() {\n const that = this;\n\n if (that._dragging) {\n that._lockCW = false;\n that._lockCCW = false;\n\n that._dragging = false;\n that.removeAttribute('dragged');\n\n if (that.mechanicalAction !== 'switchWhileDragging') {\n const newValue = that.mechanicalAction === 'switchUntilReleased' ? that._valueAtDragStart : that._valueAtMoveEnd;\n\n if (that._numericProcessor.compare(newValue, that.value)) {\n if (that.mechanicalAction === 'switchUntilReleased') {\n that._animate(that.value, newValue);\n }\n\n that._numericProcessor.updateGaugeValue(newValue);\n }\n }\n }\n }", "function _drag_init(elem) {\n selected = elem; // Store the object of the element which needs to be moved\n x_elem = x_pos - selected.offsetLeft;\n y_elem = y_pos - selected.offsetTop;\n }", "onElementMouseUp(event) {\n if (this.dragContext) {\n this.endMove();\n event.preventDefault();\n }\n }", "function initDraggable() {\n $(\"body .draggable .draggable-region\").live(\"mousedown\", function(evt){\n try{\n $(\"body\").addClass(\"noselect\");\n var obj = $(this);\n var clkObj = $(evt.target);\n //Return if disabled\n if (obj.hasClass(\"disabled\") || clkObj.hasClass(\"fakeLink\") || clkObj.get(0).tagName.toUpperCase() == \"A\") {return;}\n var wholeObj = obj.closest(\".draggable\");\n if (wholeObj.hasClass(\"disabled\")) {return;}\n //Events and Classes\n wholeObj.addClass(\"draggable-down\");\n if(UTIL.getID(\"draggable-overlay-hack\") == null) {\n $(document.body).append(\"<div id='draggable-overlay-hack' style='height:100%;width:100%;position:fixed;top:0;left:0;'></div>\");\n }\n var overlay = $(\"#draggable-overlay-hack\");\n overlay.css({\"display\" : \"block\", \"z-index\" : \"1000\", \"cursor\" : \"move\"});\n overlay.bind(\"mousemove.draggable\", function(e){\n var wholeObj = obj.closest(\".draggable\");\n wholeObj.removeClass(\"draggable-down\").addClass(\"draggable-move\");\n //Update Position\n var coor = wholeObj.attr(\"draggableAnchor\").split(\",\");\n var ancX = parseInt(coor[0]);\n var ancY = parseInt(coor[1]);\n var pos = wholeObj.offset();\n var absX = pos.left;\n var absY = pos.top;\n var relX = parseInt(wholeObj.css(\"left\"),10);\n var relY = parseInt(wholeObj.css(\"top\"),10);\n var mRelX = e.pageX - absX;\n var mRelY = e.pageY - absY;\n wholeObj.css({\"left\" : (relX+(mRelX-ancX))+\"px\", \"top\" : (relY+(mRelY-ancY))+\"px\"});\n })\n .bind(\"mouseup.draggable mouseleave.draggable\", function(){\n $(\"body\").removeClass(\"noselect\");\n var wholeObj = obj.closest(\".draggable\");\n wholeObj.removeClass(\"draggable-down draggable-move\").removeAttr(\"draggableAnchor\");\n $(this).unbind(\".draggable\").css({\"display\": \"none\", \"cursor\" : \"auto\"});\n });\n //Record the anchor point for the object\n var relX = evt.layerX ? evt.layerX : evt.offsetX;\n var relY = evt.layerY ? evt.layerY : evt.offsetY;\n wholeObj.attr(\"draggableAnchor\", relX+\",\"+relY);\n }catch(e){alert(e)}\n });\n}", "drag_feedback(){\r\n this.dragging = true;\r\n }", "function init_SwDragDrop() {\n $(\"#currentSwimlane\").sortable({\n placeholder: \"ui-state-highlight\",\n start: function (event, ui) {\n ui.item.startPos = ui.item.index();\n },\n stop: function (event, ui) {\n var index = ui.item.index();\n var startPos = ui.item.startPos;\n\n // Update to database\n var sw = this.getElementsByClassName(\"swimlane\");\n if (index < startPos) {\n // If the swimlane move up\n for (var i = index; i < startPos + 1; i++) {\n saveSwimlanePosition($(sw[i]).attr(\"data-id\"), i);\n }\n }\n else {\n // If the swimlane move down\n for (var i = startPos; i < index + 1; i++) {\n saveSwimlanePosition($(sw[i]).attr(\"data-id\"), i);\n }\n }\n\n // Update in the board\n changeSwPosition(startPos, index);\n\n // Send update to other client\n proxyNote.invoke(\"changeSWPosition\", startPos, index);\n }\n }).disableSelection();\n}", "function moveUp() {\n\n\tvar flag = '#moveUp';\n\t//apply selected class on current button\n\taddSelectedClassOnButton(flag);\n\t//get id form slected li by attr\n\tvar id = $('ul#mostPopularCode li.selected').attr('id');\n\t//get postion form slected li by attr\n\tvar pos = $('ul#mostPopularCode li.selected').attr('relpos');\n\tif(parseInt(id) > 0){\n\t\t$.ajax({\n\t\t\turl : HOST_PATH + \"admin/popularcode/moveup/id/\" + id + \"/pos/\" + pos,\n\t\t\t\tmethod : \"post\",\n\t\t\t\tdataType : \"json\",\n\t\t\t\ttype : \"post\",\n\t\t\t\tsuccess : function(json) {\n\t\t\t\t\t$('ul#mostPopularCode li').remove();\n\t\t\t\t\tvar li = '';\n\t\t\t\t\tfor(var i in json)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t \tli+= \"<li reltype='\" + json[i].type + \"' relpos='\" + json[i].position + \"' reloffer='\" + json[i].offerId + \"' id='\" + json[i].id + \"' >\" + json[i].offer.title + \"</li>\";\n\n\t\t\t\t\t\t}\n\t\t\t\t\t//append li in ul( list of popular code\n\t\t\t\t\t$('ul#mostPopularCode').append(li);\n\t\t\t\t\t$('ul#mostPopularCode li#'+id).addClass('selected');\n\t\t\t\t\t$('ul#mostPopularCode li').click(changeSelectedClass);\n\t\t\t\t}\n\n\n\t\t});\n\n\t} else {\n\n\t\tbootbox.alert(__('Please select an offer from list'));\n\t}\n}", "function doUpd(cb){\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate); \n\t\t\t\tmethods.update.call(null,$this[0],cb);\n\t\t\t}", "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "onMouseUp(event) {\n this.isDragging = false;\n this.isPanning = false;\n this.isMinimapPanning = false;\n if (this.layout && typeof this.layout !== 'string' && this.layout.onDragEnd) {\n this.layout.onDragEnd(this.draggingNode, event);\n }\n }", "function drop(event) {\n\tvar offset = event.dataTransfer.getData(\"application/x-moz-node\").split(',');\n\n\tvar mv = document.getElementsByClassName('moveable');\n\tmv[offset[2]].style.left = (event.clientX + parseInt(offset[0], 10)) + 'px';\n\tmv[offset[2]].style.top = (event.clientY + parseInt(offset[1], 10)) + 'px';\n\tevent.preventDefault();\n\treturn false;\n}", "function dragDrop(e,ui)\n\t{\n\t\tvar element=ui.draggable;\n\t\tvar data=element.data(\"url\");\n\t\tvar x=parseInt(ui.offset.left-offsetX);\n\t\tvar y=parseInt(ui.offset.top-offsetY);\n\t\timageX.push(x);\n\t\timageY.push(y);\n\t\tRedraw();\n\t}", "function onDisplayedPointMouseup(event) {\n\t\tpreviousPageX = null;\n\t\t\n\t\tpreviousPageY = null;\n\t\t\n\t\t$(this).off('mousemove', onDisplayedPointMousemove);\n\t}", "async up(xOffset: number, yOffset: number): Promise<void> {\n const location = await this._parent.getPosition();\n await this.driver.activeWindow.touch.down(location.x + xOffset, location.y + yOffset);\n }", "function setDnR(){\n\n try{\n\n $('.DroppedItem').draggable({\n drag: function(event, ui){\n if ((ui.offset.top <= 100) && (ui.offset.left <= 600)){\n $(self).offset.top(100);\n }\n\n },\n scroll : true\n }).resizable();\n \n }catch(E){\n raiseException(E);\n }\n\n\n}", "function engage(e) {\n dragging = true;\n putPoint(e);\n}", "function onMouseUp(e) {\n\n\t\t\t// propagate the event to the callback with x,y coords\n\t\t\tmouseUpCB(e, translateMouseCoords(e.clientX, e.clientY));\n\t\t}", "updateContainerDrag(event) {\n const me = this,\n context = me.context;\n if (!context.started || !context.targetElement) return;\n const containerElement = DomHelper.getAncestor(context.targetElement, me.containers, 'b-grid'),\n willLoseFocus = context.dragging && context.dragging.contains(document.activeElement);\n\n if (containerElement && DomHelper.isDescendant(context.element, containerElement)) {\n // dragging over part of self, do nothing\n return;\n } // The dragging element contains focus, and moving it within the DOM\n // will cause focus loss which might affect an encapsulating autoClose Popup.\n // Prevent focus loss handling during the DOM move.\n\n if (willLoseFocus) {\n GlobalEvents.suspendFocusEvents();\n }\n\n if (containerElement && context.valid) {\n me.moveNextTo(containerElement, event);\n } else {\n // dragged outside of containers, revert position\n me.revertPosition();\n }\n\n if (willLoseFocus) {\n GlobalEvents.resumeFocusEvents();\n }\n\n event.preventDefault();\n }", "function onMouseup(){elements.input.focus();}", "function update() {\n //var snap = snap.prop(\"checked\"), liveSnap = $liveSnap.prop(\"checked\");\n Draggable.create('.box', {\n bounds: container,\n edgeResistance: 0.65,\n type: 'x,y',\n throwProps: true,\n liveSnap: liveSnap,\n snap: {\n x: function (endValue) {\n return snap || liveSnap ? Math.round(endValue / gridWidth) * gridWidth : endValue;\n },\n y: function (endValue) {\n return snap || liveSnap ? Math.round(endValue / gridHeight) * gridHeight : endValue;\n }\n }\n });\n }", "onElementMouseUp(event) {}", "onElementMouseUp(event) {}", "function doUpd(cb){\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate);\n\t\t\t\tmethods.update.call(null,$this[0],cb);\n\t\t\t}", "function doUpd(cb){\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate);\n\t\t\t\tmethods.update.call(null,$this[0],cb);\n\t\t\t}", "function doUpd(cb){\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate);\n\t\t\t\tmethods.update.call(null,$this[0],cb);\n\t\t\t}", "function doUpd(cb){\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate);\n\t\t\t\tmethods.update.call(null,$this[0],cb);\n\t\t\t}", "function doUpd(cb){\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate);\n\t\t\t\tmethods.update.call(null,$this[0],cb);\n\t\t\t}", "function FixedUpdate(){\n\tif(beingDragged){\n\t\t//store the position if it is valid\n\t\tif(_intersecting == 0)\n\t\t\toldPosition = cachedTransform.position;\n\t\tDragObject();\n\t}\n}", "function update() {\n var snap = $snap.prop(\"checked\"),\n liveSnap = $liveSnap.prop(\"checked\");\n\tDraggable.create(\".box\", {\n\t\tbounds:$container,\n\t\tedgeResistance:0.65,\n\t\ttype:\"x,y\",\n\t\tthrowProps:true,\n\t\tliveSnap:liveSnap,\n\t\tsnap:{\n\t\t\tx: function(endValue) {\n\t\t\t\treturn (snap || liveSnap) ? Math.round(endValue / gridWidth) * gridWidth : endValue;\n\t\t\t},\n\t\t\ty: function(endValue) {\n\t\t\t\treturn (snap || liveSnap) ? Math.round(endValue / gridHeight) * gridHeight : endValue;\n\t\t\t}\n\t\t}\n\t});\n}", "onDragBegin(event,nodePath){\n var vm = this;\n\t\tevent.dataTransfer.setData(\"srcObjectNode\", nodePath);\n console.log(\"onDragBegin:\"+nodePath);\n event.stopPropagation(); \n $(\"#solvent_lastmile_drop_position_indicator\").css(\"display\",\"none\"); \n\n vm.setClientAppData(\"clipboardState\",{\"mode\":\"move\",\"component\":nodePath});\n\n\n $(\"#solvent_lastmile_drop_position_indicator\")\n .css({\"display\":\"block\"/*,\"min-width\":indicatorWidth*/})\n .position({\n my:\"center top\",\n at:\"center top\",\n of:window \n }) \n }", "function setEvent() {\r\n $('.MosContainer').draggable({revert : 'invalid', zIndex : '2700', refreshPositions: true, cursor: \"crosshair\"});\r\n $('.MosContainer').draggable({\r\n\tstart : function () {\r\n\t idDrag = $(this).data('id');\r\n\t $(this).css('z-index', '100');\r\n\t},\r\n\tend : function () {\r\n\t $(this).css('z-index', '1');\r\n\t},\r\n });\r\n\r\n $('.grill').droppable({\r\n\t'over' : function (event, ui) {\r\n\t var buffer = 'grill-can-drop';\r\n\t var x = $(this).data('x') - 1;\r\n\t var y = 0;\r\n\r\n\t if (!$(this).data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\tbuffer = 'grill-cant-drop';\r\n\t }\r\n\t for (id in $(this).data('parent').fence) {\r\n\t\tif ($(this).data('parent').fence[id].data('x') >= $(this).data('x') && $(this).data('parent').fence[id].data('x') < (ui.draggable.data('important') + $(this).data('x'))) {\r\n\t\t if ($(this).data('parent').fence[id].data('y') >= $(this).data('y') && $(this).data('parent').fence[id].data('y') < (ui.draggable.data('important') + $(this).data('y'))) {\r\n\t\t\t$(this).data('parent').fence[id].addClass(buffer);\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t},\r\n\t'out' : function () {\r\n\t $('.grill').removeClass('grill-can-drop');\r\n\t $('.grill').removeClass('grill-cant-drop');\r\n\t},\r\n\tdrop : function (event, ui) {\r\n\t if ($(this).data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\t//ui.draggable.data('parent').container.splice(ui.draggable.data('id'), 1);\r\n\t\tui.draggable.data('parent').removeContainer(ui.draggable.data('id'));\r\n\t\t//ui.draggable.css('top', $(this).css('top'));\r\n\t\t//ui.draggable.css('left', $(this).css('left'));\r\n\t\tui.draggable.data('x', $(this).data('x'));\r\n\t\tui.draggable.data('y', $(this).data('y'));\r\n\t\t$(this).data('parent').addContainer(ui.draggable.data('me'));\r\n\r\n\t } else {\r\n\t\t$('.Mosaique').trigger('mosaiqueResize');\r\n\t }\r\n\t $('.grill').removeClass('grill-can-drop');\r\n\t $('.grill').removeClass('grill-cant-drop');\r\n\t $('.Mosaique').trigger('mosaiqueResize');\r\n\t}\r\n });\r\n $('.MosContainer').droppable({\r\n\tdrop : function (event, ui) {\r\n\t if (ui.draggable.data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\tvar x = $(this).data('x');\r\n\t\tvar y = $(this).data('y');\r\n\t\tvar id = parseInt($(this).data('id'));\r\n\t\tvar container = ui.draggable.data('parent').container[id];\r\n\r\n\t\tui.draggable.data('x', x);\r\n\t\tui.draggable.data('y', y);\r\n\r\n\t\tui.draggable.data('parent').removeContainer(id);\r\n\t\t/*if (ui.draggable.data('id') > $(this).data('id')) {\r\n\t\t//ui.draggable.data('parent').container[id] = ui.draggable.data('parent').container[ui.draggable.data('id')];\r\n\t\t//ui.draggable.data('parent').container[ui.draggable.data('id')] = container;\r\n\r\n\t\t//$(this).data('id', ui.draggable.data('id'));\r\n\t\t//ui.draggable.data('id', id);\r\n\t\t}*/\r\n\t\t$('.Mosaique').trigger('mosaiqueResize');\r\n\t }\r\n\t}\r\n });\r\n $('.videoClass, .streamClass').on({\r\n\tclick : function (event, ui) {\r\n\t var t = new One_tabs();\r\n\t var tchat = new Tchat(user, new Connect(), $(this).data(\"me\").tchat_id, $(this).data(\"me\").id);\r\n\r\n\t var i = tab.add_tabs(t);\r\n\t t.tab.add_content($(this).data('me').displayContent());\r\n\t t.tab.add_content(tchat.getHtml())\r\n\t t.onglet.icon = $(this).data(\"me\").name;\r\n\t tab.displayAll();\r\n\t tab.action['moins'].html.children('a').trigger('click');\r\n\t tchat.setPos(\"70%\", \"10%\");\r\n\t tchat.setSize(\"80%\", \"28%\");\r\n\t}\r\n });\r\n $('.folderClass').click(function () {\r\n\tgoInFolder($(this).data(\"me\").id);\r\n });\r\n}", "shftUp(event) {\n // console.log(event)\n if (this.lineData.$parent.getIndexOfSon(this.lineData) != 0) {\n this.lineData.$parent.moveSonUp(this.lineData);\n }\n }", "function onMouseUp(event) {\n destination = event.point\n}" ]
[ "0.64260936", "0.6425617", "0.62787956", "0.62787956", "0.62750095", "0.62742996", "0.621151", "0.6165548", "0.61621416", "0.61463434", "0.61344", "0.610288", "0.610288", "0.60891455", "0.6087538", "0.60825616", "0.6062672", "0.6055652", "0.6052325", "0.60324657", "0.60300547", "0.6026709", "0.60230845", "0.60230845", "0.6019984", "0.60171145", "0.60045326", "0.6003708", "0.5991947", "0.59776974", "0.597736", "0.5966003", "0.59564376", "0.59473395", "0.5944624", "0.5922824", "0.59171665", "0.5899224", "0.58739114", "0.58660597", "0.58608854", "0.5858675", "0.58586156", "0.58485544", "0.58480674", "0.58419514", "0.58403045", "0.583728", "0.583728", "0.5835334", "0.58217895", "0.58217895", "0.5819534", "0.5814608", "0.58093494", "0.5804082", "0.57967937", "0.579365", "0.5791945", "0.57836455", "0.5782724", "0.57823324", "0.5780464", "0.57803535", "0.57803535", "0.5776597", "0.57752585", "0.5774137", "0.57737136", "0.57728827", "0.5767558", "0.5760575", "0.57594156", "0.57514346", "0.5741521", "0.5734035", "0.57290727", "0.57289714", "0.57259774", "0.5716624", "0.57097757", "0.57093996", "0.5706863", "0.5706165", "0.5705911", "0.57024413", "0.5700037", "0.56968755", "0.56968755", "0.56949276", "0.56949276", "0.56949276", "0.56949276", "0.56949276", "0.56938845", "0.56929994", "0.56845796", "0.5683919", "0.5681776", "0.5681612" ]
0.62344575
6
request to update an elements' text in database
function changeText(element) { //var text = element.getElementsByClassName('textnode')[0].innerHTML; var text = element.innerHTML; var elementId = element.dataset.id; console.log("neuer Text für Element " + elementId + " ist " + text); var div = $('#lengthCalculator'); div.innerHTML = element; var width = calculateWidth(element); var height = calculateHeight(element); var data = {}; data.action = "editElement"; data.elementId = elementId; data.text = text; data.height = height; data.width = width; data.handler = "slide"; var url = "ajax.php"; Ajax.post(data, url, function (json) { if (json.error) { $('#activeSlideContainer').innerHTML = json.error; } else { // only updates database document, no callback action required console.log("Neuer Text: " + json.text); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateText(elementID, text){\n \n}", "function updateNote(noteEl) {\n const noteText = document.getElementById('note-text').value\n fetch(url + '/' + `${noteEl.parentElement.id} `, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n title: noteText,\n body: noteText,\n updated_at: moment().format()\n })\n })\n .then(res => res.json())\n .then(data => {\n renderNoteText(noteEl.parentElement, data)\n })\n}", "function updateItemInDb()\n {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var result = this.responseText;\n $(\"#confirmUpdate\").text(result);\n }\n }\n \n xmlhttp.open(\"POST\", \"../stock/adminUpdateStock.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(collectData());\n }", "function UpdateText(formName, text, textName)\r\n{\r\n sql = \"UPDATE `Control` SET `Control`.`Text` = '\" + text + \"' \" +\r\n \"WHERE `Control`.`Dialog_`='\" + formName + \"' AND `Control`.`Control`='\" + textName + \"'\"\r\n view = database.OpenView(sql);\r\n view.Execute();\r\n view.Close();\r\n}", "function post_update_comment ( task_id, comment_id ){\n\n var text = document.getElementById(task_id.toString()+comment_id.toString()).innerHTML;\n\n $.ajax({\n url: \"/task/\"+task_id+\"/comment/update/\"+comment_id+\"/\",\n method:\"POST\",\n data: {\n 'text': text\n },\n dataType: 'json',\n success: function (data) {\n approve_appear(\"Changes of comment saved \");\n }\n });\n\n\n\n}", "function test_update()\n{\n // samle update request\n var sql = \"update T_TASKS tt set tt.feedback = '👍👍👍' where tt.j_tsk_id = 100500\";\n runCustomUpdate_(sql); \n}", "function Update() {\n\tvar newUrl = \"http://localhost:8000/notes/\" + $('#txtUpdate').val()\n\t$.ajax({\n\t\turl: newUrl,\n\t\tdata: { value: $('#txtnew').val() },\n\t\tmethod: \"PUT\",\n\t\tsuccess: (data) => {\n\t\t\tconsole.log(data)\n\t\t\t\n\t\t}\n\t});\n}", "function updateData(elem)\n{\n elem.attr('contenteditable', 'false');\n elem.attr('spellcheck', 'false');\n var str = elem[0].innerHTML;\n str = str.replace(/\"/g, \"'\")\n $.ajax({\n url: './php/tools/updateContent.php',\n type: 'GET',\n data: {\n \"id\": ''+elem[0].id+'',\n \"content\": str\n },\n success: function(data) {\n console.log(\"success\")\n getContent(elem);\n },\n error: function(e) {\n console.log(\"oops\");\n }\n });\n}", "updateNLPInfo(newText) {\n this.spinRefresh(true);\n var oldText = this.state.query.text;\n\n this.props.updateQuery(\n this.state.query.id,\n oldText,\n newText,\n (updatedQuery) => {\n this.setState(\n {\n query: updatedQuery,\n editMode: false,\n },\n () => {\n this.colorEntities();\n this.spinRefresh(false);\n }\n );\n }\n );\n }", "function editGo(id) {\r\n db.readTransaction(function(t) {\r\n t.executeSql('SELECT * FROM Contacts WHERE id = ?', [id], function(t, r) {\r\n var row = r.rows.item(0);\r\n if(row) {\r\n var f = element('contForm');\r\n f.elements['lastname'].value = row.lastname;\r\n f.elements['firstname'].value = row.firstname;\r\n f.elements['email'].value = row.email;\r\n f.elements['goButton'].value = 'Update';\r\n f.elements['inputAction'].value = 'update';\r\n f.elements['key'].value = row.id;\r\n f.elements['lastname'].select();\r\n }\r\n });\r\n });\r\n}", "function change_text(http_data, field_id) {\n\t\t//alert(document.getElementById(field_id).innerHTML);\n\t\t//alert(field_id);\n\t\tif(field_id && document.getElementById(field_id)) {\n \t\t\tdocument.getElementById(field_id).innerHTML = http_data;\n\t\t}\n \t}", "function update_field(name, path, type, content) {\n\t\t$.ajax({\n\t\t\ttype: 'post',\n\t\t\turl: WSData.server_path + '/admin/fields',\n\t\t\tdata: {name: name, path: path, type: type, content: content}\n\t\t}).done(function (d) {\n\t\t\t$('#ws-saving-status').html('<i class=\"icon-check\"></i> Saved.');\n\t\t}).fail(function (d) {\n\t\t\t$('#ws-saving-status').html('<i class=\"icon-remove\"></i> Error saving.');\n\t\t});\n\t}", "update(){}", "update(){}", "update(){}", "function updateEd() {\n setTimeout(function () {\n robot.ed.query(updateEd);\n }, 100);\n }", "function updateText(req, res){\n\tdb.collection('user').updateOne(\t\t\t\t\t\t\t\t// update iets wat in de collection 'user' zit van MongoDB.\n\t\t{_id: ObjectID(req.body._id)},\t\t\t\t\t\t\t\t// zoek de _id in het ObjectID van MongoDB, met param.id die uit de url komt. De specifieke _id uit MongoDB, van de gebruiker die hier in de req.body.id zit. Geen req.session.user._id, omdat dat local was en je hier dus niet kan gebruiken.\n\t\t{ $set: {textProfile: req.body.updateTextProfile} }, // verandert in de Mongo database de textProfile naar updateTextProfile die is ingevuld\n\t\t(err)=>{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// nieuwe manier van function schrijven.\n\t\t\tif (err) throw err;\t\t\t\t\t\t\t\t\t\t\t\t\t// indien error, stuur error\n\t\t\tres.redirect('profiel/' + req.body._id);\t\t// ga terug naar de profile.ejs incl. de juiste _id uit de database. Geen req.session.user._id, omdat dat local was en je hier dus niet kan gebruiken.\n\t\t});\n}", "function updateDB(POST,response){\n\n\ttitle=POST.title; description=POST.description; location=POST.location; id=POST.id; link=POST.link; status=POST.status;\n\tvar sqlQuery = 'UPDATE issues SET title=\"'+title+'\",description=\"'+description+'\",location=\"'+location+'\",link=\"'+link+'\", status=\"'+status +'\" WHERE id=' + id;\n\tdbAccess.runQuery(sqlQuery, serve(response,id));\n }", "async writeQuel(e) {\n e.preventDefault();\n\n var changeText = firestore.collection('kezako').doc('quel');\n console.log(changeText)\n let texte = this.state.quel;\n let titre = this.state.titreQuel;\n\n try {\n await changeText.update({\n texte,\n titre\n });\n }\n catch (error) {\n console.error('error updating', error);\n }\n }", "_onUpdateTextElement(nodeId) {\n let newValue = this.refs[nodeId].val()\n let editorSession = this.context.editorSession\n editorSession.transaction((doc) => {\n let element = doc.get(nodeId)\n element.setText(newValue)\n doc.setSelection(null)\n })\n // Trigger custom ref:updated which leads to an update of the rendered\n // record (see RefComponent)\n editorSession.emit('ref:updated', this.props.node.id)\n }", "async writeQui(e) {\n e.preventDefault();\n\n var changeText = firestore.collection('kezako').doc('qui');\n console.log(changeText)\n let texte = this.state.qui;\n let titre = this.state.titreQui;\n\n try {\n await changeText.update({\n texte,\n titre\n });\n }\n catch (error) {\n console.error('error updating', error);\n }\n }", "function update() {\n var restikoId = localStorage.getItem(\"id\");\n getValueFromForm()\n base('RESTIKO').update([{\n \"id\": restikoId,\n \"fields\": {\n \"Date\": date,\n \"Ce que j'ai fait\": fait,\n \"Ce que j'ai appris\": appris,\n \"Ce que j'ai aimé\": aime,\n \"Ce que j'ai utilisé de nouveaux\": nouveau,\n \"Problématiques rencontrées\": problem,\n \"Quels sont les objectifs ?\": objectif,\n \"Qu'est-ce qui m'a manqué ?\": manque,\n \"Qu'est-ce que tu ferais à la place du formateur ?\": formateur,\n \"Personne (Initiales)\": {\n \"id\": \"usrVA8D2T1b8KxCEw\",\n \"email\": \"[email protected]\",\n \"name\": \"FONG Tea\"\n },\n \"Objectif atteint ou pas\": succes,\n \"Field 13\": rating\n }\n }], function (err, records) {\n if (err) {\n console.error(err);\n return;\n }\n });\n setTimeout(function () {\n window.location = \"list.html\";\n }, 500);\n }", "function ckPropertyEdit(elem, text) {\n var data = {\n 'add':\n {\n 'subject': elem.data('subject'),\n 'predicate': elem.data('predicate'),\n 'object': text\n },\n 'type': 'ck'\n };\n console.debug(data);\n var jqxhr = $.post(EDIT_ENDPOINT, {'edit': JSON.stringify(data)}, function(returned){\n $('.ck-save').hide();\n })\n .fail(function() {\n $('.ck-save').hide();\n alert(\"Editing failed to finish.\");\n });\n}", "async writePourquoi(e) {\n e.preventDefault();\n\n var changeText = firestore.collection('kezako').doc('pourquoi');\n console.log(changeText)\n let texte = this.state.pourquoi;\n let titre = this.state.titrePourquoi;\n\n try {\n await changeText.update({\n texte,\n titre\n });\n }\n catch (error) {\n console.error('error updating', error);\n }\n }", "function editDB(){\n\t\t\t\titem_name_form = document.getElementById(\"item_name\").value;\n\t\t\t\titem_price_form = document.getElementById(\"price\").value;\n\t\t\t\titem_quantity_form = document.getElementById(\"quantity\").value;\n\t\t\t\titem_barcode_form = document.getElementById(\"barcode\").value;\n\n\t\t\t\tsessionStorage.editStatus=\"edit\";\n\t\t\t\tupdateDB(item_name_form,item_quantity_form,item_price_form,item_barcode_form)\n\t\t\t\t\t.then(function(){\n\t\t\t\t\t\tconsole.log(\"updateDB\");\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function(){\n\n\t\t\t\t\t})\n\n\t\t\t}", "function domUpdateitem(doc){\r\n\r\n var updatedValue = document.getElementById(doc.id);\r\n\r\n updatedValue.childNodes[0].nodeValue = doc.data().todo;\r\n \r\n}", "function Editar(){\n const inputIdSalon = document.getElementById(\"idsalon\").value;\n const inputUbicacion = document.getElementById(\"ubicacion\").value;\n const inputCapacidad = document.getElementById(\"capacidad\").value;\n const inputNombreSalon = document.getElementById(\"nombresalon\").value;\n objClaveMateria = {\n \"IdSalon\": inputIdSalon,\n \"Ubicacion\": inputUbicacion,\n \"NombreClave\": inputNombreSalon,\n \"Capacidad\": inputCapacidad\n }\n fetch(uri,{\n method: 'PUT',\n headers:{\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(objClaveMateria)\n })\n .then(response => response.text())\n .then(data => Mensaje(data))\n .catch(error => console.error('Unable to Editar Item.',error ,objClaveMateria));\n}", "function onUpdate(work_item_id) {\n // Get value of the new title\n const newTitle = document.getElementById(\"title_update_field\").value;\n\n // Get value of the new content\n const newContent = document.getElementById(\"content_update_field\").value;\n\n // Use Ajax to start updating task in the database\n $.ajax({\n url: `https://localhost:5001/api/v1/WorkItem?workItemId=${work_item_id}`,\n type: 'PATCH',\n dataType: \"json\",\n cache: false,\n data: JSON.stringify({\n \"Title\": newTitle,\n \"Content\": newContent\n }),\n contentType: \"application/json\",\n success: function (responseData) {\n // Update title of the work item\n $(`title-${work_item_id}`).text(responseData.data.title)\n\n // Update content of the work item\n $(`content-${work_item_id}`).text(responseData.data.content)\n }\n })\n}", "updateThought({params,body}, res){\n // Mongoose .findOneAndUpdate() method. Finds thought by id, sends new thoughtText\n Thought.findOneAndUpdate({_id: params.id}, body, {new:true})\n .then(dbThoughtData => {\n if(!dbThoughtData){\n res.status(404).json({message: \"No thought was found with that id\"});\n return\n }\n res.json(dbThoughtData)\n })\n .catch(err => {\n console.log(err)\n res.status(400).json(err);\n })\n }", "updateQuery(queryId, oldText, newText, callback) {}", "function updateEmail()\r\n{\r\n var updated = document.getElementById(\"newemail\");\r\n\r\n // At this point, we need to take that information that was passed in and update the database with it\r\n // will figure this out later\r\n updateField(\"email\", updated.value);\r\n document.getElementById(\"email\").innerHTML = \"<p id = \\\"email\\\">\" + updated.value + \"<span type=\\\"button\\\" id=\\\"setEmail\\\" onclick = \\\"editEmail()\\\" class=\\\"glyphicon glyphicon-pencil\\\"></span>\";\r\n}", "updateText(text) {\n\t\tthis.text = text;\n\t}", "function updateNotice(e){\n\tdbId = e.parentElement.parentElement.children[1].getAttribute('pk')\n\tdocument.querySelector('input[name=notice]').value = e.parentElement.parentElement.children[1].innerText\n\tdocument.querySelector('#submit').innerHTML = `<input class=\"btn btn-outline-info mr-2\" type=\"submit\" name=\"update_notice\" value=\"Update\">\n\t\t\t\t\t\t\t\t<input class=\"btn btn-outline-danger\" type=\"button\" onclick=\"cancelUpdate()\" value=\"Cancel\">`\n}", "editItem(req, res) {\n //change the item in the list at the correct index to be the new text\n const { index, newItem } = req.body;\n list[index] = newItem;\n res.status(200).send(list);\n }", "function handelUpdate(req,res){\n const id= req.params.quote_id\n const character= req.body.character\n const sql= 'UPDATE simpson SET character=$1 WHERE id=$2'\n client.query(sql,[character,id])\n .then(()=>{\n res.redirect(`/favorite-quotes/${id}`)\n })\n}", "function editDone(elem_id, idx){\n let updateNote = document.getElementById(\"updateTxtEdit\");\n let editnote = document.getElementById(parseInt(idx));\n let html = `\n <h5 class=\"card-title\">Note ${parseInt(idx) + 1}</h5>\n <div class=\"card-body-textbox\">\n <p class=\"card-text\">${updateNote.value}</p>\n </div>\n <button onclick=\"deleteNote('${elem_id}')\" class=\"btn btn-primary\">Delete Note</button>\n <button onclick=\"editNote('${elem_id}' ,'${parseInt(idx)}')\" class=\"btn btn-primary\">Edit Note</button> \n `;\n console.log(editnote);\n editnote.innerHTML = html;\n\n // Updating the edit to server\n let addTxtValue = updateNote.value;\n const obj = { // Create object to be posted through axios\n addTxtValue,\n };\n\n axios // Post data from textbox to server\n .put(`https://crudcrud.com/api/${endpoint}/notesData/${elem_id}`, obj)\n .then(res => {\n console.log(\"Data has been posted to crudcrud\");\n console.log(res);\n })\n .catch(err => {\n console.log(\"Error Message: \");\n console.log(res);\n })\n\n}", "function contentUpdate(i){\n const itm = globalArr[i]\n select_id = itm.contentsId\n $('#title').val(itm.title)\n $('#description').val(itm.description)\n $('#status').val(itm.status)\n //console.log(select_id)\n editor.setText(itm.details + \"\\n\")\n}", "function doArticleEdit() {\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper/,\"报 纸\");\r\n\t\r\n\tallElements = document.getElementById('command');\r\n\ttmp = allElements.parentNode.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Edit article/,\"编辑文章\");\r\n\ttmp = allElements.children[1];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Article title:/,\"文章标题:\");\r\n\ttmp = allElements.children[6];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Message:/,\"正文:\");\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"editNewspaper.html\":[\"Edit newspaper\",\"修改报纸信息\"],\r\n\t\t\"http://wiki.e-sim.org/en/Newspaper\":[\"Newspaper tutorial on wiki\",\"关于报纸\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Edit article\":[\"Edit article\",\"编辑提交\"]\r\n\t});\r\n}", "updateTranslation(e){\n var data = { changes : {} },\n value = this.nodeValue(e);\n\n //We need replace &nbsp; for empty spaces. Because if we push empty char it will change to this encoded value.\n //We need place empty char, when user will delete whole translation. This situation is buggy in some browsers..\n //So we need remove here this empty char at the end.\n if ( value.substr(-6) == '&nbsp;' ) {\n value = value.substr(0, -6);\n }\n\n //If is not raw text, we can save unencoded value\n //Because double encodion would be applied from laravel side\n if ( Editor.hasAllowedFormation(e) === false ) {\n value = Helpers.htmlspecialcharsDecode(value);\n }\n\n data.changes[e.getPointerSetting('originalTranslate', 'translatable')] = value;\n\n //Clear previous key change\n if ( this._ajaxSend ) {\n clearTimeout(this._ajaxSend);\n }\n\n //Remove error class before sending ajax\n Helpers.removeClass(e._CAPencil, Pencils.classNameError);\n\n //We need send ajax minimally once per second,\n //because gettext is cached on file timestamp. which in in seconds...\n this._ajaxSend = setTimeout(() => {\n var url = CAEditor.config.requests.updateText;\n\n CAEditor.ajax.post(url, data, {\n success(response){\n Helpers.addClass(e._CAPencil, Pencils.classNameSaved);\n },\n error(response){\n //Add red pointer color\n Helpers.addClass(e._CAPencil, Pencils.classNameError);\n }\n });\n\n this.updateSameTranslationElements(e);\n }, 1000);\n }", "async editar(req, res) {\n await db(\"resposta\")\n .where({ idresposta: req.params.idresposta })\n .update(req.body)\n .then(() => res.status(200).send({ Status: \"Editado com sucesso!!\" }))\n .catch(() => res.status(400).send({ status: \"ERRO\" }));\n }", "function serverPut(id, userInputUpdatedDesc) {\r\n axios.put('/:' + id, {\r\n\r\n // userInputUpdatedDesc is whatever the user inputs to change the description to\r\n description: userInputUpdatedDesc\r\n\r\n })\r\n .then(function (response) {\r\n // success\r\n // should we reload the page here?\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n });\r\n}", "function nombre() {\n var nombre = document.getElementById(\"nombre\");\n\n var texto =\n \"UPDATE cfconvenioventa SET NombredelConvenio = '\" +\n nnombre.value +\n \"' WHERE CodIdConvenioVenta = \" +\n CodIdConvenioVenta.value +\n \";\" +\n \"\\n\" +\n \"UPDATE cfconveniopago SET NombredelConvenio = '\" +\n nnombre.value +\n \"' WHERE CodIdConvenioPago = \" +\n CodIdConvenioVenta.value +\n \";\";\n\n nombre.innerText = texto;\n}", "function changeDoc(req, res) {\n var id = req.swagger.params.id.value;\n var data = JSON.parse(req.swagger.params.docname.value);\n var userId = req.decoded.user_id;\n var clientId = req.decoded.client_id;\n var name = data.docname;\n var autor = data.autor;\n var filename = data.filename\n var query = '';\n //console.log(name); \n if (data.docname) {\n query = `Update sadrzaj set \n name = '` + name + `', \n modified_by = ` + userId + `,\n modified_ts = NOW()\n\n where id =` + id + ` `;\n }\n if (data.autor) {\n query = `Update ri.dokumentacija set \n autor = '` + autor + `'\n where id =` + id + ` `;\n }\n if(data.filename)\n {\n query = `Update ri.dokumentacija set \n link = '` + filename + `' \n where id =` + id + ` `;\n }\n console.log(query);\n \n var client = new pg.Client(conString);\n client.connect(function(err) {\n if (err) {\n return console.error('could not connect to postgres', err);\n } else { \n client.query(query, function(err, result) {\n if (err) {\n return console.error('error running query', err);\n } else {\n\n res.json(\"Changed\");\n }\n })\n }\n })\n\n \n}", "function updateSomething(modifiedField) {\n\tconsole.log(\"updating \" + modifiedField);\n\n\tvar username = document.getElementById('username').innerHTML;\n var newVal = document.getElementById(modifiedField+'field').value;\n\n $.post(\"../DatabaseRelated/updateuserfield.php\",\n {name:username,field:modifiedField,newval:newVal},\n function(data){\n if (data == \"Success\"){\n\t\t\t\tdocument.getElementById('updateresult').innerHTML = modifiedField + \" successfully updated\";\n }\n\t\t\t else {\n\t\t\t\tdocument.getElementById('updateresult').innerHTML = \"Error updating \" + modifiedField + \": \" + data;\n }\n })\n}", "function doArticleEdit() {\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper/,\"Gazete\");\r\n\t\r\n\tallElements = document.getElementById('command');\r\n\ttmp = allElements.parentNode.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Edit article/,\"Makaleyi d\\u00fczenle\");\r\n\ttmp = allElements.children[1];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Article title:/,\"Makale ba\\u015fl\\u0131\\u011f\\u0131:\");\r\n\ttmp = allElements.children[6];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Message:/,\"Mesaj:\");\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"editNewspaper.html\":[\"Edit newspaper\",\"Gazeteyi d\\u00fczenle\"],\r\n\t\t\"http://wiki.e-sim.org/en/Newspaper\":[\"Newspaper tutorial on wiki\",\"Gazete e\\u011fitimi\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Edit article\":[\"Edit article\",\"Makaleyi d\\u00fczenle\"]\r\n\t});\r\n}", "updateGame(content, room_id) {\n const sql = {\n text: `UPDATE rooms SET words = $1 WHERE room_id = $2`,\n values: [content, room_id],\n };\n return db.query(sql).then((dbResult) => dbResult.rows);\n }", "update(id, data, params) {}", "updatePost(key, newtext) {\n this.props.updatePost(key, this.props.threadid, newtext);\n }", "function updateT_todo() {\n var input = ioLib.read(request.getReader());\n var message = JSON.parse(input);\n var connection = datasource.getConnection();\n try {\n var i = 0;\n \n var sql = \"UPDATE TODO SET \";\n sql += \"STATUS = ?\";\n sql += \" WHERE ID = ?\";\n \n var id = \"\";\n var statement = connection.prepareStatement(sql);\n \n statement.setInt(++i, message.status);\n id = message.id;\n statement.setInt(++i, id);\n statement.executeUpdate();\n response.getWriter().println(id);\n } catch(e){\n var errorCode = javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;\n makeError(errorCode, errorCode, e.message);\n } finally {\n connection.close();\n }\n}", "function update_announcements_button(announcementsKey){ \n\n if( document.getElementById(\"announcements-language-update\").value && \n document.getElementById(\"announcements-website-update\").value)\n {\n firebase.database().ref('Announcements/'+announcementsKey).set({\n title: document.getElementById(\"announcements-title-update\").value,\n disc: document.getElementById(\"announcements-description-update\").value,\n pic: document.getElementById(\"announcements-pic-update\").value,\n website: document.getElementById(\"announcements-website-update\").value,\n },function(error){\n if(error){\n window.alert(\"failed\");\n }else{\n window.alert(\"yes\");\n window.location.reload(false);\n }\n });\n }\n else\n {\n window.alert(\"failed. Make sure all fields are full\");\n }\n\n}", "static update(request, response) {\r\n\r\n itemsModel.getById(request.body.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n\r\n //recupera do body os campos que serao atualizados na tabela\r\n const conditions = [\r\n {\r\n field: 'id',\r\n value: request.body.id\r\n },\r\n {\r\n field: 'title',\r\n value: request.body.title\r\n },\r\n {\r\n field: 'descr',\r\n value: request.body.descr\r\n },\r\n {\r\n field: 'photo',\r\n value: request.body.photo\r\n },\r\n {\r\n field: 'category',\r\n value: request.body.category\r\n },\r\n ];\r\n\r\n //chama rotina para atualizacao dos dados\r\n itemsModel.update(conditions) \r\n response.sendStatus(200);\r\n console.log('Item has been updated. ID: ', request.body.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.body.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error updating Item by ID: ', request.body.id, err);\r\n });\r\n \r\n }", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Yeni \\u015fifre:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Tekrar yeni \\u015fifre:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Eski \\u015fifre: :\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Yeni avatar:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"max. boyut :\");\r\n\t\r\n allElements = document.getElementsByTagName('TD');\r\n tmp = allElements[19]\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Citizen/,\"Vatanda\\u015f\");\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Profil d\\u00fczenle\"]});\r\n}", "function edit_diary(btn){\n //id=\"${thisId}_${thisDiary}+contentbtn\"\n let btn_id = btn.id;\n let btn_split = btn_id.split(\"_\");\n let contentsID = btn_split[0];\n let contentsTitle = contentsID.split(\"(\");\n contentsTitle = contentsTitle[0];\n\n let afterText = btn.value;\n console.log(\"btn_id\",btn_id,\"afterText__________\",afterText);\n\n var httpRequest = new XMLHttpRequest();\n\n var data = JSON.stringify({\n id: \"i_contents\",\n sig: \"edit_diary\",\n contents: [contentsID, contentsTitle, afterText]\n })\n\n httpRequest.open('POST', 'http://localhost:3000');\n httpRequest.send(data);\n\n history.go(0);\n //location.reload(true);\n}", "function updatePlatz(parkhaus, platzID, text, callback) {\n $.ajax({\n type: 'POST',\n dataType: \"json\",\n data: {listeID: parkhaus,platz:text,platzID:platzID},\n url: 'php/api/parkplatz.php?method=update',\n success: function (r) {\n callback(r);\n }\n error: function (error) {\n alert(error);\n }\n });\n }", "function updateContent(/** @type {string} */ text) {\r\n\t\tlet json;\r\n\t\ttry {\r\n\t\t\tif (!text) {\r\n\t\t\t\ttext = '{}';\r\n\t\t\t}\r\n\t\t\tjson = JSON.parse(text);\r\n\t\t} catch {\r\n\t\t\tnotesContainer.style.display = 'none';\r\n\t\t\terrorContainer.innerText = 'Error: Document is not valid json';\r\n\t\t\terrorContainer.style.display = '';\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tnotesContainer.style.display = '';\r\n\t\terrorContainer.style.display = 'none';\r\n\r\n\t\t// Render the scratches\r\n\t\tnotesContainer.innerHTML = '';\r\n\t\tfor (const note of json.scratches || []) {\r\n\t\t\tconst element = document.createElement('div');\r\n\t\t\telement.className = 'note';\r\n\t\t\tnotesContainer.appendChild(element);\r\n\r\n\t\t\tconst text = document.createElement('div');\r\n\t\t\ttext.className = 'text';\r\n\t\t\tconst textContent = document.createElement('span');\r\n\t\t\ttextContent.innerText = note.text;\r\n\t\t\ttext.appendChild(textContent);\r\n\t\t\telement.appendChild(text);\r\n\r\n\t\t\tconst created = document.createElement('div');\r\n\t\t\tcreated.className = 'created';\r\n\t\t\tcreated.innerText = new Date(note.created).toUTCString();\r\n\t\t\telement.appendChild(created);\r\n\r\n\t\t\tconst deleteButton = document.createElement('button');\r\n\t\t\tdeleteButton.className = 'delete-button';\r\n\t\t\tdeleteButton.addEventListener('click', () => {\r\n\t\t\t\tvscode.postMessage({ type: 'delete', id: note.id, });\r\n\t\t\t});\r\n\t\t\telement.appendChild(deleteButton);\r\n\t\t}\r\n\r\n\t\tnotesContainer.appendChild(addButtonContainer);\r\n\t}", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Új jelszó:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Ismétlés:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Régi jelszó: :\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Új avatar:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"Max. méret; :\");\r\n\t\r\n allElements = document.getElementsByTagName('TD');\r\n tmp = allElements[19]\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Citizen/,\"Polgár\");\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Polgár szerkesztése\"]});\r\n}", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "function upd(i) {\n let updvalue = document.querySelector('#todoData' + i)\n if(updvalue) {\n timeLocal = Date.now();\n todos[i].data = updvalue.textContent;\n }\n fillStorage();\n}", "function postEdit(response) {\n\tif (response == \"OK\") {\n\t\talert(\"Successfull update\");\n\t\t$(\"td:eq(0)\", row).html($(\"#descr\").val());\n\t\t$(\"td:eq(2)\", row).html($(\"#videourl\").val());\n\t\t$(\"td:eq(3)\", row).html($(\"#controls\").val());\n\t\t$(\"td:eq(4)\", row).html($(\"#question\").val());\n\t\t$(\"td:eq(5)\", row).html($(\"#info\").val());\n\t}\n\telse\n\t\talert(\"Action failed\");\n}", "function updEdu()\r\n{\r\n var typeUpdate = document.getElementById(\"type0\").value;\r\n var degUpdate= document.getElementById(\"degree0\").value;\r\n var uniUpdate= document.getElementById(\"uni0\").value;\r\n var dateUpdate=document.getElementById(\"date0\").value;\r\n var studyUpdate=document.getElementById(\"study0\").value;\r\n \r\n //Sends the inputs to the backend to be added\r\n if(typeUpdate==\"\"||degUpdate==\"\"||uniUpdate==\"\"||studyUpdate==\"\")\r\n {\r\n alert(\"Please ensure you complete all fields.\");\r\n }\r\n else\r\n {\r\n httUpdateEducation = new XMLHttpRequest();\r\n httUpdateEducation.open(\"PUT\",\"Education/updateEducation/\",true);\r\n httUpdateEducation.onload=showEducationUpdate;\r\n var hIDUpdate = {};\r\n \r\n hIDUpdate.qualId=qualId; \r\n hIDUpdate.typeData= typeUpdate; \r\n hIDUpdate.degData=degUpdate;\r\n hIDUpdate.uniData=uniUpdate;\r\n hIDUpdate.dateData=dateUpdate;\r\n hIDUpdate.studyData=studyUpdate;\r\n httUpdateEducation.send(JSON.stringify(hIDUpdate)); \r\n } \r\n}", "atualizaNome() //controler\r\n {\r\n this._elemento.textContent = `[${this._idade}] ${this._nome}`;\r\n }", "function doArticleEdit() {\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Newspaper/,\"Újság\");\r\n\t\r\n\tallElements = document.getElementById('command');\r\n\ttmp = allElements.parentNode.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Edit article/,\"Cikk szerkesztése\");\r\n\ttmp = allElements.children[1];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Article title:/,\"Cikk címe:\");\r\n\ttmp = allElements.children[6];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Message:/,\"Üzenet:\");\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"editNewspaper.html\":[\"Edit newspaper\",\"Újság szerkesztése\"],\r\n\t\t\"http://wiki.e-sim.org/en/Newspaper\":[\"Newspaper tutorial on wiki\",\"Újság útmutató\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Edit article\":[\"Edit article\",\"Cikk szerkesztése\"]\r\n\t});\r\n}", "function UpdateButn(index){\n let editTitle = document.getElementById('editTitle');\n let editTxt = document.getElementById(\"editTxt\");\n let notesObj = {\n title: editTitle.value,\n text: editTxt.value,\n id: index,\n };\n let data = Object.keys(notesObj)\n .map((key) => {\n return key + \"=\" + notesObj[key];\n })\n .join(\"&\");\n\n fetch(\"http://localhost:8081/php-notes-app/update-note.php\", {\n method: \"POST\",\n body: data,\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n }\n })\n .then((response) => response.json())\n .then((data) => {\n if (data.className == \"success\") {\n showAlert(data.msg, data.className); \n }\n if (data.className == \"danger\") {\n showAlert(data.msg, data.className);\n }\n // Dismiss after 2 seconds\n setTimeout(function () {\n document.getElementById(\"alert\").remove();\n }, 2000);\n editTxt.value = \"\";\n editTitle.value = \"\";\n showNotesById(userid.value);\n })\n .catch((error) => {\n console.log(error);\n });\n }", "update() {\n\t\tlet title = this.refs.newTitle.value\n\t\tlet date = this.refs.newDate.value\n\t\tlet des = this.refs.newDescription.value\n\t\tlet link = this.refs.newLink.value\n\t\tlet id = this.props._id\n\n\t\tif(title == \"\" || date == \"\" || des == \"\" || link == \"\"){\n\t\t\talert(\"Fields can not be empty\")\n\t\t}else{\n\t\t\tlet data = '{\"Title\":\"' + title + '\",\"Description\":\"' + des + '\",\"Year\":\"' + date + '\",\"Link\":\"' + link + '\"}'\n\n\t\t\tthis.props.dispatch(updateProject(this.props._id, data))\n\t\t}\n\t}", "function submitEditNotes(ele){\n\t\t\tvar popup = document.getElementsByClassName(\"edit-notes-form\")[0],\n\t\t\t\tupdatedNotes = ele.parentNode.getElementsByTagName(\"textarea\")[0].value;\n\n\t\t\tif(!updatedNotes) updatedNotes = \"There are no notes for this event.\"\n\n\t\t\t// Update notes\n\t\t\tcurrentStepNode.setAttribute(\"data-notes\", updatedNotes);\n\n\t\t\t// Save notes to database\n\t\t\tsaveAction.enqueue( makeJsonFromNode(currentStepNode));\n\n\t\t\t// Remove popup\n\t\t\tremoveEditNotes(popup);\n\t\t}", "function editManCon(id) {\n\n\t/* Da znamo koji id trebamo promjeniti*/\n\tvar idBroj = 0;\n\tvar poslano = \"\";\n\n\tif(id)\n\t{\n\t\tidBroj = id;\n\t}\n\n\tif(this.id) {\n\t\tidBroj = this.id.slice(16);\n\t}\n\n\t/* Text koji mjenjamo */\n\tvar textId = \"editInputMan\" + idBroj;\n\tvar text = document.getElementById(textId).value;\n\n\tvar xhr = new XMLHttpRequest();\n\n\txhr.open(\"POST\", \"ajaxInj.php?editManChangeId=\" + idBroj + \"&textManChange=\" + text, true);\t\n\t\n\txhr.send();\n\t\n\t\n\t/* Ovo sam morao radi firefoxa reloadao je prije neg sto bi AJAX obavio posao */\n\txhr.onreadystatechange = function() \n\t{\n\t\tif(this.readyState == 4 && this.status == 200)\n\t\t{\n\t\t\tlocation.reload();\n\t\t}\n\t}\n\n\n}", "function updateNode(sText) {\n try {\n if (goFlow != null) {\n //get the current item selected\n var selItems = goFlow.getSelectedItems();\n //allow single item\n if (selItems.length == 1) {\n selItems[0].text = sText; //Update the caption\n selItems[0].refresh();\n }\n else {\n alert('Please select a single item');\n }\n }\n }\n catch (err) {\n alert(err.innerHTML);\n }\n}", "function update_article_button(articleKey){ \n\n if( document.getElementById(\"article-title-update\").value && \n document.getElementById(\"article-description-update\").value &&\n document.getElementById(\"article-pic-update\").value &&\n document.getElementById(\"article-website-update\").value &&\n document.getElementById(\"article-language-update\").value\n )\n {\n firebase.database().ref('Article/'+articleKey).set({\n title: document.getElementById(\"article-title-update\").value,\n disc: document.getElementById(\"article-description-update\").value,\n pic: document.getElementById(\"article-pic-update\").value,\n website: document.getElementById(\"article-website-update\").value,\n language: document.getElementById(\"article-language-update\").value,\n type: \"article\"\n },function(error){\n if(error){\n window.alert(\"failed\");\n }else{\n window.alert(\"yes\");\n window.location.reload(false);\n }\n });\n }\n else\n {\n window.alert(\"failed. Make sure all fields are full\");\n }\n\n}", "update(id) {\n\n }", "function updateItemsPuertasValoresElementos(k_codusuario,k_codinspeccion,cod_item, seleccion,descripcion) {\n db.transaction(function (tx) {\n var query = \"UPDATE puertas_valores_elementos SET v_selecion = ?,\"+\n \"o_descripcion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [descripcion,seleccion,k_codusuario,k_codinspeccion,cod_item], function(tx, res) {\n console.log(\"rowsAffected updateItemsPuertasValoresElementos: \" + res.rowsAffected);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "function updateJenkins(jenkins_id,jenkins_name, jenkins_url){\n\n var db = getDatabase();\n var res = \"\";\n\n db.transaction(function(tx) {\n var rs = tx.executeSql('UPDATE jenkins_data SET jenkins_name=?, jenkins_url=? WHERE id=?;', [jenkins_name,jenkins_url,jenkins_id]);\n if (rs.rowsAffected > 0) {\n res = \"OK\";\n } else {\n res = \"Error\";\n }\n }\n );\n return res;\n }", "async update(request, response){\n const { id } = request.params;\n const { notes } = request.body;\n \n const annotation = await Annotations.findOne({ _id : id});\n\n if (notes) { /* ele so vai mexer no banco de dados se eu alterar */\n annotation.notes = notes;\n\n await annotation.save();\n }\n \n return response.json(annotation); /*mesmo eu alterando ou não,ele vai dar o retorno do annotations */\n }", "function updateEmailBody(email_id, body, callback){\n conn.query('UPDATE Emails SET content=$1 WHERE email_id=$2',\n [\n body,\n email_id\n ], function(error, result) {\n if(error) {\n console.error(error);\n } else {\n if(callback) {\n callback();\n }\n }\n });\n}", "updateQuery(commandId, queryId, oldText, newText, callback) {\n var command = this.getCommandForId(commandId);\n var query = this.getQueryForId(commandId, queryId);\n\n // Don't make changes if old text and new text are the same\n if (oldText === newText) {\n callback(command, query);\n return;\n }\n\n // Create updated query with new text\n query.text = newText;\n\n this.sendBackendRequest(\n \"query/update\",\n {\n dev_id: preferences.getDevId(),\n intent: command.name,\n old_text: oldText,\n new_query: query,\n },\n (_xhr, error) => {\n if (error) {\n console.log(error);\n } else {\n query.entities = this.splitIntoEntities(newText);\n this.db\n .get(\"commands\")\n .getById(commandId)\n .get(\"queries\")\n .updateById(queryId, query)\n .write();\n\n callback(\n this.getCommandForId(commandId),\n this.getQueryForId(commandId, queryId)\n );\n }\n }\n );\n }", "function editEntry(entry){\n conn.query('UPDATE Entries SET collection_id=$1, entry_number=$2, author=$3, title=$4, date_submitted=$5, subject=$6, content=$7 WHERE entry_id=$8;',\n [\n entry.collection_id,\n entry.entry_number,\n entry.author, \n entry.title,\n entry.date_submitted,\n entry.subject,\n entry.content,\n entry.entry_id\n ]).on('error', console.error);\n}", "function editWindow(elem)\n{\n var str = elem[0].innerHTML;\n str = str.replace(/\"/g, \"'\");\n $.ajax({\n url: './php/tools/getContent.php',\n type: 'GET',\n data: {\n \"id\": '\"'+elem[0].id+'\"',\n \"content\": '\"'+str+'\"'\n },\n success: function(data) {\n elem.attr('contenteditable', 'true');\n elem.attr('spellcheck', 'true');\n elem.focus();\n var myElem = elem;\n elem.on('keyup',function(e){\n if(e.which == 8 || e.which ==46){\n if(this.innerHTML == '<a href=\"#!\" contenteditable=\"false\" class=\"submitButton\"><div><i class=\"fa fa-check\" aria-hidden=\"true\"></i></div></a>')\n {\n myElem.append(\"&nbsp;\");\n var range = document.createRange();\n range.selectNodeContents(this);\n range.collapse(false);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n\n }\n }\n });\n elem.find('.editButton').replaceWith(submit);\n elem.find( \".submitButton\" ).click(function(){\n updateData(elem);\n });\n },\n error: function(e) {\n console.log(\"oops\")\n }\n });\n}", "handleChange(text) {\n if (this.state.team.teamDescription !== text){\n //patch desc of team\n fetch('http://localhost:443/team?teamID='+this.state.team.teamID+'&desc='+text,{\n method: \"PATCH\",\n headers: {\n Authorization: 'Bearer ' + this.props.token\n }\n })\n .then(res => res.json())\n .then(res => {\n //update frontend overview\n let data = this.state.team;\n data.teamDescription = text;\n this.setState({team:data})\n })\n }\n }", "function updateField() {\r\n //update general text field\r\n for (var i = 0; i < glob_data.length; i++) {\r\n try {\r\n var this_node_key = glob_data[i].pk + '.' + glob_data[i].fields.node_name\r\n if (this_node_key == obj) {\r\n $('#node_details .description').text(glob_data[i].fields.node_description)\r\n $('#node_details .details').text(glob_data[i].fields.details)\r\n $('.node-name-details').text(glob_data[i].fields.node_name)\r\n $active_node_name = glob_data[i].fields.node_name\r\n }\r\n else { }\r\n }\r\n catch (err) {\r\n console.log(err)\r\n }\r\n }\r\n updatePicture()\r\n\r\n function updatePicture() { }\r\n // update picture set for slides\r\n var $target_slides = $('.slide img')\r\n\r\n for (var j = 0; j < $target_slides.length; j++) {\r\n $thisslide = $target_slides[j]\r\n $thisslide.src = \"\\\\static\\\\app\\\\content\\\\node_content\\\\\" + $active_node_name + \"images\\\\\" + (j + 1).toString() + \".jpg\"\r\n\r\n }\r\n }", "function putUpdate(data){\n $.ajax({\n url: location+'/'+$id,\n type: 'PUT',\n data: data,\n success: function(_data) {\n clearForm();\n updateTableUpdate(_data);\n }\n });\n }", "function updateEditedThread(id){\n var changed = $(id+'editThreadForm').getElement('[name=title]');\n changed = changed.get('value');\n $(id+'editThreadForm').dispose();\n var title = $(id +'title');\n title.set('text', changed);\n title.setStyle('display', 'block'); \n}", "function updateRettungskraft(id) {\n\t\n\tdocument.getElementById(\"rettungskraftNew_button\").click();\n\t\n\tvar rettungskraft = document.getElementById(id);\n\t\n\tdocument.getElementById(\"rettungskraft_id\").value = id;\n\tdocument.getElementById(\"rettungskraft_vorname\").value = rettungskraft.childNodes[7].childNodes[1].innerText;\n\tdocument.getElementById(\"rettungskraft_nachname\").value = rettungskraft.childNodes[7].childNodes[3].innerText;\n\tdocument.getElementById(\"rettungskraft_hiorg\").value = rettungskraft.childNodes[9].innerText;\n\tdocument.getElementById(\"rettungskraft_quali\").value = longQuali(rettungskraft.childNodes[7].childNodes[5].innerText);\n\tdocument.getElementById(\"rettungskraft_tel\").value = rettungskraft.childNodes[11].innerText;\n\t\n\tif (rettungskraft.childNodes[1].innerText != rettungskraft.childNodes[7].childNodes[1].innerText + \" \" + rettungskraft.childNodes[7].childNodes[3].innerText) {\n\t\n\t\tdocument.getElementById(\"rettungskraft_funkruf\").value = rettungskraft.childNodes[1].innerText;\n\t}\n\telse {\n\t\tdocument.getElementById(\"rettungskraft_funkruf\").value = \"\";\n\t}\n}", "function updateQuantity(e){\n const uid = e.target.value;\n const name = document.getElementById(\"UN\");\n const quant = document.getElementById(\"UQ\");\n const q = quant.value;\n const y = name.value;\n const xhr = new XMLHttpRequest();\n xhr.open('PUT','/product')\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(JSON.stringify({id: uid, name: y, quantity: q}));\n const form = document.getElementById(\"forms\");\n form.innerHTML = null;\n // document.getElementById(\"rows\").innerHTML = null;\n\n\n}", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"邮箱:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"新密码:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"再重复一次:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"旧密码:\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"新头像:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"文件尺寸小于\");\r\n\t\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"确定编辑\"]});\r\n}", "async function UpdateData(itemBody){\n\tconsole.log(`Item that is been updated is: ${itemBody.id}\\n`);\n\ttry{\n\t\titemBody.More = \"Good job!\";\n\t\tconst {item} = await client.database(databaseId).container(containerId).item(itemBody.id).replace(itemBody);\n\t}catch(error){\n\t\tconsole.log(error);\n\t}\n}", "function updateEditedPost(id){\n var req = new Request.JSON({\n url: 'control.php?action=getSinglePost&id=' + id,\n onSuccess: function(post) { \n var postObject = new PostItem(post.post_id, post.username, post.date_posted, post.comment);\n // Replace the previous post\n postObject.display().replaces($(post.post_id + 'post')); \n }\n }).send(); \n}", "function update_problem_descrip () {\n\tnew_problem_descrip = $( '#text_area_problem_descrp' ).val();\n\t\n\t//call the model in ajax\n\t$.ajax( {\n\t\ttype: 'POST',\n\t\turl: $( '#root_path' ).val() + 'admin/update_problem_descrip',\n\t\tdata: {\n\t\t\tproblem_id: problem_id_selected,\n\t\t\tnew_problem_descrip: new_problem_descrip\n\t\t}, success: function ( e ) {\n\t\t\tif ( e == 1 ) window.location.reload();\n\t\t\telse alert( \"Unable to process request.\" );\n\t\t}, error: function ( jqXHR, exception ) {\n\t\t\tif (jqXHR.status === 0) {\n\t\t return 'Not connected.\\nPlease verify your network connection.';\n\t\t } else if (jqXHR.status == 404) {\n\t\t return 'The requested page not found. [404]';\n\t\t } else if (jqXHR.status == 500) {\n\t\t return 'Internal Server Error [500].';\n\t\t } else if (exception === 'parsererror') {\n\t\t return 'Requested JSON parse failed.';\n\t\t } else if (exception === 'timeout') {\n\t\t return 'Time out error.';\n\t\t } else if (exception === 'abort') {\n\t\t return 'Ajax request aborted.';\n\t\t } else {\n\t\t return 'Uncaught Error.\\n' + jqXHR.responseText;\n\t\t }\n\t\t}\n\t} );\n\n}", "function updateUserElement(request, user_json){\n var id = user_json.USER.ID;\n var element = userElementArray(user_json);\n updateSingleElement(element,dataTable_users,'#user_'+id);\n}", "function update(req, res) {\n let data = [\n req.body.name,\n req.body.qty,\n req.body.amount,\n req.params.id\n ];\n\n connection.query('UPDATE items SET name = ?, qty = ?, amount = ? WHERE id = ?', data , function(error, results) {\n if (error) {\n res.status(500).send({\n message: `Error occured while updating item with id ${req.params.id}`\n });\n }\n\n apiResult = {\n message: 'Successfully updated',\n data: {\n id: req.params.id,\n name: req.body.name,\n qty: req.body.qty,\n amount: req.body.amount\n }\n };\n\n res.send(apiResult);\n });\n }", "function successTextMove(entry) {\n localStorage.setItem('textpath', entry)\n var _description = localStorage.getItem('textpath')\n console.log(\"k = \" +k)\n db.transaction(function(tx) {\n tx.executeSql(\"UPDATE maintable SET description = \"+ \"'\"+_description +\"'\"+\" WHERE id = \"+ k);\n }, function(error) {\n console.log('Update description ERROR: ' + error.message + error.code);\n }, function() {\n console.log('Update description OK');\n }\n )\n\n db.transaction(function(tx) {\n tx.executeSql(\"SELECT description FROM maintable WHERE id = \" + k, [], function(tx, rs) {\n var len = rs.rows.length;\n console.log(len + \" rows found.\");\n imgparent.firstElementChild.innerHTML = rs.rows.item(0).description\n }, function(tx, error) {\n console.log('SELECT description error: ' + error.message);\n })\n })\n }", "function ex3_update_node(node_name, field_name, value) {\n get_node(node_name)[field_name] = value;\n // Update everything\n update_all();\n}", "function fnUpdateXEditableTransaction() {\n jQuery('#AdmTransactionTable .xEditTransaction').editable({\n type: 'text',\n url: bittionUrlProjectAndController + 'fnUpdateXEditableTransaction',\n title: 'Descripción',\n validate: function(value) {\n if (jQuery.trim(value) === '')\n return 'No puede estar vacio';\n },\n ajaxOptions: {\n dataType: 'json' //assuming json response\n },\n success: function(response, newValue) {\n if (response['status'] === 'SUCCESS') {\n bittionShowGrowlMessage(response['status'],response['title'],response['content']);\n } else {\n bittionShowGrowlMessage(response['status'],response['title'],response['content']);\n }\n fnRead(jQuery('#selectController').val());\n }\n });\n }", "function updateArticle(req) {\n return connSql.then(function(conn){\n let requete = \"UPDATE `posts` SET `title`=?, `content`=?, `writer`=? WHERE `id`=?;\";\n let resultat = conn.query(requete, [req.body.title, req.body.content,req.body.writer,req.params.view]);\n return resultat\n });\n }", "static modifyC(req, res) {\n const { titulo,grupo } = req.body\n return Cuadernos\n .findByPk(req.params.id)\n .then((data) => {\n data.update({ \n titulo: titulo || data.titulo,\n grupo: grupo || data.grupo\n })\n .then(update => {\n res.status(200).send({\n success: true,\n message: 'Cuaderno actualizado',\n data: { \n titulo: titulo || update.titulo,\n grupo: grupo || update.grupo\n }\n })\n })\n .catch(error => res.status(400).send({\n success: false,\n message: 'Actualizacion Fallida',\n error}));\n })\n .catch(error => res.status(400).send(error));\n }", "function editItem(i) {\n var item = DOMPurify.sanitize(document.getElementById(\"editItem\").value);\n var price = document.getElementById(\"editPrice\").value;\n var category = document.getElementById(\"editCategory\").value;\n var image = document.getElementById(\"editImage\").src;\n var itemId = itemDatas[i][5]\n\n var comment = DOMPurify.sanitize(document.getElementById(\"editComment\").value);\n\n var xhr = new XMLHttpRequest();\n var url = 'http://fa19server.appspot.com/api/wishlists/' + itemId + \"/\"+ 'replace?access_token=' + sessionId;\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n refreshItemsPara();\n }\n }\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.send('item=' + item + '&price=' + price + '&category=' + category + '&image=' + image + '&comment=' + comment)\n\n\n document.getElementById(\"editBox\").style.display = \"none\";\n document.getElementById(\"over\").style.display = \"none\";\n}", "async function markComplete(){\n const todoText = this.parentNode.childNodes[1].innerText // 'this' keeps us on current thing clicked, the rest will select the text.\n try{\n const response = await fetch('markComplete', {\n method: 'put', // we are gonna change something in our db, need put method\n headers: {'Content-type': 'application/json'},\n body: JSON.stringify({\n 'rainbowUnicorn': todoText //gives the text grabbed the property of rainbowUnicorn\n })\n })\n const data = await response.json()\n console.log(data)\n location.reload() // reload page to run our get request again\n }catch(err){\n console.log(err)\n }\n}", "function handleSaveChangesClick(e) {\n var foodId = $(this).parents('.food').data('food-id');\n var $foodRow = $('[data-food-id=' + foodId + ']');\n\n var data = {\n foodName: $foodRow.find('.edit-food-name').val(),\n calories: $foodRow.find('.edit-calories').val(),\n };\n // remove console logs from production\n console.log('PUTing data for food', foodId, 'with data', data);\n console.log(data);\n console.log(foodId);\n\n // todo: Extract your url to a variable and pass the variable\n $.ajax({\n method: 'PUT',\n url: '/api/food/' + foodId,\n data: data,\n success: handleFoodUpdatedResponse,\n error: onError\n });\n\n function onError(error1, error2, error3) {\n console.log('error on ajax for edit');\n }\n\n function handleFoodUpdatedResponse(potato) {\n // remove console logs from production\n console.log(potato);\n console.log('response to update', potato);\n\n var foodId = potato._id;\n console.log(foodId);\n // scratch this food from the page\n //TODO: Try changing text in-place\n $('[data-food-id=' + foodId + ']').remove();\n // and then re-draw it with the updates ;-)\n renderFood(data);\n }\n }", "updatePost(entityId, newContent) {\n entityId = this.esc(entityId); newContent = this.esc(newContent);\n return this.query(`UPDATE post SET content = '${newContent}'\n WHERE entityId = '${entityId}'`);\n }", "function updateContent(/** @type {string} */ text) {\n\t\tlet json;\n\t\ttry {\n\t\t\tjson = JSON.parse(text);\n\t\t} catch {\n\t\t\tjsonDoccument.style.display = 'none';\n\t\t\treturn;\n\t\t}\n\t\tjsonDoccument.style.display = '';\n\t\terrorContainer.style.display = 'none';\n\n\t\tjsonDoccument.innerHTML = '';\n\t\tfor (const note of json.editors || []) {\n\t\t\tconst rootObject = document.createElement('div');\n\t\t\trootObject.className = 'root';\n\t\t\tjsonDoccument.appendChild(rootObject);\n\n\t\t\tconst deleteButton = document.createElement('button');\n\t\t\tdeleteButton.className = 'delete-button';\n\t\t\tdeleteButton.addEventListener('click', () => {\n\t\t\t\tvscode.postMessage({ type: 'delete', id: note.id, });\n\t\t\t});\n\t\t\trootObject.appendChild(deleteButton);\n\t\t}\n\n\t\tjsonDoccument.appendChild(addObjectButtonContainer);\n jsonDoccument.appendChild(addArrayButtonContainer);\n jsonDoccument.appendChild(addBooleanButtonContainer);\n jsonDoccument.appendChild(addNumberButtonContainer);\n\t}", "function update(name, str) {\r\n $(name).text(str);\r\n}", "function upddateRecord() {\n\n var usernameupdate = $('input:text[id=username]').val().toString();\n\n var useremailupdate = $('input:text[id=useremail]').val().toString();\n\n var useridupdate = $(\"#id\").val();\n\n db.transaction(function (tx) { tx.executeSql(updateStatement, [usernameupdate, useremailupdate, Number(useridupdate)], loadAndReset, onError); });\n \n}" ]
[ "0.65596914", "0.6273206", "0.6228144", "0.61891687", "0.6141462", "0.6102611", "0.6089756", "0.60776615", "0.6058269", "0.6040642", "0.60005695", "0.59905666", "0.5978067", "0.5978067", "0.5978067", "0.59659255", "0.59364766", "0.5934099", "0.5930564", "0.5893941", "0.58854705", "0.5884066", "0.58731097", "0.5838427", "0.58321977", "0.5828521", "0.5818811", "0.5818345", "0.58078367", "0.57936186", "0.57922083", "0.5789629", "0.57846105", "0.57803726", "0.57710725", "0.5742889", "0.572207", "0.572198", "0.57195103", "0.5711963", "0.57095665", "0.57002056", "0.5693901", "0.5685604", "0.5675698", "0.5665543", "0.56650376", "0.5662173", "0.56378317", "0.5608808", "0.5597228", "0.5594073", "0.55919784", "0.55813843", "0.5571579", "0.5559622", "0.5554556", "0.55480635", "0.55395633", "0.553661", "0.55356544", "0.55321896", "0.552551", "0.55136544", "0.5513132", "0.5501891", "0.5500352", "0.54856074", "0.5484568", "0.54828864", "0.5477832", "0.5462831", "0.54560125", "0.54497313", "0.54446316", "0.5443485", "0.5442778", "0.54386985", "0.543659", "0.5436243", "0.54350436", "0.54343134", "0.54334646", "0.5425923", "0.5422681", "0.5421417", "0.5420147", "0.5419978", "0.5419965", "0.54112387", "0.5407787", "0.54067844", "0.5398497", "0.53959984", "0.5395401", "0.5392913", "0.53894055", "0.5374187", "0.53691643", "0.5356128" ]
0.61308557
5
request the deletion of an element refresh editor view
function deleteElement(id) { var elementId = $('#' + id).value; var data = {}; data.action = "deleteElement"; data.elementId = elementId; data.handler = "slide"; var url = "ajax.php"; Ajax.post(data, url, function (json) { if (json.error) { $('#activeSlideContainer').innerHTML = json.error; } else { // update slide $('#activeSlideContainer').innerHTML = json.html; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete() {\n this.html.remove();\n }", "delete () {\n this.element = this.element.delete(this)\n }", "delete() {\n $(`#${this.idDOM}`).remove();\n }", "function onDeleteElement() {\n inputMultiElementDOM.trigger(\"ime:element:delete\");\n \n // Activate textarea\n if (getNbElements() < opts.maxElement) activateTextZone(true);\n }", "deleteFragment(editor) {\n editor.deleteFragment();\n }", "delete() {\n let $self = $(`#${this.idDOM}`);\n if(this.commentSection !== undefined) {\n this.commentSection.delete();\n this.commentSection = undefined;\n }\n $self.remove();\n Object.keys(this.buttons).forEach(type => this.buttons[type].delete());\n }", "delete() {\r\n return this.clone(WebPartDefinition, \"DeleteWebPart\").postCore();\r\n }", "function deleteElement(elementId) {\r\n\tlog(\"Deleting element: \\\"\" + $(\"#text\" + elementId).val() + \"\\\" from the canvas...\");\r\n\r\n\t$.ajax({\r\n\t\ttype: \"DELETE\",\r\n\t\turl: (\"/wysiwyg/deleteElement/\" + sessionId + \"/\" + elementId),\r\n\t\tsuccess: function() {\r\n\t\t\t$(\"#control\" + elementId).remove();\r\n\t\t\t$(\"#\" + elementId).remove();\r\n\t\t\tlog(\"Delete successful.\");\r\n },\r\n error: function(e){\r\n \tlog(\"There was a problem deleting the element\");\r\n }\r\n\t});\r\n}", "willDestroyElement() {\n this._super(...arguments);\n\n this._hideEditDialog();\n }", "function remove_tache(){\n\t// Recuperation de l'id de la tache\n\tvar id_tache = liste_infos_tache.getCoupler().getLastInformation();\n\t\n\t// Mise a jour BDD\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"DELETE\", \"/taches/\"+id_tache, false);\n\txhr.send();\n\t\n\t// Notification interface\n\tmaj_listes_taches_after_edit();\n\ttitre_tache_selectContainer.setHTMLContent('<h2 class=\"hight_titre_liste\">SELECTIONNER UNE TACHE</h2>');\n\ttitre_tache_selectContainer.update();\n\tliste_infos_tache.clear();\n\tliste_infos_tache.update();\n\tdesc_tache_selectContainer.clear();\n\tdesc_tache_selectContainer.update();\n\tdocument.getElementsByClassName('btn_showPopup_clo_tache')[0].disabled = true;\n\tGraphicalPopup.hidePopup(popup_clo_tache.getPopupIndex());\n}", "function handleDeletion () {\n if ( ! self.cfg.delSelector )\n return true;\n //if ( $('#'+self.cfg.textareaId).is(':focus') )\n // return true;\n var\n selElem = $(svgRoot).find('.selected').first();\n if ( selElem.length === 0 || isReadOnly(selElem) )\n return true;\n var delElem = self.cfg.delSelector( selElem[0] );\n if ( typeof delElem === 'boolean' )\n return delElem;\n if ( delElem && self.cfg.delConfirm(delElem) ) {\n for ( var n=0; n<self.cfg.onDelete.length; n++ )\n self.cfg.onDelete[n](delElem);\n var editables = $('.editable');\n editables = editables.eq(editables.index(delElem)+1).addClass('prev-editing');\n if ( selElem.closest('.editing').length !== 0 )\n removeEditings();\n unselectElem(selElem);\n var elemPath = getElementPath(delElem);\n\n if ( self.cfg.delTask )\n self.cfg.delTask(delElem);\n else\n $(delElem).remove();\n\n registerChange('deleted '+elemPath);\n }\n return false;\n }", "delete() {\n this.comments.forEach(comment => comment.delete());\n this.comments = [];\n $(`#${this.idDOM}`).remove();\n }", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "function onPlaceDelete(element) {\r\n\t\t\tvar $root = element.parents(\".mapsed-root\");\r\n\t\t\tvar $vw = $root.find(\".mapsed-view\");\r\n\t\t\tvar model = getViewModel($vw);\r\n\r\n\t\t\tif (settings.onDelete(_plugIn, model)) {\r\n\t\t\t\t// find the appropriate marker\r\n\t\t\t\tvar marker = findMarker(model.lat, model.lng);\r\n\r\n\t\t\t\t// remove the marker\r\n\t\t\t\tmarker.setMap(null);\r\n\t\t\t\tmarker.tooltip = null;\r\n\t\t\t}\r\n\r\n\t\t} // onPlaceDelete", "function deleteElement() {\n myPresentation.getCurrentSlide().deleteElement()\n}", "delete() {\n $(`comment-${this.config['id']}`).remove();\n }", "handleDelete() {\n API.deleteNode(this.props.node).then(() => {\n this.props.node.remove();\n this.props.engine.repaintCanvas();\n }).catch(err => console.log(err));\n }", "willDestroyElement() {\n this._super(...arguments);\n\n this._hideGoToEditDialog();\n }", "function deletee() {\n\tdocument.getElementById(\"deletebtn\").disabled = true;\t\t//Prevent sapm or misclick\n\t$.ajax({\n\t\turl: getapi(),\n\t\ttype: \"POST\",\n\t\tdata: {\n\t\t\tdelete:$('#deleteid').html(),\n\t\t},\n\t\tsuccess:function(){\n\t\t\tlocation.reload();\n\t\t},\n\t\terror:function(xhr){\n\t\t\tvar err = eval(\"(\" + xhr.responseText + \")\");\n\t\t\talert(err.error);\n\t\t\tdocument.getElementById(\"deletebtn\").disabled = false;\n\t\t}\n\t});\n}", "clickDelete(){\n let idSelected = this.__modelSelect.getSelectedModel();\n if(idSelected == -1){\n alert(\"You Need To Choose Model to Delete First!!!\");\n return;\n }\n\n //delete the selected model\n this.__modelSelect.deleteSelectedModel();\n this.__clientController.deleteModelById(idSelected);\n }", "onDeleteEvent(e){ \n let event = new CustomEvent('eventremoved', {\n bubbles: true, \n detail: {\n deleted:true, \n id: this.element.id\n }});\n this.element.dispatchEvent(event); \n }", "delete() {\n let id = $(\"#rid\").val();\n reReg.delete(id);\n $(\"#editDeleteModal\").modal('hide');\n }", "function deleteElement() {\n this.style.display = 'none';\n }", "removeResource(evt) {\n evt.preventDefault();\n let button = $(evt.target);\n this.view.attr(\"hidden\", \"\"); // do not show the block\n this.destroyed = true\n this.registry.showSaveNote();\n }", "function clickCloseBtnAfterDeleteHandler(controller) {\n\tlocation.reload();\n}", "function deleteElement(id){\n\n jQuery.ajax({\n url : 'http://127.0.0.1:8000/elements/'+id,\n async : true,\n contentType: \"application/json\",\n dataType: 'json',\n type : 'DELETE'\n }).done(function(response) {\n\n alert(\"Element supprimée avec succée\");\n\n location.reload();\n\n }).fail(function(xhr, status, error) {\n alert(status);\n });\n}", "'click .js-media-delete-button'( e, t ) {\n e.preventDefault();\n\n let cur = $( '#cb-current' ).val()\n , idx = P.indexOf( `${cur}` );\n\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-media-toolbar' ).hide();\n $('#frameBorder').remove();\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\n\n //console.log( pp.find({}).fetch() );\n }", "function deleteHostAction() {\n del_hostOnSpanClick();\n}", "function deleteNode(e, object) {\n swal({\n title: \"確定要刪除?\",\n type: \"warning\",\n showCancelButton: true,\n cancelButtonText: \"取消\",\n confirmButtonClass: \"btn-danger\",\n confirmButtonText: \"確定\",\n closeOnConfirm: true\n },\n\n function (isConfirm) {\n if (isConfirm) {\n var currentObjectKey = object.part.data.key;\n var currentObjectCategory = object.part.data.category\n\n if (currentObjectCategory === \"CareMale\" || currentObjectCategory === \"CareFemale\" || currentObjectCategory === \"FreehandDrawing\" || currentObjectCategory === \"CommentBox\") {\n mainDiagram.commandHandler.deleteSelection();\n commentBoxKey = -1;\n return\n }\n\n var newNode;\n //delete parentTree's Node\n var previousNode = searchParentTreeNodePreviousNode(globalLogicData.parentTree, currentObjectKey)\n if (previousNode != null) {\n previousNode.left = null;\n previousNode.right = null;\n reRender(previousNode.id);\n return;\n }\n\n // delete node on childrenList\n var currentNodeArrayData = searchNodeCurrentArray(globalLogicData.childrenList, currentObjectKey);\n var NodeCurrentIndex = currentNodeArrayData.index;\n var NodeCurrentchildrenList = currentNodeArrayData.childrenList;\n if (NodeCurrentchildrenList[NodeCurrentIndex].parentTree) {\n var mainNodePosition = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.linkNode\n // check weather the node that want to be deleted is child or partner, if it is not partner delete the node, else delete the partner\n if ((mainNodePosition === \"left\" && NodeCurrentchildrenList[NodeCurrentIndex].parentTree.left.id === currentObjectKey) ||\n (mainNodePosition === \"right\" && NodeCurrentchildrenList[NodeCurrentIndex].parentTree.right.id === currentObjectKey)) {\n\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n reRender(currentObjectKey);\n return;\n } else if (mainNodePosition === \"left\") {\n newNode = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.left;\n } else if (mainNodePosition === \"right\") {\n newNode = NodeCurrentchildrenList[NodeCurrentIndex].parentTree.right;\n }\n\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 0, newNode);\n reRender(currentObjectKey);\n return;\n } else {\n NodeCurrentchildrenList.splice(NodeCurrentIndex, 1);\n reRender(currentObjectKey);\n return;\n }\n } else {\n return false;\n }\n }\n );\n}", "addDeleteListener() {\n this.deleteBtn.click(() => {\n $.ajax({\n type: \"DELETE\",\n url: `/api/chirps/${this.id}`\n }).then(() => this.div.remove())\n .catch(e => console.log(e));\n });\n }", "function deleteTask_click()\n{\n var taskId = $('#findTaskId').text()\n //Kall mot xmlHttp delete funksjon\n deleteTask(taskId)\n //Unmouter detaljevisning etter at kalenderinnslag er slettet\n m.mount(taskRoot, null)\n}", "destroy () {\n this.getElement().remove()\n }", "remove() {\n this.element.remove();\n }", "_onDeleteClicked() {\n $('<p>')\n .text(_`\n This integration will be permanently removed. This cannot\n be undone.\n `)\n .modalBox({\n buttons: [\n $('<button>')\n .text(_`Cancel`),\n $('<button class=\"danger\">')\n .text(_`Delete Integration`)\n .click(() => this.model.destroy({\n beforeSend: xhr => {\n xhr.setRequestHeader(\n 'X-CSRFToken',\n this.model.collection.options.csrfToken);\n },\n })),\n ],\n title: _`Are you sure you want to delete this integration?`,\n });\n }", "deleteElement(requestData) {\r\n return axios({\r\n url: '/delete/elements',\r\n method: 'delete',\r\n baseURL: API_LOCATION + '/api/v1/',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n data: {\r\n 'viewsiteId': requestData.viewsiteId,\r\n 'viewpageId': requestData.viewpageId,\r\n 'elementId': requestData.elementId,\r\n 'kind': requestData.kind\r\n }\r\n });\r\n }", "function tag_delete_confirm(response){\n\ttag_id = JSON.parse(response);//deserialise the data rturned from the view\n\tif (tag_id > 0) {\n\t\tconsole.log(\"we get the id\")\n\t\t$('#tag_' + tag_id).remove();\n\t\t$('#tag_button_' + tag_id).remove();\n\t}\n}", "removeEditor() {\n this.editor.remove();\n }", "delete() {\r\n return super.deleteCore();\r\n }", "delete() {\r\n return super.deleteCore();\r\n }", "delete() {\r\n return super.deleteCore();\r\n }", "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"review\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/reviews/\" + id\n }).then(getReviews);\n }", "static DeleteSelected(){\n ElmentToDelete.parentElement.remove();\n UI.ShowMessage('Elemento eliminado satisfactoriamente','info');\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "destroy() {\n this.element.remove();\n }", "function deleteImage(url, id) {\n if (window.confirm(Dictionary.areYouSure)) {\n (document.getElementById(\"renderPreview\" + id)).remove();\n storage.refFromURL(url).delete().then(function () { }).catch(function (error) { console.log(error); alert(\"delete faild\"); });\n }\n}", "function deleteItem() {\n SidebarActions.deleteItem('Content', $scope.data.thisContent);\n}", "delete() {\n this.eachElem((node) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }", "delete() {\n this.eachElem((node) => {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n });\n }", "deleteElement() {\n errors.throwNotImplemented(\"deleting an element from a collection\");\n }", "destroy() {\n this.element.remove()\n }", "static onClickRemoveMedia() {\n let $element = $('.context-menu-target'); \n let id = $element.data('id');\n let name = $element.data('name');\n \n UI.confirmModal(\n 'delete',\n 'Delete media',\n 'Are you sure you want to delete the media object \"' + name + '\"?',\n () => {\n $element.parent().toggleClass('loading', true);\n\n HashBrown.Helpers.RequestHelper.request('delete', 'media/' + id)\n .then(() => {\n return HashBrown.Helpers.RequestHelper.reloadResource('media');\n })\n .then(() => {\n HashBrown.Views.Navigation.NavbarMain.reload();\n\n // Cancel the MediaViever view if it was displaying the deleted object\n if(location.hash == '#/media/' + id) {\n location.hash = '/media/';\n }\n })\n .catch(UI.errorModal);\n }\n );\n }", "function doDeleteItemLine(element){\n\t //start\n\t\t//avd_${model.avd}@opd_${model.opd}@date_${record.date}@time_${record.time}\n\t\tvar record = element.id.split('@');\n\t\tvar avd = record[0].replace(\"avd_\",\"\");\n\t\tvar opd = record[1].replace(\"opd_\",\"\");\n\t\tvar date = record[2].replace(\"date_\",\"\");\n\t\tvar time = record[3].replace(\"time_\",\"\");\n\t\t\n\t //Start dialog\n\t jq('<div></div>').dialog({\n modal: true,\n title: \"Dialog - Slett date: \" + date + \" \" + time,\n buttons: {\n\t Fortsett: function() {\n \t\tjq( this ).dialog( \"close\" );\n\t //do delete\n\t jq.blockUI({ message: BLOCKUI_OVERLAY_MESSAGE_DEFAULT});\n\t window.location = \"tror_mainorderfly_ttrace_general_edit.do?action=doDelete\" + \"&ttavd=\" + avd + \"&ttopd=\" + opd + \"&ttdate=\" + date + \"&tttime=\" + time;\n\t },\n\t Avbryt: function() {\n\t jq( this ).dialog( \"close\" );\n\t }\n },\n open: function() {\n\t \t\t var markup = \"Er du sikker på at du vil slette denne?\";\n\t jq(this).html(markup);\n\t //make Cancel the default button\n\t jq(this).siblings('.ui-dialog-buttonpane').find('button:eq(1)').focus();\n\t }\n\t }); //end dialog\n\t}", "function gotDelete(xmlDoc)\n{\n //alert(\"UserInfo: gotDelete: \" + new XMLSerializer().serializeToString(xmlDoc));\n location.reload();\n}", "function deleteElement(element){\n\t\tvar deleted = null;\n\t\tvar dc = element.dotComponent;\n\t\tif(dc){\n\t\t\tvar d = dc.__prms.deleting;\n\t\t\td && d.apply(dc);\n\t\t\tdc.$el = null;\n\t\t\tdeleted = dc.__prms.deleted;\n\t\t}\n\t\tif(element.parentNode) element.parentNode.removeChild(element);\n\t\tdeleted && deleted.apply(dc);\n\t}", "delete(e) {\n const id = e.target.dataset.id\n fetch(`http://localhost:3000/movies/${id}`,{\n method: \"DELETE\", //For sending a method through we need another argument\n headers:{\n 'Content-Type': 'application/json' //Lets my applciation know what data was returned\n }\n }).then (()=>{ //passed an anonymous funtion without an identifier\n e.target.parentElement.remove() //removes the \"div\" form the page\n })\n }", "function deletefunction(methodname,object)\n { \n\n let id = $(object).attr(\"rel\");\n alertify.confirm(\"Delete ?\", function (e) {\n\n if (e) {\n $.ajax({\n type: \"delete\",\n url: methodname,\n data: {id:id},\n complete:function()\n {\n alertify.alert(\"Object Deleted\",function(e)\n {\n if(e)\n {\n location.reload();\n }\n });\n }\n });\n\n } else {\n return false;\n }\n });\n }", "removeElement(){\n // TODO alert() if want to remove the current form element \n this.props.handleDelete(this.state.id);\n }", "function onDeleteLine() {\n changeCurrMeme('delete-row');\n initCanvasAndEditor();\n}", "function handleDeleteButtonPress() {\n var listItemData = $(this)\n .parent(\"td\")\n .parent(\"tr\")\n .data(\"reviewer\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/reviewer/\" + id\n }).then(getReviewers);\n }", "destroy () {\n this.element.remove();\n }", "handleDelete(e) {\n e.preventDefault();\n fetch('/delete', {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ reg: this.state.delId })\n }).then(res => res.json())\n .then((error) => {\n throw error.message;\n })\n\n window.location.reload(); // fetch data once more to show update\n }", "function BtnDelete() {\n transacionAjax_D_elete(\"D_elete\");\n}", "onRemove(e) {\n e.stopImmediatePropagation();\n const model = this.model;\n\n if (confirm(config.deleteAssetConfirmText)) {\n model.collection.remove(model);\n }\n }", "function deleteMe(item){\n fetch(\"/remove/\" + item.innerText,{\n method: \"delete\"\n }).then(res=>res.json())\n .then(res2 => {\n // console.log(res2)\n location.reload()\n });\n }", "deleteCommand() {\n this.dismiss();\n }", "function updateView(e){\n let noteId = e.target.dataset.id\n document.querySelector(`li[data-id = '${noteId}']`).remove()\n noteCard.innerHTML = \"\"\n fetchDeleteNote(noteId)\n }", "delete() {\n this.deleted = true;\n }", "function removeEcar(id){\r\r\n $.post('/officium/web/ecar/remove_item',{\r\r\n 'id_producto':id\r\r\n },\r\r\n function(result){\r\r\n if(result>0){\r\r\n location.reload();\r\r\n }else{\r\r\n alert(\"Error al actualizar el Carrito. Contacte a un asesor\");\r\r\n }\r\r\n });\r\r\n}///end of function result", "deleteItem() {\n this.view.removeFromParentWithTransition(\"remove\", 400);\n if (this.item != null) {\n this.itemDao.deleteById(this.item.getId());\n }\n }", "delete() {\n this.domElement.innerText = \"\";\n }", "function deleteIt(){\n \tupdateDB(\"delete\", pageElements.alertText.dataset.id);\n }", "function onDeleteClick() {\n setValue( '', onAudioCleared );\n function onAudioCleared() {\n element.page.form.raise( 'valueChanged', element );\n Y.log( 'Cleared audio element value: ' + element.value, 'info', NAME );\n element.isDirty = true;\n window.setTimeout( function() { element.page.redraw(); }, 500 );\n }\n }", "function deleteChosenDocument() {\n\tvar aid = getURLParameter(\"AID\");\n\ttogglePopup('document_del', false);\n\tdocument.getElementById(\"dokumentloeschenbutton\").disabled = \"disabled\";\n\tconnect(\"/hiwi/Clerk/js/deleteOfferDocument\", \"uid=\" + selectedDocument\n\t\t\t+ \"&aid=\" + aid, handleDocumentChangeResponse);\n\tselectedDocument = null;\n\ttogglePopup(\"document_delete\", false);\n}" ]
[ "0.6767126", "0.6560261", "0.6551945", "0.6479844", "0.64727074", "0.6402094", "0.63449997", "0.62496346", "0.6243218", "0.6231263", "0.6220395", "0.6207248", "0.6206047", "0.6206047", "0.6192891", "0.6188038", "0.61845917", "0.6159082", "0.615455", "0.61307746", "0.6128477", "0.6113201", "0.6103969", "0.609802", "0.60972804", "0.6086744", "0.6035077", "0.601331", "0.6011229", "0.6008205", "0.5999605", "0.59986365", "0.59846455", "0.59844494", "0.5972137", "0.59247136", "0.59158367", "0.5900002", "0.5894976", "0.5894976", "0.5894976", "0.5888475", "0.5883141", "0.58822167", "0.58822167", "0.58822167", "0.58822167", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.58798003", "0.5875469", "0.58741224", "0.5872786", "0.5872786", "0.5872067", "0.5867283", "0.58666295", "0.5862071", "0.5849322", "0.58452684", "0.5837596", "0.58371", "0.5831561", "0.5822818", "0.58227646", "0.58171993", "0.5812325", "0.5808025", "0.57939065", "0.5784572", "0.578434", "0.5779667", "0.5777496", "0.5775563", "0.57743484", "0.57565653", "0.5747518", "0.5743758", "0.5736335" ]
0.0
-1
request deletion of active slide
function deleteSlide() { var data = {}; data.action = "deleteActiveSlide"; data.handler = "slide"; var url = "ajax.php"; Ajax.post(data, url, function (json) { if (json.error) { $('#activeSlideContainer').innerHTML = json.error; } else { // update slide // reload updated presentation showPresentation(json.id); console.log(json.slideId); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteSlide() {\n var slideToDelete = $('.to-delete');\n slideToDelete.remove();\n }", "function deleteSlide(evt) {\n privates.sel.wrap.style.transitionDuration = '0s';\n privates.sel.slides[0].remove();\n privates.sel.wrap.style.transform = `translate${privates.opt.moveDirection}(-${privates.opt.shift * privates.opt.leftSlidePosition}px)`;\n }", "function deleteElement() {\n myPresentation.getCurrentSlide().deleteElement()\n}", "function DeleteCurrentSlide(){\n myPresentation.removeSlidesElement(myPresentation.getCurrentSlideIndex());\n //if we delete the only slide\n if( myPresentation.getSlides().length === 0){\n \tmyPresentation.cleanContainerDiv();\n AddFirstSlide();\n }\n //if you delete the first slide\n else if (myPresentation.getCurrentSlideIndex() === 0) {\n myPresentation.setCurrentSlideIndex(myPresentation.getCurrentSlideIndex() -1);\n goToNextSlide();\n }\n\n else {\n goToPreviousSlide();\n }\n updateSlideselector();\n}", "deleteSlide(data){\n const index = slides.findIndex((slide) => slide.id === data );\n console.log(slides[index]);\n slides.splice(index, 1);\n this.rendering();\n }", "'click .js-media-delete-button'( e, t ) {\n e.preventDefault();\n\n let cur = $( '#cb-current' ).val()\n , idx = P.indexOf( `${cur}` );\n\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-media-toolbar' ).hide();\n $('#frameBorder').remove();\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\n\n //console.log( pp.find({}).fetch() );\n }", "function deleteActiveUpload() {\n\t\t \t\tif(scope.activeImage) {\n\t\t \t\t\tuploadService.deleteUpload(scope.activeImage.blobKey);\n\t\t \t\t\tscope.activeImage = null;\t\n\t\t \t\t}\t\t \n\t\t \t}", "function actionDelete(p){\n\tsrc = collection[p].name;\n\t\n\tif($('#'+src).hasClass('isLocked')){\n\t\talert(\"Ce dossier est protégé contre la suppression\");\n\t\treturn false;\n\t}\n\n\tmessage = $('#'+src).hasClass('isDir')\n\t\t? \"Voulez vous supprimer ce dosssier et TOUT son contenu ?\"\n\t\t: \"Voulez vous supprimer ce fichier ?\";\n\n\tif(!confirm(message)){\n\t\t//log_(\"REMOVE CANCELED BY USER\");\n\t\treturn false;\n\t}\n\t\n\tvar get = $.ajax({\n\t\turl: 'helper/action',\n\t\tdataType: 'json',\n\t\tdata: {'action':'remove', 'src':collection[p].url}\n\t});\n\t\n\tget.done(function(r) {\n//\t\tif(r.callBack != null) eval(r.callBack);\n\t\tif(r.success == 'true'){\n\t\t\t$('div[id=\"'+src+'\"]').fadeTo(218,0, function() {\n\t\t\t\t$(this).remove();\n\t\t\t});\n\t\t\tmakeDragAndDrop();\n\t\t}\n\t});\n}", "function deletePresentation (e) {\n\tlet id = e.target.parentNode.id;\n\tlet data = JSON.stringify({\n\t\tpresentation_id: id,\n\t\tuser_id: userid\n\t});\n\n\t// sending delete request to server\n\tfetch(PRESENTATIONS_URL + `/${id}`, {\n\t\tmethod: 'DELETE',\n\t\tbody: data,\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json; charset=utf-8\",\n\t \"Authorization\": token\n\t\t}\n\t}).then(response => {\n\t\tif (response.status < 400) { // presentation is removed\n\t\t\tpresentations.removeChild(document.getElementById(id));\n\t\t\tshowConfirmPopup('Presentation is removed!');\n\t\t} else if (response.status === 403) { \t// user not authorized\n\t\t\tshowErrorPopup('You are not authorized for deleting this presentation.');\n\t\t} else {\n\t\t\tshowErrorPopup('This presentation could not be deleted, please try again later.');\n\t\t}\n\t}).catch(error => console.error(error));\n}", "async remove() {\n clearTimeout(this.timer);\n try {\n await this.message.clearReactions();\n } catch (e) {\n console.log(e);\n }\n jet.slideTabs.delete(this.userID);\n }", "function deleteSlider(id) {\n if (id) {\n if (confirm('Are you sure you want to delete this?')) {\n $.ajax({\n url: javascript_path + '/slider/delete/' + id,\n type: \"POST\",\n data: {\n '_token': $('meta[name=\"csrf-token\"]').attr('content'),\n 'slider_id': id,\n dataType: 'json',\n },\n success: function (resp) {\n window.location.href = window.location.href;\n }\n });\n }\n }\n}", "function deleteElement(id) {\r\n var elementId = $('#' + id).value;\r\n\r\n var data = {};\r\n data.action = \"deleteElement\";\r\n data.elementId = elementId;\r\n\r\n data.handler = \"slide\";\r\n var url = \"ajax.php\";\r\n\r\n Ajax.post(data, url, function (json) {\r\n\r\n if (json.error) {\r\n $('#activeSlideContainer').innerHTML = json.error;\r\n }\r\n else {\r\n // update slide\r\n $('#activeSlideContainer').innerHTML = json.html;\r\n }\r\n });\r\n}", "function deleteAppointment() {\n\n transition(\"DELETING\", true)\n \n // Async call to initiate cancel appointment\n props.cancelInterview(props.id).then((response) => {\n\n transition(\"EMPTY\")\n }).catch((err) => {\n\n transition(\"ERROR_DELETE\", true);\n });\n }", "function deletePhoto() {\n // If an operation is in progress, usually involving the server, don't do it.\n if (processing) { return false; }\n if (currentPhoto == null) {\n alert(\"Please select a photo first.\");\n return false;\n }\n // If photo happens to be growing, cut it short.\n snapImageToLandingPad();\n // Get the name of the selected collection, the filename of the current\n // photo, and verify deletion.\n var collectionName = parent.fraControl.document.getElementById(\n \"collectionsList\").value;\n var photoFilename = currentPhoto.getFilename();\n if (confirm(\"Are you sure you want to delete the current photo?\")) {\n // Show the please wait floatover.\n showPleaseWait();\n // Make AJAX call.\n dojo.io.bind({\n url: \"deletePhoto.action\",\n content: {collection: collectionName, filename: photoFilename},\n error: function(type, errObj) { alert(\"AJAX error!\"); },\n load: function(type, data, evt) {\n alert(data);\n hidePleaseWait();\n loadCollection();\n },\n mimetype: \"text/plain\",\n transport: \"XMLHTTPTransport\"\n });\n }\n}", "'click .js-video-delete-button'( e, t ){\n e.preventDefault();\n let cur = $( '#cb-current' ).val()\n , page_no = t.page.get()\n , idx = P.indexOf( cur );\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\nconsole.log( pp.find({}).fetch() );\n P.print();\n $('#fb-template').css( 'border', '' );\n $( '#fb-template iframe' ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-video-toolbar' ).hide();\n//---------------------------------------------------------\n }", "handleDelete() {\n\t \tvar that = this;\n\t\tlet uri = `/task/${this.state.taskId}`;\n\n\t\taxios.delete(uri)\n\t .then(response => {\n\t\t\t// dispatch action to reload task listing....\n\t\t\tthat.props.updateTaskList(true, true);\n\t })\n\t .catch(function (error) {\n\t\t console.log(error);\n\t })\n\t\t\n\t\t// also reset all dialogs to Close state......\n\t\tthis.resetDialogState();\n\t }", "function auspostWorkflowTrigger_delete(paths, startComment, model) {\n var admin = this;\n var startComment = startComment;\n var params = {\n \"_charset_\":\"UTF-8\",\n \"model\":model,\n \"payload\":paths,\n \"payloadType\":\"JCR_PATH\",\n \"startComment\":startComment,\n \"actionRequested\":\"deletepage\"\n };\n $.ajax({\n \t url: '/etc/workflow/instances',\n \t async: false,\n \t data: {\n \t\t \"_charset_\":\"UTF-8\",\n \t \"model\":model,\n \t \"payload\":paths,\n \t \"payloadType\":\"JCR_PATH\",\n \t \"startComment\":startComment,\n \t \"actionRequested\":\"deletepage\"\n \t },\n \t error: function() {\n \t alert('Error, Please contact the admin !!!');\n \t },\n \t success: function(data) {\n \t\tui.notify(null, Granite.I18n.get(\"Request for page deletion has been forwarded for an approval workflow\"));\n\n \t },\n \t type: 'POST'\n \t});\n\n }", "function deleteCallback(v,m,f){\n\tif(v == '1'){\n\t\t document.getElementById('deleteSlideshowForm').submit(); \n\t}\n}", "delete() {\n $(`#${this.idDOM}`).remove();\n }", "function removeBulletPoint(id) {\r\n selectedSlide.data.list.splice(id, 1);\r\n runUpdateTimer();\r\n displaySlide();\r\n}", "_handleButtonDeleteWorkflow()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__WORKFLOW_DELETE, {workflow: this.model});\n }", "function deletePage() {\n var $wp = $('.write-pages li'); // the list of book pages\n var $page = $($wp.get(editIndex)); // the current page\n $page.remove(); // remove it\n setupEditContent();\n setModified();\n }", "function deleteImage(url, id) {\n if (window.confirm(Dictionary.areYouSure)) {\n (document.getElementById(\"renderPreview\" + id)).remove();\n storage.refFromURL(url).delete().then(function () { }).catch(function (error) { console.log(error); alert(\"delete faild\"); });\n }\n}", "function clearSlide()\n {\n var ok = confirm(\"Delete notes and board on this slide?\");\n if ( ok )\n {\n activeStroke = null;\n closeWhiteboard();\n\n clearCanvas( drawingCanvas[0].context );\n clearCanvas( drawingCanvas[1].context );\n\n mode = 1;\n var slideData = getSlideData();\n slideData.events = [];\n\n mode = 0;\n var slideData = getSlideData();\n slideData.events = [];\n }\n }", "deleteDSP(todelete) {\n if (todelete)\n faust.deleteDSPWorkletInstance(todelete);\n }", "delete() {\n this.items().then(instances => {\n instances.forEach(instance => {\n instance.delete();\n })\n }).catch(error => {\n debugger;\n throw error;\n })\n }", "deleteItem() {\n this.view.removeFromParentWithTransition(\"remove\", 400);\n if (this.item != null) {\n this.itemDao.deleteById(this.item.getId());\n }\n }", "delete() {\n let $self = $(`#${this.idDOM}`);\n if(this.commentSection !== undefined) {\n this.commentSection.delete();\n this.commentSection = undefined;\n }\n $self.remove();\n Object.keys(this.buttons).forEach(type => this.buttons[type].delete());\n }", "function deleteCreation(id){\n $(\"#currentCreation\").remove();\n $(\"#making\").slideUp(\"slow\");\n var widget=GetWidget(id);\n var idPanel= widget.panel;\n var panel=GetPanel(idPanel) \n panel.deleteElement(widget)\n}", "removeActiveStep() {\n this.activeStep = null;\n }", "function createdeleteanchor(meal) {\n\n var deleteAnchor = $(dc('a'))\n .attr('id', 'deletePictureAnchor')\n .attr('class', 'carousel_caption deletePictureAnchor grid_3')\n .html('Delete Picture');\n \n // Click handler\n deleteAnchor.click(function() {\n\n // Return immediately if the carousel is rotating\n if(!elm || true == elm.isrotating()) {\n return;\n }\n\n // Return immediately if there are no more pictures\n if(meal.picInfo.length <= 0) {\n return;\n }\n\n if(promptdeletepic) {\n if(usesimpleprompt) {\n var answer = confirm(\"Delete this picture?\");\n if(answer) removepic();\n }\n else {\n var dpprompt = createdeletepicprompt(\n function() {\n removepic();\n enable_scroll();\n $.unblockUI();\n },\n function() {\n enable_scroll();\n $.unblockUI();\n },\n function() {\n promptdeletepic = false;\n removepic();\n enable_scroll();\n $.unblockUI();\n }\n );\n\n disable_scroll();\n $.blockUI({message: dpprompt});\n\n }\n }\n else {\n removepic();\n }\n \n // Encapsulate in a function\n function removepic() {\n\n // Remove picture from carousel\n elm.removepicture(function(removed, pinfo) {\n \n if(removed) {\n \n // Find index of removed photo\n var ii = findpicidx(meal.picInfo, pinfo.timestamp);\n \n // Remove this picture\n if(ii >= 0) {\n meal.picInfo.splice(ii, 1);\n }\n \n var changepic = false;\n \n // Delete from mongo\n deletePicAjax(meal, pinfo);\n \n // Was this a key picture\n if(pinfo.timestamp == meal.keytimestamp) {\n \n changepic = true;\n meal.keytimestamp = 0;\n \n }\n \n // If this was the first picture\n if(!meal.keytimestamp && ii == 0) {\n changepic = true;\n }\n \n // Changing the displaypic\n if(changepic) {\n var pinfo0;\n \n // Get new key picture\n if(meal.picInfo.length > 0) {\n pinfo0 = meal.picInfo[0];\n }\n \n // Set new display picture\n if(setgriddisplay) {\n setgriddisplay(meal, pinfo0);\n }\n }\n \n // Update grid picture count\n if(setgridcount)\n setgridcount(meal);\n }\n });\n }\n });\n\n return deleteAnchor;\n }", "deleteStage() {\n let currentStages = this.props.stages,\n index = this.state.activeStage.index;\n\n currentStages.splice(index, 1);\n this.props.onStagesChange(currentStages);\n this.setState({ settingsOpen: false });\n }", "function deleteBtnHandler(e){\n //getting the value of mid\n let mId=e.currentTarget.parentNode.getAttribute(\"data-mId\")\n deleteMediaFromGallery(mId);\n //removing from the databse\n e.currentTarget.parentNode.remove()\n}", "deleteAction() {}", "function destroy(event) {\n transition(DELETE, true);\n props\n .deleteInterview(props.id)\n .then(() => transition(EMPTY))\n .catch(error => transition(ERROR_DELETE, true));\n }", "function deleteChosenDocument() {\n\tvar aid = getURLParameter(\"AID\");\n\ttogglePopup('document_del', false);\n\tdocument.getElementById(\"dokumentloeschenbutton\").disabled = \"disabled\";\n\tconnect(\"/hiwi/Clerk/js/deleteOfferDocument\", \"uid=\" + selectedDocument\n\t\t\t+ \"&aid=\" + aid, handleDocumentChangeResponse);\n\tselectedDocument = null;\n\ttogglePopup(\"document_delete\", false);\n}", "delete() {\r\n return this.clone(WebPartDefinition, \"DeleteWebPart\").postCore();\r\n }", "function deleteTask_click()\n{\n var taskId = $('#findTaskId').text()\n //Kall mot xmlHttp delete funksjon\n deleteTask(taskId)\n //Unmouter detaljevisning etter at kalenderinnslag er slettet\n m.mount(taskRoot, null)\n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "handleDelete() {\n API.deleteNode(this.props.node).then(() => {\n this.props.node.remove();\n this.props.engine.repaintCanvas();\n }).catch(err => console.log(err));\n }", "remove() {\n\t\tthis.active = false;\n\t\tthis.ctx.remove();\n\t\tthis.parent.removeDot(this.id);\n\t}", "function deletePublication(req, res, next,proxyMensagem) {\n\tlet pub = new Publication();\n\tvar reqMensagem = req.body.Publication;\n\tpub.deletePublication(reqMensagem).then((msgCreated) => {\n\t\treturn res.json(msgCreated);\n\t}).catch((err) => {\n\t\treturn res.send(\"Publication delete failed\" + err);\n\t});\n\treturn next();\n}", "delete(id) {\n return http.delete(`/removePuppy/${id}`);\n \n }", "async function remove (id){\n const slider = await findById(id);\n await slider.remove(id)\n\n}", "function deleteCollection() {\n // If an operation is in progress, usually involving the server, don't do it.\n if (processing) { return false; }\n if (currentCollection == null) {\n alert(\"Please select a collection first.\");\n return false;\n }\n // If photo happens to be growing, cut it short.\n snapImageToLandingPad();\n // Get the selected collection and verify deletion.\n var collectionName = parent.fraControl.document.getElementById(\n \"collectionsList\").value;\n if (confirm(\"Are you sure you want to delete the collection '\"\n + collectionName + \"'?\")) {\n // Show the please wait floatover.\n showPleaseWait();\n // Make AJAX call.\n dojo.io.bind({\n url: \"deleteCollection.action\",\n content: {name: collectionName},\n error: function(type, errObj) { alert(\"AJAX error!\"); },\n load: function(type, data, evt) {\n setPicLocations();\n updatePics();\n resetLandingPad();\n setShadowDefaultSize();\n resetVars();\n alert(data);\n hidePleaseWait();\n updateCollectionsList();\n },\n mimetype: \"text/plain\",\n transport: \"XMLHTTPTransport\"\n });\n }\n}", "function deleteItem() {\n deleteImage(localStorage.getItem(currentImageId), currentImageId)\n}", "delete() {\n this.afterDelete();\n Fiber.yield(true)\n }", "function deleteInterview(id){\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n return axios.delete(`http://localhost:8001/api/appointments/${id}`)\n .then(response => {\n setState({\n ...state,\n appointments\n })\n updateSpots(id)\n }\n )\n }", "function deletePannier() {\n dispatch({\n type: \"RESET\"\n })\n }", "function deleteUploaded(selectedUpDoc, selectedData) {\n\t\t\tif (utils.isNotEmptyVal(self.display.uploaded.filterText) && allUploadedSelected()) {\n\t\t\t\tselectedUpDoc = selectedData;\n\t\t\t}\n\n\n\t\t\tvar modalOptions = {\n\t\t\t\tcloseButtonText: 'Cancel',\n\t\t\t\tactionButtonText: 'Delete',\n\t\t\t\theaderText: 'Delete ?',\n\t\t\t\tbodyText: 'Are you sure you want to delete ?'\n\t\t\t};\n\n\t\t\t// confirm before delete\n\t\t\tmodalService.showModal({}, modalOptions).then(function () {\n\t\t\t\tvar docdata = {};\n\t\t\t\tif (self.activeTab == 'uploadeddailymail') {\n\n\t\t\t\t\tdocdata['docID'] = _.pluck(selectedUpDoc, 'id');\n\n\t\t\t\t\tvar promesa = dailyMailScanDataService.deleteUploadedDocument(docdata);\n\t\t\t\t\tpromesa.then(function (data) {\n\t\t\t\t\t\tnotificationService.success('Documents deleted successfully');\n\t\t\t\t\t\tangular.forEach(docdata['docID'], function (datavalue, datakey) {\n\t\t\t\t\t\t\tvar index = _.findIndex(self.uploadedList.data, { id: datavalue });\n\t\t\t\t\t\t\tself.uploadedList.data.splice(index, 1);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.uploadedGridOptions.selectAll = false;\n\t\t\t\t\t\tself.uploadedGridOptions.uploadedSelectedItems = [];\n\t\t\t\t\t}, function (error) {\n\t\t\t\t\t\tnotificationService.error('Unable to delete documents');\n\t\t\t\t\t});\n\n\t\t\t\t} else if (self.activeTab == 'unindexeddailymail') {\n\n\t\t\t\t\tdocdata['docID'] = _.pluck(self.unindexedGridOptions.unindexedSelectedItems, 'id');\n\n\t\t\t\t\tvar promesa = dailyMailScanDataService.deleteUnindexedDocument(docdata);\n\t\t\t\t\tpromesa.then(function (data) {\n\t\t\t\t\t\tnotificationService.success('Documents deleted successfully');\n\t\t\t\t\t\tangular.forEach(docdata['docID'], function (datavalue, datakey) {\n\t\t\t\t\t\t\tvar index = _.findIndex(self.unindexedList.data, { id: datavalue });\n\t\t\t\t\t\t\tself.unindexedList.data.splice(index, 1);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.unindexedGridOptions.selectAll = false;\n\t\t\t\t\t\tself.unindexedGridOptions.unindexedSelectedItems = [];\n\n\t\t\t\t\t}, function (error) {\n\t\t\t\t\t\tnotificationService.error('Unable to delete documents');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function del(id){\n\t\t\t$(\"[data-eid=\"+ id +\"]\").each(function(){\n\t\t\t\tvar action = makeJsonFromNode(this);\n\t\t\t\tvar idArr = action.id.split('-');\n\n\t\t\t\t// Find object and reset start/end data\n\t\t\t\tvar p = getObjInArr(experiments[idArr[2]].protocols, 'id', idArr[3]);\n\t\t\t\tvar s = getObjInArr(p.steps, 'id', idArr[4]);\n\t\t\t\tvar a = getObjInArr(s.actions, 'id', action.id);\n\t\t\t\t\n\t\t\t\ta.start = a.end = \n\t\t\t\taction.start = action.end = 0;\n\n\t\t\t\t// Save and remove\n\t\t\t\tsaveAction.enqueue(action);\n\t\t\t\t$('#calendar').fullCalendar(\"removeEvents\", this.getAttribute(\"data-fc-id\"));\n\t\t\t});\n\t\t\t$(\"[data-id=\"+ id +\"]\").removeClass('disabled');\n\t\t}", "afterDelete(result, params) {\n console.log(\"Hereeeeeeeeeee 16\");\n }", "deleteArticleImage(key)\n {\n let vm = this;\n\n if(vm.articleImages[key].pivot)\n {\n Api.http\n .delete(`/articles/${vm.article.id}/images/${vm.articleImages[key].id}`)\n .then(response => {\n if(response.status === 204)\n {\n vm.articleImages.splice(key, 1);\n Vue.toast('Article image detached successfully', {\n className: ['nau_toast', 'nau_success'],\n });\n }\n });\n }\n else\n {\n vm.articleImages.splice(key, 1);\n\n Vue.toast('Article image detached successfully', {\n className: ['nau_toast', 'nau_success'],\n });\n }\n }", "deleteThisInvoice() { if(confirm('Sure?')) Invoices.remove(this.props.invoice._id); }", "function deletePhoto(event) {\n let reqDB = indexedDB.open('photos', 1);\n reqDB.onsuccess = function (e) {\n let db = e.target.result;\n\n // получаем ключ записи\n const id = event.target.getAttribute('id')\n // открываем транзакцию чтения/записи БД, готовую к удалению данных\n const tx = db.transaction(['cachedForms'], 'readwrite');\n // описываем обработчики на завершение транзакции\n tx.oncomplete = () => {\n console.log('Transaction completed. Photo deleted')\n getAndDisplayImg();\n };\n tx.onerror = function (event) {\n alert('error in cursor request ' + event.target.errorCode);\n };\n\n // создаем хранилище объектов по транзакции\n const store = tx.objectStore('cachedForms');\n // выполняем запрос на удаление указанной записи из хранилища объектов\n let req = store.delete(+id);\n\n req.onsuccess = () => {\n\n //удалить это фото из всех localStorage tag\n if (localStorage.getItem('tags') !== null) {\n let tags = JSON.parse(localStorage.getItem('tags'))\n tags = tags.map(tagObj => {\n return {...tagObj, images: tagObj.images.filter(imgId => imgId !== +id)}\n })\n tags = JSON.stringify(tags)\n localStorage.setItem('tags', tags)\n }\n\n // обрабатываем успех нашего запроса на удаление\n console.log('Delete request successful');\n };\n document.querySelector('.container2').remove()\n };\n }", "function deleteEvaluation(id){\n\n}", "deleteImage() {\n this.props.deleteImage(this.props.index)\n }", "function deleteTask(e){\n const taskID = document.getElementById('id').value;\n http\n .delete(`http://localhost:3000/Tasks/${taskID}`)\n .then(task=>{\n //clearing field\n ui.clearFiled();\n //showing message\n ui.showAlertMessage('Task deleted','alert alert-warning');\n //getting task\n getTasks();\n })\n}", "function callDelete(id,filename){\r\n\tvar msg = \"Are you sure you want to delete this record !!!\";\r\n\tif(typeof($.ui)!==\"undefined\" && typeof(DialogBox)!==\"undefined\") {\r\n\t\t//needs jquery UI and tools.js\r\n\t\tDialogBox.showConfirm(msg, \"Delete\", function(ok) {\r\n\t\t\tif(ok == true) {\r\n\t\t\t\tdeleteNow();\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tvar confirmation=confirm(msg);\r\n\t\tif(confirmation)\r\n\t\t{\r\n\t\t\tdeleteNow();\r\n\t\t}\r\n\t}\t\r\n\t//delete now\r\n\tfunction deleteNow() {\t\t\r\n\t\t$.post(CMSSITEPATH + '/' + filename + '/get.php', {'id':id, 'action':'d'}, function(data) {\r\n\t\t\tif(data == '%$#@%') {\r\n\t\t\t\tshowAccessMsg();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t//add for history\r\n\t\t\t//adding to undo history only if success\r\n\t\t\tvar jObj=eval(\"(\"+data+\")\"); \r\n\t\t\tif (jObj.status==1) {\r\n\t\t\t\tvar divID = \"singleCont\"+jObj.id;\r\n\t\t\t\tvar html = $(\"#\" + divID).html();\r\n\t\t\t\tvar obj = {ajaxPath:CMSSITEPATH + '/' + filename + '/get.php', id:id, module:filename, html:html};\r\n\t\t\t\tUndoAction.addToHistory(obj);\r\n\t\t\t\tUndoAction.showUndoPanel();\r\n\t\t\t}\r\n\t\t\tremoveDiv(data);\r\n\t\t});\r\n\t}\r\n}", "handleIdeaDelete(id){\n const {deleteIdea}=this.props.actions\n deleteIdea(id);\n }", "onRemoveSingle() {\n if (this.needToCancel) {\n this.artifactDeployDao.cancelUpload({fileName: this.deployFile.fileName});\n this.needToCancel = false;\n }\n }", "remove(id, params) {}", "onDeleted(){\n this.props.dispatch(removePost(this.props.index))\n }", "remove(){\n document.body.removeChild(document.getElementById(this.id))\n this.active = false\n }", "async delete(requisition, response){\n await Model.deleteOne({\"_id\": requisition.params.id}).then(resp =>{\n return response.status(200).json(resp);\n }).catch(error => {return response.status(500).json(error);});\n }", "function deleteIt(){\n \tupdateDB(\"delete\", pageElements.alertText.dataset.id);\n }", "function DELETE(){\n\n}", "destroy(request, response) {\n Resttask.remove(request.params)\n .then(result => response.json(result))\n .catch(error => response.json(error));\n }", "function deleteHandler() {\n console.log(\"clicked delete button in tasks\");\n deleteTask($(this).data(\"id\"))\n} // end deleteHandler", "function handleDreamsDelete() {\n var currentDream = $(this)\n .parent()\n .parent()\n .parent()\n .data(\"dream\");\n deleteDream(currentDream.id);\n window.location.href = \"/my-dreams\";\n }", "function deleteItem(pokemonId) {\n $.ajax({\n method: 'DELETE',\n url: 'http://localhost:8080/pokemon/' + pokemonId\n }).done(function (pokemon) {\n })\n}", "async delete ({ params, response }) {\n const page = await Page.find(params.id)\n\n await page.delete()\n\n return response.status(200).json({\n message: 'page deleted successfully.'\n })\n }", "function del() {\n\t\tif( $( '#img' ).data( 'pngPath' ) !== undefined ) {\n\t\t\t$.post( \"delete.php\", { path: $( '#img' ).data( 'path' ), pngPath : $( '#img' ).data( 'pngPath' ) } ); \n\t\t}\n\t\telse {\n\t\t\t$.post( \"delete.php\", { path: $( '#img' ).data( 'path' ) } ); \n\t\t}\n\t}", "function handleDelete() {\n console.log('delete click');\n\n taskToDelete = $(this).data(\"id\");\n\n deleteTask(taskToDelete);\n}", "function deleteHabit(element) {\n var ref = new Firebase('https://burning-heat-9490.firebaseio.com/');\n var habit = ref.child('Habits');\n var flag = confirm(\"Are you sure you want to delete the habit?\");\n if(flag === true){\n habit.child(element.value).remove();\n var child = element.parentNode.parentNode;\n var parent = child.parentNode;\n\n ///Slides up to delete \n $(child).closest('li').slideUp('slow', function(){\n $(child).remove(); \n });\n }\n}", "static get DELETE() {\n return \"mg_delete_selected_page\";\n }", "deleteItem() {\n if (window.confirm('Etes-vous sur de vouloir effacer cet outil ?')) {\n sendEzApiRequest(this.DELETE_ITEM_URI + this.props.id, \"DELETE\")\n .then((response) => {\n this.props.deleteButtonCB(this.props.tool)\n }, error => {\n alert(\"Impossible de suprimer l'outil\")\n\n console.log(error)\n })\n }\n }", "function delete_article(articleid)\n{\n change_article_state(articleid, \"delete\", \"deletebtn-a\" + articleid);\n}", "DeleteGuidedTour(e, guidedTourId) {\r\n db.collection(\"GuidedTours\").doc(guidedTourId).delete()\r\n .then(() => {\r\n this.setState({\r\n deleteModal: false\r\n });\r\n this.display();\r\n });\r\n }", "function del (e) {\r\n var parent = $(e.target).parent();\r\n var id = parent.attr('id');\r\n parent.remove();\r\n $.ajax({\r\n url: \"core/delete.php\",\r\n type: \"POST\",\r\n dataType: \"text\",\r\n data: \"id=\" + id\r\n });\r\n}", "function deleteProduct() {\n data = \"name=\" + String($(\".product_name.act\").html()) + \"^class=Product\";\n dbOperations(\"pro\", \"delete_operation\", data);\n $(\"li.actparent\").remove();\n $(\"#producthistorypane\").css(\"opacity\", \"0\");\n check_for_active_row(\"product_name\", \"stock\");\n $(\"#producthistorypane\").animate({\n opacity: 1\n });\n\n}", "function handlenoteDelete() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n deletenote(currentnote);\n }", "handleDelete(e) {\n e.preventDefault()\n this.props.onDelete(this.props.testimony.testimonial_id);\n }", "handleDelete() {\n this.props.deleteItem(this.props.id);\n }", "function removeSlide(index) {\n var _slides = [ ];\n\n for (var o = 0, m = $conf.slides.length; o < m; o++) {\n if (o == index) {\n $conf.slider.removeChild($conf.slider.children[o]);\n }\n else {\n _slides.push($conf.slides[o]);\n }\n }\n\n $conf.slides = _slides;\n $elems.dots = buildPager($conf.pager.wrap);\n alignToActiveSlide();\n }", "function delete_person(data) {\n\t\t$('#' + data['old_id']).remove();\n\t}", "function deleteItem() {\n var id = $(this).parent().attr('data-id');\n\n $.ajax(\n {\n url: 'http://157.230.17.132:3017/todos/' + id,\n method: 'DELETE',\n success: function() {\n getAllItemsSaved();\n },\n error: function() {\n alert(\"Attenzione, non sono riuscito a eliminare l'elemento\");\n }\n }\n );\n}", "delete(req, res) {\n console.log('Delete Request is=====>');\n console.log(req.query);\n queryVars = req.query;\n Image.destroy({\n where: {\n id: queryVars.id\n }\n })\n .then(function (deletedRecords) {\n //if successfull, delete image from the file system tourcosts\n\n res.status(200).json(deletedRecords);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }", "async destroy({ params, request, response }) {}", "function postDelete(response) {\n\tif (response == \"OK\") {\n\t\t$(\"h3#h\" + $(\"#expiddel\").val()).remove();\n\t\t$(\"div#h\" + $(\"#expiddel\").val()).remove();\n\t\t$(\"#dialog\").dialog('close');\n\t} else\n\t\talert(\"Action failed\");\n}", "function tag_delete_confirm(response){\n\ttag_id = JSON.parse(response);//deserialise the data rturned from the view\n\tif (tag_id > 0) {\n\t\tconsole.log(\"we get the id\")\n\t\t$('#tag_' + tag_id).remove();\n\t\t$('#tag_button_' + tag_id).remove();\n\t}\n}", "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "function deleteCurrentTemplate() {\r\n\t\t$('ul#template_queue').children('li').each(function (key, val) {\r\n\t\t\t$('div.bqremove:first').click();\r\n\t\t});\r\n\t}", "deletePerson(index) {\n Actions.deletePerson(index)\n }", "delete(item) {\n this.sendAction('delete', item);\n }", "function handleDeleteItem() {\r\n $('main').on('click', '#delete-button', event => {\r\n let id = getItemIdFromElement(event.target)\r\n api.deleteBookmark(id)\r\n .then(() => {\r\n store.findAndDelete(id);\r\n render();\r\n })\r\n .catch((error) => {\r\n store.setError(error.message);\r\n renderError();\r\n })\r\n })\r\n}", "deleteUnicorn() {\n this.props.deleteUnicorn(this.props._id);\n }", "function handleDelete(exercise){\n fetch(`http://localhost:3000/exercises/${exercise.id}`,{ \n method: \"DELETE\"\n })\n let exercisesRemaining = exerciseLibrary.filter(eachExercise => eachExercise.id !== exercise.id);\n console.log(exercisesRemaining)\n setExerciseLibrary([...exercisesRemaining])\n }", "function deleteImage() {\n \n var array = document.querySelectorAll('.mySlides')\n for (i=0;i<array.length;i++) {\n if (array[i].style.display === 'block') {\n document.getElementById('imageId').value = array[i].id\n }\n }\n \n const input = {\n id : document.getElementById('imageId').value\n \n }\n \n fetch('https://lisathomasapi.herokuapp.com/routes/images/deleteImage', {\n method: 'POST',\n body: JSON.stringify(input),\n headers: { \"Content-Type\": \"application/json\"}\n }).then(function(response) {\n return response.json();\n }).then(function(data) {\n \n })\nwindow.location.href = 'adminmessage.html'\n \n}" ]
[ "0.77357244", "0.7377002", "0.72924876", "0.7282034", "0.7161172", "0.6709938", "0.6579135", "0.65381134", "0.64747137", "0.6448782", "0.63921636", "0.6382087", "0.6324793", "0.6295693", "0.6248558", "0.6229366", "0.62201375", "0.6201239", "0.6166086", "0.616189", "0.61408406", "0.6064575", "0.60026264", "0.59896225", "0.5983047", "0.5975616", "0.5951295", "0.5947877", "0.5941072", "0.5933729", "0.5932683", "0.59246975", "0.59240526", "0.59218353", "0.5918917", "0.5914678", "0.59145766", "0.59009683", "0.58772707", "0.58772707", "0.58540636", "0.58506465", "0.5839781", "0.5839206", "0.5829105", "0.5827016", "0.5826129", "0.5820969", "0.58198065", "0.5804788", "0.5802444", "0.58016187", "0.57973284", "0.57938313", "0.57924414", "0.57919216", "0.5789715", "0.57881445", "0.57818085", "0.5781464", "0.57808995", "0.57796085", "0.5775625", "0.577056", "0.5769272", "0.5768757", "0.57666916", "0.5765804", "0.5763779", "0.57534367", "0.57503235", "0.574939", "0.57461894", "0.5745635", "0.5740471", "0.57388324", "0.5718011", "0.57172513", "0.5717191", "0.57134634", "0.571152", "0.5708598", "0.5703493", "0.5703472", "0.57032424", "0.5695372", "0.56939375", "0.56875724", "0.56734604", "0.5669344", "0.5668992", "0.5668952", "0.56615096", "0.5661024", "0.56601113", "0.56551105", "0.56547815", "0.5654058", "0.5653837", "0.5649811" ]
0.77518266
0
Automatically parses all request parameters and puts them into the `params` property of the request object. This is the union of all GET (query string) and POST (content) parameters, such that all POST parameters with the same name take precedence. Valid options include the following: maxLength The maximum length (in bytes) of the request content. Overrides Request.maxContentLength for all requests using this middleware. uploadPrefix A special prefix to use for temporary files on disk that are created from file uploads. Overrides Request.defaultUploadPrefix for all requests using this middleware.
function makeParams(app, options) { options = options || {}; var maxLength = options.maxLength; var uploadPrefix = options.uploadPrefix; function paramsApp(request) { if (request.params) { return request.call(app); // Don't overwrite existing params. } request.params = {}; merge(request.params, request.query); return request.parseContent(maxLength, uploadPrefix).then(function (params) { merge(request.params, params); return request.call(app); }, function (error) { if (error instanceof errors.MaxLengthExceededError) { return utils.requestEntityTooLarge(); } throw error; }); } return paramsApp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseBody (req, res, next) {\n var uri = url.parse(req.url, true);\n req.pathname = uri.pathname;\n req.cookies = qs.parse(req.headers.cookie);\n req.query = uri.query;\n\n req.on('readable', function () {\n var body = req.read();\n var contentType = req.headers['content-type'];\n if (contentType === 'application/json') {\n util._extend(req.params, JSON.parse(body));\n } else {\n util._extend(req.params, qs.parse(body));\n }\n next(req, res);\n });\n}", "function mergeParams (req, res, next) {\n\n req.resource = req.resource || {};\n req.resource.params = {};\n req.body = req.body || {};\n\n //\n // Iterate through all the querystring and request.body values and\n // merge them into a single \"data\" argument\n //\n if (typeof req.params === 'object') {\n Object.keys(req.params).forEach(function (p) {\n req.resource.params[p] = req.param(p);\n });\n }\n\n if (typeof req.query === 'object') {\n Object.keys(req.query).forEach(function (p) {\n req.resource.params[p] = req.query[p];\n });\n }\n\n Object.keys(req.body).forEach(function (p) {\n req.resource.params[p] = req.body[p];\n });\n\n next();\n}", "function requestOptions (requestOptions, options) {\n return {\n url: requestOptions.url,\n method: requestOptions.method,\n body: Object.assign({}, requestOptions.body, options.body),\n query: Object.assign({}, requestOptions.query, options.query),\n headers: Object.assign({}, requestOptions.headers, options.headers)\n }\n}", "function HttpParamsOptions() {}", "function HttpParamsOptions() {}", "function getUrlParams(options) {\n if (options.url.indexOf('?') !== -1) {\n options.requestParams = options.requestParams || {};\n var queryString = options.url.substring(options.url.indexOf('?') + 1);\n options.url = options.url.split('?')[0];\n options.requestParams = JSON.parse('{\"' + decodeURI(queryString).replace(/\"/g, '\\\\\"').replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}');\n }\n\n options.url = cleanUrl(options.url.split('?')[0]);\n return options;\n}", "function getUrlParams (options) {\r\n if (options.url.indexOf('?') !== -1) {\r\n options.requestParams = options.requestParams || {};\r\n var queryString = options.url.substring(options.url.indexOf('?') + 1);\r\n options.url = options.url.split('?')[0];\r\n options.requestParams = JSON.parse('{\"' + decodeURI(queryString).replace(/\"/g, '\\\\\"').replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}');\r\n }\r\n options.url = cleanUrl(options.url.split('?')[0]);\r\n return options;\r\n}", "_params(req, opts) {\n const body = req.body || {};\n\n if (opts.name) body.Name = opts.name;\n if (opts.session) body.Session = opts.session;\n if (opts.token) {\n body.Token = opts.token;\n delete opts.token;\n }\n if (opts.near) body.Near = opts.near;\n if (opts.template) {\n const template = utils.normalizeKeys(opts.template);\n if (template.type || template.regexp) {\n body.Template = {};\n if (template.type) body.Template.Type = template.type;\n if (template.regexp) body.Template.Regexp = template.regexp;\n }\n }\n if (opts.service) {\n const service = utils.normalizeKeys(opts.service);\n body.Service = {};\n if (service.service) body.Service.Service = service.service;\n if (service.failover) {\n const failover = utils.normalizeKeys(service.failover);\n if (typeof failover.nearestn === \"number\" || failover.datacenters) {\n body.Service.Failover = {};\n if (typeof failover.nearestn === \"number\") {\n body.Service.Failover.NearestN = failover.nearestn;\n }\n if (failover.datacenters) {\n body.Service.Failover.Datacenters = failover.datacenters;\n }\n }\n }\n if (typeof service.onlypassing === \"boolean\") {\n body.Service.OnlyPassing = service.onlypassing;\n }\n if (service.tags) body.Service.Tags = service.tags;\n }\n if (opts.dns) {\n const dns = utils.normalizeKeys(opts.dns);\n if (dns.ttl) body.DNS = { TTL: dns.ttl };\n }\n\n req.body = body;\n }", "function HttpParamsOptions() { }", "function HttpParamsOptions() { }", "function HttpParamsOptions() { }", "parseParams(){\n\t\tthis.app.use(\n\t\t\t(req, res, next) => {\n\t\t\t\treq.parsedParams = {};\n\n\t\t\t\tconst records = req.body;\n\t\t\t\tthis.log.debug({records}, 'parseParams() getting records');\n\t\t\t\tif(records || records === '' || records === 0){\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParms,\n\t\t\t\t\t\trecords\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst rangeMatch = ( req.get('Range') || '' ).match(/=(\\d*)[-–](\\d*)$/);\n\t\t\t\tif(Array.isArray(rangeMatch) && typeof rangeMatch[1] == 'string' && typeof rangeMatch[2] == 'string'){\n\t\t\t\t\tlet end = parseInt(rangeMatch[2], 10);\n\t\t\t\t\tend = isNaN(end) ? undefined : end;\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParams,\n\t\t\t\t\t\tstart: parseInt(rangeMatch[1], 10),\n\t\t\t\t\t\tend\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst idMatch = req.originalUrl.match(/\\/(?<id>\\d+)\\/*$/);\n\t\t\t\tif(Array.isArray(idMatch) && typeof idMatch[1] == 'string'){\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParams,\n\t\t\t\t\t\tstart: parseInt(idMatch[1], 10), // yes, let this start override the range start above\n\t\t\t\t\t\tid: parseInt(idMatch[1], 10)\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tnext();\n\t\t\t}\n\t\t);\n\t}", "function getRequestOptions() {\n var requestOptions = url.parse(ENDPOINT);\n requestOptions.auth = 'api:' + settings.key;\n requestOptions.method = 'POST';\n\n return requestOptions;\n }", "function setDefaultRequestOptions (options) {\n var base = request.Request.request.defaults(options);\n request.Request.request = base;\n return request;\n}", "function queryParams() {\n const params = {};\n urlBase.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return params;\n }", "setParams(){\r\n params = {};\r\n params[\"method\"] = this.sendMethod;\r\n params[\"headers\"] = this.sendHeaders;\r\n if (this.sendMethod !== \"GET\") {\r\n if (typeof params.headers['Content-Type'] == \"undefined\") {\r\n params.headers['Content-Type'] = 'application/x-www-form-urlencoded';\r\n }\r\n params[\"body\"] = this.sendData;\r\n }\r\n return params;\r\n }", "function getRequestedParams(req) {\n\n const parsedUrl = url.parse(req.url, true);\n\n // path\n const reqPath = parsedUrl.pathname.replace(/^\\/+|\\/$/g, '');\n\n // http method\n const method = req.method.toLowerCase();\n\n // query String\n const query = parsedUrl.query;\n\n // http header\n const headers = req.headers;\n\n return {\n path: reqPath,\n method,\n query,\n headers\n };\n\n}", "function RequestOptions(opts) {\n if (opts === void 0) { opts = {}; }\n var method = opts.method, headers = opts.headers, body = opts.body, url = opts.url, search = opts.search, params = opts.params, withCredentials = opts.withCredentials, responseType = opts.responseType;\n this.method = method != null ? normalizeMethodName(method) : null;\n this.headers = headers != null ? headers : null;\n this.body = body != null ? body : null;\n this.url = url != null ? url : null;\n this.params = this._mergeSearchParams(params || search);\n this.withCredentials = withCredentials != null ? withCredentials : null;\n this.responseType = responseType != null ? responseType : null;\n }", "function RequestOptions(opts) {\n if (opts === void 0) { opts = {}; }\n var method = opts.method, headers = opts.headers, body = opts.body, url = opts.url, search = opts.search, params = opts.params, withCredentials = opts.withCredentials, responseType = opts.responseType;\n this.method = method != null ? normalizeMethodName(method) : null;\n this.headers = headers != null ? headers : null;\n this.body = body != null ? body : null;\n this.url = url != null ? url : null;\n this.params = this._mergeSearchParams(params || search);\n this.withCredentials = withCredentials != null ? withCredentials : null;\n this.responseType = responseType != null ? responseType : null;\n }", "function RequestOptions(opts) {\n if (opts === void 0) { opts = {}; }\n var method = opts.method, headers = opts.headers, body = opts.body, url = opts.url, search = opts.search, params = opts.params, withCredentials = opts.withCredentials, responseType = opts.responseType;\n this.method = method != null ? normalizeMethodName(method) : null;\n this.headers = headers != null ? headers : null;\n this.body = body != null ? body : null;\n this.url = url != null ? url : null;\n this.params = this._mergeSearchParams(params || search);\n this.withCredentials = withCredentials != null ? withCredentials : null;\n this.responseType = responseType != null ? responseType : null;\n }", "getParamsByMethodType(context) {\n\t\t/** If set config mergeParam = true at setting routes */\n\t\tif (context.params && !context.params.query && !context.params.body && !context.params.params) {\n\t\t\treturn context.params;\n\t\t}\n\t\t/** Else will check and get params via method type */\n\t\tlet params = {};\n\t\tif (context.meta.method) {\n\t\t\tswitch (context.meta.method) {\n\t\t\t\tcase \"GET\": {\n\t\t\t\t\tparams = {...context.params.query, ...context.params.params};\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"POST\" || \"PUT\" || \"DELETE\" || \"OPTIONS\": {\n\t\t\t\t\tparams = context.params.body;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (params && !_.isEmpty(params)) {\n\t\t\treturn params;\n\t\t}\n\t\t/** Try for get params if case method type is not set, merge all to a object params */\n\t\tparams = {...context.params.query, ...context.params.body, ...context.params.params};\n\t\treturn params;\n\t}", "function processRequest(req, res, next) {\n if (config.debug) {\n console.log(util.inspect(req.body, null, 3));\n };\n\n var reqQuery = req.body,\n params = reqQuery.params || {},\n methodURL = reqQuery.methodUri,\n httpMethod = reqQuery.httpMethod,\n apiKey = reqQuery.apiKey,\n apiSecret = reqQuery.apiSecret,\n apiName = reqQuery.apiName\n apiConfig = apisConfig[apiName],\n key = req.sessionID + ':' + apiName;\n\n // Replace placeholders in the methodURL with matching params\n for (var param in params) {\n if (params.hasOwnProperty(param)) {\n if (params[param] !== '') {\n // URL params are prepended with \":\"\n var regx = new RegExp(':' + param);\n\n // If the param is actually a part of the URL, put it in the URL and remove the param\n if (!!regx.test(methodURL)) {\n methodURL = methodURL.replace(regx, params[param]);\n delete params[param]\n }\n } else {\n delete params[param]; // Delete blank params\n }\n }\n }\n\n var baseHostInfo = apiConfig.baseURL.split(':');\n var baseHostUrl = baseHostInfo[0],\n baseHostPort = (baseHostInfo.length > 1) ? baseHostInfo[1] : \"\";\n\n var paramString = query.stringify(params),\n privateReqURL = apiConfig.protocol + '://' + apiConfig.baseURL + apiConfig.privatePath + methodURL + ((paramString.length > 0) ? '?' + paramString : \"\"),\n options = {\n headers: apiConfig.headers,\n protocol: apiConfig.protocol + ':',\n host: baseHostUrl,\n port: baseHostPort,\n method: httpMethod,\n path: apiConfig.publicPath + methodURL// + ((paramString.length > 0) ? '?' + paramString : \"\")\n };\n\n if (['POST','DELETE','PUT'].indexOf(httpMethod) !== -1) {\n var requestBody = query.stringify(params);\n }\n\n if (['POST','PUT','DELETE'].indexOf(httpMethod) === -1) {\n options.path += ((paramString.length > 0) ? '?' + paramString : \"\");\n }\n\n // Add API Key to params, if any.\n if (apiKey != '' && apiKey != 'undefined' && apiKey != undefined) {\n if (options.path.indexOf('?') !== -1) {\n options.path += '&';\n }\n else {\n options.path += '?';\n }\n options.path += apiConfig.keyParam + '=' + apiKey;\n }\n\n // Perform signature routine, if any.\n if (apiConfig.signature) {\n if (apiConfig.signature.type == 'signed_md5') {\n // Add signature parameter\n var timeStamp = Math.round(new Date().getTime()/1000);\n var sig = crypto.createHash('md5').update('' + apiKey + apiSecret + timeStamp + '').digest(apiConfig.signature.digest);\n options.path += '&' + apiConfig.signature.sigParam + '=' + sig;\n }\n else if (apiConfig.signature.type == 'signed_sha256') { // sha256(key+secret+epoch)\n // Add signature parameter\n var timeStamp = Math.round(new Date().getTime()/1000);\n var sig = crypto.createHash('sha256').update('' + apiKey + apiSecret + timeStamp + '').digest(apiConfig.signature.digest);\n options.path += '&' + apiConfig.signature.sigParam + '=' + sig;\n }\n }\n\n // Setup headers, if any\n if (reqQuery.headerNames && reqQuery.headerNames.length > 0) {\n if (config.debug) {\n console.log('Setting headers');\n };\n var headers = {};\n\n for (var x = 0, len = reqQuery.headerNames.length; x < len; x++) {\n if (config.debug) {\n console.log('Setting header: ' + reqQuery.headerNames[x] + ':' + reqQuery.headerValues[x]);\n };\n if (reqQuery.headerNames[x] != '') {\n headers[reqQuery.headerNames[x]] = reqQuery.headerValues[x];\n }\n }\n\n options.headers = headers;\n }\n if(options.headers === void 0){\n options.headers = {}\n }\n\n // If POST, PUT, -or- DELETE\n if (requestBody) {\n options.headers['Content-Length'] = requestBody.length;\n options.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8';\n }\n else {\n options.headers['Content-Length'] = 0;\n delete options.headers['Content-Type'];\n }\n\n if (config.debug) {\n console.log(util.inspect(options));\n };\n\n var doRequest;\n if (options.protocol === 'https' || options.protocol === 'https:') {\n options.protocol = 'https:'\n doRequest = https.request;\n } else {\n doRequest = http.request;\n }\n\n if (config.debug) {\n console.log('Protocol: ' + options.protocol);\n }\n\n // API Call. response is the response from the API, res is the response we will send back to the user.\n var apiCall = doRequest(options, function(response) {\n response.setEncoding('utf-8');\n\n if (config.debug) {\n console.log('HEADERS: ' + JSON.stringify(response.headers));\n console.log('STATUS CODE: ' + response.statusCode);\n };\n\n res.statusCode = response.statusCode;\n\n var body = '';\n\n response.on('data', function(data) {\n body += data;\n })\n\n response.on('end', function() {\n delete options.agent;\n\n var responseContentType = response.headers['content-type'];\n\n switch (true) {\n case /application\\/javascript/.test(responseContentType):\n case /application\\/json/.test(responseContentType):\n if (config.debug) {\n console.log(util.inspect(body));\n }\n break;\n case /application\\/xml/.test(responseContentType):\n case /text\\/xml/.test(responseContentType):\n default:\n }\n\n // Set Headers and Call\n req.resultHeaders = response.headers;\n req.call = url.parse(options.host + options.path);\n req.call = url.format(req.call);\n\n // Response body\n req.result = body;\n\n if (config.debug) {\n console.log(util.inspect(body));\n }\n\n next();\n })\n }).on('error', function(e) {\n if (config.debug) {\n console.log('HEADERS: ' + JSON.stringify(res.headers));\n console.log(\"Got error: \" + e.message);\n console.log(\"Error: \" + util.inspect(e));\n };\n });\n\n if (requestBody) {\n apiCall.end(requestBody, 'utf-8');\n }\n else {\n apiCall.end();\n }\n}", "function queryParams() {\n const params = {};\n urlBase.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return params;\n }", "function getParams(request, parsed) {\n return new Promise(function(resolve, reject) {\n if (request.method == 'POST') {\n var body = '';\n \n request.on('data', function (chunk) {\n body += chunk;\n\n // Too much POST data, kill the connection!\n // 1e6 === 1 * Math.pow(10, 6) === 1 * 1000000 ~~~ 1MB\n if (body.length > 1e6) {\n request.connection.destroy();\n reject('Too much data');\n }\n });\n\n request.on('end', function () {\n resolve(JSON.parse(body || \"{}\"));\n });\n } else if (request.method == 'GET') {\n resolve(parsed.query);\n }\n });\n}", "getGeneralParameters() {\n\t\t\tconst params = {};\n\t\t\tObject.keys(this.$route.query).forEach((key) => {\n\t\t\t\tif (!(key in this.filters)) {\n\t\t\t\t\tparams[key] = this.$route.query[key];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn params;\n\t\t}", "get_request_kwargs() {\n return {}\n }", "function sanitizeRequestData(req, res, next) {\r\n\r\n debug('before sanitizing query params: %s', JSON.stringify(req.query));\r\n\r\n let origData;\r\n\r\n if (securityConfig.logBadValues) {\r\n\r\n origData = _.assign(_.stubObject(), _.cloneDeep(req.query), _.cloneDeep(req.body));\r\n\r\n _.each(['cookie', 'user-agent', 'host', 'referer'], (header) => {\r\n if (req.headers[header]) {\r\n _.set(origData, header, req.headers[header]);\r\n }\r\n });\r\n\r\n }\r\n\r\n // sanitize all query params\r\n _.forOwn(req.query, (val, key) => {\r\n\r\n if (!_.isArray(val)) {\r\n req.query[key] = safeStripTags(req.query[key]);\r\n } else {\r\n _.each(val, (iVal, i) => {\r\n req.query[key][i] = safeStripTags(req.query[key][i]);\r\n });\r\n }\r\n });\r\n\r\n debug('after sanitizing query params: %s', JSON.stringify(req.query));\r\n\r\n if (!_.isEmpty(req.body)) {\r\n\r\n debug('before sanitizing body: %s', JSON.stringify(req.body));\r\n\r\n _.forOwn(req.body, (val, key) => {\r\n\r\n if (!_.isArray(val)) {\r\n req.body[key] = safeStripTags(req.body[key]);\r\n } else {\r\n _.each(val, (iVal, i) => {\r\n req.body[key][i] = safeStripTags(req.body[key][i]);\r\n });\r\n }\r\n });\r\n\r\n debug('after sanitizing body: %s', JSON.stringify(req.body));\r\n\r\n }\r\n\r\n // sanitize all cookies and headers that might be reflected in browser\r\n _.each(['cookie', 'user-agent', 'host', 'referer'], (header) => {\r\n req.headers[header] = safeStripTags(req.headers[header]);\r\n });\r\n\r\n if (securityConfig.logBadValues) {\r\n\r\n const badData = {\r\n query: {},\r\n body: {},\r\n headers: {},\r\n };\r\n\r\n _.forOwn(req.query, (val, key) => {\r\n\r\n if (!_.isArray(val) && origData[key] !== val) {\r\n badData.query[key] = origData[key];\r\n } else {\r\n const badArr = [];\r\n _.each(val, (iVal, i) => {\r\n if (origData[key][i] !== iVal) {\r\n badArr.push(origData[key][i]);\r\n }\r\n });\r\n if (badArr.length) {\r\n badData.query[key] = badArr;\r\n }\r\n }\r\n });\r\n\r\n _.forOwn(req.body, (val, key) => {\r\n\r\n if (!_.isArray(val) && origData[key] !== val) {\r\n badData.body[key] = origData[key];\r\n } else {\r\n const badArr = [];\r\n _.each(val, (iVal, i) => {\r\n if (origData[key][i] !== iVal) {\r\n badArr.push(origData[key][i]);\r\n }\r\n });\r\n if (badArr.length) {\r\n badData.body[key] = badArr;\r\n }\r\n }\r\n });\r\n\r\n _.each(['cookie', 'user-agent', 'host', 'referer'], (header) => {\r\n if (req.headers[header] && origData[header] !== req.headers[header]) {\r\n badData.headers[header] = origData[header];\r\n }\r\n });\r\n\r\n if (!_.isEmpty(badData.query)) {\r\n _.set(res.locals, 'logInfo.security.badRequestData.query', badData.query);\r\n statsd.increment('request.invalid.query-param-data');\r\n }\r\n\r\n if (!_.isEmpty(badData.body)) {\r\n _.set(res.locals, 'logInfo.security.badRequestData.body', badData.body);\r\n statsd.increment('request.invalid.body-data');\r\n }\r\n\r\n if (!_.isEmpty(badData.headers)) {\r\n _.set(res.locals, 'logInfo.security.badRequestData.headers', badData.headers);\r\n statsd.increment('request.invalid.header-data');\r\n }\r\n }\r\n\r\n next();\r\n}", "setBodyParser() {\n this.app.use(bodyParser.json({ limit: this.configuration.bodyLimit }));\n this.app.use(bodyParser.urlencoded({ extended: true, limit: this.configuration.bodyLimit }));\n }", "_defaultParams(name, params) {\n const handlers = this.recognizer.handlersFor(name);\n let paramNames = [];\n for (let i = 0, len = handlers.length; i < len; i++) {\n paramNames = paramNames.concat(handlers[i].names);\n }\n params = Object.assign(pick(this.store.state.params, paramNames), params);\n this._cleanParams(params);\n return params;\n }", "setRequestProperties (req) {\n const uri = this.parseUri(req.url)\n for (const key in uri) {\n req[key] = uri[key]\n }\n }", "prepareRequestParams(options) {\n let requestParams;\n const searchKeys = _.split(options.searchKey, ','), matchModes = _.split(options.matchMode, ','), formFields = {};\n _.forEach(searchKeys, (colName, index) => {\n formFields[colName] = {\n value: options.query,\n logicalOp: 'AND',\n matchMode: matchModes[index] || matchModes[0] || 'startignorecase'\n };\n });\n requestParams = {\n filterFields: formFields,\n page: options.page,\n pagesize: options.limit || options.pagesize,\n skipDataSetUpdate: true,\n skipToggleState: true,\n inFlightBehavior: 'executeAll',\n logicalOp: 'OR',\n orderBy: options.orderby ? _.replace(options.orderby, /:/g, ' ') : ''\n };\n if (options.onBeforeservicecall) {\n options.onBeforeservicecall(formFields);\n }\n return requestParams;\n }", "function placeDataIntoRequest(options, data) {\n // Data is in querystring when a get\n if (options.method === 'GET' || options.method === 'DELETE') {\n Object.assign(options.qs, data);\n }\n else { // data is in the body for PUT,POST,etc.\n options.body = data;\n }\n }", "computeOptions(parameters) {\n let options = {\n timeout: 30000,\n headers: {},\n encoding: null,\n followAllRedirects: true,\n followRedirect: true,\n time: true\n };\n\n options.method = parameters.method;\n options.url = parameters.url;\n\n if (parameters.request_parameters) {\n let requestParameters = parameters.request_parameters;\n\n if (requestParameters.headers) {\n options.headers = JSON.parse(\n JSON.stringify(requestParameters.headers).toLowerCase()\n );\n }\n\n if (requestParameters.hasOwnProperty(\"follow_redirect\")) {\n options.followRedirect = requestParameters.follow_redirect;\n options.followAllRedirects = requestParameters.follow_redirect;\n }\n\n if (requestParameters.payload) {\n options.body = requestParameters.payload;\n\n options.headers[\"content-length\"] = Buffer.byteLength(\n requestParameters.payload\n );\n\n if (!options.headers[\"content-type\"]) {\n console.log(\n \"You need to send Content-Type in headers to identify the body content of this request.\"\n );\n }\n }\n }\n\n if (!options.headers.hasOwnProperty(\"accept\")) {\n options.headers[\"accept\"] = \"*/*\";\n } else if (options.headers[\"accept\"] == \"\") {\n delete options.headers[\"accept\"];\n }\n\n if (!options.headers.hasOwnProperty(\"user-agent\")) {\n options.headers[\"user-agent\"] = this.userAgent;\n } else if (options.headers[\"user-agent\"] == \"\") {\n delete options.headers[\"user-agent\"];\n }\n\n return options;\n }", "constructor(options) {\r\n this.method = options.method || 'GET';\r\n this.host = options.host;\r\n this.path = options.path || '/';\r\n this.port = options.port || 80;\r\n this.body = options.body || {};\r\n this.headers = options.headers || {};\r\n\r\n if (!this.headers['Content-Type']) {\r\n this.headers['Content-Type'] = 'application/x-www-form-urlencoded';\r\n }\r\n\r\n if (this.headers['Content-Type'] === 'application/json') {\r\n this.bodyText = JSON.stringify(this.body);\r\n }\r\n\r\n if (this.headers['Content-Type'] === 'application/x-www-form-urlencoded') {\r\n this.bodyText = Object.keys(this.body)\r\n .map((key) => {\r\n return `${key}=${encodeURIComponent(this.body[key])}`;\r\n })\r\n .join('&');\r\n this.headers['Content-Length'] = this.bodyText.length;\r\n }\r\n }", "initExpressMiddleWare() {\n\t\tthis.app.use(bodyParser.urlencoded({ extended: true }));\n\t\tthis.app.use(bodyParser.json());\n\t}", "function getUrlParams (options$$1) {\n if (options$$1.url.indexOf('?') !== -1) {\n options$$1.requestParams = options$$1.requestParams || {};\n var queryString = options$$1.url.substring(options$$1.url.indexOf('?') + 1);\n options$$1.url = options$$1.url.split('?')[0];\n options$$1.requestParams = JSON.parse('{\"' + decodeURI(queryString).replace(/\"/g, '\\\\\"').replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}');\n }\n options$$1.url = cleanUrl(options$$1.url.split('?')[0]);\n return options$$1;\n}", "function bodyRequest(body){\n\t/* Process Request Modified from CS 290 Lecture \n\t http://eecs.oregonstate.edu/ecampus-video/CS290/core-content/hello-node/express-forms.html */\n\tvar qParams = [];\n\tfor (var p in body){ /* Loop through request body */\n\t\tqParams.push({'name':p,'value':body[p]})\n\t}\n\treturn qParams; /* Add requrest to context object */\n}", "function initialBodyParsers(app) {\n // parse application/json\n app.use(bodyParser.json());\n // parse application/x-www-form-urlencoded\n app.use(bodyParser.urlencoded({ extended: false }));\n}", "function HttpRequestArgs() {\n var _this = this;\n var __arguments = new Array(arguments.length);\n for (var __argumentIndex = 0; __argumentIndex < __arguments.length; ++__argumentIndex) {\n __arguments[__argumentIndex] = arguments[__argumentIndex];\n }\n if (__arguments.length == 0) {\n _this = _super.call(this) || this;\n _this.fmliveswitchHttpRequestArgsInit();\n _this.setTimeout(15000);\n _this.setMethod(fm.liveswitch.HttpMethod.Post);\n _this.__headers = new fm.liveswitch.NameValueCollection();\n }\n else {\n throw new fm.liveswitch.Exception('Constructor overload does not exist with specified parameter count/type combination.');\n }\n return _this;\n }", "function parseRequest(req, res, next) {\n req.segment = req.segment || {};\n\n req.segment.body = req.body;\n req.segment.message = req.body;\n return next();\n}", "_setQueryStringOptions () {\n this.qs = this._get('qs', {})\n }", "bodyParser() {\n this.app.use(bodyParser.urlencoded({ extended: true }));\n this.app.use(bodyParser.json());\n }", "function setAppMiddleware(app) {\n app.use(bodyParser.json());\n app.use(bodyParser.urlencoded({ extended : false}));\n}", "serializeApiCallOptions(options, headers) {\n // The following operation both flattens complex objects into a JSON-encoded strings and searches the values for\n // binary content\n let containsBinaryData = false;\n const flattened = Object.entries(options)\n .map(([key, value]) => {\n if (value === undefined || value === null) {\n return [];\n }\n let serializedValue = value;\n if (Buffer.isBuffer(value) || is_stream_1.default(value)) {\n containsBinaryData = true;\n }\n else if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean') {\n // if value is anything other than string, number, boolean, binary data, a Stream, or a Buffer, then encode it\n // as a JSON string.\n serializedValue = JSON.stringify(value);\n }\n return [key, serializedValue];\n });\n // A body with binary content should be serialized as multipart/form-data\n if (containsBinaryData) {\n this.logger.debug('request arguments contain binary data');\n const form = flattened.reduce((form, [key, value]) => {\n if (Buffer.isBuffer(value) || is_stream_1.default(value)) {\n const options = {};\n options.filename = (() => {\n // attempt to find filename from `value`. adapted from:\n // tslint:disable-next-line:max-line-length\n // https://github.com/form-data/form-data/blob/028c21e0f93c5fefa46a7bbf1ba753e4f627ab7a/lib/form_data.js#L227-L230\n // formidable and the browser add a name property\n // fs- and request- streams have path property\n const streamOrBuffer = value;\n if (typeof streamOrBuffer.name === 'string') {\n return path_1.basename(streamOrBuffer.name);\n }\n if (typeof streamOrBuffer.path === 'string') {\n return path_1.basename(streamOrBuffer.path);\n }\n return defaultFilename;\n })();\n form.append(key, value, options);\n }\n else if (key !== undefined && value !== undefined) {\n form.append(key, value);\n }\n return form;\n }, new form_data_1.default());\n // Copying FormData-generated headers into headers param\n // not reassigning to headers param since it is passed by reference and behaves as an inout param\n for (const [header, value] of Object.entries(form.getHeaders())) {\n headers[header] = value;\n }\n return form;\n }\n // Otherwise, a simple key-value object is returned\n headers['Content-Type'] = 'application/x-www-form-urlencoded';\n const initialValue = {};\n return querystring_1.stringify(flattened.reduce((accumulator, [key, value]) => {\n if (key !== undefined && value !== undefined) {\n accumulator[key] = value;\n }\n return accumulator;\n }, initialValue));\n }", "function getRequestParam(request){\n return querystring.parse( url.parse(request.url).query );\n}", "function extractRequestData(req, keys) {\n if (keys === void 0) { keys = DEFAULT_REQUEST_KEYS; }\n var requestData = {};\n // headers:\n // node, express, nextjs: req.headers\n // koa: req.header\n var headers = (req.headers || req.header || {});\n // method:\n // node, express, koa, nextjs: req.method\n var method = req.method;\n // host:\n // express: req.hostname in > 4 and req.host in < 4\n // koa: req.host\n // node, nextjs: req.headers.host\n var host = req.hostname || req.host || headers.host || '<no host>';\n // protocol:\n // node, nextjs: <n/a>\n // express, koa: req.protocol\n var protocol = req.protocol === 'https' || req.secure || (req.socket || {}).encrypted\n ? 'https'\n : 'http';\n // url (including path and query string):\n // node, express: req.originalUrl\n // koa, nextjs: req.url\n var originalUrl = (req.originalUrl || req.url || '');\n // absolute url\n var absoluteUrl = protocol + \"://\" + host + originalUrl;\n keys.forEach(function (key) {\n switch (key) {\n case 'headers':\n requestData.headers = headers;\n break;\n case 'method':\n requestData.method = method;\n break;\n case 'url':\n requestData.url = absoluteUrl;\n break;\n case 'cookies':\n // cookies:\n // node, express, koa: req.headers.cookie\n // vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n requestData.cookies = req.cookies || cookie.parse(headers.cookie || '');\n break;\n case 'query_string':\n // query string:\n // node: req.url (raw)\n // express, koa, nextjs: req.query\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n requestData.query_string = req.query || url.parse(originalUrl || '', false).query;\n break;\n case 'data':\n if (method === 'GET' || method === 'HEAD') {\n break;\n }\n // body data:\n // express, koa, nextjs: req.body\n //\n // when using node by itself, you have to read the incoming stream(see\n // https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know\n // where they're going to store the final result, so they'll have to capture this data themselves\n if (req.body !== undefined) {\n requestData.data = utils_1.isString(req.body) ? req.body : JSON.stringify(utils_1.normalize(req.body));\n }\n break;\n default:\n if ({}.hasOwnProperty.call(req, key)) {\n requestData[key] = req[key];\n }\n }\n });\n return requestData;\n}", "constructor(options) {\n this.method = options.method || \"GET\";\n this.host = options.host;\n this.part = options.path || 80;\n this.path = options.path || \"/\";\n this.body = options.body || {};\n this.headers = options.headers || {};\n if (!this.headers[\"Content-Type\"]) {\n this.headers[\"Content-Type\"] = \"application/x-www-form-urlencided\"\n } else if (this.headers[\"Content-Type\"] === \"application/json\") {\n this.bodyText = JSON.stringify(this.body);\n } else if (this.header[\"Content-Type\"] === \"application/x-www-form-urlencided\") {\n this.bodyText = Object.keys(this.body).map(key => `${key}=${this.body[key]}`).join(\"&\");\n\n this.headers[\"Content-Length\"] = this.bodyText.length;\n }\n }", "function prepareRequest(request, handler, context) {\n\n // Default to GET if no method has been specified.\n if (!request.method) {\n request.method = \"GET\";\n }\n\n if (!request.headers) {\n request.headers = {};\n } else {\n normalizeHeaders(request.headers);\n }\n\n if (request.headers.Accept === undefined) {\n request.headers.Accept = handler.accept;\n }\n\n if (assigned(request.data) && request.body === undefined) {\n handler.write(request, context);\n }\n\n if (!assigned(request.headers[\"OData-MaxVersion\"])) {\n request.headers[\"OData-MaxVersion\"] = handler.maxDataServiceVersion || \"4.0\";\n }\n\n if (request.async === undefined) {\n request.async = true;\n }\n\n}", "mergeParamsWithStandardParams(opts) {\n if (this.defaultOptions) {\n return Object.assign({}, opts, this.defaultOptions);\n }\n else {\n return opts;\n }\n }", "loadQueryParams() {\n queryParamsToFormStore(\n this.args.queryParams,\n this.formStore,\n this.sourceNode\n );\n }", "function addSwaggerParamsToReq(req, swaggerParams) {\n const swagger = {\n params: swaggerParams || {},\n };\n return _.merge({ swagger }, req);\n}", "function queryParamsValues() {\n const params = [];\n urlBase.searchParams.forEach((value) => {\n params.push(value);\n });\n\n return params;\n }", "_prepareParams (params) {\n if (params == null) {\n params = {}\n }\n if (params.auth == null) {\n params.auth = {}\n }\n if (params.auth.key == null) {\n params.auth.key = this._authKey\n }\n if (params.auth.expires == null) {\n params.auth.expires = this._getExpiresDate()\n }\n\n return JSON.stringify(params)\n }", "function buildOptions (srcOptions) {\n\n var keys = ['method', 'url', 'params', 'body', 'cache', 'headers'];\n\n var result = {};\n\n keys.map(function (k) {\n\n if (srcOptions[k]) {\n result[k] = srcOptions[k];\n }\n });\n\n if (result.body) {\n if (result.headers && result.headers['Content-Type'] && result.headers['Content-Type'] === 'application/x-www-form-urlencoded') {\n result.body = serialize(result.body);\n }\n }\n\n return result;\n }", "static merge(...requests) {\n return requests.reduce((base, request) => {\n if (!request)\n return base;\n base.url = Request.mergeUrls(base.url, request.url);\n base.method = request.method || base.method;\n Object.assign(base.urlParameters, request.urlParameters);\n base.host = request.host.length ? request.host : base.host;\n Object.assign(base.headers, request.headers);\n base.body = RequestBody.merge(base.body, request.body);\n return base;\n }, new Request());\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "middleware() {\n this.express.use(logger('dev'));\n this.express.use(bodyParser.json());\n this.express.use(bodyParser.urlencoded({ extended: false }));\n }", "function ReadQueryParams() {\n const urlParams = new URLSearchParams(location.search)\n\n inputBoxWidth.value = +urlParams.get(paramBoxWidth) || defaultBoxWidth\n inputBoxHeight.value = +urlParams.get(paramBoxHeight) || defaultBoxHeight\n inputBoxRadius.value = +urlParams.get(paramBoxRadius) || defaultBoxRadius\n inputBoxMargin.value = +urlParams.get(paramBoxMargin) || defaultBoxMargin\n inputBoxColor.value = urlParams.get(paramBoxColor) || defaultBoxColor\n inputBgColor.value = urlParams.get(paramBgColor) || defaultBgColor\n inputBoxShadowColor.value = urlParams.get(paramBoxShadowColor) || defaultBoxShadowColor\n inputBoxShadowX.value = +urlParams.get(paramBoxShadowX) || defaultBoxShadowX\n inputBoxShadowY.value = +urlParams.get(paramBoxShadowY) || defaultBoxShadowY\n inputBlurRadius.value = +urlParams.get(paramBlurRadius) || defaultBlurRadius\n inputSpreadRadius.value = +urlParams.get(paramSpreadRadius) || defaultSpreadRadius\n}", "function makeParamsFromFormData(formData) {\n var params = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpParams\"]();\n\n if (Object.keys(formData).length) {\n Object.keys(formData).forEach(function (key) {\n if (Array.isArray(formData[key])) {\n formData[key].forEach(function (k) {\n params = params.append(key + '[]', k);\n });\n } else {\n params = params.append(key, formData[key]);\n }\n });\n }\n\n return params;\n }", "function getURLParams (req) {\n\tvar urlParts = url.parse(req.url, true);\n\treturn urlParts.query;\n}", "_setUploadOptions () {\n this.uploadOptions = {\n maxFieldsSize: bytes(this._get('uploads.maxSize', '4mb')),\n hash: this._get('uploads.hash', false),\n multiples: this._get('uploads.multiple', true),\n maxFields: this._get('qs.parameterLimit', 1000)\n }\n }", "function requestFormatOverride() {\n return function(req, res, next) {\n var parsedUrl = url.parse(req.url);\n if ('json' === req.query.format || parsedUrl.pathname.match(/\\.json$/)) {\n parsedUrl.pathname = parsedUrl.pathname.replace(/\\.json$/, '');\n req.url = parsedUrl.pathname + ( parsedUrl.search || '' );\n req.headers.accept = 'application/json';\n }\n next();\n };\n}", "getQueryParameters(queryParameters, routeParams) {\n const urlSearchParams = new URLSearchParams(queryParameters);\n const dictParams = Object.fromEntries(urlSearchParams.entries());\n Object.keys(dictParams).forEach(key => {\n routeParams[key] = dictParams[key];\n });\n }", "getQueryParameters(queryParameters, routeParams) {\n const urlSearchParams = new URLSearchParams(queryParameters);\n const dictParams = Object.fromEntries(urlSearchParams.entries());\n Object.keys(dictParams).forEach(key => {\n routeParams[key] = dictParams[key];\n });\n }", "function processRequestBody(inputData, params) {\n var requestBody = {},\n missingParams = [],\n paramValue;\n _.forEach(params, function (param) {\n paramValue = _.get(inputData, param.name);\n if (WM.isDefined(paramValue) && (paramValue !== '')) {\n paramValue = Utils.isDateTimeType(param.type) ? Utils.formatDate(paramValue, param.type) : paramValue;\n //Construct ',' separated string if param is not array type but value is an array\n if (WM.isArray(paramValue) && _.toLower(Utils.extractType(param.type)) === 'string') {\n paramValue = _.join(paramValue, ',');\n }\n requestBody[param.name] = paramValue;\n } else if (param.required) {\n missingParams.push(param.name || param.id);\n }\n });\n return {\n 'requestBody' : requestBody,\n 'missingParams' : missingParams\n };\n }", "function Params() {\n return {\n // Wave shape\n wave_type: SQUARE,\n\n // Envelope\n env_attack: 0, // Attack time\n env_sustain: 0.3, // Sustain time\n env_punch: 0, // Sustain punch\n env_decay: 0.4, // Decay time\n\n // Tone\n base_freq: 0.3, // Start frequency\n freq_limit: 0, // Min frequency cutoff\n freq_ramp: 0, // Slide (SIGNED)\n freq_dramp: 0, // Delta slide (SIGNED)\n\n // Vibrato\n vib_strength: 0, // Vibrato depth\n vib_speed: 0, // Vibrato speed\n\n // Tonal change\n arp_mod: 0, // Change amount (SIGNED)\n arp_speed: 0, // Change speed\n\n // Duty (affects the timbre of SQUARE waves)\n duty: 0, // Square duty\n duty_ramp: 0, // Duty sweep (SIGNED)\n\n // Repeat\n repeat_speed: 0, // Repeat speed\n\n // Phaser\n pha_offset: 0, // Phaser offset (SIGNED)\n pha_ramp: 0, // Phaser sweep (SIGNED)\n\n // Low-pass filter\n lpf_freq: 1.0, // Low-pass filter cutoff\n lpf_ramp: 0, // Low-pass filter cutoff sweep (SIGNED)\n lpf_resonance: 0, // Low-pass filter resonance\n // High-pass filter\n hpf_freq: 0, // High-pass filter cutoff\n hpf_ramp: 0, // High-pass filter cutoff sweep (SIGNED)\n\n // Sample parameters\n sound_vol: 0.5,\n sample_rate: 44100,\n sample_size: 8\n };\n}", "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n\n if (!key) {\n return;\n }\n\n this.capture(key);\n let value = '';\n\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n\n currentVal.push(decodedVal);\n } else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "function MeshRequestOptions(request) {\n this.auth = new MeshAuth(request);\n this.logging = request.meshConfig.logging;\n }", "function queryParamsValues() {\n const params = [];\n urlBase.searchParams.forEach((value) => {\n params.push(value);\n });\n\n return params;\n }", "function getParametersMiddleware ({\n api,\n path,\n operation\n}) {\n const middleware = []\n\n const parameters = getParameters(\n api,\n path,\n operation\n )\n\n // path parameters\n middleware.push(\n inPath(\n parameters.filter(parameter => parameter.in === 'path')\n )\n )\n\n // query parameters\n middleware.push(\n inQuery(\n parameters.filter(parameter => parameter.in === 'query')\n )\n )\n\n return middleware\n}", "function prepareParam(value){\n var config = utils.append(value, defaultConfig(), globalParam)\n config.form = {}\n var key = ''\n for(key in config){\n if(config.hasOwnProperty(key)){\n if(!utils.existInObj(key, defaultConfig())){\n if(key === 'uri' || key === 'url' || key === 'form' || key === 'qs') continue\n config.form[key] = config[key]\n delete config[key]\n }\n }\n }\n return config;\n}", "constructor(input, init = {}) {\n // TODO support `input` being a Request\n this[urlSym] = input;\n\n if (!(init.headers instanceof Headers)) {\n this[rawHeadersSym] = init.headers;\n } else {\n this[headersSym] = init.headers;\n }\n this[methodSym] = init.method || 'GET';\n\n if (init.body instanceof ReadableStream || init.body instanceof FormData) {\n this[bodySym] = init.body;\n } else if (typeof init.body === 'string') {\n this[_bodyStringSym] = init.body;\n } else if (isBufferish(init.body)) {\n this[bodySym] = new StringReadable(init.body);\n }\n }", "function getParams() {\n var params = {};\n if (isVideoDropped) {\n params[\"./videoId\"] = storedId;\n params[\"./type\"] = getType();\n params[\"./videoService\"] = \"brightcove\";\n } else {\n params[\"./fileReference\"] = storedId;\n params[\"./type\"] = getType();\n params[\"./imageCrop\"] = calculateCrop();\n }\n return params;\n }", "function getParams() {\n return qs.parse(window.location.search);\n}", "function parseQueryParams(reqQuery) {\n var skip = (typeof reqQuery.skip !== 'undefined' && typeof reqQuery.skip !== 'null') ? reqQuery.skip : 0;\n var limit = (typeof reqQuery.limit !== 'undefined' && typeof reqQuery.limit !== 'null') ? reqQuery.limit : 100;\n var count = (typeof reqQuery.count !== 'undefined' && typeof reqQuery.count !== 'null') ? reqQuery.count : false;\n \n var select = (typeof reqQuery.select !== 'undefined' && typeof reqQuery.select !== 'null') ? JSON.parse(reqQuery.select) : '';\n var sort = (typeof reqQuery.sort !== 'undefined' && typeof reqQuery.sort !== 'null') ? JSON.parse(reqQuery.sort) : '';\n var where = (typeof reqQuery.where !== 'undefined' && reqQuery.where !== 0) ? JSON.parse(reqQuery.where.trim()) : '';\n\n if (typeof where === 'string') {\n where = where.trim();\n }\n\n var queryOptions = {\n where: where,\n skip: skip,\n limit: limit,\n count: count,\n select: select,\n sort: sort\n }\n return queryOptions;\n}", "setupAppMiddleware() {\n\t\t// small security protections by adjusting request headers\n\t\tthis.app.use(helmet());\n\n\t\t// adding the request's client ip\n\t\tthis.app.use(requestIp.mw());\n\n\t\tif(Config.isDev) {\n\t\t\t// Log requests in the console in dev mode\n\t\t\tthis.app.use(morgan('dev'));\n\t\t}\n\t\telse {\n\t\t\t// Compress responses in prod mode\n\t\t\tthis.app.use(compression());\n\t\t}\n\n\t\t// decode json-body requests\n\t\tthis.app.use(bodyParser.json());\n\n\t\t// TODO: Move mongo sanitation to save actions\n\t\t// sanitizing request data for mongo-injection attacks\n\t\tthis.app.use(mongoSanitize());\n\n\t\t// any internal data that is needed to be attached to the request must be attached to the \"internalAppVars\" object\n\t\tthis.app.use((req, res, next) => {\n\t\t\treq.internalAppVars = {};\n\t\t\tnext();\n\t\t});\n\t}", "function cleanUserRequestParameters( editor, trimEnd ){\r\n\t\tif( editor.config.autosaveRequestParams ) {\r\n\t\t\tvar helper = editor.config.autosaveRequestParams;\t\r\n\t\t\tvar x = '&';\r\n\t\t\t\r\n\t\t\t// Remove all leading '&'.\r\n\t\t\twhile( helper && helper.indexOf( x ) === 0 )\r\n\t\t\t\thelper = ( helper.length === 1 ? '' : helper.substring( 1 ) );\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tif(trimEnd){// true only during init.\t\t\t\t\r\n\t\t\t\t// Remove all trailing '&'.\t\t\t\t\r\n\t\t\t\twhile( helper && endsWith( helper, x ) )\r\n\t\t\t\t\thelper = helper.substring( 0, helper.length - 1 );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Later assume there is none or only one '&' at the end.\r\n\t\t\tif ( helper && !endsWith( helper, x ) )\r\n\t\t\t\thelper += '&';\r\n\t\t\t\r\n\t\t\teditor.config.autosaveRequestParams = helper;\r\n\t\t}\t\t\r\n\t}", "extract_request(params) {\n if (params.hasOwnProperty('_raw_'))\n var raw = params['_raw_'];\n else\n var raw = { res: null, req: null};\n return [raw.res, raw.req];\n }", "function bodySetter(req, res, next) {\n if (req._post_body) return next()\n req.post_body = req.post_body || \"\"\n\n if ('POST' != req.method) return next()\n\n req._post_body = true\n\n req.setEncoding('utf8')\n req.on('data', function(chunk) {\n req.post_body += chunk\n })\n\n next()\n}", "function mergeInQueryOrForm() {\n var req = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _req$url = req.url,\n url = _req$url === void 0 ? '' : _req$url,\n query = req.query,\n form = req.form;\n\n var joinSearch = function joinSearch() {\n for (var _len = arguments.length, strs = new Array(_len), _key = 0; _key < _len; _key++) {\n strs[_key] = arguments[_key];\n }\n\n var search = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_13___default()(strs).call(strs, function (a) {\n return a;\n }).join('&'); // Only truthy value\n\n\n return search ? \"?\".concat(search) : ''; // Only add '?' if there is a str\n };\n\n if (form) {\n var hasFile = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(form).some(function (key) {\n var value = form[key].value;\n return isFile(value) || isArrayOfFile(value);\n });\n\n var contentType = req.headers['content-type'] || req.headers['Content-Type'];\n\n if (hasFile || /multipart\\/form-data/i.test(contentType)) {\n var formdata = buildFormData(req.form);\n Object(_fold_formdata_to_request_node__WEBPACK_IMPORTED_MODULE_22__[\"default\"])(formdata, req);\n } else {\n req.body = encodeFormOrQuery(form);\n }\n\n delete req.form;\n }\n\n if (query) {\n var _url$split = url.split('?'),\n _url$split2 = _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2___default()(_url$split, 2),\n baseUrl = _url$split2[0],\n oriSearch = _url$split2[1];\n\n var newStr = '';\n\n if (oriSearch) {\n var oriQuery = qs__WEBPACK_IMPORTED_MODULE_15___default.a.parse(oriSearch);\n\n var keysToRemove = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(query);\n\n keysToRemove.forEach(function (key) {\n return delete oriQuery[key];\n });\n newStr = qs__WEBPACK_IMPORTED_MODULE_15___default.a.stringify(oriQuery, {\n encode: true\n });\n }\n\n var finalStr = joinSearch(newStr, encodeFormOrQuery(query));\n req.url = baseUrl + finalStr;\n delete req.query;\n }\n\n return req;\n} // Wrap a http function ( there are otherways to do this, consider this deprecated )", "function mergeInQueryOrForm() {\n var req = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _req$url = req.url,\n url = _req$url === void 0 ? '' : _req$url,\n query = req.query,\n form = req.form;\n\n var joinSearch = function joinSearch() {\n for (var _len = arguments.length, strs = new Array(_len), _key = 0; _key < _len; _key++) {\n strs[_key] = arguments[_key];\n }\n\n var search = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_13___default()(strs).call(strs, function (a) {\n return a;\n }).join('&'); // Only truthy value\n\n\n return search ? \"?\".concat(search) : ''; // Only add '?' if there is a str\n };\n\n if (form) {\n var hasFile = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(form).some(function (key) {\n var value = form[key].value;\n return isFile(value) || isArrayOfFile(value);\n });\n\n var contentType = req.headers['content-type'] || req.headers['Content-Type'];\n\n if (hasFile || /multipart\\/form-data/i.test(contentType)) {\n req.body = buildFormData(req.form);\n } else {\n req.body = encodeFormOrQuery(form);\n }\n\n delete req.form;\n }\n\n if (query) {\n var _url$split = url.split('?'),\n _url$split2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_2__.default)(_url$split, 2),\n baseUrl = _url$split2[0],\n oriSearch = _url$split2[1];\n\n var newStr = '';\n\n if (oriSearch) {\n var oriQuery = qs__WEBPACK_IMPORTED_MODULE_15___default().parse(oriSearch);\n\n var keysToRemove = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_10___default()(query);\n\n keysToRemove.forEach(function (key) {\n return delete oriQuery[key];\n });\n newStr = qs__WEBPACK_IMPORTED_MODULE_15___default().stringify(oriQuery, {\n encode: true\n });\n }\n\n var finalStr = joinSearch(newStr, encodeFormOrQuery(query));\n req.url = baseUrl + finalStr;\n delete req.query;\n }\n\n return req;\n} // Wrap a http function ( there are otherways to do this, consider this deprecated )", "formParser(req, res, next) {\n\t\tif(['POST','PATCH'].indexOf(req.method)==-1) { next(); return }\n\t\tvar ct = req.get('content-type') || ''\n\t\tswitch (ct) {\n\t\tcase 'application/json':\n\t\t\treq.setEncoding('utf8')\n\t\t\tvar data = ''\n\t\t\treq.on('data', function(chunk) { data += chunk })\n\t\t\treq.on('end', function() {\n\t\t\t\ttry {\n\t\t\t\t\treq.body = JSON.parse(data)\n\t\t\t\t} catch(e) {\n\t\t\t\t\tres.status(422).send(JSON.stringify({code: 'JSON_ERROR', message: 'Error decoding JSON'})).end()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tnext()\n\t\t\t})\n\t\t\treturn\n\t\tcase 'application/x-www-form-urlencoded':\n\t\t\treq.body = {}\n\t\t\tvar busboy = new Busboy({ headers: req.headers })\n\t\t\tbusboy.on('file', function(fieldname, file, filename, encoding, mimetype) {\n\t\t\t\tvar tmpFile = tmp.fileSync()\n\t\t\t\treq.body[fieldname] = {\n\t\t\t\t\tfilename: filename,\n\t\t\t\t\tencoding: encoding,\n\t\t\t\t\tmimetype: mimetype,\n\t\t\t\t\tstream: fs.createWriteStream(null, {fd: tmpFile.fd}),\n\t\t\t\t\tlength: 0\n\t\t\t\t}\n\t\t\t\tfile.on('data', function(data) {\n\t\t\t\t\treq.body[fieldname].stream.write(data)\n\t\t\t\t\treq.body[fieldname].length += data.length\n\t\t\t\t})\n\t\t\t\tfile.on('end', function() {\n\t\t\t\t\treq.body[fieldname].stream.end()\n\t\t\t\t\treq.body[fieldname].stream = fs.createReadStream(tmpFile.name)\n\t\t\t\t})\n\t\t\t})\n\t\t\tbusboy.on('field', function(fieldname, val) {\n\t\t\t\tif(req.body[fieldname]) {\n\t\t\t\t\tif(!_.isArray(req.body[fieldname])) req.body[fieldname] = [ req.body[fieldname] ]\n\t\t\t\t\treq.body[fieldname].push(val)\n\t\t\t\t} else {\n\t\t\t\t\treq.body[fieldname] = val\n\t\t\t\t}\n\t\t\t})\n\t\t\tbusboy.on('finish', function() {\n\t\t\t\tnext()\n\t\t\t})\n\t\t\treq.pipe(busboy)\n\t\t\tbreak\n\t\tdefault:\n\t\t\tres.status(415).send(JSON.stringify({code: 415, message: 'Unsupported Content-Type `'+ct+'`'})).end()\n\t\t\tbreak\n\t\t}\n\n\t}", "function applyQueryStringFiltersToRequest(data) {\n var urlParams = new URLSearchParams(location.search);\n urlParams.forEach(function(value, key) {\n if (key.match(/^filter-/)) {\n if (typeof data.filter_def === 'undefined') {\n data.filter_def = {};\n }\n data.filter_def[key.replace(/^filter-/, '')] = value;\n }\n });\n }", "setParameters () {\n if (arguments.length > 1 || isString (arguments[0])) {\n // This branch is for backwards compatibility. In older versions, the\n // parameters were the supported scopes.\n\n this.options = {\n scope: flattenDeep (...arguments)\n }\n }\n else {\n this.options = arguments[0];\n }\n }", "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n }", "function getUrlArgs() {\n\tvar qs = (location.search.length > 0 ? location.search.substring(1) : \"\")\n\tvar args = {};\n\tvar items = qs.split(\"&\");\n\tvar item = null;\n\tname = null;\n\tvalue = null;\n\tfor (var i = 0; i < items.length; i++) {\n\t\titem = items[i].split(\"=\");\n\t\tname = decodeURIComponent(item[0]);\n\t\tvalue = decodeURIComponent(item[1]);\n\t\targs[name] = value;\n\t}\n\treturn args;\n}", "function getArgsFrom(request) {\n var r = request || {};\n var args = _.assign({}, r.params, r.query);\n args.body = r.body;\n args.fromto = getDateRangeFrom(r);\n return args;\n}", "function buildRequestParams(meta, range, calendar) {\n var dateEnv = calendar.dateEnv;\n var startParam;\n var endParam;\n var timeZoneParam;\n var customRequestParams;\n var params = {};\n if (range) {\n // startParam = meta.startParam\n // if (startParam == null) {\n startParam = calendar.opt('startParam');\n // }\n // endParam = meta.endParam\n // if (endParam == null) {\n endParam = calendar.opt('endParam');\n // }\n // timeZoneParam = meta.timeZoneParam\n // if (timeZoneParam == null) {\n timeZoneParam = calendar.opt('timeZoneParam');\n // }\n params[startParam] = dateEnv.formatIso(range.start);\n params[endParam] = dateEnv.formatIso(range.end);\n if (dateEnv.timeZone !== 'local') {\n params[timeZoneParam] = dateEnv.timeZone;\n }\n }\n // retrieve any outbound GET/POST data from the options\n if (typeof meta.extraParams === 'function') {\n // supplied as a function that returns a key/value object\n customRequestParams = meta.extraParams();\n }\n else {\n // probably supplied as a straight key/value object\n customRequestParams = meta.extraParams || {};\n }\n __assign(params, customRequestParams);\n return params;\n}", "addDefaultRequestInterceptor() {\n\t\tthis.axiosInstance.interceptors.request.use((config) => {\n\t\t\tlet need = Object.keys(this.option.auth).length > 0\n\t\t\tif (need) {\n\t\t\t\tconst timestamp = Date.now()\n\n\t\t\t\tlet query = {}\n\t\t\t\tconst array = config.url.split('?')\n\t\t\t\tif (array.length > 1) {\n\t\t\t\t\tquery = qs.parse(array[1])\n\t\t\t\t}\n\t\t\t\tconst data = config.data || {}\n\t\t\t\tconst params = config.params || {}\n\n\t\t\t\t// signature\n\t\t\t\tconst signature = sign(\n\t\t\t\t\tObject.assign({\n\t\t\t\t\t\t__timestamp__: timestamp\n\t\t\t\t\t}, data, params, query),\n\t\t\t\t\tthis.option.auth.token\n\t\t\t\t)\n\n\t\t\t\t// headers\n\t\t\t\tconfig.headers = {\n\t\t\t\t\t'h-token': this.option.auth.token,\n\t\t\t\t\t'h-nonce': this.option.auth.nonce,\n\t\t\t\t\t'h-signature': signature,\n\t\t\t\t\t'h-timestamp': timestamp\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn config\n\t\t}, (err) => {\n\t\t\treturn Promise.reject(err)\n\t\t})\n\t}", "function normalizeRequestArgs(httpModule, requestArgs) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n var callback, requestOptions;\n // pop off the callback, if there is one\n if (typeof requestArgs[requestArgs.length - 1] === 'function') {\n callback = requestArgs.pop();\n }\n // create a RequestOptions object of whatever's at index 0\n if (typeof requestArgs[0] === 'string') {\n requestOptions = urlToOptions(new url_1.URL(requestArgs[0]));\n }\n else if (requestArgs[0] instanceof url_1.URL) {\n requestOptions = urlToOptions(requestArgs[0]);\n }\n else {\n requestOptions = requestArgs[0];\n }\n // if the options were given separately from the URL, fold them in\n if (requestArgs.length === 2) {\n requestOptions = tslib_1.__assign(tslib_1.__assign({}, requestOptions), requestArgs[1]);\n }\n // Figure out the protocol if it's currently missing\n if (requestOptions.protocol === undefined) {\n // Worst case we end up populating protocol with undefined, which it already is\n /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */\n // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n // Because of that, we cannot rely on `httpModule` to provide us with valid protocol,\n // as it will always return `http`, even when using `https` module.\n //\n // See test/integrations/http.test.ts for more details on Node <=v8 protocol issue.\n if (NODE_VERSION.major && NODE_VERSION.major > 8) {\n requestOptions.protocol =\n ((_b = (_a = httpModule) === null || _a === void 0 ? void 0 : _a.globalAgent) === null || _b === void 0 ? void 0 : _b.protocol) || ((_c = requestOptions.agent) === null || _c === void 0 ? void 0 : _c.protocol) || ((_d = requestOptions._defaultAgent) === null || _d === void 0 ? void 0 : _d.protocol);\n }\n else {\n requestOptions.protocol =\n ((_e = requestOptions.agent) === null || _e === void 0 ? void 0 : _e.protocol) || ((_f = requestOptions._defaultAgent) === null || _f === void 0 ? void 0 : _f.protocol) || ((_h = (_g = httpModule) === null || _g === void 0 ? void 0 : _g.globalAgent) === null || _h === void 0 ? void 0 : _h.protocol);\n }\n /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */\n }\n // return args in standardized form\n if (callback) {\n return [requestOptions, callback];\n }\n else {\n return [requestOptions];\n }\n}", "function QueryParameters() {}", "function modifyReqObj(req, res, next){\n req.body = {};\n req.files = [];\n next();\n}", "function getURLParameters() {\n var params = {};\n if (location.search) {\n var parts = location.search.substring(1).split(\"&\");\n for (var i = 0; i < parts.length; i++) {\n var pair = parts[i].split(\"=\");\n if (!pair[0]) {\n continue;\n }\n params[pair[0]] = pair[1] || \"\";\n }\n }\n return params;\n}", "function extendObjects (req, res, next) {\n req.setEncoding(req.headers['content-encoding'] || 'utf8');\n req.params = {};\n res.send = send;\n next();\n}", "function parseRequest(content) {\n\tconst params = content.split(\" \");\n\n\tconst type = params[0].match(/[a-zA-Z0-9]/g).join(\"\");\n\n\tconst info = {\n\t\tappType: \"form/data\",\n\t};\n\t\n\tif (params[1]) {\n\t\tinfo.url = params[1];\n\t} else {\n\t\tinfo.url = `${app.packageInfos.sampleUrl}${app.localUrl}`;\n\t}\n\n\tif (type.toLowerCase() === \"json\") info.appType = \"application/json\";\n\n\treturn {\n\t\trequest: info\n\t};\n}", "function getParameters() {\n let filtersParameter = filters.val() === '' ? '' : 'filters=' + filters.val();\n\n // let parameters = '?' + filtersParameter;\n return parameters= '?' + filtersParameter;\n }" ]
[ "0.56840175", "0.5627153", "0.5602417", "0.5493548", "0.5493548", "0.5485229", "0.5476286", "0.5392052", "0.538496", "0.538496", "0.538496", "0.53082705", "0.5189435", "0.5032697", "0.49922815", "0.49785656", "0.4959587", "0.49431035", "0.49431035", "0.49431035", "0.49379027", "0.49115956", "0.48926276", "0.4890987", "0.48905367", "0.4878812", "0.4870961", "0.48609227", "0.48568517", "0.4833929", "0.48120525", "0.47835714", "0.47672865", "0.47658205", "0.472015", "0.4702198", "0.46596184", "0.46579584", "0.46394357", "0.45699346", "0.4548937", "0.4530316", "0.452826", "0.45132965", "0.45108387", "0.45103875", "0.44988325", "0.44772246", "0.4457924", "0.44557118", "0.44108018", "0.44073173", "0.4407255", "0.4403516", "0.43966967", "0.43946844", "0.43946844", "0.43946844", "0.43946844", "0.43946844", "0.43917257", "0.43868613", "0.4380704", "0.43747222", "0.43716952", "0.4369937", "0.43472564", "0.43472564", "0.43441373", "0.43401185", "0.4338384", "0.4336966", "0.4333598", "0.43265355", "0.4323808", "0.43217945", "0.43157545", "0.4311935", "0.42974618", "0.42961952", "0.42943567", "0.42942315", "0.42922014", "0.42724356", "0.42697722", "0.42697075", "0.42623898", "0.42609876", "0.42549527", "0.42534184", "0.4246258", "0.4242079", "0.4237958", "0.42354724", "0.42350546", "0.42341703", "0.4218618", "0.42163604", "0.42093018", "0.4209142" ]
0.5889075
0
maak component aan en zet niet active gameobject maakt dan een refference naar game en naar gameobject
function Dcomponent(name) { this.mName = name; this.mActive = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ActiverCameraCarte(){\n\t//bascule entre la carte du jeu et la vue 3e pers\n\tcameraPerso.SetActive(!cameraPerso.activeSelf);\n\tcameraCarte.SetActive(!cameraCarte.activeSelf);\n\t\n\t//bascule l'affichage de l'interface de camera\n\tuiCarte.SetActive(!uiCarte.activeSelf);\t\n\t\n\t/*cache les textes d'interaction si on n'est pas sur la camera du joueur\n\t(normalement InteractionObjet devrait etre vide de toute facon,\n\tsauf si certains objets interactifs ne sont pas dans le conteneur)*/\n\tuiJoueur.transform.Find(\"InteractionObjet\").gameObject.SetActive(!uiCarte.activeSelf);\n\t//cache les objets interactifs si on visualise la carte\n\tconteneurObjets.SetActive(!uiCarte.activeSelf);\n\t\n\tif(uiCarte.activeSelf){\n\t\t//rafraichit les icones en les vidant et en les recreeant\n\t\tInterfaceJeu.ViderMarqueursCarte();\n\t\t//affiche le pointeur du perso sur la carte\n\t\tInterfaceJeu.AfficherPointeurPersoSurCarte(GameObject.Find(\"/Joueur\"), \"Vous êtes ici\");\n\t\t//affiche des icones aux emplacements des objets si le joueur a le power-up correspondant\n\t\tif(Joueur.powerUpCarte){\n\t\t\tfor (var i = 0; i < listeObjets.length; i++){\n\t\t\t\tInterfaceJeu.AfficherMarqueurCarte(listeObjets[i].gameObject, listeObjets[i].gameObject.tag);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//les indicateurs des power-ups\n\tpowerUpLumiere.SetActive(Joueur.powerUpLumiere);\n\tpowerUpCarte.SetActive(Joueur.powerUpCarte);\n\tpowerUpPotion.SetActive(Joueur.powerUpPotion);\n\t\n\t\n}", "function component(width, height, color, x, y, type) { // essa eh uma funcao com seis parametros diferentes e logo abaixo tem a definicao de cada um\n this.type = type;\n if (type == \"image\") { // se for do tipo img vai ser img.src, o q for escrito em color vai entrar em src\n this.image = new Image();\n this.image.src = color;\n }\n this.width = width;\n this.height = height;\n this.speedX = 0;\n this.speedY = 0;\n this.gravity = 0.5;\n this.gravitySpeed = 0;\n this.bounce = 0.6; //eh o q faz o personagem quicar\n this.x = x;\n this.y = y;\n this.update = function() {\n ctx = myGameArea.context;\n if (type == \"image\") {\n ctx.drawImage(this.image,\n this.x,\n this.y,\n this.width, this.height);\n } else {\n ctx.fillStyle = color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n }\n }\n this.newPos = function() {\n this.gravitySpeed += this.gravity;\n this.x += this.speedX; //velocidade do personagem\n this.y += this.speedY + this.gravitySpeed;\n this.hitBottom(); //define até onde o personagem pode cair,tipo um limite\n }\n this.hitBottom = function() {\n var rockbottom = myGameArea.canvas.height - this.height; //aqui ta definindo a altura do canvas, reduzindo do tamanho do personagem\n if (this.y > rockbottom) {\n this.y = rockbottom;\n this.gravitySpeed = -(this.gravitySpeed * this.bounce);//isso tem a ver com o pulo e o limite do chao, o bounce e o pulo\n }\n }\n}", "function Awake () {\n\n\n//Inicializacion de los managers y demas scripts\nplayerManager = GetComponent(Player_Manager);\nmanagerDialogos = GetComponent(ManagerDialogos2);\nlootManager = GetComponent(LootManager2);\ninventario = GetComponent(InventarioManager);\npersistance = GameObject.Find(\"Persistance\").GetComponent(Persistance);\n//GameObject.Find(\"Estacion1\").GetComponent(Interactor_Click).FlagOff();\nGameObject.Find(\"Estacion2\").GetComponent(Interactor_Click).FlagOff();\n//GameObject.Find(\"Estacion3\").GetComponent(Interactor_Click).FlagOff();\n\npuzzle = GetComponent(Puzzle);\npuzzleAlambre = GetComponent(PuzzleAlambre);\ninventario.setItemsActuales(persistance.getInventario());\ncontadorPapel = 0;\ncontadorFantasmas = 0;\nvar tempPlayers: Player[] = persistance.getParty();\nfor(var i:int = 0 ; i <tempPlayers.Length ; i++){\n\tif(tempPlayers[i]){\n\t\tplayerManager.addPlayer(new Player(tempPlayers[i].getTextura(),tempPlayers[i].getId(),tempPlayers[i].getNombre(),tempPlayers[i].getCursor()));\n\t}\n\n}\ncurrentPlayer = tempPlayers[0];\n}", "function Awake() {\n\t_ce = GetComponent(\"CombatEngine\");\n\t_me = GetComponent(\"MovementEngine\");\n\t_audio = GetComponent(\"AudioSource\");\n}", "activer() {\n\t\tSprite.addEventListeners(window, this.evt.window);\n console.log(this.cellule.infoDebogage());\n }", "function Awake () {\n\tmotor = GetComponent(CharacterMotor);\n\tGUIDisplay = GameObject.Find(\"GUIDisplay\");\n\tPlayer = GameObject.FindGameObjectWithTag(\"Player\");\n}", "function startGame() {\n // Controls the size and position of the components. Makes game piece into an image.\n myGamePiece = new component(100, 30, \"Pictures/green airplane.png\", 500, 140, \"image\");\n // Image by Clker-Free-Vector-Images https://pixabay.com/vectors/airplane-plane-transportation-303563/\n myScore = new component(\"30px\", \"Consolas\", \"black\", 120, 50, \"text\");\n myGameArea.start();\n}", "__activeMesh(material) {}", "collitionsControl() {\n\n var that = this;\n\n // Añadimos los objetos del mundo para colisiones\n var obstaculos = this.world.getObstacles();\n\n for (var i = 0; i < obstaculos.length; i++) {\n var collider = new THREEx.Collider.createFromObject3d(obstaculos[i]);\n this.colliders.push(collider);\n }\n\n // La nave\n var colliderShip = new THREEx.Collider.createFromObject3d(this.ship.getShip());\n\n colliderShip.addEventListener('contactEnter', function (otherCollider) {\n\n if (that.gameStart) {\n if (otherCollider.id < 2)\n that.ship.winLife();\n else\n that.ship.lostLife();\n }\n });\n\n this.colliders.push(colliderShip);\n\n }", "function startGame() {\n myGameArea.start();\n\n //ylempi vaakasuora laatta rivi \n var i = 1;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n //alempi vaakasuora laatta rivi \n i = 1;\n posX = 20;\n posY = 560;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n i = 1;\n posX = 20;\n posY = 1160;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n\n // vasen laatta palkki \n i = 1;\n posX = 20;\n posY = 80;\n while(i < 20){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posY = posY + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n // oikea laatta palkki \n i = 1;\n posX = 560;\n posY = 80;\n while(i < 20){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posY = posY + 60;\n tilesArray.push(tileName)\n i++;\n }\n //console.log(tilesArray);\n //pelaaja\n player = new Component(20, 20, \"red\", 30, 30);\n}", "function Start () {\nS = GetComponent(Scripts);// S sera igual al compoonente(script) llamado \"Scripts\"\n}", "function OnStrategyBecameVisible()\n{\n\t$.DispatchEvent( 'DOTAGlobalSceneSetCameraEntity', 'PregameBG', 'shot_cameraB', 1.0 );\n}", "function Awake()\n{\n\t//Link components\n\tmyTransform = gameObject.GetComponent(Transform);\n\tmyController = gameObject.GetComponent(CharacterController) as CharacterController;\n\tmyAnimator = gameObject.GetComponent(Animator);\n\n\t//Link children\n\tmyCameraViewPivot = transform.Find(\"CameraViewPivot\");\n}", "function Awake ()\r\n{\r\n\t\r\n\t// set the variable of 'myTransform' to be that of the transform attached to this script (cop)\r\n\tmyTransform = transform;\r\n\t\r\n\t// intializes the RigidBody variable that is attached to Cop (enemy)\r\n\tRb = transform.GetComponent(Rigidbody);\r\n\r\n\t// get and set FluxCapacitor\r\n\ttheFluxCapacitor = GameObject.FindWithTag(\"Flux\").GetComponent(FluxCapacitor);\r\n\t\r\n}", "function OnTriggerEnter (Other : Collider) {\n\n if(Other.gameObject.tag == \"Hero\") // Si mon perso approche la porte\n {\n \n if (nbClefs == 4 ) //Et que mon perso possède 4 clefs\n {\n Porte.GetComponent.<Animation>().Play(); // Joue l'animation d'ouverture de porte\n Debug.Log (\"porte ouverte\");\n Destroy(this);\n }\n\n else {\n \t\tpanneauClefs.SetActive(true); //Sinon, ouvre le panneau indiquant l'objectif à accomplir\n }\n\n }\n\n}", "function startGame() {\n gameArea.start();\n myGameCloudSmall = new component(100, 70, \"img/cloud-1.png\", 600, 50, 'img');\n myGameCloudBig = new component(100, 70, \"img/cloud-2.png\", 600, 30, 'img');\n myBackgroundBack = new component(600, 400, \"img/country-back.png\", 0, 0, 'background');\n myBackgroundForest = new component(600, 200, \"img/country-forest.png\", 0, 160, 'background');\n myBackgroundRoad = new component(600, 200, \"img/country-road.png\", 0, 200, 'background');\n}", "GetComponentInParent() {}", "GetComponentInParent() {}", "GetComponentInParent() {}", "GetComponentInParent() {}", "function gameInit(){\n ctx.clearRect(0, 0, canvas.width,canvas.height);\n laberinto2.forEach(component=>{\n component.dibujar();\n heroe.checkCollision(component)\n \n })\n \n elements[0].draw()\n \n bordes.forEach(component=>{\n component.dibujar();\n })\n heroe.draw()\n // llave1.draw()\n// gemelas.draw()\n enemies.forEach(enemigo => {\n enemigo.draw()\n })\n gemelas.frameX++\n gemelas.frameX >= 5 ? gemelas.frameX = 0 : null;\n gemelas.newPos()\n gemelas.movimiento()\n heroe.checkCollision(gemelas)\n heroe.draw()\n heroe.frameX++\n heroe.frameX >= 5 ? heroe.frameX = 0 : null;\n \n }", "function Update()\r\n{\r\n\tif (selected && !activated)\r\n\t{\r\n\t\tif (puzzle_desc_box.enabled == false)\r\n\t\t{\r\n\t\t\teditor_object.SendMessage(\"assign_target\", this.gameObject, \r\n\t\t\t\t\t\t\t\t\t SendMessageOptions.DontRequireReceiver);\r\n\t\t\tpuzzle_desc_box.enabled = true;\r\n\t\t}\r\n\t} else if (puzzle_desc_box.enabled == true) \r\n\t{\r\n\t\tpuzzle_desc_box.enabled = false;\r\n\t}\r\n}", "function basculeJoueur() {\r\n //Verifie si il reste des tours\r\n endgame();\r\n //Change la valeur du joueur actif\r\n if (playerActive === 2) {\r\n playerActive = 1;\r\n } else if (playerActive === 1) {\r\n playerActive = 2;\r\n }\r\n //Reinitialise le compteur de tours du place jeton\r\n i = 0;\r\n //Rappel le tour joueur\r\n tourJoueur();\r\n}", "function Awake (){\n\t//get the parent of the markers\n\tGlobe = transform.parent;\n\t//Just setting the name again, to make sure.\n\tboardObject = \"CountryBoard\";\n\t//When start, look for the plane\n\tBoard = GameObject.Find(boardObject);\n}", "function component(width, height, color, x, y, type) {\r\n this.type = type;\r\n if (type == \"image\") {\r\n this.image = new Image();\r\n this.image.src = color;\r\n }\r\n this.width = width;\r\n this.height = height;\r\n this.angle = 0;\r\n this.moveAngle = 0;\r\n this.x = x;\r\n this.y = y;\r\n this.speedX = 0;\r\n this.speedY = 0;\r\n this.speed= 0;\r\n this.updatestraight = function() {\r\n if (type == \"image\") {\r\n ctx.drawImage(this.image,\r\n this.x,\r\n this.y,\r\n this.width, this.height);\r\n if(cnt==3){ctx.font=\"30px Comic Sans MS\";\r\n ctx.fillStyle = \"green\";\r\n ctx.textAlign = \"center\";\r\n ctx.fillText(\"Risposta corretta!\", canvas.width/2, canvas.height/2);}}\r\n else {\r\n ctx.fillStyle = color;\r\n ctx.fillRect(this.x, this.y, this.width, this.height);\r\n }\r\n }\r\n this.updateturn = function() {\r\n if (type == \"image\") {\r\n ctx.save();\r\n ctx.translate(this.x+35, this.y+50);\r\n ctx.rotate(this.angle);\r\n ctx.drawImage(this.image, this.width / -2, this.height / -2, this.width, this.height);\r\n ctx.restore();\r\n }\r\n }\r\n this.newPosstraight = function() {\r\n this.x += this.speedX;\r\n this.y += this.speedY;\r\n }\r\n this.newPosturn = function() {\r\n if (this.angle > Math.PI/4){\r\n this.x -= 2;\r\n this.y +=2;\r\n }\r\n else{\r\n this.angle += this.moveAngle * Math.PI / 30;\r\n this.x += this.speed * Math.sin(this.angle);\r\n this.y -= this.speed * Math.cos(this.angle);}\r\n }\r\n\r\n}", "GetComponentInChildren() {}", "GetComponentInChildren() {}", "GetComponentInChildren() {}", "GetComponentInChildren() {}", "chargement() {\n this.prop.compte += 1;\n if (this.prop.compte === this.prop.nombreImg) {\n console.log('%c les ressources sont chargées ' + this.prop.nombreImg + \" / \" + this.prop.nombreImg, 'padding:2px; border-left:2px solid green; background: lightgreen; color: #000');\n // menu\n let bouttons = [{\n nom: \"start game\",\n lien: \"start\"\n }, {\n nom: \"levels\",\n lien: \"niveaux\"\n }, {\n nom: \"how to play\",\n lien: \"regles\"\n }, {\n nom: \"about\",\n lien: \"info\"\n }, ];\n this.menu = new Menu(this, this.L / 2, 110, bouttons);\n // Fin de chargement\n this.phase(\"menu\");\n document.addEventListener(\"keydown\", event => this.touchePresse(event), false);\n document.addEventListener(\"keyup\", event => this.toucheLache(event), false);\n } else {\n // écran de chargement\n this.ctx.fillStyle = \"#000\";\n this.ctx.fillRect(0, 0, this.L, this.H);\n this.ctx.fillStyle = \"#fff\";\n this.ctx.fillRect(0, (this.H / 2) - 1, (this.prop.compte * this.L) / this.prop.nombreImg, 2);\n }\n }", "function Start() {\n\tWin = false;\n\tshowCountdown = false;\n\tshowEnd = false;\n\tContestant = new GameObject[GameObject.FindGameObjectsWithTag(\"Race Contestant\").Length];\n\tContestant = GameObject.FindGameObjectsWithTag(\"Race Contestant\");\n\tCar = GameObject.Find(\"_Player\").GetComponent.<Car>();\n\tGManager = GameObject.Find(\"_Game Manager\").GetComponent.<GameManager>();\n\tSeekSteer = new GameObject[GameObject.FindGameObjectsWithTag(\"Race Contestant\").Length-1];\n\tvar i : int = 0; \n\tfor( var u :int = 0;u<GameObject.FindGameObjectsWithTag(\"Race Contestant\").Length;u++){\n\t\tif(Contestant[u].GetComponent(\"seekSteer\") != null){\n\t\t\tSeekSteer[i] = Contestant[u]; \n\t\t\ti++;\n\t\t}\n\t\tContestant[u].AddComponent.<Car_rm>();\n\t}\n\tvar aSources = GetComponents(AudioSource); \n\tRaceOrDie = aSources[0]; \n\tYouWon = aSources[1];\n\tYouLost = aSources[2];\n\tEndRaceTrigger = false;\n \n}", "GetComponent() {}", "GetComponent() {}", "GetComponent() {}", "GetComponent() {}", "function Start () {\n\talli = Vector.GetComponent(CarControlScript);\n\tmonk = Lucky.GetComponent(CarControlScript);\n\twolf = Broken.GetComponent(CarControlScript);\n\t\n}", "constructor(game) {\n this.game = game;\n this.sprite = null; // Children will deal with this\n this.health = 1;\n this.speed = 60;\n this.damage = 1;\n this.componentList = [];\n }", "function Start () \n{\n\tgm = GameObject.Find(\"GameManager\");\n\t\n\tif(gm != null)\n\t{\n\t\tpm = gm.GetComponent(PlayerManager);\n\t\tefx = gm.GetComponent(EnemyFX);\n\t}\n\t\n\t\n\tif(startTexture != null)\n\t{\n\t\tgameObject.renderer.material.mainTexture = startTexture;\n\t}\n\t\n\t\n\t// if it is a multiframe object\n\tif(gifFrames.Length > 0)\n\t{\n\t\tgameObject.AddComponent(GifDrawer);\n\t\t\n\t\tgameObject.GetComponent(GifDrawer).frames = gifFrames;\n\t\tgameObject.GetComponent(GifDrawer).framesPerSecond = gifSpeed;\n\t}\t\n}", "function Start () {\n\tfor (var component : Behaviour in componentsToDisable){\n\t\tcomponent.enabled = false;\n\t}\n\tif (gameObject.collider != null){\n\t\tcollider.enabled = false;\n\t}\n}", "constructor({gridX, gridY, movementType, name, asset, type, id}) {\n this.name = asset; // Not unique!\n this.id = id;\n this.x = this.lastX = gridX;\n this.y = this.lastY = gridY;\n\n\n // Set up stats\n this.stats = {\n // Base stats\n hp: 10, atk: 0, spd: 0, def: 0, res: 0,\n // Tracks \"hone\" or visible bonuses, only one of which can be active at a time\n honeAtk: 0, honeSpd: 0, honeDef: 0, honeRes: 0,\n // Tracks penalties from threaten\n threatenAtk: 0, threatenSpd: 0, threatenDef: 0, threatenRes: 0,\n // Tracks in-combat bonuses (spur, initiate/defend bonuses)\n spurAtk: 0, spurSpd: 0, spurDef: 0, spurRes: 0\n };\n this.stats.totalhp = this.stats.hp;\n\n // Movement component is also the visual component\n this.sprite = new MoveComponent(this, asset, gridX, gridY);\n game.world.addChild(this.sprite);\n\n // Creates the healthbar object, which will individually add all components as children of this unit\n this.spriteUI = new SpriteUI(this, this.isPlayer());\n this.sprite.addChild(this.spriteUI);\n\n // Set up type and movement type\n this.movementType = movementType;\n this.type = type; // This will set the color\n\n // Set up skills\n this.passiveA = null;\n this.passiveB = null;\n this.passiveC = null;\n this.passiveAData = {};\n this.passiveBData = {};\n this.passiveCData = {};\n\n // Weapon\n this.weapon = '';\n // Assist\n this.assist = '';\n // Special\n this.special = '';\n\n // Bookkeeping\n this.dead = false;\n this.turnEnded = false;\n\n // Flip unit horizontally if on enemy team\n if (!this.isPlayer()) {\n this.sprite.flip();\n this.spriteUI.flip();\n }\n }", "function PratoDoDiaComponent() {\n }", "comEffect() {\n if (this.computer === \"rock\") {\n rockCompClass.classList.add(\"game-img-clicked\");\n paperCompClass.classList.remove(\"game-img-clicked\");\n scissorCompClass.classList.remove(\"game-img-clicked\");\n } else if (this.computer === \"paper\") {\n paperCompClass.classList.add(\"game-img-clicked\");\n scissorCompClass.classList.remove(\"game-img-clicked\");\n rockCompClass.classList.remove(\"game-img-clicked\");\n } else if (this.computer === \"scissor\") {\n scissorCompClass.classList.add(\"game-img-clicked\");\n rockCompClass.classList.remove(\"game-img-clicked\");\n paperCompClass.classList.remove(\"game-img-clicked\");\n }\n }", "moveComponent() {\n if (this.raycaster.ray.intersectPlane(this.plane, this.intersection)) {\n var computedPosition = this.intersection.y - this.offset; //The component's new computed position on the yy axis\n let closetTopFace = this.closet.getClosetFaces().get(FaceOrientationEnum.TOP).mesh();\n let closetBaseFace = this.closet.getClosetFaces().get(FaceOrientationEnum.BASE).mesh();\n if (computedPosition < closetTopFace.position.y &&\n computedPosition >= closetBaseFace.position.y) {\n this.selected_component.position.y = computedPosition; //Sets the new position as long as the component stays within the closet boundaries\n }\n }\n\n var intersects = this.raycaster.intersectObjects(this.scene.children[0].children);\n if (intersects.length > 0) {\n //Updates plane position to look at the camera\n var object = intersects[0].object;\n this.plane.setFromNormalAndCoplanarPoint(this.camera.position, object.position);\n\n if (this.hovered_object !== object) this.hovered_object = object;\n } else if (this.hovered_object !== null) this.hovered_object = null;\n }", "function vxlActor(model){\r\n \r\n this._bb = [0, 0, 0, 0, 0, 0];\r\n this._position \t = vec3.fromValues(0, 0, 0);\r\n this._translation = vec3.fromValues(0, 0, 0);\r\n this._centre = vec3.fromValues(0, 0, 0);\r\n this._scale \t\t = vec3.fromValues(1, 1, 1);\r\n this._rotation \t = vec3.fromValues(0, 0, 0);\r\n this._matrix = mat4.create();\r\n this._matrix_world = mat4.create();\r\n this._matrix_normal = mat4.create();\r\n this._dirty = false;\r\n this._picking = vxl.def.actor.picking.DISABLED;\r\n this._pickingCallback = undefined;\r\n this._pickingColor = undefined; //used when the picking is vxl.def.actor.picking.OBJECT\r\n this._trackingCameras = [];\r\n \r\n this.UID = vxl.util.generateUID();\r\n this.scene = undefined;\r\n this.clones = 0;\r\n \r\n this.mode = vxl.def.actor.mode.SOLID;\r\n this.cull = vxl.def.actor.cull.NONE;\r\n this.visible = true;\r\n \r\n this.mesh = undefined;\r\n \r\n this.material = new vxlMaterial();\r\n this.renderable = undefined;\r\n \r\n this._bb_disabled = false; //to accelerate animations if we dont care about bb.\r\n //@TODO: find another way to optimize this.\r\n \r\n if (model){\r\n \tthis.model \t = model;\r\n \tthis.name \t = model.name;\r\n \tthis.mode = model.mode;\r\n \tthis._bb = model.bb.slice(0);\r\n \tthis._centre = vec3.clone(model.centre);\r\n \tthis.material.getFrom(model);\r\n \t\r\n \tif (model.type == vxl.def.model.type.BIG_DATA){\r\n \t this.renderable = new vxlRenderable(this);\r\n \t}\r\n }\r\n else{\r\n this.model = new vxlModel();\r\n }\r\n \r\n var e = vxl.events;\r\n vxl.go.notifier.publish(\r\n [\r\n e.ACTOR_MOVED,\r\n e.ACTOR_SCALED,\r\n e.ACTOR_ROTATED,\r\n e.ACTOR_CHANGED_COLOR,\r\n e.ACTOR_CHANGED_SHADING,\r\n ], this);\r\n}", "function component(width, height, color, x, y, type) {\r\n this.type = type;\r\n if (type == \"image\") {\r\n this.image = new Image();\r\n this.image.src = color;\r\n }\r\n this.width = width;\r\n this.height = height;\r\n this.speedX = 0;\r\n this.speedY = 0; \r\n this.x = x;\r\n this.y = y; \r\n this.update = function() {\r\n ctx = myGameArea.context;\r\n if (type == \"image\") {\r\n ctx.drawImage(this.image, \r\n this.x, \r\n this.y,\r\n this.width, this.height);\r\n } else {\r\n ctx.fillStyle = color;\r\n ctx.fillRect(this.x, this.y, this.width, this.height);\r\n }\r\n }\r\n this.newPos = function() {\r\n this.x += this.speedX;\r\n this.y += this.speedY; \r\n }\r\n}", "activePanelCollision() {\n\t\tlet coll_Help = new Collision(65, 33, 33, 30)\n\t\tif (coll_Help.collisionRect(this.p.mouseX, this.p.mouseY)) {\n\t\t\tthis.help = true\n\t\t\tthis.offBtn = false\n\t\t\tthis.mic = false\n\t\t\tthis.projector = false\n\t\t}\n\n\t\tlet coll_Projector = new Collision(110, 33, 45, 30)\n\t\tif (coll_Projector.collisionRect(this.p.mouseX, this.p.mouseY)) {\n\t\t\tthis.projector = true\n\t\t\tthis.help = false\n\t\t\tthis.offBtn = false\n\t\t\tthis.mic = false\n\t\t}\n\n\t\tlet coll_Mic = new Collision(168, 33, 33, 30)\n\t\tif (coll_Mic.collisionRect(this.p.mouseX, this.p.mouseY)) {\n\t\t\tthis.mic = true\n\t\t\tthis.projector = false\n\t\t\tthis.help = false\n\t\t\tthis.offBtn = false\n\t\t}\n\n\t\tlet coll_offBtn = new Collision(212, 33, 35, 30)\n\t\tif (coll_offBtn.collisionRect(this.p.mouseX, this.p.mouseY)) {\n\t\t\tthis.offBtn = true\n\t\t\tthis.mic = false\n\t\t\tthis.projector = false\n\t\t\tthis.help = false\n\t\t}\n\t}", "function briqueScene(){\n\tbriqueScene.instance = this;\n\t//Parametres\n\tthis.sizeX = 5000;\n\tthis.sizeY = 3000;\n\tthis.sizeZ = 5000;\n\tthis.gravite = 0;\n\t\n\tthis.paramPartie;\n\t\n//\tthis.raqueteSizeX = 13;//doit etre impaire\n//\tthis.raqueteSizeY = 1;//doit etre impaire\n//\tthis.raqueteSeulementSurX = false;\n\tthis.maxSpeed = 100;\n\tthis.minSpeed = 75;\n//\tthis.difficulte = 0;\n\tthis.listner=null;\n\t//Elements du decors\n\tthis.sol;\n//\tthis.boiteGlobal = new THREE.Box3(new THREE.Vector3(-this.sizeX/2,-this.sizeY/2,-this.sizeZ/2),new THREE.Vector3(this.sizeX/2,this.sizeY/2,this.sizeZ/2));\n\tthis.murs = {};\n\tthis.murArray = [];\n\tthis.boules=[];\n\tthis.boulesMesh = [];\t\n\t\n\tthis.boiteCaisseArray = [];\n\tthis.boiteCaisse = {};\n\tthis.caisses = [];\t\n\tthis.caissesMesh = [];\n\tthis.controlsMesh = [];\n\t\n\t//gestion des colisions\n\tthis.raycaster = new THREE.Raycaster();\t\n\t\n\t//Gestion des parties\n\tthis.partiEnCours = false;\n\tthis.pointsMarques = 0;\t//TODO séparer par joueurs\n\t\n\tthis.players = [];\n}", "function Awake () {\n\n\t}", "function Awake () {\n\n\t}", "setActive() {\n GameManager.activeGame = this;\n }", "function compFromBlender(){\r\n\r\nvar compName = prompt(\"Blender Comp's Name \\nEnter Name of newly created Composition\",\"BlendComp\",\"Composition's Name\");\r\nif (compName){\r\nvar newComp = app.project.items.addComp(compName, 1920, 1080, 1.000000, 10.416667, 24);\r\nnewComp.displayStartTime = 0.083333;\r\n\r\n\r\n// ************** CAMERA 3D MARKERS **************\r\n\r\n\r\n// ************** OBJECTS **************\r\n\r\n\r\nvar _Mesh_1437 = newComp.layers.addNull();\r\n_Mesh_1437.threeDLayer = true;\r\n_Mesh_1437.source.name = \"_Mesh_1437\";\r\n_Mesh_1437.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1437.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1437.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1436 = newComp.layers.addNull();\r\n_Mesh_1436.threeDLayer = true;\r\n_Mesh_1436.source.name = \"_Mesh_1436\";\r\n_Mesh_1436.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1436.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1436.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1435 = newComp.layers.addNull();\r\n_Mesh_1435.threeDLayer = true;\r\n_Mesh_1435.source.name = \"_Mesh_1435\";\r\n_Mesh_1435.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1435.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1435.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1434 = newComp.layers.addNull();\r\n_Mesh_1434.threeDLayer = true;\r\n_Mesh_1434.source.name = \"_Mesh_1434\";\r\n_Mesh_1434.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1434.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1434.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1433 = newComp.layers.addNull();\r\n_Mesh_1433.threeDLayer = true;\r\n_Mesh_1433.source.name = \"_Mesh_1433\";\r\n_Mesh_1433.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1433.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1433.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1432 = newComp.layers.addNull();\r\n_Mesh_1432.threeDLayer = true;\r\n_Mesh_1432.source.name = \"_Mesh_1432\";\r\n_Mesh_1432.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1432.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1432.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1431 = newComp.layers.addNull();\r\n_Mesh_1431.threeDLayer = true;\r\n_Mesh_1431.source.name = \"_Mesh_1431\";\r\n_Mesh_1431.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1431.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1431.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1430 = newComp.layers.addNull();\r\n_Mesh_1430.threeDLayer = true;\r\n_Mesh_1430.source.name = \"_Mesh_1430\";\r\n_Mesh_1430.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1430.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1430.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1439 = newComp.layers.addNull();\r\n_Mesh_1439.threeDLayer = true;\r\n_Mesh_1439.source.name = \"_Mesh_1439\";\r\n_Mesh_1439.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1439.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1439.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1438 = newComp.layers.addNull();\r\n_Mesh_1438.threeDLayer = true;\r\n_Mesh_1438.source.name = \"_Mesh_1438\";\r\n_Mesh_1438.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1438.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1438.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1219 = newComp.layers.addNull();\r\n_Mesh_1219.threeDLayer = true;\r\n_Mesh_1219.source.name = \"_Mesh_1219\";\r\n_Mesh_1219.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1219.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1219.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1218 = newComp.layers.addNull();\r\n_Mesh_1218.threeDLayer = true;\r\n_Mesh_1218.source.name = \"_Mesh_1218\";\r\n_Mesh_1218.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1218.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1218.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1216 = newComp.layers.addNull();\r\n_Mesh_1216.threeDLayer = true;\r\n_Mesh_1216.source.name = \"_Mesh_1216\";\r\n_Mesh_1216.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1216.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1216.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1215 = newComp.layers.addNull();\r\n_Mesh_1215.threeDLayer = true;\r\n_Mesh_1215.source.name = \"_Mesh_1215\";\r\n_Mesh_1215.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1215.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1215.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1214 = newComp.layers.addNull();\r\n_Mesh_1214.threeDLayer = true;\r\n_Mesh_1214.source.name = \"_Mesh_1214\";\r\n_Mesh_1214.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1214.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1214.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1213 = newComp.layers.addNull();\r\n_Mesh_1213.threeDLayer = true;\r\n_Mesh_1213.source.name = \"_Mesh_1213\";\r\n_Mesh_1213.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1213.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1213.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1212 = newComp.layers.addNull();\r\n_Mesh_1212.threeDLayer = true;\r\n_Mesh_1212.source.name = \"_Mesh_1212\";\r\n_Mesh_1212.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1212.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1212.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1211 = newComp.layers.addNull();\r\n_Mesh_1211.threeDLayer = true;\r\n_Mesh_1211.source.name = \"_Mesh_1211\";\r\n_Mesh_1211.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1211.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1211.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1210 = newComp.layers.addNull();\r\n_Mesh_1210.threeDLayer = true;\r\n_Mesh_1210.source.name = \"_Mesh_1210\";\r\n_Mesh_1210.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1210.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1210.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1328 = newComp.layers.addNull();\r\n_Mesh_1328.threeDLayer = true;\r\n_Mesh_1328.source.name = \"_Mesh_1328\";\r\n_Mesh_1328.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1328.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1328.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1323 = newComp.layers.addNull();\r\n_Mesh_1323.threeDLayer = true;\r\n_Mesh_1323.source.name = \"_Mesh_1323\";\r\n_Mesh_1323.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1323.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1323.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1322 = newComp.layers.addNull();\r\n_Mesh_1322.threeDLayer = true;\r\n_Mesh_1322.source.name = \"_Mesh_1322\";\r\n_Mesh_1322.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1322.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1322.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1321 = newComp.layers.addNull();\r\n_Mesh_1321.threeDLayer = true;\r\n_Mesh_1321.source.name = \"_Mesh_1321\";\r\n_Mesh_1321.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1321.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1321.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1320 = newComp.layers.addNull();\r\n_Mesh_1320.threeDLayer = true;\r\n_Mesh_1320.source.name = \"_Mesh_1320\";\r\n_Mesh_1320.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1320.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1320.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1327 = newComp.layers.addNull();\r\n_Mesh_1327.threeDLayer = true;\r\n_Mesh_1327.source.name = \"_Mesh_1327\";\r\n_Mesh_1327.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1327.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1327.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1326 = newComp.layers.addNull();\r\n_Mesh_1326.threeDLayer = true;\r\n_Mesh_1326.source.name = \"_Mesh_1326\";\r\n_Mesh_1326.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1326.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1326.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1325 = newComp.layers.addNull();\r\n_Mesh_1325.threeDLayer = true;\r\n_Mesh_1325.source.name = \"_Mesh_1325\";\r\n_Mesh_1325.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1325.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1325.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1324 = newComp.layers.addNull();\r\n_Mesh_1324.threeDLayer = true;\r\n_Mesh_1324.source.name = \"_Mesh_1324\";\r\n_Mesh_1324.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1324.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1324.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1103 = newComp.layers.addNull();\r\n_Mesh_1103.threeDLayer = true;\r\n_Mesh_1103.source.name = \"_Mesh_1103\";\r\n_Mesh_1103.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1103.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1103.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1102 = newComp.layers.addNull();\r\n_Mesh_1102.threeDLayer = true;\r\n_Mesh_1102.source.name = \"_Mesh_1102\";\r\n_Mesh_1102.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1102.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1102.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1101 = newComp.layers.addNull();\r\n_Mesh_1101.threeDLayer = true;\r\n_Mesh_1101.source.name = \"_Mesh_1101\";\r\n_Mesh_1101.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1101.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1101.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1100 = newComp.layers.addNull();\r\n_Mesh_1100.threeDLayer = true;\r\n_Mesh_1100.source.name = \"_Mesh_1100\";\r\n_Mesh_1100.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1100.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1100.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1107 = newComp.layers.addNull();\r\n_Mesh_1107.threeDLayer = true;\r\n_Mesh_1107.source.name = \"_Mesh_1107\";\r\n_Mesh_1107.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1107.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1107.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1106 = newComp.layers.addNull();\r\n_Mesh_1106.threeDLayer = true;\r\n_Mesh_1106.source.name = \"_Mesh_1106\";\r\n_Mesh_1106.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1106.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1106.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1105 = newComp.layers.addNull();\r\n_Mesh_1105.threeDLayer = true;\r\n_Mesh_1105.source.name = \"_Mesh_1105\";\r\n_Mesh_1105.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1105.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1105.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1104 = newComp.layers.addNull();\r\n_Mesh_1104.threeDLayer = true;\r\n_Mesh_1104.source.name = \"_Mesh_1104\";\r\n_Mesh_1104.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1104.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1104.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1109 = newComp.layers.addNull();\r\n_Mesh_1109.threeDLayer = true;\r\n_Mesh_1109.source.name = \"_Mesh_1109\";\r\n_Mesh_1109.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1109.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1109.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1108 = newComp.layers.addNull();\r\n_Mesh_1108.threeDLayer = true;\r\n_Mesh_1108.source.name = \"_Mesh_1108\";\r\n_Mesh_1108.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1108.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1108.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_518 = newComp.layers.addNull();\r\n_Mesh_518.threeDLayer = true;\r\n_Mesh_518.source.name = \"_Mesh_518\";\r\n_Mesh_518.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_518.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_518.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_519 = newComp.layers.addNull();\r\n_Mesh_519.threeDLayer = true;\r\n_Mesh_519.source.name = \"_Mesh_519\";\r\n_Mesh_519.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_519.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_519.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_516 = newComp.layers.addNull();\r\n_Mesh_516.threeDLayer = true;\r\n_Mesh_516.source.name = \"_Mesh_516\";\r\n_Mesh_516.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_516.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_516.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_517 = newComp.layers.addNull();\r\n_Mesh_517.threeDLayer = true;\r\n_Mesh_517.source.name = \"_Mesh_517\";\r\n_Mesh_517.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_517.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_517.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_514 = newComp.layers.addNull();\r\n_Mesh_514.threeDLayer = true;\r\n_Mesh_514.source.name = \"_Mesh_514\";\r\n_Mesh_514.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_514.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_514.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_515 = newComp.layers.addNull();\r\n_Mesh_515.threeDLayer = true;\r\n_Mesh_515.source.name = \"_Mesh_515\";\r\n_Mesh_515.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_515.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_515.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_512 = newComp.layers.addNull();\r\n_Mesh_512.threeDLayer = true;\r\n_Mesh_512.source.name = \"_Mesh_512\";\r\n_Mesh_512.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_512.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_512.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_513 = newComp.layers.addNull();\r\n_Mesh_513.threeDLayer = true;\r\n_Mesh_513.source.name = \"_Mesh_513\";\r\n_Mesh_513.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_513.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_513.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_510 = newComp.layers.addNull();\r\n_Mesh_510.threeDLayer = true;\r\n_Mesh_510.source.name = \"_Mesh_510\";\r\n_Mesh_510.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_510.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_510.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_511 = newComp.layers.addNull();\r\n_Mesh_511.threeDLayer = true;\r\n_Mesh_511.source.name = \"_Mesh_511\";\r\n_Mesh_511.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_511.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_511.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_916 = newComp.layers.addNull();\r\n_Mesh_916.threeDLayer = true;\r\n_Mesh_916.source.name = \"_Mesh_916\";\r\n_Mesh_916.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_916.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_916.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_202 = newComp.layers.addNull();\r\n_Mesh_202.threeDLayer = true;\r\n_Mesh_202.source.name = \"_Mesh_202\";\r\n_Mesh_202.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_202.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_202.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_203 = newComp.layers.addNull();\r\n_Mesh_203.threeDLayer = true;\r\n_Mesh_203.source.name = \"_Mesh_203\";\r\n_Mesh_203.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_203.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_203.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_200 = newComp.layers.addNull();\r\n_Mesh_200.threeDLayer = true;\r\n_Mesh_200.source.name = \"_Mesh_200\";\r\n_Mesh_200.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_200.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_200.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_201 = newComp.layers.addNull();\r\n_Mesh_201.threeDLayer = true;\r\n_Mesh_201.source.name = \"_Mesh_201\";\r\n_Mesh_201.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_201.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_201.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_206 = newComp.layers.addNull();\r\n_Mesh_206.threeDLayer = true;\r\n_Mesh_206.source.name = \"_Mesh_206\";\r\n_Mesh_206.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_206.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_206.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_207 = newComp.layers.addNull();\r\n_Mesh_207.threeDLayer = true;\r\n_Mesh_207.source.name = \"_Mesh_207\";\r\n_Mesh_207.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_207.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_207.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_204 = newComp.layers.addNull();\r\n_Mesh_204.threeDLayer = true;\r\n_Mesh_204.source.name = \"_Mesh_204\";\r\n_Mesh_204.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_204.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_204.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_205 = newComp.layers.addNull();\r\n_Mesh_205.threeDLayer = true;\r\n_Mesh_205.source.name = \"_Mesh_205\";\r\n_Mesh_205.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_205.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_205.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_208 = newComp.layers.addNull();\r\n_Mesh_208.threeDLayer = true;\r\n_Mesh_208.source.name = \"_Mesh_208\";\r\n_Mesh_208.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_208.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_208.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_209 = newComp.layers.addNull();\r\n_Mesh_209.threeDLayer = true;\r\n_Mesh_209.source.name = \"_Mesh_209\";\r\n_Mesh_209.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_209.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_209.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_688 = newComp.layers.addNull();\r\n_Mesh_688.threeDLayer = true;\r\n_Mesh_688.source.name = \"_Mesh_688\";\r\n_Mesh_688.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_688.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_688.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_689 = newComp.layers.addNull();\r\n_Mesh_689.threeDLayer = true;\r\n_Mesh_689.source.name = \"_Mesh_689\";\r\n_Mesh_689.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_689.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_689.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_686 = newComp.layers.addNull();\r\n_Mesh_686.threeDLayer = true;\r\n_Mesh_686.source.name = \"_Mesh_686\";\r\n_Mesh_686.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_686.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_686.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_687 = newComp.layers.addNull();\r\n_Mesh_687.threeDLayer = true;\r\n_Mesh_687.source.name = \"_Mesh_687\";\r\n_Mesh_687.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_687.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_687.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_684 = newComp.layers.addNull();\r\n_Mesh_684.threeDLayer = true;\r\n_Mesh_684.source.name = \"_Mesh_684\";\r\n_Mesh_684.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_684.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_684.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_685 = newComp.layers.addNull();\r\n_Mesh_685.threeDLayer = true;\r\n_Mesh_685.source.name = \"_Mesh_685\";\r\n_Mesh_685.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_685.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_685.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_682 = newComp.layers.addNull();\r\n_Mesh_682.threeDLayer = true;\r\n_Mesh_682.source.name = \"_Mesh_682\";\r\n_Mesh_682.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_682.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_682.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_683 = newComp.layers.addNull();\r\n_Mesh_683.threeDLayer = true;\r\n_Mesh_683.source.name = \"_Mesh_683\";\r\n_Mesh_683.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_683.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_683.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_680 = newComp.layers.addNull();\r\n_Mesh_680.threeDLayer = true;\r\n_Mesh_680.source.name = \"_Mesh_680\";\r\n_Mesh_680.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_680.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_680.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_681 = newComp.layers.addNull();\r\n_Mesh_681.threeDLayer = true;\r\n_Mesh_681.source.name = \"_Mesh_681\";\r\n_Mesh_681.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_681.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_681.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_336 = newComp.layers.addNull();\r\n_Mesh_336.threeDLayer = true;\r\n_Mesh_336.source.name = \"_Mesh_336\";\r\n_Mesh_336.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_336.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_336.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_337 = newComp.layers.addNull();\r\n_Mesh_337.threeDLayer = true;\r\n_Mesh_337.source.name = \"_Mesh_337\";\r\n_Mesh_337.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_337.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_337.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_334 = newComp.layers.addNull();\r\n_Mesh_334.threeDLayer = true;\r\n_Mesh_334.source.name = \"_Mesh_334\";\r\n_Mesh_334.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_334.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_334.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_335 = newComp.layers.addNull();\r\n_Mesh_335.threeDLayer = true;\r\n_Mesh_335.source.name = \"_Mesh_335\";\r\n_Mesh_335.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_335.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_335.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_332 = newComp.layers.addNull();\r\n_Mesh_332.threeDLayer = true;\r\n_Mesh_332.source.name = \"_Mesh_332\";\r\n_Mesh_332.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_332.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_332.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_333 = newComp.layers.addNull();\r\n_Mesh_333.threeDLayer = true;\r\n_Mesh_333.source.name = \"_Mesh_333\";\r\n_Mesh_333.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_333.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_333.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_330 = newComp.layers.addNull();\r\n_Mesh_330.threeDLayer = true;\r\n_Mesh_330.source.name = \"_Mesh_330\";\r\n_Mesh_330.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_330.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_330.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_331 = newComp.layers.addNull();\r\n_Mesh_331.threeDLayer = true;\r\n_Mesh_331.source.name = \"_Mesh_331\";\r\n_Mesh_331.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_331.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_331.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_338 = newComp.layers.addNull();\r\n_Mesh_338.threeDLayer = true;\r\n_Mesh_338.source.name = \"_Mesh_338\";\r\n_Mesh_338.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_338.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_338.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_339 = newComp.layers.addNull();\r\n_Mesh_339.threeDLayer = true;\r\n_Mesh_339.source.name = \"_Mesh_339\";\r\n_Mesh_339.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_339.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_339.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_028 = newComp.layers.addNull();\r\n_Mesh_028.threeDLayer = true;\r\n_Mesh_028.source.name = \"_Mesh_028\";\r\n_Mesh_028.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_028.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_028.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_029 = newComp.layers.addNull();\r\n_Mesh_029.threeDLayer = true;\r\n_Mesh_029.source.name = \"_Mesh_029\";\r\n_Mesh_029.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_029.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_029.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_022 = newComp.layers.addNull();\r\n_Mesh_022.threeDLayer = true;\r\n_Mesh_022.source.name = \"_Mesh_022\";\r\n_Mesh_022.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_022.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_022.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_023 = newComp.layers.addNull();\r\n_Mesh_023.threeDLayer = true;\r\n_Mesh_023.source.name = \"_Mesh_023\";\r\n_Mesh_023.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_023.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_023.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_020 = newComp.layers.addNull();\r\n_Mesh_020.threeDLayer = true;\r\n_Mesh_020.source.name = \"_Mesh_020\";\r\n_Mesh_020.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_020.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_020.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_021 = newComp.layers.addNull();\r\n_Mesh_021.threeDLayer = true;\r\n_Mesh_021.source.name = \"_Mesh_021\";\r\n_Mesh_021.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_021.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_021.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_026 = newComp.layers.addNull();\r\n_Mesh_026.threeDLayer = true;\r\n_Mesh_026.source.name = \"_Mesh_026\";\r\n_Mesh_026.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_026.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_026.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_027 = newComp.layers.addNull();\r\n_Mesh_027.threeDLayer = true;\r\n_Mesh_027.source.name = \"_Mesh_027\";\r\n_Mesh_027.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_027.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_027.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_024 = newComp.layers.addNull();\r\n_Mesh_024.threeDLayer = true;\r\n_Mesh_024.source.name = \"_Mesh_024\";\r\n_Mesh_024.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_024.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_024.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_025 = newComp.layers.addNull();\r\n_Mesh_025.threeDLayer = true;\r\n_Mesh_025.source.name = \"_Mesh_025\";\r\n_Mesh_025.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_025.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_025.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_822 = newComp.layers.addNull();\r\n_Mesh_822.threeDLayer = true;\r\n_Mesh_822.source.name = \"_Mesh_822\";\r\n_Mesh_822.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_822.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_822.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_823 = newComp.layers.addNull();\r\n_Mesh_823.threeDLayer = true;\r\n_Mesh_823.source.name = \"_Mesh_823\";\r\n_Mesh_823.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_823.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_823.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_820 = newComp.layers.addNull();\r\n_Mesh_820.threeDLayer = true;\r\n_Mesh_820.source.name = \"_Mesh_820\";\r\n_Mesh_820.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_820.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_820.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_821 = newComp.layers.addNull();\r\n_Mesh_821.threeDLayer = true;\r\n_Mesh_821.source.name = \"_Mesh_821\";\r\n_Mesh_821.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_821.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_821.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_826 = newComp.layers.addNull();\r\n_Mesh_826.threeDLayer = true;\r\n_Mesh_826.source.name = \"_Mesh_826\";\r\n_Mesh_826.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_826.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_826.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_827 = newComp.layers.addNull();\r\n_Mesh_827.threeDLayer = true;\r\n_Mesh_827.source.name = \"_Mesh_827\";\r\n_Mesh_827.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_827.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_827.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_824 = newComp.layers.addNull();\r\n_Mesh_824.threeDLayer = true;\r\n_Mesh_824.source.name = \"_Mesh_824\";\r\n_Mesh_824.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_824.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_824.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_825 = newComp.layers.addNull();\r\n_Mesh_825.threeDLayer = true;\r\n_Mesh_825.source.name = \"_Mesh_825\";\r\n_Mesh_825.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_825.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_825.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1358 = newComp.layers.addNull();\r\n_Mesh_1358.threeDLayer = true;\r\n_Mesh_1358.source.name = \"_Mesh_1358\";\r\n_Mesh_1358.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1358.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1358.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1359 = newComp.layers.addNull();\r\n_Mesh_1359.threeDLayer = true;\r\n_Mesh_1359.source.name = \"_Mesh_1359\";\r\n_Mesh_1359.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1359.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1359.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1356 = newComp.layers.addNull();\r\n_Mesh_1356.threeDLayer = true;\r\n_Mesh_1356.source.name = \"_Mesh_1356\";\r\n_Mesh_1356.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1356.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1356.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1357 = newComp.layers.addNull();\r\n_Mesh_1357.threeDLayer = true;\r\n_Mesh_1357.source.name = \"_Mesh_1357\";\r\n_Mesh_1357.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1357.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1357.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1354 = newComp.layers.addNull();\r\n_Mesh_1354.threeDLayer = true;\r\n_Mesh_1354.source.name = \"_Mesh_1354\";\r\n_Mesh_1354.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1354.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1354.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1355 = newComp.layers.addNull();\r\n_Mesh_1355.threeDLayer = true;\r\n_Mesh_1355.source.name = \"_Mesh_1355\";\r\n_Mesh_1355.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1355.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1355.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1352 = newComp.layers.addNull();\r\n_Mesh_1352.threeDLayer = true;\r\n_Mesh_1352.source.name = \"_Mesh_1352\";\r\n_Mesh_1352.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1352.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1352.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1353 = newComp.layers.addNull();\r\n_Mesh_1353.threeDLayer = true;\r\n_Mesh_1353.source.name = \"_Mesh_1353\";\r\n_Mesh_1353.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1353.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1353.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1350 = newComp.layers.addNull();\r\n_Mesh_1350.threeDLayer = true;\r\n_Mesh_1350.source.name = \"_Mesh_1350\";\r\n_Mesh_1350.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1350.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1350.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1351 = newComp.layers.addNull();\r\n_Mesh_1351.threeDLayer = true;\r\n_Mesh_1351.source.name = \"_Mesh_1351\";\r\n_Mesh_1351.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1351.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1351.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1176 = newComp.layers.addNull();\r\n_Mesh_1176.threeDLayer = true;\r\n_Mesh_1176.source.name = \"_Mesh_1176\";\r\n_Mesh_1176.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1176.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1176.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1174 = newComp.layers.addNull();\r\n_Mesh_1174.threeDLayer = true;\r\n_Mesh_1174.source.name = \"_Mesh_1174\";\r\n_Mesh_1174.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1174.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1174.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1175 = newComp.layers.addNull();\r\n_Mesh_1175.threeDLayer = true;\r\n_Mesh_1175.source.name = \"_Mesh_1175\";\r\n_Mesh_1175.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1175.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1175.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1172 = newComp.layers.addNull();\r\n_Mesh_1172.threeDLayer = true;\r\n_Mesh_1172.source.name = \"_Mesh_1172\";\r\n_Mesh_1172.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1172.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1172.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1173 = newComp.layers.addNull();\r\n_Mesh_1173.threeDLayer = true;\r\n_Mesh_1173.source.name = \"_Mesh_1173\";\r\n_Mesh_1173.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1173.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1173.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1170 = newComp.layers.addNull();\r\n_Mesh_1170.threeDLayer = true;\r\n_Mesh_1170.source.name = \"_Mesh_1170\";\r\n_Mesh_1170.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1170.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1170.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1171 = newComp.layers.addNull();\r\n_Mesh_1171.threeDLayer = true;\r\n_Mesh_1171.source.name = \"_Mesh_1171\";\r\n_Mesh_1171.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1171.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1171.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1178 = newComp.layers.addNull();\r\n_Mesh_1178.threeDLayer = true;\r\n_Mesh_1178.source.name = \"_Mesh_1178\";\r\n_Mesh_1178.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1178.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1178.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1179 = newComp.layers.addNull();\r\n_Mesh_1179.threeDLayer = true;\r\n_Mesh_1179.source.name = \"_Mesh_1179\";\r\n_Mesh_1179.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1179.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1179.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1008 = newComp.layers.addNull();\r\n_Mesh_1008.threeDLayer = true;\r\n_Mesh_1008.source.name = \"_Mesh_1008\";\r\n_Mesh_1008.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1008.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1008.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1009 = newComp.layers.addNull();\r\n_Mesh_1009.threeDLayer = true;\r\n_Mesh_1009.source.name = \"_Mesh_1009\";\r\n_Mesh_1009.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1009.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1009.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1002 = newComp.layers.addNull();\r\n_Mesh_1002.threeDLayer = true;\r\n_Mesh_1002.source.name = \"_Mesh_1002\";\r\n_Mesh_1002.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1002.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1002.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1003 = newComp.layers.addNull();\r\n_Mesh_1003.threeDLayer = true;\r\n_Mesh_1003.source.name = \"_Mesh_1003\";\r\n_Mesh_1003.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1003.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1003.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1000 = newComp.layers.addNull();\r\n_Mesh_1000.threeDLayer = true;\r\n_Mesh_1000.source.name = \"_Mesh_1000\";\r\n_Mesh_1000.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1000.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1000.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1001 = newComp.layers.addNull();\r\n_Mesh_1001.threeDLayer = true;\r\n_Mesh_1001.source.name = \"_Mesh_1001\";\r\n_Mesh_1001.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1001.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1001.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1006 = newComp.layers.addNull();\r\n_Mesh_1006.threeDLayer = true;\r\n_Mesh_1006.source.name = \"_Mesh_1006\";\r\n_Mesh_1006.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1006.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1006.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1007 = newComp.layers.addNull();\r\n_Mesh_1007.threeDLayer = true;\r\n_Mesh_1007.source.name = \"_Mesh_1007\";\r\n_Mesh_1007.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1007.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1007.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1004 = newComp.layers.addNull();\r\n_Mesh_1004.threeDLayer = true;\r\n_Mesh_1004.source.name = \"_Mesh_1004\";\r\n_Mesh_1004.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1004.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1004.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1005 = newComp.layers.addNull();\r\n_Mesh_1005.threeDLayer = true;\r\n_Mesh_1005.source.name = \"_Mesh_1005\";\r\n_Mesh_1005.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1005.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1005.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_831 = newComp.layers.addNull();\r\n_Mesh_831.threeDLayer = true;\r\n_Mesh_831.source.name = \"_Mesh_831\";\r\n_Mesh_831.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_831.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_831.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_830 = newComp.layers.addNull();\r\n_Mesh_830.threeDLayer = true;\r\n_Mesh_830.source.name = \"_Mesh_830\";\r\n_Mesh_830.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_830.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_830.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_833 = newComp.layers.addNull();\r\n_Mesh_833.threeDLayer = true;\r\n_Mesh_833.source.name = \"_Mesh_833\";\r\n_Mesh_833.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_833.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_833.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_832 = newComp.layers.addNull();\r\n_Mesh_832.threeDLayer = true;\r\n_Mesh_832.source.name = \"_Mesh_832\";\r\n_Mesh_832.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_832.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_832.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_835 = newComp.layers.addNull();\r\n_Mesh_835.threeDLayer = true;\r\n_Mesh_835.source.name = \"_Mesh_835\";\r\n_Mesh_835.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_835.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_835.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_834 = newComp.layers.addNull();\r\n_Mesh_834.threeDLayer = true;\r\n_Mesh_834.source.name = \"_Mesh_834\";\r\n_Mesh_834.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_834.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_834.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_837 = newComp.layers.addNull();\r\n_Mesh_837.threeDLayer = true;\r\n_Mesh_837.source.name = \"_Mesh_837\";\r\n_Mesh_837.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_837.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_837.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_836 = newComp.layers.addNull();\r\n_Mesh_836.threeDLayer = true;\r\n_Mesh_836.source.name = \"_Mesh_836\";\r\n_Mesh_836.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_836.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_836.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_839 = newComp.layers.addNull();\r\n_Mesh_839.threeDLayer = true;\r\n_Mesh_839.source.name = \"_Mesh_839\";\r\n_Mesh_839.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_839.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_839.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_838 = newComp.layers.addNull();\r\n_Mesh_838.threeDLayer = true;\r\n_Mesh_838.source.name = \"_Mesh_838\";\r\n_Mesh_838.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_838.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_838.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_529 = newComp.layers.addNull();\r\n_Mesh_529.threeDLayer = true;\r\n_Mesh_529.source.name = \"_Mesh_529\";\r\n_Mesh_529.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_529.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_529.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_528 = newComp.layers.addNull();\r\n_Mesh_528.threeDLayer = true;\r\n_Mesh_528.source.name = \"_Mesh_528\";\r\n_Mesh_528.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_528.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_528.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_787 = newComp.layers.addNull();\r\n_Mesh_787.threeDLayer = true;\r\n_Mesh_787.source.name = \"_Mesh_787\";\r\n_Mesh_787.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_787.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_787.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_786 = newComp.layers.addNull();\r\n_Mesh_786.threeDLayer = true;\r\n_Mesh_786.source.name = \"_Mesh_786\";\r\n_Mesh_786.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_786.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_786.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_785 = newComp.layers.addNull();\r\n_Mesh_785.threeDLayer = true;\r\n_Mesh_785.source.name = \"_Mesh_785\";\r\n_Mesh_785.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_785.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_785.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_784 = newComp.layers.addNull();\r\n_Mesh_784.threeDLayer = true;\r\n_Mesh_784.source.name = \"_Mesh_784\";\r\n_Mesh_784.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_784.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_784.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_783 = newComp.layers.addNull();\r\n_Mesh_783.threeDLayer = true;\r\n_Mesh_783.source.name = \"_Mesh_783\";\r\n_Mesh_783.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_783.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_783.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_782 = newComp.layers.addNull();\r\n_Mesh_782.threeDLayer = true;\r\n_Mesh_782.source.name = \"_Mesh_782\";\r\n_Mesh_782.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_782.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_782.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_781 = newComp.layers.addNull();\r\n_Mesh_781.threeDLayer = true;\r\n_Mesh_781.source.name = \"_Mesh_781\";\r\n_Mesh_781.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_781.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_781.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_780 = newComp.layers.addNull();\r\n_Mesh_780.threeDLayer = true;\r\n_Mesh_780.source.name = \"_Mesh_780\";\r\n_Mesh_780.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_780.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_780.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_789 = newComp.layers.addNull();\r\n_Mesh_789.threeDLayer = true;\r\n_Mesh_789.source.name = \"_Mesh_789\";\r\n_Mesh_789.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_789.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_789.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_788 = newComp.layers.addNull();\r\n_Mesh_788.threeDLayer = true;\r\n_Mesh_788.source.name = \"_Mesh_788\";\r\n_Mesh_788.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_788.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_788.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_237 = newComp.layers.addNull();\r\n_Mesh_237.threeDLayer = true;\r\n_Mesh_237.source.name = \"_Mesh_237\";\r\n_Mesh_237.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_237.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_237.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_236 = newComp.layers.addNull();\r\n_Mesh_236.threeDLayer = true;\r\n_Mesh_236.source.name = \"_Mesh_236\";\r\n_Mesh_236.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_236.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_236.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_235 = newComp.layers.addNull();\r\n_Mesh_235.threeDLayer = true;\r\n_Mesh_235.source.name = \"_Mesh_235\";\r\n_Mesh_235.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_235.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_235.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_234 = newComp.layers.addNull();\r\n_Mesh_234.threeDLayer = true;\r\n_Mesh_234.source.name = \"_Mesh_234\";\r\n_Mesh_234.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_234.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_234.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_233 = newComp.layers.addNull();\r\n_Mesh_233.threeDLayer = true;\r\n_Mesh_233.source.name = \"_Mesh_233\";\r\n_Mesh_233.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_233.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_233.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_232 = newComp.layers.addNull();\r\n_Mesh_232.threeDLayer = true;\r\n_Mesh_232.source.name = \"_Mesh_232\";\r\n_Mesh_232.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_232.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_232.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_231 = newComp.layers.addNull();\r\n_Mesh_231.threeDLayer = true;\r\n_Mesh_231.source.name = \"_Mesh_231\";\r\n_Mesh_231.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_231.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_231.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_230 = newComp.layers.addNull();\r\n_Mesh_230.threeDLayer = true;\r\n_Mesh_230.source.name = \"_Mesh_230\";\r\n_Mesh_230.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_230.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_230.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_239 = newComp.layers.addNull();\r\n_Mesh_239.threeDLayer = true;\r\n_Mesh_239.source.name = \"_Mesh_239\";\r\n_Mesh_239.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_239.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_239.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_238 = newComp.layers.addNull();\r\n_Mesh_238.threeDLayer = true;\r\n_Mesh_238.source.name = \"_Mesh_238\";\r\n_Mesh_238.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_238.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_238.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_659 = newComp.layers.addNull();\r\n_Mesh_659.threeDLayer = true;\r\n_Mesh_659.source.name = \"_Mesh_659\";\r\n_Mesh_659.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_659.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_659.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_658 = newComp.layers.addNull();\r\n_Mesh_658.threeDLayer = true;\r\n_Mesh_658.source.name = \"_Mesh_658\";\r\n_Mesh_658.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_658.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_658.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_309 = newComp.layers.addNull();\r\n_Mesh_309.threeDLayer = true;\r\n_Mesh_309.source.name = \"_Mesh_309\";\r\n_Mesh_309.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_309.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_309.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_308 = newComp.layers.addNull();\r\n_Mesh_308.threeDLayer = true;\r\n_Mesh_308.source.name = \"_Mesh_308\";\r\n_Mesh_308.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_308.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_308.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_651 = newComp.layers.addNull();\r\n_Mesh_651.threeDLayer = true;\r\n_Mesh_651.source.name = \"_Mesh_651\";\r\n_Mesh_651.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_651.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_651.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_302 = newComp.layers.addNull();\r\n_Mesh_302.threeDLayer = true;\r\n_Mesh_302.source.name = \"_Mesh_302\";\r\n_Mesh_302.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_302.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_302.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_301 = newComp.layers.addNull();\r\n_Mesh_301.threeDLayer = true;\r\n_Mesh_301.source.name = \"_Mesh_301\";\r\n_Mesh_301.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_301.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_301.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_300 = newComp.layers.addNull();\r\n_Mesh_300.threeDLayer = true;\r\n_Mesh_300.source.name = \"_Mesh_300\";\r\n_Mesh_300.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_300.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_300.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_307 = newComp.layers.addNull();\r\n_Mesh_307.threeDLayer = true;\r\n_Mesh_307.source.name = \"_Mesh_307\";\r\n_Mesh_307.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_307.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_307.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_306 = newComp.layers.addNull();\r\n_Mesh_306.threeDLayer = true;\r\n_Mesh_306.source.name = \"_Mesh_306\";\r\n_Mesh_306.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_306.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_306.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_305 = newComp.layers.addNull();\r\n_Mesh_305.threeDLayer = true;\r\n_Mesh_305.source.name = \"_Mesh_305\";\r\n_Mesh_305.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_305.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_305.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_304 = newComp.layers.addNull();\r\n_Mesh_304.threeDLayer = true;\r\n_Mesh_304.source.name = \"_Mesh_304\";\r\n_Mesh_304.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_304.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_304.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_019 = newComp.layers.addNull();\r\n_Mesh_019.threeDLayer = true;\r\n_Mesh_019.source.name = \"_Mesh_019\";\r\n_Mesh_019.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_019.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_019.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_018 = newComp.layers.addNull();\r\n_Mesh_018.threeDLayer = true;\r\n_Mesh_018.source.name = \"_Mesh_018\";\r\n_Mesh_018.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_018.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_018.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_017 = newComp.layers.addNull();\r\n_Mesh_017.threeDLayer = true;\r\n_Mesh_017.source.name = \"_Mesh_017\";\r\n_Mesh_017.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_017.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_017.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_016 = newComp.layers.addNull();\r\n_Mesh_016.threeDLayer = true;\r\n_Mesh_016.source.name = \"_Mesh_016\";\r\n_Mesh_016.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_016.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_016.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_015 = newComp.layers.addNull();\r\n_Mesh_015.threeDLayer = true;\r\n_Mesh_015.source.name = \"_Mesh_015\";\r\n_Mesh_015.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_015.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_015.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_014 = newComp.layers.addNull();\r\n_Mesh_014.threeDLayer = true;\r\n_Mesh_014.source.name = \"_Mesh_014\";\r\n_Mesh_014.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_014.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_014.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_013 = newComp.layers.addNull();\r\n_Mesh_013.threeDLayer = true;\r\n_Mesh_013.source.name = \"_Mesh_013\";\r\n_Mesh_013.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_013.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_013.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_012 = newComp.layers.addNull();\r\n_Mesh_012.threeDLayer = true;\r\n_Mesh_012.source.name = \"_Mesh_012\";\r\n_Mesh_012.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_012.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_012.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_011 = newComp.layers.addNull();\r\n_Mesh_011.threeDLayer = true;\r\n_Mesh_011.source.name = \"_Mesh_011\";\r\n_Mesh_011.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_011.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_011.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_010 = newComp.layers.addNull();\r\n_Mesh_010.threeDLayer = true;\r\n_Mesh_010.source.name = \"_Mesh_010\";\r\n_Mesh_010.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_010.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_010.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_899 = newComp.layers.addNull();\r\n_Mesh_899.threeDLayer = true;\r\n_Mesh_899.source.name = \"_Mesh_899\";\r\n_Mesh_899.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_899.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_899.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_898 = newComp.layers.addNull();\r\n_Mesh_898.threeDLayer = true;\r\n_Mesh_898.source.name = \"_Mesh_898\";\r\n_Mesh_898.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_898.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_898.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_897 = newComp.layers.addNull();\r\n_Mesh_897.threeDLayer = true;\r\n_Mesh_897.source.name = \"_Mesh_897\";\r\n_Mesh_897.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_897.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_897.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_896 = newComp.layers.addNull();\r\n_Mesh_896.threeDLayer = true;\r\n_Mesh_896.source.name = \"_Mesh_896\";\r\n_Mesh_896.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_896.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_896.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1349 = newComp.layers.addNull();\r\n_Mesh_1349.threeDLayer = true;\r\n_Mesh_1349.source.name = \"_Mesh_1349\";\r\n_Mesh_1349.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1349.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1349.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1348 = newComp.layers.addNull();\r\n_Mesh_1348.threeDLayer = true;\r\n_Mesh_1348.source.name = \"_Mesh_1348\";\r\n_Mesh_1348.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1348.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1348.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1345 = newComp.layers.addNull();\r\n_Mesh_1345.threeDLayer = true;\r\n_Mesh_1345.source.name = \"_Mesh_1345\";\r\n_Mesh_1345.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1345.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1345.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1344 = newComp.layers.addNull();\r\n_Mesh_1344.threeDLayer = true;\r\n_Mesh_1344.source.name = \"_Mesh_1344\";\r\n_Mesh_1344.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1344.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1344.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1347 = newComp.layers.addNull();\r\n_Mesh_1347.threeDLayer = true;\r\n_Mesh_1347.source.name = \"_Mesh_1347\";\r\n_Mesh_1347.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1347.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1347.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1346 = newComp.layers.addNull();\r\n_Mesh_1346.threeDLayer = true;\r\n_Mesh_1346.source.name = \"_Mesh_1346\";\r\n_Mesh_1346.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1346.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1346.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1341 = newComp.layers.addNull();\r\n_Mesh_1341.threeDLayer = true;\r\n_Mesh_1341.source.name = \"_Mesh_1341\";\r\n_Mesh_1341.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1341.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1341.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1340 = newComp.layers.addNull();\r\n_Mesh_1340.threeDLayer = true;\r\n_Mesh_1340.source.name = \"_Mesh_1340\";\r\n_Mesh_1340.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1340.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1340.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1343 = newComp.layers.addNull();\r\n_Mesh_1343.threeDLayer = true;\r\n_Mesh_1343.source.name = \"_Mesh_1343\";\r\n_Mesh_1343.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1343.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1343.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1342 = newComp.layers.addNull();\r\n_Mesh_1342.threeDLayer = true;\r\n_Mesh_1342.source.name = \"_Mesh_1342\";\r\n_Mesh_1342.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1342.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1342.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1165 = newComp.layers.addNull();\r\n_Mesh_1165.threeDLayer = true;\r\n_Mesh_1165.source.name = \"_Mesh_1165\";\r\n_Mesh_1165.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1165.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1165.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1164 = newComp.layers.addNull();\r\n_Mesh_1164.threeDLayer = true;\r\n_Mesh_1164.source.name = \"_Mesh_1164\";\r\n_Mesh_1164.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1164.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1164.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1167 = newComp.layers.addNull();\r\n_Mesh_1167.threeDLayer = true;\r\n_Mesh_1167.source.name = \"_Mesh_1167\";\r\n_Mesh_1167.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1167.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1167.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1166 = newComp.layers.addNull();\r\n_Mesh_1166.threeDLayer = true;\r\n_Mesh_1166.source.name = \"_Mesh_1166\";\r\n_Mesh_1166.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1166.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1166.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1161 = newComp.layers.addNull();\r\n_Mesh_1161.threeDLayer = true;\r\n_Mesh_1161.source.name = \"_Mesh_1161\";\r\n_Mesh_1161.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1161.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1161.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1160 = newComp.layers.addNull();\r\n_Mesh_1160.threeDLayer = true;\r\n_Mesh_1160.source.name = \"_Mesh_1160\";\r\n_Mesh_1160.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1160.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1160.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1163 = newComp.layers.addNull();\r\n_Mesh_1163.threeDLayer = true;\r\n_Mesh_1163.source.name = \"_Mesh_1163\";\r\n_Mesh_1163.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1163.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1163.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1162 = newComp.layers.addNull();\r\n_Mesh_1162.threeDLayer = true;\r\n_Mesh_1162.source.name = \"_Mesh_1162\";\r\n_Mesh_1162.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1162.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1162.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1169 = newComp.layers.addNull();\r\n_Mesh_1169.threeDLayer = true;\r\n_Mesh_1169.source.name = \"_Mesh_1169\";\r\n_Mesh_1169.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1169.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1169.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1168 = newComp.layers.addNull();\r\n_Mesh_1168.threeDLayer = true;\r\n_Mesh_1168.source.name = \"_Mesh_1168\";\r\n_Mesh_1168.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1168.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1168.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh = newComp.layers.addNull();\r\n_Mesh.threeDLayer = true;\r\n_Mesh.source.name = \"_Mesh\";\r\n_Mesh.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1019 = newComp.layers.addNull();\r\n_Mesh_1019.threeDLayer = true;\r\n_Mesh_1019.source.name = \"_Mesh_1019\";\r\n_Mesh_1019.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1019.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1019.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1018 = newComp.layers.addNull();\r\n_Mesh_1018.threeDLayer = true;\r\n_Mesh_1018.source.name = \"_Mesh_1018\";\r\n_Mesh_1018.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1018.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1018.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1011 = newComp.layers.addNull();\r\n_Mesh_1011.threeDLayer = true;\r\n_Mesh_1011.source.name = \"_Mesh_1011\";\r\n_Mesh_1011.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1011.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1011.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1010 = newComp.layers.addNull();\r\n_Mesh_1010.threeDLayer = true;\r\n_Mesh_1010.source.name = \"_Mesh_1010\";\r\n_Mesh_1010.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1010.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1010.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1013 = newComp.layers.addNull();\r\n_Mesh_1013.threeDLayer = true;\r\n_Mesh_1013.source.name = \"_Mesh_1013\";\r\n_Mesh_1013.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1013.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1013.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1012 = newComp.layers.addNull();\r\n_Mesh_1012.threeDLayer = true;\r\n_Mesh_1012.source.name = \"_Mesh_1012\";\r\n_Mesh_1012.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1012.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1012.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1015 = newComp.layers.addNull();\r\n_Mesh_1015.threeDLayer = true;\r\n_Mesh_1015.source.name = \"_Mesh_1015\";\r\n_Mesh_1015.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1015.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1015.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1014 = newComp.layers.addNull();\r\n_Mesh_1014.threeDLayer = true;\r\n_Mesh_1014.source.name = \"_Mesh_1014\";\r\n_Mesh_1014.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1014.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1014.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1017 = newComp.layers.addNull();\r\n_Mesh_1017.threeDLayer = true;\r\n_Mesh_1017.source.name = \"_Mesh_1017\";\r\n_Mesh_1017.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1017.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1017.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1016 = newComp.layers.addNull();\r\n_Mesh_1016.threeDLayer = true;\r\n_Mesh_1016.source.name = \"_Mesh_1016\";\r\n_Mesh_1016.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1016.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1016.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_534 = newComp.layers.addNull();\r\n_Mesh_534.threeDLayer = true;\r\n_Mesh_534.source.name = \"_Mesh_534\";\r\n_Mesh_534.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_534.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_534.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_535 = newComp.layers.addNull();\r\n_Mesh_535.threeDLayer = true;\r\n_Mesh_535.source.name = \"_Mesh_535\";\r\n_Mesh_535.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_535.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_535.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_536 = newComp.layers.addNull();\r\n_Mesh_536.threeDLayer = true;\r\n_Mesh_536.source.name = \"_Mesh_536\";\r\n_Mesh_536.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_536.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_536.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_537 = newComp.layers.addNull();\r\n_Mesh_537.threeDLayer = true;\r\n_Mesh_537.source.name = \"_Mesh_537\";\r\n_Mesh_537.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_537.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_537.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_530 = newComp.layers.addNull();\r\n_Mesh_530.threeDLayer = true;\r\n_Mesh_530.source.name = \"_Mesh_530\";\r\n_Mesh_530.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_530.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_530.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_531 = newComp.layers.addNull();\r\n_Mesh_531.threeDLayer = true;\r\n_Mesh_531.source.name = \"_Mesh_531\";\r\n_Mesh_531.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_531.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_531.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_532 = newComp.layers.addNull();\r\n_Mesh_532.threeDLayer = true;\r\n_Mesh_532.source.name = \"_Mesh_532\";\r\n_Mesh_532.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_532.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_532.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_533 = newComp.layers.addNull();\r\n_Mesh_533.threeDLayer = true;\r\n_Mesh_533.source.name = \"_Mesh_533\";\r\n_Mesh_533.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_533.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_533.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_828 = newComp.layers.addNull();\r\n_Mesh_828.threeDLayer = true;\r\n_Mesh_828.source.name = \"_Mesh_828\";\r\n_Mesh_828.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_828.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_828.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_829 = newComp.layers.addNull();\r\n_Mesh_829.threeDLayer = true;\r\n_Mesh_829.source.name = \"_Mesh_829\";\r\n_Mesh_829.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_829.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_829.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_538 = newComp.layers.addNull();\r\n_Mesh_538.threeDLayer = true;\r\n_Mesh_538.source.name = \"_Mesh_538\";\r\n_Mesh_538.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_538.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_538.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_539 = newComp.layers.addNull();\r\n_Mesh_539.threeDLayer = true;\r\n_Mesh_539.source.name = \"_Mesh_539\";\r\n_Mesh_539.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_539.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_539.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_097 = newComp.layers.addNull();\r\n_Mesh_097.threeDLayer = true;\r\n_Mesh_097.source.name = \"_Mesh_097\";\r\n_Mesh_097.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_097.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_097.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_096 = newComp.layers.addNull();\r\n_Mesh_096.threeDLayer = true;\r\n_Mesh_096.source.name = \"_Mesh_096\";\r\n_Mesh_096.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_096.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_096.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_095 = newComp.layers.addNull();\r\n_Mesh_095.threeDLayer = true;\r\n_Mesh_095.source.name = \"_Mesh_095\";\r\n_Mesh_095.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_095.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_095.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_094 = newComp.layers.addNull();\r\n_Mesh_094.threeDLayer = true;\r\n_Mesh_094.source.name = \"_Mesh_094\";\r\n_Mesh_094.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_094.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_094.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_093 = newComp.layers.addNull();\r\n_Mesh_093.threeDLayer = true;\r\n_Mesh_093.source.name = \"_Mesh_093\";\r\n_Mesh_093.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_093.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_093.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_092 = newComp.layers.addNull();\r\n_Mesh_092.threeDLayer = true;\r\n_Mesh_092.source.name = \"_Mesh_092\";\r\n_Mesh_092.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_092.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_092.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_228 = newComp.layers.addNull();\r\n_Mesh_228.threeDLayer = true;\r\n_Mesh_228.source.name = \"_Mesh_228\";\r\n_Mesh_228.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_228.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_228.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_229 = newComp.layers.addNull();\r\n_Mesh_229.threeDLayer = true;\r\n_Mesh_229.source.name = \"_Mesh_229\";\r\n_Mesh_229.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_229.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_229.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_091 = newComp.layers.addNull();\r\n_Mesh_091.threeDLayer = true;\r\n_Mesh_091.source.name = \"_Mesh_091\";\r\n_Mesh_091.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_091.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_091.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_220 = newComp.layers.addNull();\r\n_Mesh_220.threeDLayer = true;\r\n_Mesh_220.source.name = \"_Mesh_220\";\r\n_Mesh_220.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_220.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_220.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_221 = newComp.layers.addNull();\r\n_Mesh_221.threeDLayer = true;\r\n_Mesh_221.source.name = \"_Mesh_221\";\r\n_Mesh_221.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_221.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_221.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_222 = newComp.layers.addNull();\r\n_Mesh_222.threeDLayer = true;\r\n_Mesh_222.source.name = \"_Mesh_222\";\r\n_Mesh_222.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_222.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_222.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_223 = newComp.layers.addNull();\r\n_Mesh_223.threeDLayer = true;\r\n_Mesh_223.source.name = \"_Mesh_223\";\r\n_Mesh_223.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_223.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_223.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_224 = newComp.layers.addNull();\r\n_Mesh_224.threeDLayer = true;\r\n_Mesh_224.source.name = \"_Mesh_224\";\r\n_Mesh_224.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_224.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_224.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_225 = newComp.layers.addNull();\r\n_Mesh_225.threeDLayer = true;\r\n_Mesh_225.source.name = \"_Mesh_225\";\r\n_Mesh_225.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_225.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_225.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_226 = newComp.layers.addNull();\r\n_Mesh_226.threeDLayer = true;\r\n_Mesh_226.source.name = \"_Mesh_226\";\r\n_Mesh_226.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_226.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_226.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_227 = newComp.layers.addNull();\r\n_Mesh_227.threeDLayer = true;\r\n_Mesh_227.source.name = \"_Mesh_227\";\r\n_Mesh_227.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_227.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_227.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_642 = newComp.layers.addNull();\r\n_Mesh_642.threeDLayer = true;\r\n_Mesh_642.source.name = \"_Mesh_642\";\r\n_Mesh_642.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_642.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_642.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_643 = newComp.layers.addNull();\r\n_Mesh_643.threeDLayer = true;\r\n_Mesh_643.source.name = \"_Mesh_643\";\r\n_Mesh_643.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_643.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_643.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_316 = newComp.layers.addNull();\r\n_Mesh_316.threeDLayer = true;\r\n_Mesh_316.source.name = \"_Mesh_316\";\r\n_Mesh_316.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_316.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_316.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_641 = newComp.layers.addNull();\r\n_Mesh_641.threeDLayer = true;\r\n_Mesh_641.source.name = \"_Mesh_641\";\r\n_Mesh_641.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_641.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_641.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_310 = newComp.layers.addNull();\r\n_Mesh_310.threeDLayer = true;\r\n_Mesh_310.source.name = \"_Mesh_310\";\r\n_Mesh_310.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_310.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_310.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_647 = newComp.layers.addNull();\r\n_Mesh_647.threeDLayer = true;\r\n_Mesh_647.source.name = \"_Mesh_647\";\r\n_Mesh_647.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_647.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_647.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_644 = newComp.layers.addNull();\r\n_Mesh_644.threeDLayer = true;\r\n_Mesh_644.source.name = \"_Mesh_644\";\r\n_Mesh_644.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_644.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_644.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_645 = newComp.layers.addNull();\r\n_Mesh_645.threeDLayer = true;\r\n_Mesh_645.source.name = \"_Mesh_645\";\r\n_Mesh_645.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_645.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_645.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_648 = newComp.layers.addNull();\r\n_Mesh_648.threeDLayer = true;\r\n_Mesh_648.source.name = \"_Mesh_648\";\r\n_Mesh_648.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_648.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_648.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_649 = newComp.layers.addNull();\r\n_Mesh_649.threeDLayer = true;\r\n_Mesh_649.source.name = \"_Mesh_649\";\r\n_Mesh_649.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_649.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_649.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_318 = newComp.layers.addNull();\r\n_Mesh_318.threeDLayer = true;\r\n_Mesh_318.source.name = \"_Mesh_318\";\r\n_Mesh_318.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_318.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_318.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_319 = newComp.layers.addNull();\r\n_Mesh_319.threeDLayer = true;\r\n_Mesh_319.source.name = \"_Mesh_319\";\r\n_Mesh_319.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_319.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_319.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_314 = newComp.layers.addNull();\r\n_Mesh_314.threeDLayer = true;\r\n_Mesh_314.source.name = \"_Mesh_314\";\r\n_Mesh_314.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_314.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_314.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_315 = newComp.layers.addNull();\r\n_Mesh_315.threeDLayer = true;\r\n_Mesh_315.source.name = \"_Mesh_315\";\r\n_Mesh_315.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_315.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_315.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_640 = newComp.layers.addNull();\r\n_Mesh_640.threeDLayer = true;\r\n_Mesh_640.source.name = \"_Mesh_640\";\r\n_Mesh_640.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_640.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_640.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_317 = newComp.layers.addNull();\r\n_Mesh_317.threeDLayer = true;\r\n_Mesh_317.source.name = \"_Mesh_317\";\r\n_Mesh_317.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_317.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_317.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_646 = newComp.layers.addNull();\r\n_Mesh_646.threeDLayer = true;\r\n_Mesh_646.source.name = \"_Mesh_646\";\r\n_Mesh_646.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_646.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_646.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_311 = newComp.layers.addNull();\r\n_Mesh_311.threeDLayer = true;\r\n_Mesh_311.source.name = \"_Mesh_311\";\r\n_Mesh_311.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_311.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_311.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_312 = newComp.layers.addNull();\r\n_Mesh_312.threeDLayer = true;\r\n_Mesh_312.source.name = \"_Mesh_312\";\r\n_Mesh_312.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_312.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_312.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_313 = newComp.layers.addNull();\r\n_Mesh_313.threeDLayer = true;\r\n_Mesh_313.source.name = \"_Mesh_313\";\r\n_Mesh_313.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_313.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_313.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_798 = newComp.layers.addNull();\r\n_Mesh_798.threeDLayer = true;\r\n_Mesh_798.source.name = \"_Mesh_798\";\r\n_Mesh_798.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_798.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_798.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_799 = newComp.layers.addNull();\r\n_Mesh_799.threeDLayer = true;\r\n_Mesh_799.source.name = \"_Mesh_799\";\r\n_Mesh_799.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_799.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_799.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_790 = newComp.layers.addNull();\r\n_Mesh_790.threeDLayer = true;\r\n_Mesh_790.source.name = \"_Mesh_790\";\r\n_Mesh_790.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_790.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_790.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_791 = newComp.layers.addNull();\r\n_Mesh_791.threeDLayer = true;\r\n_Mesh_791.source.name = \"_Mesh_791\";\r\n_Mesh_791.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_791.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_791.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_792 = newComp.layers.addNull();\r\n_Mesh_792.threeDLayer = true;\r\n_Mesh_792.source.name = \"_Mesh_792\";\r\n_Mesh_792.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_792.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_792.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_793 = newComp.layers.addNull();\r\n_Mesh_793.threeDLayer = true;\r\n_Mesh_793.source.name = \"_Mesh_793\";\r\n_Mesh_793.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_793.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_793.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_794 = newComp.layers.addNull();\r\n_Mesh_794.threeDLayer = true;\r\n_Mesh_794.source.name = \"_Mesh_794\";\r\n_Mesh_794.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_794.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_794.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_795 = newComp.layers.addNull();\r\n_Mesh_795.threeDLayer = true;\r\n_Mesh_795.source.name = \"_Mesh_795\";\r\n_Mesh_795.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_795.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_795.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_796 = newComp.layers.addNull();\r\n_Mesh_796.threeDLayer = true;\r\n_Mesh_796.source.name = \"_Mesh_796\";\r\n_Mesh_796.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_796.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_796.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_797 = newComp.layers.addNull();\r\n_Mesh_797.threeDLayer = true;\r\n_Mesh_797.source.name = \"_Mesh_797\";\r\n_Mesh_797.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_797.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_797.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_001 = newComp.layers.addNull();\r\n_Mesh_001.threeDLayer = true;\r\n_Mesh_001.source.name = \"_Mesh_001\";\r\n_Mesh_001.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_001.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_001.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_002 = newComp.layers.addNull();\r\n_Mesh_002.threeDLayer = true;\r\n_Mesh_002.source.name = \"_Mesh_002\";\r\n_Mesh_002.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_002.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_002.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_003 = newComp.layers.addNull();\r\n_Mesh_003.threeDLayer = true;\r\n_Mesh_003.source.name = \"_Mesh_003\";\r\n_Mesh_003.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_003.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_003.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_004 = newComp.layers.addNull();\r\n_Mesh_004.threeDLayer = true;\r\n_Mesh_004.source.name = \"_Mesh_004\";\r\n_Mesh_004.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_004.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_004.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_005 = newComp.layers.addNull();\r\n_Mesh_005.threeDLayer = true;\r\n_Mesh_005.source.name = \"_Mesh_005\";\r\n_Mesh_005.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_005.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_005.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_006 = newComp.layers.addNull();\r\n_Mesh_006.threeDLayer = true;\r\n_Mesh_006.source.name = \"_Mesh_006\";\r\n_Mesh_006.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_006.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_006.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_007 = newComp.layers.addNull();\r\n_Mesh_007.threeDLayer = true;\r\n_Mesh_007.source.name = \"_Mesh_007\";\r\n_Mesh_007.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_007.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_007.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_008 = newComp.layers.addNull();\r\n_Mesh_008.threeDLayer = true;\r\n_Mesh_008.source.name = \"_Mesh_008\";\r\n_Mesh_008.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_008.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_008.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_009 = newComp.layers.addNull();\r\n_Mesh_009.threeDLayer = true;\r\n_Mesh_009.source.name = \"_Mesh_009\";\r\n_Mesh_009.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_009.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_009.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1486 = newComp.layers.addNull();\r\n_Mesh_1486.threeDLayer = true;\r\n_Mesh_1486.source.name = \"_Mesh_1486\";\r\n_Mesh_1486.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1486.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1486.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1487 = newComp.layers.addNull();\r\n_Mesh_1487.threeDLayer = true;\r\n_Mesh_1487.source.name = \"_Mesh_1487\";\r\n_Mesh_1487.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1487.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1487.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1484 = newComp.layers.addNull();\r\n_Mesh_1484.threeDLayer = true;\r\n_Mesh_1484.source.name = \"_Mesh_1484\";\r\n_Mesh_1484.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1484.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1484.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1485 = newComp.layers.addNull();\r\n_Mesh_1485.threeDLayer = true;\r\n_Mesh_1485.source.name = \"_Mesh_1485\";\r\n_Mesh_1485.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1485.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1485.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1482 = newComp.layers.addNull();\r\n_Mesh_1482.threeDLayer = true;\r\n_Mesh_1482.source.name = \"_Mesh_1482\";\r\n_Mesh_1482.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1482.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1482.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1483 = newComp.layers.addNull();\r\n_Mesh_1483.threeDLayer = true;\r\n_Mesh_1483.source.name = \"_Mesh_1483\";\r\n_Mesh_1483.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1483.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1483.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1480 = newComp.layers.addNull();\r\n_Mesh_1480.threeDLayer = true;\r\n_Mesh_1480.source.name = \"_Mesh_1480\";\r\n_Mesh_1480.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1480.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1480.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1481 = newComp.layers.addNull();\r\n_Mesh_1481.threeDLayer = true;\r\n_Mesh_1481.source.name = \"_Mesh_1481\";\r\n_Mesh_1481.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1481.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1481.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1488 = newComp.layers.addNull();\r\n_Mesh_1488.threeDLayer = true;\r\n_Mesh_1488.source.name = \"_Mesh_1488\";\r\n_Mesh_1488.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1488.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1488.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1489 = newComp.layers.addNull();\r\n_Mesh_1489.threeDLayer = true;\r\n_Mesh_1489.source.name = \"_Mesh_1489\";\r\n_Mesh_1489.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1489.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1489.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1370 = newComp.layers.addNull();\r\n_Mesh_1370.threeDLayer = true;\r\n_Mesh_1370.source.name = \"_Mesh_1370\";\r\n_Mesh_1370.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1370.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1370.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1371 = newComp.layers.addNull();\r\n_Mesh_1371.threeDLayer = true;\r\n_Mesh_1371.source.name = \"_Mesh_1371\";\r\n_Mesh_1371.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1371.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1371.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1372 = newComp.layers.addNull();\r\n_Mesh_1372.threeDLayer = true;\r\n_Mesh_1372.source.name = \"_Mesh_1372\";\r\n_Mesh_1372.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1372.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1372.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1373 = newComp.layers.addNull();\r\n_Mesh_1373.threeDLayer = true;\r\n_Mesh_1373.source.name = \"_Mesh_1373\";\r\n_Mesh_1373.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1373.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1373.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1374 = newComp.layers.addNull();\r\n_Mesh_1374.threeDLayer = true;\r\n_Mesh_1374.source.name = \"_Mesh_1374\";\r\n_Mesh_1374.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1374.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1374.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1375 = newComp.layers.addNull();\r\n_Mesh_1375.threeDLayer = true;\r\n_Mesh_1375.source.name = \"_Mesh_1375\";\r\n_Mesh_1375.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1375.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1375.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1376 = newComp.layers.addNull();\r\n_Mesh_1376.threeDLayer = true;\r\n_Mesh_1376.source.name = \"_Mesh_1376\";\r\n_Mesh_1376.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1376.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1376.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1377 = newComp.layers.addNull();\r\n_Mesh_1377.threeDLayer = true;\r\n_Mesh_1377.source.name = \"_Mesh_1377\";\r\n_Mesh_1377.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1377.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1377.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1378 = newComp.layers.addNull();\r\n_Mesh_1378.threeDLayer = true;\r\n_Mesh_1378.source.name = \"_Mesh_1378\";\r\n_Mesh_1378.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1378.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1378.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1379 = newComp.layers.addNull();\r\n_Mesh_1379.threeDLayer = true;\r\n_Mesh_1379.source.name = \"_Mesh_1379\";\r\n_Mesh_1379.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1379.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1379.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1159 = newComp.layers.addNull();\r\n_Mesh_1159.threeDLayer = true;\r\n_Mesh_1159.source.name = \"_Mesh_1159\";\r\n_Mesh_1159.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1159.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1159.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1150 = newComp.layers.addNull();\r\n_Mesh_1150.threeDLayer = true;\r\n_Mesh_1150.source.name = \"_Mesh_1150\";\r\n_Mesh_1150.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1150.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1150.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1151 = newComp.layers.addNull();\r\n_Mesh_1151.threeDLayer = true;\r\n_Mesh_1151.source.name = \"_Mesh_1151\";\r\n_Mesh_1151.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1151.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1151.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1152 = newComp.layers.addNull();\r\n_Mesh_1152.threeDLayer = true;\r\n_Mesh_1152.source.name = \"_Mesh_1152\";\r\n_Mesh_1152.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1152.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1152.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1153 = newComp.layers.addNull();\r\n_Mesh_1153.threeDLayer = true;\r\n_Mesh_1153.source.name = \"_Mesh_1153\";\r\n_Mesh_1153.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1153.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1153.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1154 = newComp.layers.addNull();\r\n_Mesh_1154.threeDLayer = true;\r\n_Mesh_1154.source.name = \"_Mesh_1154\";\r\n_Mesh_1154.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1154.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1154.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1155 = newComp.layers.addNull();\r\n_Mesh_1155.threeDLayer = true;\r\n_Mesh_1155.source.name = \"_Mesh_1155\";\r\n_Mesh_1155.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1155.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1155.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1156 = newComp.layers.addNull();\r\n_Mesh_1156.threeDLayer = true;\r\n_Mesh_1156.source.name = \"_Mesh_1156\";\r\n_Mesh_1156.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1156.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1156.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1398 = newComp.layers.addNull();\r\n_Mesh_1398.threeDLayer = true;\r\n_Mesh_1398.source.name = \"_Mesh_1398\";\r\n_Mesh_1398.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1398.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1398.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1399 = newComp.layers.addNull();\r\n_Mesh_1399.threeDLayer = true;\r\n_Mesh_1399.source.name = \"_Mesh_1399\";\r\n_Mesh_1399.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1399.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1399.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1392 = newComp.layers.addNull();\r\n_Mesh_1392.threeDLayer = true;\r\n_Mesh_1392.source.name = \"_Mesh_1392\";\r\n_Mesh_1392.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1392.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1392.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1393 = newComp.layers.addNull();\r\n_Mesh_1393.threeDLayer = true;\r\n_Mesh_1393.source.name = \"_Mesh_1393\";\r\n_Mesh_1393.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1393.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1393.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1390 = newComp.layers.addNull();\r\n_Mesh_1390.threeDLayer = true;\r\n_Mesh_1390.source.name = \"_Mesh_1390\";\r\n_Mesh_1390.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1390.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1390.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1391 = newComp.layers.addNull();\r\n_Mesh_1391.threeDLayer = true;\r\n_Mesh_1391.source.name = \"_Mesh_1391\";\r\n_Mesh_1391.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1391.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1391.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1396 = newComp.layers.addNull();\r\n_Mesh_1396.threeDLayer = true;\r\n_Mesh_1396.source.name = \"_Mesh_1396\";\r\n_Mesh_1396.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1396.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1396.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1397 = newComp.layers.addNull();\r\n_Mesh_1397.threeDLayer = true;\r\n_Mesh_1397.source.name = \"_Mesh_1397\";\r\n_Mesh_1397.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1397.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1397.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1394 = newComp.layers.addNull();\r\n_Mesh_1394.threeDLayer = true;\r\n_Mesh_1394.source.name = \"_Mesh_1394\";\r\n_Mesh_1394.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1394.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1394.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1395 = newComp.layers.addNull();\r\n_Mesh_1395.threeDLayer = true;\r\n_Mesh_1395.source.name = \"_Mesh_1395\";\r\n_Mesh_1395.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1395.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1395.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1028 = newComp.layers.addNull();\r\n_Mesh_1028.threeDLayer = true;\r\n_Mesh_1028.source.name = \"_Mesh_1028\";\r\n_Mesh_1028.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1028.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1028.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1029 = newComp.layers.addNull();\r\n_Mesh_1029.threeDLayer = true;\r\n_Mesh_1029.source.name = \"_Mesh_1029\";\r\n_Mesh_1029.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1029.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1029.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1024 = newComp.layers.addNull();\r\n_Mesh_1024.threeDLayer = true;\r\n_Mesh_1024.source.name = \"_Mesh_1024\";\r\n_Mesh_1024.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1024.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1024.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1025 = newComp.layers.addNull();\r\n_Mesh_1025.threeDLayer = true;\r\n_Mesh_1025.source.name = \"_Mesh_1025\";\r\n_Mesh_1025.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1025.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1025.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1026 = newComp.layers.addNull();\r\n_Mesh_1026.threeDLayer = true;\r\n_Mesh_1026.source.name = \"_Mesh_1026\";\r\n_Mesh_1026.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1026.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1026.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1027 = newComp.layers.addNull();\r\n_Mesh_1027.threeDLayer = true;\r\n_Mesh_1027.source.name = \"_Mesh_1027\";\r\n_Mesh_1027.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1027.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1027.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1020 = newComp.layers.addNull();\r\n_Mesh_1020.threeDLayer = true;\r\n_Mesh_1020.source.name = \"_Mesh_1020\";\r\n_Mesh_1020.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1020.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1020.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1021 = newComp.layers.addNull();\r\n_Mesh_1021.threeDLayer = true;\r\n_Mesh_1021.source.name = \"_Mesh_1021\";\r\n_Mesh_1021.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1021.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1021.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1022 = newComp.layers.addNull();\r\n_Mesh_1022.threeDLayer = true;\r\n_Mesh_1022.source.name = \"_Mesh_1022\";\r\n_Mesh_1022.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1022.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1022.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1023 = newComp.layers.addNull();\r\n_Mesh_1023.threeDLayer = true;\r\n_Mesh_1023.source.name = \"_Mesh_1023\";\r\n_Mesh_1023.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1023.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1023.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_817 = newComp.layers.addNull();\r\n_Mesh_817.threeDLayer = true;\r\n_Mesh_817.source.name = \"_Mesh_817\";\r\n_Mesh_817.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_817.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_817.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_816 = newComp.layers.addNull();\r\n_Mesh_816.threeDLayer = true;\r\n_Mesh_816.source.name = \"_Mesh_816\";\r\n_Mesh_816.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_816.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_816.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_815 = newComp.layers.addNull();\r\n_Mesh_815.threeDLayer = true;\r\n_Mesh_815.source.name = \"_Mesh_815\";\r\n_Mesh_815.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_815.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_815.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_814 = newComp.layers.addNull();\r\n_Mesh_814.threeDLayer = true;\r\n_Mesh_814.source.name = \"_Mesh_814\";\r\n_Mesh_814.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_814.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_814.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_813 = newComp.layers.addNull();\r\n_Mesh_813.threeDLayer = true;\r\n_Mesh_813.source.name = \"_Mesh_813\";\r\n_Mesh_813.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_813.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_813.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_812 = newComp.layers.addNull();\r\n_Mesh_812.threeDLayer = true;\r\n_Mesh_812.source.name = \"_Mesh_812\";\r\n_Mesh_812.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_812.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_812.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_811 = newComp.layers.addNull();\r\n_Mesh_811.threeDLayer = true;\r\n_Mesh_811.source.name = \"_Mesh_811\";\r\n_Mesh_811.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_811.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_811.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_810 = newComp.layers.addNull();\r\n_Mesh_810.threeDLayer = true;\r\n_Mesh_810.source.name = \"_Mesh_810\";\r\n_Mesh_810.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_810.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_810.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_819 = newComp.layers.addNull();\r\n_Mesh_819.threeDLayer = true;\r\n_Mesh_819.source.name = \"_Mesh_819\";\r\n_Mesh_819.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_819.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_819.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_818 = newComp.layers.addNull();\r\n_Mesh_818.threeDLayer = true;\r\n_Mesh_818.source.name = \"_Mesh_818\";\r\n_Mesh_818.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_818.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_818.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_259 = newComp.layers.addNull();\r\n_Mesh_259.threeDLayer = true;\r\n_Mesh_259.source.name = \"_Mesh_259\";\r\n_Mesh_259.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_259.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_259.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_258 = newComp.layers.addNull();\r\n_Mesh_258.threeDLayer = true;\r\n_Mesh_258.source.name = \"_Mesh_258\";\r\n_Mesh_258.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_258.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_258.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_255 = newComp.layers.addNull();\r\n_Mesh_255.threeDLayer = true;\r\n_Mesh_255.source.name = \"_Mesh_255\";\r\n_Mesh_255.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_255.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_255.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_254 = newComp.layers.addNull();\r\n_Mesh_254.threeDLayer = true;\r\n_Mesh_254.source.name = \"_Mesh_254\";\r\n_Mesh_254.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_254.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_254.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_257 = newComp.layers.addNull();\r\n_Mesh_257.threeDLayer = true;\r\n_Mesh_257.source.name = \"_Mesh_257\";\r\n_Mesh_257.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_257.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_257.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_256 = newComp.layers.addNull();\r\n_Mesh_256.threeDLayer = true;\r\n_Mesh_256.source.name = \"_Mesh_256\";\r\n_Mesh_256.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_256.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_256.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_251 = newComp.layers.addNull();\r\n_Mesh_251.threeDLayer = true;\r\n_Mesh_251.source.name = \"_Mesh_251\";\r\n_Mesh_251.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_251.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_251.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_250 = newComp.layers.addNull();\r\n_Mesh_250.threeDLayer = true;\r\n_Mesh_250.source.name = \"_Mesh_250\";\r\n_Mesh_250.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_250.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_250.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_253 = newComp.layers.addNull();\r\n_Mesh_253.threeDLayer = true;\r\n_Mesh_253.source.name = \"_Mesh_253\";\r\n_Mesh_253.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_253.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_253.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_252 = newComp.layers.addNull();\r\n_Mesh_252.threeDLayer = true;\r\n_Mesh_252.source.name = \"_Mesh_252\";\r\n_Mesh_252.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_252.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_252.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_499 = newComp.layers.addNull();\r\n_Mesh_499.threeDLayer = true;\r\n_Mesh_499.source.name = \"_Mesh_499\";\r\n_Mesh_499.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_499.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_499.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_498 = newComp.layers.addNull();\r\n_Mesh_498.threeDLayer = true;\r\n_Mesh_498.source.name = \"_Mesh_498\";\r\n_Mesh_498.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_498.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_498.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_493 = newComp.layers.addNull();\r\n_Mesh_493.threeDLayer = true;\r\n_Mesh_493.source.name = \"_Mesh_493\";\r\n_Mesh_493.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_493.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_493.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_492 = newComp.layers.addNull();\r\n_Mesh_492.threeDLayer = true;\r\n_Mesh_492.source.name = \"_Mesh_492\";\r\n_Mesh_492.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_492.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_492.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_491 = newComp.layers.addNull();\r\n_Mesh_491.threeDLayer = true;\r\n_Mesh_491.source.name = \"_Mesh_491\";\r\n_Mesh_491.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_491.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_491.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_490 = newComp.layers.addNull();\r\n_Mesh_490.threeDLayer = true;\r\n_Mesh_490.source.name = \"_Mesh_490\";\r\n_Mesh_490.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_490.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_490.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_497 = newComp.layers.addNull();\r\n_Mesh_497.threeDLayer = true;\r\n_Mesh_497.source.name = \"_Mesh_497\";\r\n_Mesh_497.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_497.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_497.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_496 = newComp.layers.addNull();\r\n_Mesh_496.threeDLayer = true;\r\n_Mesh_496.source.name = \"_Mesh_496\";\r\n_Mesh_496.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_496.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_496.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_495 = newComp.layers.addNull();\r\n_Mesh_495.threeDLayer = true;\r\n_Mesh_495.source.name = \"_Mesh_495\";\r\n_Mesh_495.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_495.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_495.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_494 = newComp.layers.addNull();\r\n_Mesh_494.threeDLayer = true;\r\n_Mesh_494.source.name = \"_Mesh_494\";\r\n_Mesh_494.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_494.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_494.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_679 = newComp.layers.addNull();\r\n_Mesh_679.threeDLayer = true;\r\n_Mesh_679.source.name = \"_Mesh_679\";\r\n_Mesh_679.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_679.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_679.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_678 = newComp.layers.addNull();\r\n_Mesh_678.threeDLayer = true;\r\n_Mesh_678.source.name = \"_Mesh_678\";\r\n_Mesh_678.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_678.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_678.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_677 = newComp.layers.addNull();\r\n_Mesh_677.threeDLayer = true;\r\n_Mesh_677.source.name = \"_Mesh_677\";\r\n_Mesh_677.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_677.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_677.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_676 = newComp.layers.addNull();\r\n_Mesh_676.threeDLayer = true;\r\n_Mesh_676.source.name = \"_Mesh_676\";\r\n_Mesh_676.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_676.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_676.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_675 = newComp.layers.addNull();\r\n_Mesh_675.threeDLayer = true;\r\n_Mesh_675.source.name = \"_Mesh_675\";\r\n_Mesh_675.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_675.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_675.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_674 = newComp.layers.addNull();\r\n_Mesh_674.threeDLayer = true;\r\n_Mesh_674.source.name = \"_Mesh_674\";\r\n_Mesh_674.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_674.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_674.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_673 = newComp.layers.addNull();\r\n_Mesh_673.threeDLayer = true;\r\n_Mesh_673.source.name = \"_Mesh_673\";\r\n_Mesh_673.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_673.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_673.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_672 = newComp.layers.addNull();\r\n_Mesh_672.threeDLayer = true;\r\n_Mesh_672.source.name = \"_Mesh_672\";\r\n_Mesh_672.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_672.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_672.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_671 = newComp.layers.addNull();\r\n_Mesh_671.threeDLayer = true;\r\n_Mesh_671.source.name = \"_Mesh_671\";\r\n_Mesh_671.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_671.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_671.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_670 = newComp.layers.addNull();\r\n_Mesh_670.threeDLayer = true;\r\n_Mesh_670.source.name = \"_Mesh_670\";\r\n_Mesh_670.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_670.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_670.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_075 = newComp.layers.addNull();\r\n_Mesh_075.threeDLayer = true;\r\n_Mesh_075.source.name = \"_Mesh_075\";\r\n_Mesh_075.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_075.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_075.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_074 = newComp.layers.addNull();\r\n_Mesh_074.threeDLayer = true;\r\n_Mesh_074.source.name = \"_Mesh_074\";\r\n_Mesh_074.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_074.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_074.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_077 = newComp.layers.addNull();\r\n_Mesh_077.threeDLayer = true;\r\n_Mesh_077.source.name = \"_Mesh_077\";\r\n_Mesh_077.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_077.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_077.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_076 = newComp.layers.addNull();\r\n_Mesh_076.threeDLayer = true;\r\n_Mesh_076.source.name = \"_Mesh_076\";\r\n_Mesh_076.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_076.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_076.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_071 = newComp.layers.addNull();\r\n_Mesh_071.threeDLayer = true;\r\n_Mesh_071.source.name = \"_Mesh_071\";\r\n_Mesh_071.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_071.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_071.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_070 = newComp.layers.addNull();\r\n_Mesh_070.threeDLayer = true;\r\n_Mesh_070.source.name = \"_Mesh_070\";\r\n_Mesh_070.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_070.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_070.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_073 = newComp.layers.addNull();\r\n_Mesh_073.threeDLayer = true;\r\n_Mesh_073.source.name = \"_Mesh_073\";\r\n_Mesh_073.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_073.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_073.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_072 = newComp.layers.addNull();\r\n_Mesh_072.threeDLayer = true;\r\n_Mesh_072.source.name = \"_Mesh_072\";\r\n_Mesh_072.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_072.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_072.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_079 = newComp.layers.addNull();\r\n_Mesh_079.threeDLayer = true;\r\n_Mesh_079.source.name = \"_Mesh_079\";\r\n_Mesh_079.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_079.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_079.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_078 = newComp.layers.addNull();\r\n_Mesh_078.threeDLayer = true;\r\n_Mesh_078.source.name = \"_Mesh_078\";\r\n_Mesh_078.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_078.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_078.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_109 = newComp.layers.addNull();\r\n_Mesh_109.threeDLayer = true;\r\n_Mesh_109.source.name = \"_Mesh_109\";\r\n_Mesh_109.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_109.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_109.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_108 = newComp.layers.addNull();\r\n_Mesh_108.threeDLayer = true;\r\n_Mesh_108.source.name = \"_Mesh_108\";\r\n_Mesh_108.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_108.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_108.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_101 = newComp.layers.addNull();\r\n_Mesh_101.threeDLayer = true;\r\n_Mesh_101.source.name = \"_Mesh_101\";\r\n_Mesh_101.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_101.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_101.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_100 = newComp.layers.addNull();\r\n_Mesh_100.threeDLayer = true;\r\n_Mesh_100.source.name = \"_Mesh_100\";\r\n_Mesh_100.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_100.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_100.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_103 = newComp.layers.addNull();\r\n_Mesh_103.threeDLayer = true;\r\n_Mesh_103.source.name = \"_Mesh_103\";\r\n_Mesh_103.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_103.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_103.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_102 = newComp.layers.addNull();\r\n_Mesh_102.threeDLayer = true;\r\n_Mesh_102.source.name = \"_Mesh_102\";\r\n_Mesh_102.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_102.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_102.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_105 = newComp.layers.addNull();\r\n_Mesh_105.threeDLayer = true;\r\n_Mesh_105.source.name = \"_Mesh_105\";\r\n_Mesh_105.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_105.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_105.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_104 = newComp.layers.addNull();\r\n_Mesh_104.threeDLayer = true;\r\n_Mesh_104.source.name = \"_Mesh_104\";\r\n_Mesh_104.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_104.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_104.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_107 = newComp.layers.addNull();\r\n_Mesh_107.threeDLayer = true;\r\n_Mesh_107.source.name = \"_Mesh_107\";\r\n_Mesh_107.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_107.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_107.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_106 = newComp.layers.addNull();\r\n_Mesh_106.threeDLayer = true;\r\n_Mesh_106.source.name = \"_Mesh_106\";\r\n_Mesh_106.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_106.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_106.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1495 = newComp.layers.addNull();\r\n_Mesh_1495.threeDLayer = true;\r\n_Mesh_1495.source.name = \"_Mesh_1495\";\r\n_Mesh_1495.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1495.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1495.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1494 = newComp.layers.addNull();\r\n_Mesh_1494.threeDLayer = true;\r\n_Mesh_1494.source.name = \"_Mesh_1494\";\r\n_Mesh_1494.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1494.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1494.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1497 = newComp.layers.addNull();\r\n_Mesh_1497.threeDLayer = true;\r\n_Mesh_1497.source.name = \"_Mesh_1497\";\r\n_Mesh_1497.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1497.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1497.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1496 = newComp.layers.addNull();\r\n_Mesh_1496.threeDLayer = true;\r\n_Mesh_1496.source.name = \"_Mesh_1496\";\r\n_Mesh_1496.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1496.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1496.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1491 = newComp.layers.addNull();\r\n_Mesh_1491.threeDLayer = true;\r\n_Mesh_1491.source.name = \"_Mesh_1491\";\r\n_Mesh_1491.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1491.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1491.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1490 = newComp.layers.addNull();\r\n_Mesh_1490.threeDLayer = true;\r\n_Mesh_1490.source.name = \"_Mesh_1490\";\r\n_Mesh_1490.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1490.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1490.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1493 = newComp.layers.addNull();\r\n_Mesh_1493.threeDLayer = true;\r\n_Mesh_1493.source.name = \"_Mesh_1493\";\r\n_Mesh_1493.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1493.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1493.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1492 = newComp.layers.addNull();\r\n_Mesh_1492.threeDLayer = true;\r\n_Mesh_1492.source.name = \"_Mesh_1492\";\r\n_Mesh_1492.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1492.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1492.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1499 = newComp.layers.addNull();\r\n_Mesh_1499.threeDLayer = true;\r\n_Mesh_1499.source.name = \"_Mesh_1499\";\r\n_Mesh_1499.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1499.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1499.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1498 = newComp.layers.addNull();\r\n_Mesh_1498.threeDLayer = true;\r\n_Mesh_1498.source.name = \"_Mesh_1498\";\r\n_Mesh_1498.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1498.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1498.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1367 = newComp.layers.addNull();\r\n_Mesh_1367.threeDLayer = true;\r\n_Mesh_1367.source.name = \"_Mesh_1367\";\r\n_Mesh_1367.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1367.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1367.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1366 = newComp.layers.addNull();\r\n_Mesh_1366.threeDLayer = true;\r\n_Mesh_1366.source.name = \"_Mesh_1366\";\r\n_Mesh_1366.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1366.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1366.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1365 = newComp.layers.addNull();\r\n_Mesh_1365.threeDLayer = true;\r\n_Mesh_1365.source.name = \"_Mesh_1365\";\r\n_Mesh_1365.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1365.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1365.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1364 = newComp.layers.addNull();\r\n_Mesh_1364.threeDLayer = true;\r\n_Mesh_1364.source.name = \"_Mesh_1364\";\r\n_Mesh_1364.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1364.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1364.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1363 = newComp.layers.addNull();\r\n_Mesh_1363.threeDLayer = true;\r\n_Mesh_1363.source.name = \"_Mesh_1363\";\r\n_Mesh_1363.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1363.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1363.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1362 = newComp.layers.addNull();\r\n_Mesh_1362.threeDLayer = true;\r\n_Mesh_1362.source.name = \"_Mesh_1362\";\r\n_Mesh_1362.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1362.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1362.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1361 = newComp.layers.addNull();\r\n_Mesh_1361.threeDLayer = true;\r\n_Mesh_1361.source.name = \"_Mesh_1361\";\r\n_Mesh_1361.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1361.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1361.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1360 = newComp.layers.addNull();\r\n_Mesh_1360.threeDLayer = true;\r\n_Mesh_1360.source.name = \"_Mesh_1360\";\r\n_Mesh_1360.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1360.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1360.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1369 = newComp.layers.addNull();\r\n_Mesh_1369.threeDLayer = true;\r\n_Mesh_1369.source.name = \"_Mesh_1369\";\r\n_Mesh_1369.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1369.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1369.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1368 = newComp.layers.addNull();\r\n_Mesh_1368.threeDLayer = true;\r\n_Mesh_1368.source.name = \"_Mesh_1368\";\r\n_Mesh_1368.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1368.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1368.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1149 = newComp.layers.addNull();\r\n_Mesh_1149.threeDLayer = true;\r\n_Mesh_1149.source.name = \"_Mesh_1149\";\r\n_Mesh_1149.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1149.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1149.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1148 = newComp.layers.addNull();\r\n_Mesh_1148.threeDLayer = true;\r\n_Mesh_1148.source.name = \"_Mesh_1148\";\r\n_Mesh_1148.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1148.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1148.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1147 = newComp.layers.addNull();\r\n_Mesh_1147.threeDLayer = true;\r\n_Mesh_1147.source.name = \"_Mesh_1147\";\r\n_Mesh_1147.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1147.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1147.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1146 = newComp.layers.addNull();\r\n_Mesh_1146.threeDLayer = true;\r\n_Mesh_1146.source.name = \"_Mesh_1146\";\r\n_Mesh_1146.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1146.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1146.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1145 = newComp.layers.addNull();\r\n_Mesh_1145.threeDLayer = true;\r\n_Mesh_1145.source.name = \"_Mesh_1145\";\r\n_Mesh_1145.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1145.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1145.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1144 = newComp.layers.addNull();\r\n_Mesh_1144.threeDLayer = true;\r\n_Mesh_1144.source.name = \"_Mesh_1144\";\r\n_Mesh_1144.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1144.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1144.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1143 = newComp.layers.addNull();\r\n_Mesh_1143.threeDLayer = true;\r\n_Mesh_1143.source.name = \"_Mesh_1143\";\r\n_Mesh_1143.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1143.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1143.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1142 = newComp.layers.addNull();\r\n_Mesh_1142.threeDLayer = true;\r\n_Mesh_1142.source.name = \"_Mesh_1142\";\r\n_Mesh_1142.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1142.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1142.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1141 = newComp.layers.addNull();\r\n_Mesh_1141.threeDLayer = true;\r\n_Mesh_1141.source.name = \"_Mesh_1141\";\r\n_Mesh_1141.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1141.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1141.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1140 = newComp.layers.addNull();\r\n_Mesh_1140.threeDLayer = true;\r\n_Mesh_1140.source.name = \"_Mesh_1140\";\r\n_Mesh_1140.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1140.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1140.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1389 = newComp.layers.addNull();\r\n_Mesh_1389.threeDLayer = true;\r\n_Mesh_1389.source.name = \"_Mesh_1389\";\r\n_Mesh_1389.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1389.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1389.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1388 = newComp.layers.addNull();\r\n_Mesh_1388.threeDLayer = true;\r\n_Mesh_1388.source.name = \"_Mesh_1388\";\r\n_Mesh_1388.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1388.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1388.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1381 = newComp.layers.addNull();\r\n_Mesh_1381.threeDLayer = true;\r\n_Mesh_1381.source.name = \"_Mesh_1381\";\r\n_Mesh_1381.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1381.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1381.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1380 = newComp.layers.addNull();\r\n_Mesh_1380.threeDLayer = true;\r\n_Mesh_1380.source.name = \"_Mesh_1380\";\r\n_Mesh_1380.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1380.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1380.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1383 = newComp.layers.addNull();\r\n_Mesh_1383.threeDLayer = true;\r\n_Mesh_1383.source.name = \"_Mesh_1383\";\r\n_Mesh_1383.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1383.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1383.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1382 = newComp.layers.addNull();\r\n_Mesh_1382.threeDLayer = true;\r\n_Mesh_1382.source.name = \"_Mesh_1382\";\r\n_Mesh_1382.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1382.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1382.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1385 = newComp.layers.addNull();\r\n_Mesh_1385.threeDLayer = true;\r\n_Mesh_1385.source.name = \"_Mesh_1385\";\r\n_Mesh_1385.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1385.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1385.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1384 = newComp.layers.addNull();\r\n_Mesh_1384.threeDLayer = true;\r\n_Mesh_1384.source.name = \"_Mesh_1384\";\r\n_Mesh_1384.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1384.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1384.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1387 = newComp.layers.addNull();\r\n_Mesh_1387.threeDLayer = true;\r\n_Mesh_1387.source.name = \"_Mesh_1387\";\r\n_Mesh_1387.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1387.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1387.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1386 = newComp.layers.addNull();\r\n_Mesh_1386.threeDLayer = true;\r\n_Mesh_1386.source.name = \"_Mesh_1386\";\r\n_Mesh_1386.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1386.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1386.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1033 = newComp.layers.addNull();\r\n_Mesh_1033.threeDLayer = true;\r\n_Mesh_1033.source.name = \"_Mesh_1033\";\r\n_Mesh_1033.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1033.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1033.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1032 = newComp.layers.addNull();\r\n_Mesh_1032.threeDLayer = true;\r\n_Mesh_1032.source.name = \"_Mesh_1032\";\r\n_Mesh_1032.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1032.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1032.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1031 = newComp.layers.addNull();\r\n_Mesh_1031.threeDLayer = true;\r\n_Mesh_1031.source.name = \"_Mesh_1031\";\r\n_Mesh_1031.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1031.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1031.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1030 = newComp.layers.addNull();\r\n_Mesh_1030.threeDLayer = true;\r\n_Mesh_1030.source.name = \"_Mesh_1030\";\r\n_Mesh_1030.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1030.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1030.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1037 = newComp.layers.addNull();\r\n_Mesh_1037.threeDLayer = true;\r\n_Mesh_1037.source.name = \"_Mesh_1037\";\r\n_Mesh_1037.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1037.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1037.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1036 = newComp.layers.addNull();\r\n_Mesh_1036.threeDLayer = true;\r\n_Mesh_1036.source.name = \"_Mesh_1036\";\r\n_Mesh_1036.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1036.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1036.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1035 = newComp.layers.addNull();\r\n_Mesh_1035.threeDLayer = true;\r\n_Mesh_1035.source.name = \"_Mesh_1035\";\r\n_Mesh_1035.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1035.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1035.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1034 = newComp.layers.addNull();\r\n_Mesh_1034.threeDLayer = true;\r\n_Mesh_1034.source.name = \"_Mesh_1034\";\r\n_Mesh_1034.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1034.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1034.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1039 = newComp.layers.addNull();\r\n_Mesh_1039.threeDLayer = true;\r\n_Mesh_1039.source.name = \"_Mesh_1039\";\r\n_Mesh_1039.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1039.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1039.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1038 = newComp.layers.addNull();\r\n_Mesh_1038.threeDLayer = true;\r\n_Mesh_1038.source.name = \"_Mesh_1038\";\r\n_Mesh_1038.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1038.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1038.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_248 = newComp.layers.addNull();\r\n_Mesh_248.threeDLayer = true;\r\n_Mesh_248.source.name = \"_Mesh_248\";\r\n_Mesh_248.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_248.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_248.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_249 = newComp.layers.addNull();\r\n_Mesh_249.threeDLayer = true;\r\n_Mesh_249.source.name = \"_Mesh_249\";\r\n_Mesh_249.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_249.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_249.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_246 = newComp.layers.addNull();\r\n_Mesh_246.threeDLayer = true;\r\n_Mesh_246.source.name = \"_Mesh_246\";\r\n_Mesh_246.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_246.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_246.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_247 = newComp.layers.addNull();\r\n_Mesh_247.threeDLayer = true;\r\n_Mesh_247.source.name = \"_Mesh_247\";\r\n_Mesh_247.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_247.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_247.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_244 = newComp.layers.addNull();\r\n_Mesh_244.threeDLayer = true;\r\n_Mesh_244.source.name = \"_Mesh_244\";\r\n_Mesh_244.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_244.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_244.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_245 = newComp.layers.addNull();\r\n_Mesh_245.threeDLayer = true;\r\n_Mesh_245.source.name = \"_Mesh_245\";\r\n_Mesh_245.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_245.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_245.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_242 = newComp.layers.addNull();\r\n_Mesh_242.threeDLayer = true;\r\n_Mesh_242.source.name = \"_Mesh_242\";\r\n_Mesh_242.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_242.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_242.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_243 = newComp.layers.addNull();\r\n_Mesh_243.threeDLayer = true;\r\n_Mesh_243.source.name = \"_Mesh_243\";\r\n_Mesh_243.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_243.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_243.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_240 = newComp.layers.addNull();\r\n_Mesh_240.threeDLayer = true;\r\n_Mesh_240.source.name = \"_Mesh_240\";\r\n_Mesh_240.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_240.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_240.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_241 = newComp.layers.addNull();\r\n_Mesh_241.threeDLayer = true;\r\n_Mesh_241.source.name = \"_Mesh_241\";\r\n_Mesh_241.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_241.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_241.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_488 = newComp.layers.addNull();\r\n_Mesh_488.threeDLayer = true;\r\n_Mesh_488.source.name = \"_Mesh_488\";\r\n_Mesh_488.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_488.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_488.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_489 = newComp.layers.addNull();\r\n_Mesh_489.threeDLayer = true;\r\n_Mesh_489.source.name = \"_Mesh_489\";\r\n_Mesh_489.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_489.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_489.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_484 = newComp.layers.addNull();\r\n_Mesh_484.threeDLayer = true;\r\n_Mesh_484.source.name = \"_Mesh_484\";\r\n_Mesh_484.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_484.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_484.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_485 = newComp.layers.addNull();\r\n_Mesh_485.threeDLayer = true;\r\n_Mesh_485.source.name = \"_Mesh_485\";\r\n_Mesh_485.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_485.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_485.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_486 = newComp.layers.addNull();\r\n_Mesh_486.threeDLayer = true;\r\n_Mesh_486.source.name = \"_Mesh_486\";\r\n_Mesh_486.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_486.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_486.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_487 = newComp.layers.addNull();\r\n_Mesh_487.threeDLayer = true;\r\n_Mesh_487.source.name = \"_Mesh_487\";\r\n_Mesh_487.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_487.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_487.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_480 = newComp.layers.addNull();\r\n_Mesh_480.threeDLayer = true;\r\n_Mesh_480.source.name = \"_Mesh_480\";\r\n_Mesh_480.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_480.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_480.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_481 = newComp.layers.addNull();\r\n_Mesh_481.threeDLayer = true;\r\n_Mesh_481.source.name = \"_Mesh_481\";\r\n_Mesh_481.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_481.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_481.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_482 = newComp.layers.addNull();\r\n_Mesh_482.threeDLayer = true;\r\n_Mesh_482.source.name = \"_Mesh_482\";\r\n_Mesh_482.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_482.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_482.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_483 = newComp.layers.addNull();\r\n_Mesh_483.threeDLayer = true;\r\n_Mesh_483.source.name = \"_Mesh_483\";\r\n_Mesh_483.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_483.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_483.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_808 = newComp.layers.addNull();\r\n_Mesh_808.threeDLayer = true;\r\n_Mesh_808.source.name = \"_Mesh_808\";\r\n_Mesh_808.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_808.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_808.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_809 = newComp.layers.addNull();\r\n_Mesh_809.threeDLayer = true;\r\n_Mesh_809.source.name = \"_Mesh_809\";\r\n_Mesh_809.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_809.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_809.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_800 = newComp.layers.addNull();\r\n_Mesh_800.threeDLayer = true;\r\n_Mesh_800.source.name = \"_Mesh_800\";\r\n_Mesh_800.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_800.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_800.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_801 = newComp.layers.addNull();\r\n_Mesh_801.threeDLayer = true;\r\n_Mesh_801.source.name = \"_Mesh_801\";\r\n_Mesh_801.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_801.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_801.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_802 = newComp.layers.addNull();\r\n_Mesh_802.threeDLayer = true;\r\n_Mesh_802.source.name = \"_Mesh_802\";\r\n_Mesh_802.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_802.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_802.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_803 = newComp.layers.addNull();\r\n_Mesh_803.threeDLayer = true;\r\n_Mesh_803.source.name = \"_Mesh_803\";\r\n_Mesh_803.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_803.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_803.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_804 = newComp.layers.addNull();\r\n_Mesh_804.threeDLayer = true;\r\n_Mesh_804.source.name = \"_Mesh_804\";\r\n_Mesh_804.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_804.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_804.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_805 = newComp.layers.addNull();\r\n_Mesh_805.threeDLayer = true;\r\n_Mesh_805.source.name = \"_Mesh_805\";\r\n_Mesh_805.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_805.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_805.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_806 = newComp.layers.addNull();\r\n_Mesh_806.threeDLayer = true;\r\n_Mesh_806.source.name = \"_Mesh_806\";\r\n_Mesh_806.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_806.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_806.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_807 = newComp.layers.addNull();\r\n_Mesh_807.threeDLayer = true;\r\n_Mesh_807.source.name = \"_Mesh_807\";\r\n_Mesh_807.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_807.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_807.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_660 = newComp.layers.addNull();\r\n_Mesh_660.threeDLayer = true;\r\n_Mesh_660.source.name = \"_Mesh_660\";\r\n_Mesh_660.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_660.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_660.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_661 = newComp.layers.addNull();\r\n_Mesh_661.threeDLayer = true;\r\n_Mesh_661.source.name = \"_Mesh_661\";\r\n_Mesh_661.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_661.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_661.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_662 = newComp.layers.addNull();\r\n_Mesh_662.threeDLayer = true;\r\n_Mesh_662.source.name = \"_Mesh_662\";\r\n_Mesh_662.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_662.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_662.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_663 = newComp.layers.addNull();\r\n_Mesh_663.threeDLayer = true;\r\n_Mesh_663.source.name = \"_Mesh_663\";\r\n_Mesh_663.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_663.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_663.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_664 = newComp.layers.addNull();\r\n_Mesh_664.threeDLayer = true;\r\n_Mesh_664.source.name = \"_Mesh_664\";\r\n_Mesh_664.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_664.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_664.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_665 = newComp.layers.addNull();\r\n_Mesh_665.threeDLayer = true;\r\n_Mesh_665.source.name = \"_Mesh_665\";\r\n_Mesh_665.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_665.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_665.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_666 = newComp.layers.addNull();\r\n_Mesh_666.threeDLayer = true;\r\n_Mesh_666.source.name = \"_Mesh_666\";\r\n_Mesh_666.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_666.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_666.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_667 = newComp.layers.addNull();\r\n_Mesh_667.threeDLayer = true;\r\n_Mesh_667.source.name = \"_Mesh_667\";\r\n_Mesh_667.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_667.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_667.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_668 = newComp.layers.addNull();\r\n_Mesh_668.threeDLayer = true;\r\n_Mesh_668.source.name = \"_Mesh_668\";\r\n_Mesh_668.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_668.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_668.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_669 = newComp.layers.addNull();\r\n_Mesh_669.threeDLayer = true;\r\n_Mesh_669.source.name = \"_Mesh_669\";\r\n_Mesh_669.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_669.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_669.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_066 = newComp.layers.addNull();\r\n_Mesh_066.threeDLayer = true;\r\n_Mesh_066.source.name = \"_Mesh_066\";\r\n_Mesh_066.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_066.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_066.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_067 = newComp.layers.addNull();\r\n_Mesh_067.threeDLayer = true;\r\n_Mesh_067.source.name = \"_Mesh_067\";\r\n_Mesh_067.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_067.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_067.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_064 = newComp.layers.addNull();\r\n_Mesh_064.threeDLayer = true;\r\n_Mesh_064.source.name = \"_Mesh_064\";\r\n_Mesh_064.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_064.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_064.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_065 = newComp.layers.addNull();\r\n_Mesh_065.threeDLayer = true;\r\n_Mesh_065.source.name = \"_Mesh_065\";\r\n_Mesh_065.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_065.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_065.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_062 = newComp.layers.addNull();\r\n_Mesh_062.threeDLayer = true;\r\n_Mesh_062.source.name = \"_Mesh_062\";\r\n_Mesh_062.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_062.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_062.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_063 = newComp.layers.addNull();\r\n_Mesh_063.threeDLayer = true;\r\n_Mesh_063.source.name = \"_Mesh_063\";\r\n_Mesh_063.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_063.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_063.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_060 = newComp.layers.addNull();\r\n_Mesh_060.threeDLayer = true;\r\n_Mesh_060.source.name = \"_Mesh_060\";\r\n_Mesh_060.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_060.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_060.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_068 = newComp.layers.addNull();\r\n_Mesh_068.threeDLayer = true;\r\n_Mesh_068.source.name = \"_Mesh_068\";\r\n_Mesh_068.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_068.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_068.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_069 = newComp.layers.addNull();\r\n_Mesh_069.threeDLayer = true;\r\n_Mesh_069.source.name = \"_Mesh_069\";\r\n_Mesh_069.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_069.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_069.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_118 = newComp.layers.addNull();\r\n_Mesh_118.threeDLayer = true;\r\n_Mesh_118.source.name = \"_Mesh_118\";\r\n_Mesh_118.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_118.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_118.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_119 = newComp.layers.addNull();\r\n_Mesh_119.threeDLayer = true;\r\n_Mesh_119.source.name = \"_Mesh_119\";\r\n_Mesh_119.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_119.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_119.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_112 = newComp.layers.addNull();\r\n_Mesh_112.threeDLayer = true;\r\n_Mesh_112.source.name = \"_Mesh_112\";\r\n_Mesh_112.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_112.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_112.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_113 = newComp.layers.addNull();\r\n_Mesh_113.threeDLayer = true;\r\n_Mesh_113.source.name = \"_Mesh_113\";\r\n_Mesh_113.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_113.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_113.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_110 = newComp.layers.addNull();\r\n_Mesh_110.threeDLayer = true;\r\n_Mesh_110.source.name = \"_Mesh_110\";\r\n_Mesh_110.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_110.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_110.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_111 = newComp.layers.addNull();\r\n_Mesh_111.threeDLayer = true;\r\n_Mesh_111.source.name = \"_Mesh_111\";\r\n_Mesh_111.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_111.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_111.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_116 = newComp.layers.addNull();\r\n_Mesh_116.threeDLayer = true;\r\n_Mesh_116.source.name = \"_Mesh_116\";\r\n_Mesh_116.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_116.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_116.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_117 = newComp.layers.addNull();\r\n_Mesh_117.threeDLayer = true;\r\n_Mesh_117.source.name = \"_Mesh_117\";\r\n_Mesh_117.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_117.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_117.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_114 = newComp.layers.addNull();\r\n_Mesh_114.threeDLayer = true;\r\n_Mesh_114.source.name = \"_Mesh_114\";\r\n_Mesh_114.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_114.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_114.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_115 = newComp.layers.addNull();\r\n_Mesh_115.threeDLayer = true;\r\n_Mesh_115.source.name = \"_Mesh_115\";\r\n_Mesh_115.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_115.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_115.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_650 = newComp.layers.addNull();\r\n_Mesh_650.threeDLayer = true;\r\n_Mesh_650.source.name = \"_Mesh_650\";\r\n_Mesh_650.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_650.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_650.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1047 = newComp.layers.addNull();\r\n_Mesh_1047.threeDLayer = true;\r\n_Mesh_1047.source.name = \"_Mesh_1047\";\r\n_Mesh_1047.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1047.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1047.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1044 = newComp.layers.addNull();\r\n_Mesh_1044.threeDLayer = true;\r\n_Mesh_1044.source.name = \"_Mesh_1044\";\r\n_Mesh_1044.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1044.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1044.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1045 = newComp.layers.addNull();\r\n_Mesh_1045.threeDLayer = true;\r\n_Mesh_1045.source.name = \"_Mesh_1045\";\r\n_Mesh_1045.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1045.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1045.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1042 = newComp.layers.addNull();\r\n_Mesh_1042.threeDLayer = true;\r\n_Mesh_1042.source.name = \"_Mesh_1042\";\r\n_Mesh_1042.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1042.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1042.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1043 = newComp.layers.addNull();\r\n_Mesh_1043.threeDLayer = true;\r\n_Mesh_1043.source.name = \"_Mesh_1043\";\r\n_Mesh_1043.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1043.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1043.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1040 = newComp.layers.addNull();\r\n_Mesh_1040.threeDLayer = true;\r\n_Mesh_1040.source.name = \"_Mesh_1040\";\r\n_Mesh_1040.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1040.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1040.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1041 = newComp.layers.addNull();\r\n_Mesh_1041.threeDLayer = true;\r\n_Mesh_1041.source.name = \"_Mesh_1041\";\r\n_Mesh_1041.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1041.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1041.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1048 = newComp.layers.addNull();\r\n_Mesh_1048.threeDLayer = true;\r\n_Mesh_1048.source.name = \"_Mesh_1048\";\r\n_Mesh_1048.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1048.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1048.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1049 = newComp.layers.addNull();\r\n_Mesh_1049.threeDLayer = true;\r\n_Mesh_1049.source.name = \"_Mesh_1049\";\r\n_Mesh_1049.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1049.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1049.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_901 = newComp.layers.addNull();\r\n_Mesh_901.threeDLayer = true;\r\n_Mesh_901.source.name = \"_Mesh_901\";\r\n_Mesh_901.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_901.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_901.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_900 = newComp.layers.addNull();\r\n_Mesh_900.threeDLayer = true;\r\n_Mesh_900.source.name = \"_Mesh_900\";\r\n_Mesh_900.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_900.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_900.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_271 = newComp.layers.addNull();\r\n_Mesh_271.threeDLayer = true;\r\n_Mesh_271.source.name = \"_Mesh_271\";\r\n_Mesh_271.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_271.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_271.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_902 = newComp.layers.addNull();\r\n_Mesh_902.threeDLayer = true;\r\n_Mesh_902.source.name = \"_Mesh_902\";\r\n_Mesh_902.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_902.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_902.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_905 = newComp.layers.addNull();\r\n_Mesh_905.threeDLayer = true;\r\n_Mesh_905.source.name = \"_Mesh_905\";\r\n_Mesh_905.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_905.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_905.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_904 = newComp.layers.addNull();\r\n_Mesh_904.threeDLayer = true;\r\n_Mesh_904.source.name = \"_Mesh_904\";\r\n_Mesh_904.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_904.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_904.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_907 = newComp.layers.addNull();\r\n_Mesh_907.threeDLayer = true;\r\n_Mesh_907.source.name = \"_Mesh_907\";\r\n_Mesh_907.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_907.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_907.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_906 = newComp.layers.addNull();\r\n_Mesh_906.threeDLayer = true;\r\n_Mesh_906.source.name = \"_Mesh_906\";\r\n_Mesh_906.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_906.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_906.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_273 = newComp.layers.addNull();\r\n_Mesh_273.threeDLayer = true;\r\n_Mesh_273.source.name = \"_Mesh_273\";\r\n_Mesh_273.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_273.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_273.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_272 = newComp.layers.addNull();\r\n_Mesh_272.threeDLayer = true;\r\n_Mesh_272.source.name = \"_Mesh_272\";\r\n_Mesh_272.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_272.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_272.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_903 = newComp.layers.addNull();\r\n_Mesh_903.threeDLayer = true;\r\n_Mesh_903.source.name = \"_Mesh_903\";\r\n_Mesh_903.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_903.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_903.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_270 = newComp.layers.addNull();\r\n_Mesh_270.threeDLayer = true;\r\n_Mesh_270.source.name = \"_Mesh_270\";\r\n_Mesh_270.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_270.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_270.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_277 = newComp.layers.addNull();\r\n_Mesh_277.threeDLayer = true;\r\n_Mesh_277.source.name = \"_Mesh_277\";\r\n_Mesh_277.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_277.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_277.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_276 = newComp.layers.addNull();\r\n_Mesh_276.threeDLayer = true;\r\n_Mesh_276.source.name = \"_Mesh_276\";\r\n_Mesh_276.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_276.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_276.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_275 = newComp.layers.addNull();\r\n_Mesh_275.threeDLayer = true;\r\n_Mesh_275.source.name = \"_Mesh_275\";\r\n_Mesh_275.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_275.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_275.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_274 = newComp.layers.addNull();\r\n_Mesh_274.threeDLayer = true;\r\n_Mesh_274.source.name = \"_Mesh_274\";\r\n_Mesh_274.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_274.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_274.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_909 = newComp.layers.addNull();\r\n_Mesh_909.threeDLayer = true;\r\n_Mesh_909.source.name = \"_Mesh_909\";\r\n_Mesh_909.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_909.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_909.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_908 = newComp.layers.addNull();\r\n_Mesh_908.threeDLayer = true;\r\n_Mesh_908.source.name = \"_Mesh_908\";\r\n_Mesh_908.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_908.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_908.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_279 = newComp.layers.addNull();\r\n_Mesh_279.threeDLayer = true;\r\n_Mesh_279.source.name = \"_Mesh_279\";\r\n_Mesh_279.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_279.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_279.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_278 = newComp.layers.addNull();\r\n_Mesh_278.threeDLayer = true;\r\n_Mesh_278.source.name = \"_Mesh_278\";\r\n_Mesh_278.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_278.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_278.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_471 = newComp.layers.addNull();\r\n_Mesh_471.threeDLayer = true;\r\n_Mesh_471.source.name = \"_Mesh_471\";\r\n_Mesh_471.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_471.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_471.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_470 = newComp.layers.addNull();\r\n_Mesh_470.threeDLayer = true;\r\n_Mesh_470.source.name = \"_Mesh_470\";\r\n_Mesh_470.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_470.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_470.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_473 = newComp.layers.addNull();\r\n_Mesh_473.threeDLayer = true;\r\n_Mesh_473.source.name = \"_Mesh_473\";\r\n_Mesh_473.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_473.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_473.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_472 = newComp.layers.addNull();\r\n_Mesh_472.threeDLayer = true;\r\n_Mesh_472.source.name = \"_Mesh_472\";\r\n_Mesh_472.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_472.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_472.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_475 = newComp.layers.addNull();\r\n_Mesh_475.threeDLayer = true;\r\n_Mesh_475.source.name = \"_Mesh_475\";\r\n_Mesh_475.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_475.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_475.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_474 = newComp.layers.addNull();\r\n_Mesh_474.threeDLayer = true;\r\n_Mesh_474.source.name = \"_Mesh_474\";\r\n_Mesh_474.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_474.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_474.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_477 = newComp.layers.addNull();\r\n_Mesh_477.threeDLayer = true;\r\n_Mesh_477.source.name = \"_Mesh_477\";\r\n_Mesh_477.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_477.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_477.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_476 = newComp.layers.addNull();\r\n_Mesh_476.threeDLayer = true;\r\n_Mesh_476.source.name = \"_Mesh_476\";\r\n_Mesh_476.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_476.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_476.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_479 = newComp.layers.addNull();\r\n_Mesh_479.threeDLayer = true;\r\n_Mesh_479.source.name = \"_Mesh_479\";\r\n_Mesh_479.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_479.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_479.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_478 = newComp.layers.addNull();\r\n_Mesh_478.threeDLayer = true;\r\n_Mesh_478.source.name = \"_Mesh_478\";\r\n_Mesh_478.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_478.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_478.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_090 = newComp.layers.addNull();\r\n_Mesh_090.threeDLayer = true;\r\n_Mesh_090.source.name = \"_Mesh_090\";\r\n_Mesh_090.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_090.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_090.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_879 = newComp.layers.addNull();\r\n_Mesh_879.threeDLayer = true;\r\n_Mesh_879.source.name = \"_Mesh_879\";\r\n_Mesh_879.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_879.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_879.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_878 = newComp.layers.addNull();\r\n_Mesh_878.threeDLayer = true;\r\n_Mesh_878.source.name = \"_Mesh_878\";\r\n_Mesh_878.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_878.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_878.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_875 = newComp.layers.addNull();\r\n_Mesh_875.threeDLayer = true;\r\n_Mesh_875.source.name = \"_Mesh_875\";\r\n_Mesh_875.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_875.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_875.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_874 = newComp.layers.addNull();\r\n_Mesh_874.threeDLayer = true;\r\n_Mesh_874.source.name = \"_Mesh_874\";\r\n_Mesh_874.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_874.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_874.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_877 = newComp.layers.addNull();\r\n_Mesh_877.threeDLayer = true;\r\n_Mesh_877.source.name = \"_Mesh_877\";\r\n_Mesh_877.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_877.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_877.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_876 = newComp.layers.addNull();\r\n_Mesh_876.threeDLayer = true;\r\n_Mesh_876.source.name = \"_Mesh_876\";\r\n_Mesh_876.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_876.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_876.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_871 = newComp.layers.addNull();\r\n_Mesh_871.threeDLayer = true;\r\n_Mesh_871.source.name = \"_Mesh_871\";\r\n_Mesh_871.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_871.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_871.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_870 = newComp.layers.addNull();\r\n_Mesh_870.threeDLayer = true;\r\n_Mesh_870.source.name = \"_Mesh_870\";\r\n_Mesh_870.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_870.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_870.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_873 = newComp.layers.addNull();\r\n_Mesh_873.threeDLayer = true;\r\n_Mesh_873.source.name = \"_Mesh_873\";\r\n_Mesh_873.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_873.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_873.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_872 = newComp.layers.addNull();\r\n_Mesh_872.threeDLayer = true;\r\n_Mesh_872.source.name = \"_Mesh_872\";\r\n_Mesh_872.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_872.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_872.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_615 = newComp.layers.addNull();\r\n_Mesh_615.threeDLayer = true;\r\n_Mesh_615.source.name = \"_Mesh_615\";\r\n_Mesh_615.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_615.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_615.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_614 = newComp.layers.addNull();\r\n_Mesh_614.threeDLayer = true;\r\n_Mesh_614.source.name = \"_Mesh_614\";\r\n_Mesh_614.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_614.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_614.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_617 = newComp.layers.addNull();\r\n_Mesh_617.threeDLayer = true;\r\n_Mesh_617.source.name = \"_Mesh_617\";\r\n_Mesh_617.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_617.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_617.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_616 = newComp.layers.addNull();\r\n_Mesh_616.threeDLayer = true;\r\n_Mesh_616.source.name = \"_Mesh_616\";\r\n_Mesh_616.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_616.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_616.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_611 = newComp.layers.addNull();\r\n_Mesh_611.threeDLayer = true;\r\n_Mesh_611.source.name = \"_Mesh_611\";\r\n_Mesh_611.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_611.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_611.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_610 = newComp.layers.addNull();\r\n_Mesh_610.threeDLayer = true;\r\n_Mesh_610.source.name = \"_Mesh_610\";\r\n_Mesh_610.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_610.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_610.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_613 = newComp.layers.addNull();\r\n_Mesh_613.threeDLayer = true;\r\n_Mesh_613.source.name = \"_Mesh_613\";\r\n_Mesh_613.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_613.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_613.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_612 = newComp.layers.addNull();\r\n_Mesh_612.threeDLayer = true;\r\n_Mesh_612.source.name = \"_Mesh_612\";\r\n_Mesh_612.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_612.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_612.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_619 = newComp.layers.addNull();\r\n_Mesh_619.threeDLayer = true;\r\n_Mesh_619.source.name = \"_Mesh_619\";\r\n_Mesh_619.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_619.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_619.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_618 = newComp.layers.addNull();\r\n_Mesh_618.threeDLayer = true;\r\n_Mesh_618.source.name = \"_Mesh_618\";\r\n_Mesh_618.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_618.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_618.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_585 = newComp.layers.addNull();\r\n_Mesh_585.threeDLayer = true;\r\n_Mesh_585.source.name = \"_Mesh_585\";\r\n_Mesh_585.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_585.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_585.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_584 = newComp.layers.addNull();\r\n_Mesh_584.threeDLayer = true;\r\n_Mesh_584.source.name = \"_Mesh_584\";\r\n_Mesh_584.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_584.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_584.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_587 = newComp.layers.addNull();\r\n_Mesh_587.threeDLayer = true;\r\n_Mesh_587.source.name = \"_Mesh_587\";\r\n_Mesh_587.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_587.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_587.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_586 = newComp.layers.addNull();\r\n_Mesh_586.threeDLayer = true;\r\n_Mesh_586.source.name = \"_Mesh_586\";\r\n_Mesh_586.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_586.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_586.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_581 = newComp.layers.addNull();\r\n_Mesh_581.threeDLayer = true;\r\n_Mesh_581.source.name = \"_Mesh_581\";\r\n_Mesh_581.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_581.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_581.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_580 = newComp.layers.addNull();\r\n_Mesh_580.threeDLayer = true;\r\n_Mesh_580.source.name = \"_Mesh_580\";\r\n_Mesh_580.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_580.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_580.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_583 = newComp.layers.addNull();\r\n_Mesh_583.threeDLayer = true;\r\n_Mesh_583.source.name = \"_Mesh_583\";\r\n_Mesh_583.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_583.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_583.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_582 = newComp.layers.addNull();\r\n_Mesh_582.threeDLayer = true;\r\n_Mesh_582.source.name = \"_Mesh_582\";\r\n_Mesh_582.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_582.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_582.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_589 = newComp.layers.addNull();\r\n_Mesh_589.threeDLayer = true;\r\n_Mesh_589.source.name = \"_Mesh_589\";\r\n_Mesh_589.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_589.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_589.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_588 = newComp.layers.addNull();\r\n_Mesh_588.threeDLayer = true;\r\n_Mesh_588.source.name = \"_Mesh_588\";\r\n_Mesh_588.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_588.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_588.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_729 = newComp.layers.addNull();\r\n_Mesh_729.threeDLayer = true;\r\n_Mesh_729.source.name = \"_Mesh_729\";\r\n_Mesh_729.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_729.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_729.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_728 = newComp.layers.addNull();\r\n_Mesh_728.threeDLayer = true;\r\n_Mesh_728.source.name = \"_Mesh_728\";\r\n_Mesh_728.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_728.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_728.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_059 = newComp.layers.addNull();\r\n_Mesh_059.threeDLayer = true;\r\n_Mesh_059.source.name = \"_Mesh_059\";\r\n_Mesh_059.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_059.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_059.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_721 = newComp.layers.addNull();\r\n_Mesh_721.threeDLayer = true;\r\n_Mesh_721.source.name = \"_Mesh_721\";\r\n_Mesh_721.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_721.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_721.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_720 = newComp.layers.addNull();\r\n_Mesh_720.threeDLayer = true;\r\n_Mesh_720.source.name = \"_Mesh_720\";\r\n_Mesh_720.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_720.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_720.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_722 = newComp.layers.addNull();\r\n_Mesh_722.threeDLayer = true;\r\n_Mesh_722.source.name = \"_Mesh_722\";\r\n_Mesh_722.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_722.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_722.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_725 = newComp.layers.addNull();\r\n_Mesh_725.threeDLayer = true;\r\n_Mesh_725.source.name = \"_Mesh_725\";\r\n_Mesh_725.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_725.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_725.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_056 = newComp.layers.addNull();\r\n_Mesh_056.threeDLayer = true;\r\n_Mesh_056.source.name = \"_Mesh_056\";\r\n_Mesh_056.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_056.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_056.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_727 = newComp.layers.addNull();\r\n_Mesh_727.threeDLayer = true;\r\n_Mesh_727.source.name = \"_Mesh_727\";\r\n_Mesh_727.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_727.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_727.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_726 = newComp.layers.addNull();\r\n_Mesh_726.threeDLayer = true;\r\n_Mesh_726.source.name = \"_Mesh_726\";\r\n_Mesh_726.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_726.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_726.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_299 = newComp.layers.addNull();\r\n_Mesh_299.threeDLayer = true;\r\n_Mesh_299.source.name = \"_Mesh_299\";\r\n_Mesh_299.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_299.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_299.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_298 = newComp.layers.addNull();\r\n_Mesh_298.threeDLayer = true;\r\n_Mesh_298.source.name = \"_Mesh_298\";\r\n_Mesh_298.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_298.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_298.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_291 = newComp.layers.addNull();\r\n_Mesh_291.threeDLayer = true;\r\n_Mesh_291.source.name = \"_Mesh_291\";\r\n_Mesh_291.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_291.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_291.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_290 = newComp.layers.addNull();\r\n_Mesh_290.threeDLayer = true;\r\n_Mesh_290.source.name = \"_Mesh_290\";\r\n_Mesh_290.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_290.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_290.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_293 = newComp.layers.addNull();\r\n_Mesh_293.threeDLayer = true;\r\n_Mesh_293.source.name = \"_Mesh_293\";\r\n_Mesh_293.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_293.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_293.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_292 = newComp.layers.addNull();\r\n_Mesh_292.threeDLayer = true;\r\n_Mesh_292.source.name = \"_Mesh_292\";\r\n_Mesh_292.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_292.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_292.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_295 = newComp.layers.addNull();\r\n_Mesh_295.threeDLayer = true;\r\n_Mesh_295.source.name = \"_Mesh_295\";\r\n_Mesh_295.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_295.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_295.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_294 = newComp.layers.addNull();\r\n_Mesh_294.threeDLayer = true;\r\n_Mesh_294.source.name = \"_Mesh_294\";\r\n_Mesh_294.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_294.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_294.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_297 = newComp.layers.addNull();\r\n_Mesh_297.threeDLayer = true;\r\n_Mesh_297.source.name = \"_Mesh_297\";\r\n_Mesh_297.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_297.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_297.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_296 = newComp.layers.addNull();\r\n_Mesh_296.threeDLayer = true;\r\n_Mesh_296.source.name = \"_Mesh_296\";\r\n_Mesh_296.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_296.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_296.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_129 = newComp.layers.addNull();\r\n_Mesh_129.threeDLayer = true;\r\n_Mesh_129.source.name = \"_Mesh_129\";\r\n_Mesh_129.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_129.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_129.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_128 = newComp.layers.addNull();\r\n_Mesh_128.threeDLayer = true;\r\n_Mesh_128.source.name = \"_Mesh_128\";\r\n_Mesh_128.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_128.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_128.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_127 = newComp.layers.addNull();\r\n_Mesh_127.threeDLayer = true;\r\n_Mesh_127.source.name = \"_Mesh_127\";\r\n_Mesh_127.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_127.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_127.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_126 = newComp.layers.addNull();\r\n_Mesh_126.threeDLayer = true;\r\n_Mesh_126.source.name = \"_Mesh_126\";\r\n_Mesh_126.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_126.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_126.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_125 = newComp.layers.addNull();\r\n_Mesh_125.threeDLayer = true;\r\n_Mesh_125.source.name = \"_Mesh_125\";\r\n_Mesh_125.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_125.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_125.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_124 = newComp.layers.addNull();\r\n_Mesh_124.threeDLayer = true;\r\n_Mesh_124.source.name = \"_Mesh_124\";\r\n_Mesh_124.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_124.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_124.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_123 = newComp.layers.addNull();\r\n_Mesh_123.threeDLayer = true;\r\n_Mesh_123.source.name = \"_Mesh_123\";\r\n_Mesh_123.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_123.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_123.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_122 = newComp.layers.addNull();\r\n_Mesh_122.threeDLayer = true;\r\n_Mesh_122.source.name = \"_Mesh_122\";\r\n_Mesh_122.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_122.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_122.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_121 = newComp.layers.addNull();\r\n_Mesh_121.threeDLayer = true;\r\n_Mesh_121.source.name = \"_Mesh_121\";\r\n_Mesh_121.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_121.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_121.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_120 = newComp.layers.addNull();\r\n_Mesh_120.threeDLayer = true;\r\n_Mesh_120.source.name = \"_Mesh_120\";\r\n_Mesh_120.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_120.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_120.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1055 = newComp.layers.addNull();\r\n_Mesh_1055.threeDLayer = true;\r\n_Mesh_1055.source.name = \"_Mesh_1055\";\r\n_Mesh_1055.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1055.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1055.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1054 = newComp.layers.addNull();\r\n_Mesh_1054.threeDLayer = true;\r\n_Mesh_1054.source.name = \"_Mesh_1054\";\r\n_Mesh_1054.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1054.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1054.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1057 = newComp.layers.addNull();\r\n_Mesh_1057.threeDLayer = true;\r\n_Mesh_1057.source.name = \"_Mesh_1057\";\r\n_Mesh_1057.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1057.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1057.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1050 = newComp.layers.addNull();\r\n_Mesh_1050.threeDLayer = true;\r\n_Mesh_1050.source.name = \"_Mesh_1050\";\r\n_Mesh_1050.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1050.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1050.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1053 = newComp.layers.addNull();\r\n_Mesh_1053.threeDLayer = true;\r\n_Mesh_1053.source.name = \"_Mesh_1053\";\r\n_Mesh_1053.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1053.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1053.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1058 = newComp.layers.addNull();\r\n_Mesh_1058.threeDLayer = true;\r\n_Mesh_1058.source.name = \"_Mesh_1058\";\r\n_Mesh_1058.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1058.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1058.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_264 = newComp.layers.addNull();\r\n_Mesh_264.threeDLayer = true;\r\n_Mesh_264.source.name = \"_Mesh_264\";\r\n_Mesh_264.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_264.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_264.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_265 = newComp.layers.addNull();\r\n_Mesh_265.threeDLayer = true;\r\n_Mesh_265.source.name = \"_Mesh_265\";\r\n_Mesh_265.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_265.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_265.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_266 = newComp.layers.addNull();\r\n_Mesh_266.threeDLayer = true;\r\n_Mesh_266.source.name = \"_Mesh_266\";\r\n_Mesh_266.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_266.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_266.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_267 = newComp.layers.addNull();\r\n_Mesh_267.threeDLayer = true;\r\n_Mesh_267.source.name = \"_Mesh_267\";\r\n_Mesh_267.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_267.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_267.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_260 = newComp.layers.addNull();\r\n_Mesh_260.threeDLayer = true;\r\n_Mesh_260.source.name = \"_Mesh_260\";\r\n_Mesh_260.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_260.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_260.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_261 = newComp.layers.addNull();\r\n_Mesh_261.threeDLayer = true;\r\n_Mesh_261.source.name = \"_Mesh_261\";\r\n_Mesh_261.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_261.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_261.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_262 = newComp.layers.addNull();\r\n_Mesh_262.threeDLayer = true;\r\n_Mesh_262.source.name = \"_Mesh_262\";\r\n_Mesh_262.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_262.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_262.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_263 = newComp.layers.addNull();\r\n_Mesh_263.threeDLayer = true;\r\n_Mesh_263.source.name = \"_Mesh_263\";\r\n_Mesh_263.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_263.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_263.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_918 = newComp.layers.addNull();\r\n_Mesh_918.threeDLayer = true;\r\n_Mesh_918.source.name = \"_Mesh_918\";\r\n_Mesh_918.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_918.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_918.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_919 = newComp.layers.addNull();\r\n_Mesh_919.threeDLayer = true;\r\n_Mesh_919.source.name = \"_Mesh_919\";\r\n_Mesh_919.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_919.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_919.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_268 = newComp.layers.addNull();\r\n_Mesh_268.threeDLayer = true;\r\n_Mesh_268.source.name = \"_Mesh_268\";\r\n_Mesh_268.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_268.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_268.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_269 = newComp.layers.addNull();\r\n_Mesh_269.threeDLayer = true;\r\n_Mesh_269.source.name = \"_Mesh_269\";\r\n_Mesh_269.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_269.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_269.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_462 = newComp.layers.addNull();\r\n_Mesh_462.threeDLayer = true;\r\n_Mesh_462.source.name = \"_Mesh_462\";\r\n_Mesh_462.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_462.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_462.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_463 = newComp.layers.addNull();\r\n_Mesh_463.threeDLayer = true;\r\n_Mesh_463.source.name = \"_Mesh_463\";\r\n_Mesh_463.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_463.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_463.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_460 = newComp.layers.addNull();\r\n_Mesh_460.threeDLayer = true;\r\n_Mesh_460.source.name = \"_Mesh_460\";\r\n_Mesh_460.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_460.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_460.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_461 = newComp.layers.addNull();\r\n_Mesh_461.threeDLayer = true;\r\n_Mesh_461.source.name = \"_Mesh_461\";\r\n_Mesh_461.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_461.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_461.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_466 = newComp.layers.addNull();\r\n_Mesh_466.threeDLayer = true;\r\n_Mesh_466.source.name = \"_Mesh_466\";\r\n_Mesh_466.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_466.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_466.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_467 = newComp.layers.addNull();\r\n_Mesh_467.threeDLayer = true;\r\n_Mesh_467.source.name = \"_Mesh_467\";\r\n_Mesh_467.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_467.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_467.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_464 = newComp.layers.addNull();\r\n_Mesh_464.threeDLayer = true;\r\n_Mesh_464.source.name = \"_Mesh_464\";\r\n_Mesh_464.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_464.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_464.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_465 = newComp.layers.addNull();\r\n_Mesh_465.threeDLayer = true;\r\n_Mesh_465.source.name = \"_Mesh_465\";\r\n_Mesh_465.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_465.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_465.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_468 = newComp.layers.addNull();\r\n_Mesh_468.threeDLayer = true;\r\n_Mesh_468.source.name = \"_Mesh_468\";\r\n_Mesh_468.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_468.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_468.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_469 = newComp.layers.addNull();\r\n_Mesh_469.threeDLayer = true;\r\n_Mesh_469.source.name = \"_Mesh_469\";\r\n_Mesh_469.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_469.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_469.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_868 = newComp.layers.addNull();\r\n_Mesh_868.threeDLayer = true;\r\n_Mesh_868.source.name = \"_Mesh_868\";\r\n_Mesh_868.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_868.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_868.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_869 = newComp.layers.addNull();\r\n_Mesh_869.threeDLayer = true;\r\n_Mesh_869.source.name = \"_Mesh_869\";\r\n_Mesh_869.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_869.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_869.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_866 = newComp.layers.addNull();\r\n_Mesh_866.threeDLayer = true;\r\n_Mesh_866.source.name = \"_Mesh_866\";\r\n_Mesh_866.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_866.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_866.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_867 = newComp.layers.addNull();\r\n_Mesh_867.threeDLayer = true;\r\n_Mesh_867.source.name = \"_Mesh_867\";\r\n_Mesh_867.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_867.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_867.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_864 = newComp.layers.addNull();\r\n_Mesh_864.threeDLayer = true;\r\n_Mesh_864.source.name = \"_Mesh_864\";\r\n_Mesh_864.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_864.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_864.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_865 = newComp.layers.addNull();\r\n_Mesh_865.threeDLayer = true;\r\n_Mesh_865.source.name = \"_Mesh_865\";\r\n_Mesh_865.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_865.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_865.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_862 = newComp.layers.addNull();\r\n_Mesh_862.threeDLayer = true;\r\n_Mesh_862.source.name = \"_Mesh_862\";\r\n_Mesh_862.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_862.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_862.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_863 = newComp.layers.addNull();\r\n_Mesh_863.threeDLayer = true;\r\n_Mesh_863.source.name = \"_Mesh_863\";\r\n_Mesh_863.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_863.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_863.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_860 = newComp.layers.addNull();\r\n_Mesh_860.threeDLayer = true;\r\n_Mesh_860.source.name = \"_Mesh_860\";\r\n_Mesh_860.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_860.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_860.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_861 = newComp.layers.addNull();\r\n_Mesh_861.threeDLayer = true;\r\n_Mesh_861.source.name = \"_Mesh_861\";\r\n_Mesh_861.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_861.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_861.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_606 = newComp.layers.addNull();\r\n_Mesh_606.threeDLayer = true;\r\n_Mesh_606.source.name = \"_Mesh_606\";\r\n_Mesh_606.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_606.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_606.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_607 = newComp.layers.addNull();\r\n_Mesh_607.threeDLayer = true;\r\n_Mesh_607.source.name = \"_Mesh_607\";\r\n_Mesh_607.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_607.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_607.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_604 = newComp.layers.addNull();\r\n_Mesh_604.threeDLayer = true;\r\n_Mesh_604.source.name = \"_Mesh_604\";\r\n_Mesh_604.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_604.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_604.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_605 = newComp.layers.addNull();\r\n_Mesh_605.threeDLayer = true;\r\n_Mesh_605.source.name = \"_Mesh_605\";\r\n_Mesh_605.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_605.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_605.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_602 = newComp.layers.addNull();\r\n_Mesh_602.threeDLayer = true;\r\n_Mesh_602.source.name = \"_Mesh_602\";\r\n_Mesh_602.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_602.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_602.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_603 = newComp.layers.addNull();\r\n_Mesh_603.threeDLayer = true;\r\n_Mesh_603.source.name = \"_Mesh_603\";\r\n_Mesh_603.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_603.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_603.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_600 = newComp.layers.addNull();\r\n_Mesh_600.threeDLayer = true;\r\n_Mesh_600.source.name = \"_Mesh_600\";\r\n_Mesh_600.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_600.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_600.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_601 = newComp.layers.addNull();\r\n_Mesh_601.threeDLayer = true;\r\n_Mesh_601.source.name = \"_Mesh_601\";\r\n_Mesh_601.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_601.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_601.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_608 = newComp.layers.addNull();\r\n_Mesh_608.threeDLayer = true;\r\n_Mesh_608.source.name = \"_Mesh_608\";\r\n_Mesh_608.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_608.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_608.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_609 = newComp.layers.addNull();\r\n_Mesh_609.threeDLayer = true;\r\n_Mesh_609.source.name = \"_Mesh_609\";\r\n_Mesh_609.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_609.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_609.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_596 = newComp.layers.addNull();\r\n_Mesh_596.threeDLayer = true;\r\n_Mesh_596.source.name = \"_Mesh_596\";\r\n_Mesh_596.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_596.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_596.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_597 = newComp.layers.addNull();\r\n_Mesh_597.threeDLayer = true;\r\n_Mesh_597.source.name = \"_Mesh_597\";\r\n_Mesh_597.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_597.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_597.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_594 = newComp.layers.addNull();\r\n_Mesh_594.threeDLayer = true;\r\n_Mesh_594.source.name = \"_Mesh_594\";\r\n_Mesh_594.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_594.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_594.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_595 = newComp.layers.addNull();\r\n_Mesh_595.threeDLayer = true;\r\n_Mesh_595.source.name = \"_Mesh_595\";\r\n_Mesh_595.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_595.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_595.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_592 = newComp.layers.addNull();\r\n_Mesh_592.threeDLayer = true;\r\n_Mesh_592.source.name = \"_Mesh_592\";\r\n_Mesh_592.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_592.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_592.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_593 = newComp.layers.addNull();\r\n_Mesh_593.threeDLayer = true;\r\n_Mesh_593.source.name = \"_Mesh_593\";\r\n_Mesh_593.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_593.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_593.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_590 = newComp.layers.addNull();\r\n_Mesh_590.threeDLayer = true;\r\n_Mesh_590.source.name = \"_Mesh_590\";\r\n_Mesh_590.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_590.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_590.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_591 = newComp.layers.addNull();\r\n_Mesh_591.threeDLayer = true;\r\n_Mesh_591.source.name = \"_Mesh_591\";\r\n_Mesh_591.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_591.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_591.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_598 = newComp.layers.addNull();\r\n_Mesh_598.threeDLayer = true;\r\n_Mesh_598.source.name = \"_Mesh_598\";\r\n_Mesh_598.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_598.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_598.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_599 = newComp.layers.addNull();\r\n_Mesh_599.threeDLayer = true;\r\n_Mesh_599.source.name = \"_Mesh_599\";\r\n_Mesh_599.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_599.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_599.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_738 = newComp.layers.addNull();\r\n_Mesh_738.threeDLayer = true;\r\n_Mesh_738.source.name = \"_Mesh_738\";\r\n_Mesh_738.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_738.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_738.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_739 = newComp.layers.addNull();\r\n_Mesh_739.threeDLayer = true;\r\n_Mesh_739.source.name = \"_Mesh_739\";\r\n_Mesh_739.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_739.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_739.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_048 = newComp.layers.addNull();\r\n_Mesh_048.threeDLayer = true;\r\n_Mesh_048.source.name = \"_Mesh_048\";\r\n_Mesh_048.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_048.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_048.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_049 = newComp.layers.addNull();\r\n_Mesh_049.threeDLayer = true;\r\n_Mesh_049.source.name = \"_Mesh_049\";\r\n_Mesh_049.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_049.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_049.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_732 = newComp.layers.addNull();\r\n_Mesh_732.threeDLayer = true;\r\n_Mesh_732.source.name = \"_Mesh_732\";\r\n_Mesh_732.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_732.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_732.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_733 = newComp.layers.addNull();\r\n_Mesh_733.threeDLayer = true;\r\n_Mesh_733.source.name = \"_Mesh_733\";\r\n_Mesh_733.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_733.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_733.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_046 = newComp.layers.addNull();\r\n_Mesh_046.threeDLayer = true;\r\n_Mesh_046.source.name = \"_Mesh_046\";\r\n_Mesh_046.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_046.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_046.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_047 = newComp.layers.addNull();\r\n_Mesh_047.threeDLayer = true;\r\n_Mesh_047.source.name = \"_Mesh_047\";\r\n_Mesh_047.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_047.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_047.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_736 = newComp.layers.addNull();\r\n_Mesh_736.threeDLayer = true;\r\n_Mesh_736.source.name = \"_Mesh_736\";\r\n_Mesh_736.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_736.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_736.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_737 = newComp.layers.addNull();\r\n_Mesh_737.threeDLayer = true;\r\n_Mesh_737.source.name = \"_Mesh_737\";\r\n_Mesh_737.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_737.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_737.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_734 = newComp.layers.addNull();\r\n_Mesh_734.threeDLayer = true;\r\n_Mesh_734.source.name = \"_Mesh_734\";\r\n_Mesh_734.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_734.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_734.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_735 = newComp.layers.addNull();\r\n_Mesh_735.threeDLayer = true;\r\n_Mesh_735.source.name = \"_Mesh_735\";\r\n_Mesh_735.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_735.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_735.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_288 = newComp.layers.addNull();\r\n_Mesh_288.threeDLayer = true;\r\n_Mesh_288.source.name = \"_Mesh_288\";\r\n_Mesh_288.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_288.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_288.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_289 = newComp.layers.addNull();\r\n_Mesh_289.threeDLayer = true;\r\n_Mesh_289.source.name = \"_Mesh_289\";\r\n_Mesh_289.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_289.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_289.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_282 = newComp.layers.addNull();\r\n_Mesh_282.threeDLayer = true;\r\n_Mesh_282.source.name = \"_Mesh_282\";\r\n_Mesh_282.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_282.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_282.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_283 = newComp.layers.addNull();\r\n_Mesh_283.threeDLayer = true;\r\n_Mesh_283.source.name = \"_Mesh_283\";\r\n_Mesh_283.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_283.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_283.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_280 = newComp.layers.addNull();\r\n_Mesh_280.threeDLayer = true;\r\n_Mesh_280.source.name = \"_Mesh_280\";\r\n_Mesh_280.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_280.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_280.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_281 = newComp.layers.addNull();\r\n_Mesh_281.threeDLayer = true;\r\n_Mesh_281.source.name = \"_Mesh_281\";\r\n_Mesh_281.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_281.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_281.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_286 = newComp.layers.addNull();\r\n_Mesh_286.threeDLayer = true;\r\n_Mesh_286.source.name = \"_Mesh_286\";\r\n_Mesh_286.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_286.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_286.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_287 = newComp.layers.addNull();\r\n_Mesh_287.threeDLayer = true;\r\n_Mesh_287.source.name = \"_Mesh_287\";\r\n_Mesh_287.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_287.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_287.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_284 = newComp.layers.addNull();\r\n_Mesh_284.threeDLayer = true;\r\n_Mesh_284.source.name = \"_Mesh_284\";\r\n_Mesh_284.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_284.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_284.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_285 = newComp.layers.addNull();\r\n_Mesh_285.threeDLayer = true;\r\n_Mesh_285.source.name = \"_Mesh_285\";\r\n_Mesh_285.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_285.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_285.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_130 = newComp.layers.addNull();\r\n_Mesh_130.threeDLayer = true;\r\n_Mesh_130.source.name = \"_Mesh_130\";\r\n_Mesh_130.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_130.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_130.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_131 = newComp.layers.addNull();\r\n_Mesh_131.threeDLayer = true;\r\n_Mesh_131.source.name = \"_Mesh_131\";\r\n_Mesh_131.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_131.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_131.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_132 = newComp.layers.addNull();\r\n_Mesh_132.threeDLayer = true;\r\n_Mesh_132.source.name = \"_Mesh_132\";\r\n_Mesh_132.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_132.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_132.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_133 = newComp.layers.addNull();\r\n_Mesh_133.threeDLayer = true;\r\n_Mesh_133.source.name = \"_Mesh_133\";\r\n_Mesh_133.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_133.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_133.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_134 = newComp.layers.addNull();\r\n_Mesh_134.threeDLayer = true;\r\n_Mesh_134.source.name = \"_Mesh_134\";\r\n_Mesh_134.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_134.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_134.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_135 = newComp.layers.addNull();\r\n_Mesh_135.threeDLayer = true;\r\n_Mesh_135.source.name = \"_Mesh_135\";\r\n_Mesh_135.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_135.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_135.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_136 = newComp.layers.addNull();\r\n_Mesh_136.threeDLayer = true;\r\n_Mesh_136.source.name = \"_Mesh_136\";\r\n_Mesh_136.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_136.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_136.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_137 = newComp.layers.addNull();\r\n_Mesh_137.threeDLayer = true;\r\n_Mesh_137.source.name = \"_Mesh_137\";\r\n_Mesh_137.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_137.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_137.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_138 = newComp.layers.addNull();\r\n_Mesh_138.threeDLayer = true;\r\n_Mesh_138.source.name = \"_Mesh_138\";\r\n_Mesh_138.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_138.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_138.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_139 = newComp.layers.addNull();\r\n_Mesh_139.threeDLayer = true;\r\n_Mesh_139.source.name = \"_Mesh_139\";\r\n_Mesh_139.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_139.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_139.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_053 = newComp.layers.addNull();\r\n_Mesh_053.threeDLayer = true;\r\n_Mesh_053.source.name = \"_Mesh_053\";\r\n_Mesh_053.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_053.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_053.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_052 = newComp.layers.addNull();\r\n_Mesh_052.threeDLayer = true;\r\n_Mesh_052.source.name = \"_Mesh_052\";\r\n_Mesh_052.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_052.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_052.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_050 = newComp.layers.addNull();\r\n_Mesh_050.threeDLayer = true;\r\n_Mesh_050.source.name = \"_Mesh_050\";\r\n_Mesh_050.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_050.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_050.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_057 = newComp.layers.addNull();\r\n_Mesh_057.threeDLayer = true;\r\n_Mesh_057.source.name = \"_Mesh_057\";\r\n_Mesh_057.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_057.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_057.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_055 = newComp.layers.addNull();\r\n_Mesh_055.threeDLayer = true;\r\n_Mesh_055.source.name = \"_Mesh_055\";\r\n_Mesh_055.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_055.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_055.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_054 = newComp.layers.addNull();\r\n_Mesh_054.threeDLayer = true;\r\n_Mesh_054.source.name = \"_Mesh_054\";\r\n_Mesh_054.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_054.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_054.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1442 = newComp.layers.addNull();\r\n_Mesh_1442.threeDLayer = true;\r\n_Mesh_1442.source.name = \"_Mesh_1442\";\r\n_Mesh_1442.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1442.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1442.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1443 = newComp.layers.addNull();\r\n_Mesh_1443.threeDLayer = true;\r\n_Mesh_1443.source.name = \"_Mesh_1443\";\r\n_Mesh_1443.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1443.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1443.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1440 = newComp.layers.addNull();\r\n_Mesh_1440.threeDLayer = true;\r\n_Mesh_1440.source.name = \"_Mesh_1440\";\r\n_Mesh_1440.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1440.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1440.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1441 = newComp.layers.addNull();\r\n_Mesh_1441.threeDLayer = true;\r\n_Mesh_1441.source.name = \"_Mesh_1441\";\r\n_Mesh_1441.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1441.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1441.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1446 = newComp.layers.addNull();\r\n_Mesh_1446.threeDLayer = true;\r\n_Mesh_1446.source.name = \"_Mesh_1446\";\r\n_Mesh_1446.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1446.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1446.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1447 = newComp.layers.addNull();\r\n_Mesh_1447.threeDLayer = true;\r\n_Mesh_1447.source.name = \"_Mesh_1447\";\r\n_Mesh_1447.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1447.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1447.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1444 = newComp.layers.addNull();\r\n_Mesh_1444.threeDLayer = true;\r\n_Mesh_1444.source.name = \"_Mesh_1444\";\r\n_Mesh_1444.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1444.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1444.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1445 = newComp.layers.addNull();\r\n_Mesh_1445.threeDLayer = true;\r\n_Mesh_1445.source.name = \"_Mesh_1445\";\r\n_Mesh_1445.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1445.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1445.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1448 = newComp.layers.addNull();\r\n_Mesh_1448.threeDLayer = true;\r\n_Mesh_1448.source.name = \"_Mesh_1448\";\r\n_Mesh_1448.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1448.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1448.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1449 = newComp.layers.addNull();\r\n_Mesh_1449.threeDLayer = true;\r\n_Mesh_1449.source.name = \"_Mesh_1449\";\r\n_Mesh_1449.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1449.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1449.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1194 = newComp.layers.addNull();\r\n_Mesh_1194.threeDLayer = true;\r\n_Mesh_1194.source.name = \"_Mesh_1194\";\r\n_Mesh_1194.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1194.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1194.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1195 = newComp.layers.addNull();\r\n_Mesh_1195.threeDLayer = true;\r\n_Mesh_1195.source.name = \"_Mesh_1195\";\r\n_Mesh_1195.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1195.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1195.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1196 = newComp.layers.addNull();\r\n_Mesh_1196.threeDLayer = true;\r\n_Mesh_1196.source.name = \"_Mesh_1196\";\r\n_Mesh_1196.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1196.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1196.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1197 = newComp.layers.addNull();\r\n_Mesh_1197.threeDLayer = true;\r\n_Mesh_1197.source.name = \"_Mesh_1197\";\r\n_Mesh_1197.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1197.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1197.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1190 = newComp.layers.addNull();\r\n_Mesh_1190.threeDLayer = true;\r\n_Mesh_1190.source.name = \"_Mesh_1190\";\r\n_Mesh_1190.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1190.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1190.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1191 = newComp.layers.addNull();\r\n_Mesh_1191.threeDLayer = true;\r\n_Mesh_1191.source.name = \"_Mesh_1191\";\r\n_Mesh_1191.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1191.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1191.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1192 = newComp.layers.addNull();\r\n_Mesh_1192.threeDLayer = true;\r\n_Mesh_1192.source.name = \"_Mesh_1192\";\r\n_Mesh_1192.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1192.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1192.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1193 = newComp.layers.addNull();\r\n_Mesh_1193.threeDLayer = true;\r\n_Mesh_1193.source.name = \"_Mesh_1193\";\r\n_Mesh_1193.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1193.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1193.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1198 = newComp.layers.addNull();\r\n_Mesh_1198.threeDLayer = true;\r\n_Mesh_1198.source.name = \"_Mesh_1198\";\r\n_Mesh_1198.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1198.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1198.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1199 = newComp.layers.addNull();\r\n_Mesh_1199.threeDLayer = true;\r\n_Mesh_1199.source.name = \"_Mesh_1199\";\r\n_Mesh_1199.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1199.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1199.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1280 = newComp.layers.addNull();\r\n_Mesh_1280.threeDLayer = true;\r\n_Mesh_1280.source.name = \"_Mesh_1280\";\r\n_Mesh_1280.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1280.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1280.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1281 = newComp.layers.addNull();\r\n_Mesh_1281.threeDLayer = true;\r\n_Mesh_1281.source.name = \"_Mesh_1281\";\r\n_Mesh_1281.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1281.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1281.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1282 = newComp.layers.addNull();\r\n_Mesh_1282.threeDLayer = true;\r\n_Mesh_1282.source.name = \"_Mesh_1282\";\r\n_Mesh_1282.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1282.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1282.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1283 = newComp.layers.addNull();\r\n_Mesh_1283.threeDLayer = true;\r\n_Mesh_1283.source.name = \"_Mesh_1283\";\r\n_Mesh_1283.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1283.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1283.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1284 = newComp.layers.addNull();\r\n_Mesh_1284.threeDLayer = true;\r\n_Mesh_1284.source.name = \"_Mesh_1284\";\r\n_Mesh_1284.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1284.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1284.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1285 = newComp.layers.addNull();\r\n_Mesh_1285.threeDLayer = true;\r\n_Mesh_1285.source.name = \"_Mesh_1285\";\r\n_Mesh_1285.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1285.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1285.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1286 = newComp.layers.addNull();\r\n_Mesh_1286.threeDLayer = true;\r\n_Mesh_1286.source.name = \"_Mesh_1286\";\r\n_Mesh_1286.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1286.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1286.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1287 = newComp.layers.addNull();\r\n_Mesh_1287.threeDLayer = true;\r\n_Mesh_1287.source.name = \"_Mesh_1287\";\r\n_Mesh_1287.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1287.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1287.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1288 = newComp.layers.addNull();\r\n_Mesh_1288.threeDLayer = true;\r\n_Mesh_1288.source.name = \"_Mesh_1288\";\r\n_Mesh_1288.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1288.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1288.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1289 = newComp.layers.addNull();\r\n_Mesh_1289.threeDLayer = true;\r\n_Mesh_1289.source.name = \"_Mesh_1289\";\r\n_Mesh_1289.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1289.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1289.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1068 = newComp.layers.addNull();\r\n_Mesh_1068.threeDLayer = true;\r\n_Mesh_1068.source.name = \"_Mesh_1068\";\r\n_Mesh_1068.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1068.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1068.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1069 = newComp.layers.addNull();\r\n_Mesh_1069.threeDLayer = true;\r\n_Mesh_1069.source.name = \"_Mesh_1069\";\r\n_Mesh_1069.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1069.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1069.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1061 = newComp.layers.addNull();\r\n_Mesh_1061.threeDLayer = true;\r\n_Mesh_1061.source.name = \"_Mesh_1061\";\r\n_Mesh_1061.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1061.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1061.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1063 = newComp.layers.addNull();\r\n_Mesh_1063.threeDLayer = true;\r\n_Mesh_1063.source.name = \"_Mesh_1063\";\r\n_Mesh_1063.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1063.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1063.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1064 = newComp.layers.addNull();\r\n_Mesh_1064.threeDLayer = true;\r\n_Mesh_1064.source.name = \"_Mesh_1064\";\r\n_Mesh_1064.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1064.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1064.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1066 = newComp.layers.addNull();\r\n_Mesh_1066.threeDLayer = true;\r\n_Mesh_1066.source.name = \"_Mesh_1066\";\r\n_Mesh_1066.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1066.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1066.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1067 = newComp.layers.addNull();\r\n_Mesh_1067.threeDLayer = true;\r\n_Mesh_1067.source.name = \"_Mesh_1067\";\r\n_Mesh_1067.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1067.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1067.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1268 = newComp.layers.addNull();\r\n_Mesh_1268.threeDLayer = true;\r\n_Mesh_1268.source.name = \"_Mesh_1268\";\r\n_Mesh_1268.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1268.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1268.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1269 = newComp.layers.addNull();\r\n_Mesh_1269.threeDLayer = true;\r\n_Mesh_1269.source.name = \"_Mesh_1269\";\r\n_Mesh_1269.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1269.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1269.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1262 = newComp.layers.addNull();\r\n_Mesh_1262.threeDLayer = true;\r\n_Mesh_1262.source.name = \"_Mesh_1262\";\r\n_Mesh_1262.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1262.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1262.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1263 = newComp.layers.addNull();\r\n_Mesh_1263.threeDLayer = true;\r\n_Mesh_1263.source.name = \"_Mesh_1263\";\r\n_Mesh_1263.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1263.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1263.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1260 = newComp.layers.addNull();\r\n_Mesh_1260.threeDLayer = true;\r\n_Mesh_1260.source.name = \"_Mesh_1260\";\r\n_Mesh_1260.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1260.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1260.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1261 = newComp.layers.addNull();\r\n_Mesh_1261.threeDLayer = true;\r\n_Mesh_1261.source.name = \"_Mesh_1261\";\r\n_Mesh_1261.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1261.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1261.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1266 = newComp.layers.addNull();\r\n_Mesh_1266.threeDLayer = true;\r\n_Mesh_1266.source.name = \"_Mesh_1266\";\r\n_Mesh_1266.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1266.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1266.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1267 = newComp.layers.addNull();\r\n_Mesh_1267.threeDLayer = true;\r\n_Mesh_1267.source.name = \"_Mesh_1267\";\r\n_Mesh_1267.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1267.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1267.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1264 = newComp.layers.addNull();\r\n_Mesh_1264.threeDLayer = true;\r\n_Mesh_1264.source.name = \"_Mesh_1264\";\r\n_Mesh_1264.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1264.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1264.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1265 = newComp.layers.addNull();\r\n_Mesh_1265.threeDLayer = true;\r\n_Mesh_1265.source.name = \"_Mesh_1265\";\r\n_Mesh_1265.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1265.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1265.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_927 = newComp.layers.addNull();\r\n_Mesh_927.threeDLayer = true;\r\n_Mesh_927.source.name = \"_Mesh_927\";\r\n_Mesh_927.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_927.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_927.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_926 = newComp.layers.addNull();\r\n_Mesh_926.threeDLayer = true;\r\n_Mesh_926.source.name = \"_Mesh_926\";\r\n_Mesh_926.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_926.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_926.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_925 = newComp.layers.addNull();\r\n_Mesh_925.threeDLayer = true;\r\n_Mesh_925.source.name = \"_Mesh_925\";\r\n_Mesh_925.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_925.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_925.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_924 = newComp.layers.addNull();\r\n_Mesh_924.threeDLayer = true;\r\n_Mesh_924.source.name = \"_Mesh_924\";\r\n_Mesh_924.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_924.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_924.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_923 = newComp.layers.addNull();\r\n_Mesh_923.threeDLayer = true;\r\n_Mesh_923.source.name = \"_Mesh_923\";\r\n_Mesh_923.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_923.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_923.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_922 = newComp.layers.addNull();\r\n_Mesh_922.threeDLayer = true;\r\n_Mesh_922.source.name = \"_Mesh_922\";\r\n_Mesh_922.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_922.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_922.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_921 = newComp.layers.addNull();\r\n_Mesh_921.threeDLayer = true;\r\n_Mesh_921.source.name = \"_Mesh_921\";\r\n_Mesh_921.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_921.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_921.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_920 = newComp.layers.addNull();\r\n_Mesh_920.threeDLayer = true;\r\n_Mesh_920.source.name = \"_Mesh_920\";\r\n_Mesh_920.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_920.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_920.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_929 = newComp.layers.addNull();\r\n_Mesh_929.threeDLayer = true;\r\n_Mesh_929.source.name = \"_Mesh_929\";\r\n_Mesh_929.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_929.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_929.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_928 = newComp.layers.addNull();\r\n_Mesh_928.threeDLayer = true;\r\n_Mesh_928.source.name = \"_Mesh_928\";\r\n_Mesh_928.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_928.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_928.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_457 = newComp.layers.addNull();\r\n_Mesh_457.threeDLayer = true;\r\n_Mesh_457.source.name = \"_Mesh_457\";\r\n_Mesh_457.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_457.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_457.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_456 = newComp.layers.addNull();\r\n_Mesh_456.threeDLayer = true;\r\n_Mesh_456.source.name = \"_Mesh_456\";\r\n_Mesh_456.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_456.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_456.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_455 = newComp.layers.addNull();\r\n_Mesh_455.threeDLayer = true;\r\n_Mesh_455.source.name = \"_Mesh_455\";\r\n_Mesh_455.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_455.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_455.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_454 = newComp.layers.addNull();\r\n_Mesh_454.threeDLayer = true;\r\n_Mesh_454.source.name = \"_Mesh_454\";\r\n_Mesh_454.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_454.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_454.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_453 = newComp.layers.addNull();\r\n_Mesh_453.threeDLayer = true;\r\n_Mesh_453.source.name = \"_Mesh_453\";\r\n_Mesh_453.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_453.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_453.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_450 = newComp.layers.addNull();\r\n_Mesh_450.threeDLayer = true;\r\n_Mesh_450.source.name = \"_Mesh_450\";\r\n_Mesh_450.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_450.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_450.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_459 = newComp.layers.addNull();\r\n_Mesh_459.threeDLayer = true;\r\n_Mesh_459.source.name = \"_Mesh_459\";\r\n_Mesh_459.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_459.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_459.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_458 = newComp.layers.addNull();\r\n_Mesh_458.threeDLayer = true;\r\n_Mesh_458.source.name = \"_Mesh_458\";\r\n_Mesh_458.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_458.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_458.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_853 = newComp.layers.addNull();\r\n_Mesh_853.threeDLayer = true;\r\n_Mesh_853.source.name = \"_Mesh_853\";\r\n_Mesh_853.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_853.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_853.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_852 = newComp.layers.addNull();\r\n_Mesh_852.threeDLayer = true;\r\n_Mesh_852.source.name = \"_Mesh_852\";\r\n_Mesh_852.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_852.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_852.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_851 = newComp.layers.addNull();\r\n_Mesh_851.threeDLayer = true;\r\n_Mesh_851.source.name = \"_Mesh_851\";\r\n_Mesh_851.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_851.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_851.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_850 = newComp.layers.addNull();\r\n_Mesh_850.threeDLayer = true;\r\n_Mesh_850.source.name = \"_Mesh_850\";\r\n_Mesh_850.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_850.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_850.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_857 = newComp.layers.addNull();\r\n_Mesh_857.threeDLayer = true;\r\n_Mesh_857.source.name = \"_Mesh_857\";\r\n_Mesh_857.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_857.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_857.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_856 = newComp.layers.addNull();\r\n_Mesh_856.threeDLayer = true;\r\n_Mesh_856.source.name = \"_Mesh_856\";\r\n_Mesh_856.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_856.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_856.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_855 = newComp.layers.addNull();\r\n_Mesh_855.threeDLayer = true;\r\n_Mesh_855.source.name = \"_Mesh_855\";\r\n_Mesh_855.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_855.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_855.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_854 = newComp.layers.addNull();\r\n_Mesh_854.threeDLayer = true;\r\n_Mesh_854.source.name = \"_Mesh_854\";\r\n_Mesh_854.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_854.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_854.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_859 = newComp.layers.addNull();\r\n_Mesh_859.threeDLayer = true;\r\n_Mesh_859.source.name = \"_Mesh_859\";\r\n_Mesh_859.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_859.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_859.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_858 = newComp.layers.addNull();\r\n_Mesh_858.threeDLayer = true;\r\n_Mesh_858.source.name = \"_Mesh_858\";\r\n_Mesh_858.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_858.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_858.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_639 = newComp.layers.addNull();\r\n_Mesh_639.threeDLayer = true;\r\n_Mesh_639.source.name = \"_Mesh_639\";\r\n_Mesh_639.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_639.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_639.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_638 = newComp.layers.addNull();\r\n_Mesh_638.threeDLayer = true;\r\n_Mesh_638.source.name = \"_Mesh_638\";\r\n_Mesh_638.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_638.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_638.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_633 = newComp.layers.addNull();\r\n_Mesh_633.threeDLayer = true;\r\n_Mesh_633.source.name = \"_Mesh_633\";\r\n_Mesh_633.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_633.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_633.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_632 = newComp.layers.addNull();\r\n_Mesh_632.threeDLayer = true;\r\n_Mesh_632.source.name = \"_Mesh_632\";\r\n_Mesh_632.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_632.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_632.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_631 = newComp.layers.addNull();\r\n_Mesh_631.threeDLayer = true;\r\n_Mesh_631.source.name = \"_Mesh_631\";\r\n_Mesh_631.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_631.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_631.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_630 = newComp.layers.addNull();\r\n_Mesh_630.threeDLayer = true;\r\n_Mesh_630.source.name = \"_Mesh_630\";\r\n_Mesh_630.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_630.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_630.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_637 = newComp.layers.addNull();\r\n_Mesh_637.threeDLayer = true;\r\n_Mesh_637.source.name = \"_Mesh_637\";\r\n_Mesh_637.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_637.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_637.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_636 = newComp.layers.addNull();\r\n_Mesh_636.threeDLayer = true;\r\n_Mesh_636.source.name = \"_Mesh_636\";\r\n_Mesh_636.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_636.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_636.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_635 = newComp.layers.addNull();\r\n_Mesh_635.threeDLayer = true;\r\n_Mesh_635.source.name = \"_Mesh_635\";\r\n_Mesh_635.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_635.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_635.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_634 = newComp.layers.addNull();\r\n_Mesh_634.threeDLayer = true;\r\n_Mesh_634.source.name = \"_Mesh_634\";\r\n_Mesh_634.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_634.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_634.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_709 = newComp.layers.addNull();\r\n_Mesh_709.threeDLayer = true;\r\n_Mesh_709.source.name = \"_Mesh_709\";\r\n_Mesh_709.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_709.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_709.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_708 = newComp.layers.addNull();\r\n_Mesh_708.threeDLayer = true;\r\n_Mesh_708.source.name = \"_Mesh_708\";\r\n_Mesh_708.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_708.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_708.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_707 = newComp.layers.addNull();\r\n_Mesh_707.threeDLayer = true;\r\n_Mesh_707.source.name = \"_Mesh_707\";\r\n_Mesh_707.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_707.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_707.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_706 = newComp.layers.addNull();\r\n_Mesh_706.threeDLayer = true;\r\n_Mesh_706.source.name = \"_Mesh_706\";\r\n_Mesh_706.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_706.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_706.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_705 = newComp.layers.addNull();\r\n_Mesh_705.threeDLayer = true;\r\n_Mesh_705.source.name = \"_Mesh_705\";\r\n_Mesh_705.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_705.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_705.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_704 = newComp.layers.addNull();\r\n_Mesh_704.threeDLayer = true;\r\n_Mesh_704.source.name = \"_Mesh_704\";\r\n_Mesh_704.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_704.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_704.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_703 = newComp.layers.addNull();\r\n_Mesh_703.threeDLayer = true;\r\n_Mesh_703.source.name = \"_Mesh_703\";\r\n_Mesh_703.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_703.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_703.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_702 = newComp.layers.addNull();\r\n_Mesh_702.threeDLayer = true;\r\n_Mesh_702.source.name = \"_Mesh_702\";\r\n_Mesh_702.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_702.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_702.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_701 = newComp.layers.addNull();\r\n_Mesh_701.threeDLayer = true;\r\n_Mesh_701.source.name = \"_Mesh_701\";\r\n_Mesh_701.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_701.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_701.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_700 = newComp.layers.addNull();\r\n_Mesh_700.threeDLayer = true;\r\n_Mesh_700.source.name = \"_Mesh_700\";\r\n_Mesh_700.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_700.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_700.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_552 = newComp.layers.addNull();\r\n_Mesh_552.threeDLayer = true;\r\n_Mesh_552.source.name = \"_Mesh_552\";\r\n_Mesh_552.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_552.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_552.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_553 = newComp.layers.addNull();\r\n_Mesh_553.threeDLayer = true;\r\n_Mesh_553.source.name = \"_Mesh_553\";\r\n_Mesh_553.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_553.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_553.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_550 = newComp.layers.addNull();\r\n_Mesh_550.threeDLayer = true;\r\n_Mesh_550.source.name = \"_Mesh_550\";\r\n_Mesh_550.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_550.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_550.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_551 = newComp.layers.addNull();\r\n_Mesh_551.threeDLayer = true;\r\n_Mesh_551.source.name = \"_Mesh_551\";\r\n_Mesh_551.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_551.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_551.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_556 = newComp.layers.addNull();\r\n_Mesh_556.threeDLayer = true;\r\n_Mesh_556.source.name = \"_Mesh_556\";\r\n_Mesh_556.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_556.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_556.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_557 = newComp.layers.addNull();\r\n_Mesh_557.threeDLayer = true;\r\n_Mesh_557.source.name = \"_Mesh_557\";\r\n_Mesh_557.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_557.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_557.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_554 = newComp.layers.addNull();\r\n_Mesh_554.threeDLayer = true;\r\n_Mesh_554.source.name = \"_Mesh_554\";\r\n_Mesh_554.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_554.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_554.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_555 = newComp.layers.addNull();\r\n_Mesh_555.threeDLayer = true;\r\n_Mesh_555.source.name = \"_Mesh_555\";\r\n_Mesh_555.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_555.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_555.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_145 = newComp.layers.addNull();\r\n_Mesh_145.threeDLayer = true;\r\n_Mesh_145.source.name = \"_Mesh_145\";\r\n_Mesh_145.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_145.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_145.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_144 = newComp.layers.addNull();\r\n_Mesh_144.threeDLayer = true;\r\n_Mesh_144.source.name = \"_Mesh_144\";\r\n_Mesh_144.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_144.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_144.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_147 = newComp.layers.addNull();\r\n_Mesh_147.threeDLayer = true;\r\n_Mesh_147.source.name = \"_Mesh_147\";\r\n_Mesh_147.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_147.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_147.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_146 = newComp.layers.addNull();\r\n_Mesh_146.threeDLayer = true;\r\n_Mesh_146.source.name = \"_Mesh_146\";\r\n_Mesh_146.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_146.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_146.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_141 = newComp.layers.addNull();\r\n_Mesh_141.threeDLayer = true;\r\n_Mesh_141.source.name = \"_Mesh_141\";\r\n_Mesh_141.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_141.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_141.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_140 = newComp.layers.addNull();\r\n_Mesh_140.threeDLayer = true;\r\n_Mesh_140.source.name = \"_Mesh_140\";\r\n_Mesh_140.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_140.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_140.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_143 = newComp.layers.addNull();\r\n_Mesh_143.threeDLayer = true;\r\n_Mesh_143.source.name = \"_Mesh_143\";\r\n_Mesh_143.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_143.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_143.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_142 = newComp.layers.addNull();\r\n_Mesh_142.threeDLayer = true;\r\n_Mesh_142.source.name = \"_Mesh_142\";\r\n_Mesh_142.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_142.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_142.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_149 = newComp.layers.addNull();\r\n_Mesh_149.threeDLayer = true;\r\n_Mesh_149.source.name = \"_Mesh_149\";\r\n_Mesh_149.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_149.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_149.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_148 = newComp.layers.addNull();\r\n_Mesh_148.threeDLayer = true;\r\n_Mesh_148.source.name = \"_Mesh_148\";\r\n_Mesh_148.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_148.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_148.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1451 = newComp.layers.addNull();\r\n_Mesh_1451.threeDLayer = true;\r\n_Mesh_1451.source.name = \"_Mesh_1451\";\r\n_Mesh_1451.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1451.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1451.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1450 = newComp.layers.addNull();\r\n_Mesh_1450.threeDLayer = true;\r\n_Mesh_1450.source.name = \"_Mesh_1450\";\r\n_Mesh_1450.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1450.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1450.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1453 = newComp.layers.addNull();\r\n_Mesh_1453.threeDLayer = true;\r\n_Mesh_1453.source.name = \"_Mesh_1453\";\r\n_Mesh_1453.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1453.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1453.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1452 = newComp.layers.addNull();\r\n_Mesh_1452.threeDLayer = true;\r\n_Mesh_1452.source.name = \"_Mesh_1452\";\r\n_Mesh_1452.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1452.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1452.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1455 = newComp.layers.addNull();\r\n_Mesh_1455.threeDLayer = true;\r\n_Mesh_1455.source.name = \"_Mesh_1455\";\r\n_Mesh_1455.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1455.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1455.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1454 = newComp.layers.addNull();\r\n_Mesh_1454.threeDLayer = true;\r\n_Mesh_1454.source.name = \"_Mesh_1454\";\r\n_Mesh_1454.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1454.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1454.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1457 = newComp.layers.addNull();\r\n_Mesh_1457.threeDLayer = true;\r\n_Mesh_1457.source.name = \"_Mesh_1457\";\r\n_Mesh_1457.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1457.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1457.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1456 = newComp.layers.addNull();\r\n_Mesh_1456.threeDLayer = true;\r\n_Mesh_1456.source.name = \"_Mesh_1456\";\r\n_Mesh_1456.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1456.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1456.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1459 = newComp.layers.addNull();\r\n_Mesh_1459.threeDLayer = true;\r\n_Mesh_1459.source.name = \"_Mesh_1459\";\r\n_Mesh_1459.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1459.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1459.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1458 = newComp.layers.addNull();\r\n_Mesh_1458.threeDLayer = true;\r\n_Mesh_1458.source.name = \"_Mesh_1458\";\r\n_Mesh_1458.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1458.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1458.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1297 = newComp.layers.addNull();\r\n_Mesh_1297.threeDLayer = true;\r\n_Mesh_1297.source.name = \"_Mesh_1297\";\r\n_Mesh_1297.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1297.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1297.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1296 = newComp.layers.addNull();\r\n_Mesh_1296.threeDLayer = true;\r\n_Mesh_1296.source.name = \"_Mesh_1296\";\r\n_Mesh_1296.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1296.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1296.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1295 = newComp.layers.addNull();\r\n_Mesh_1295.threeDLayer = true;\r\n_Mesh_1295.source.name = \"_Mesh_1295\";\r\n_Mesh_1295.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1295.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1295.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1294 = newComp.layers.addNull();\r\n_Mesh_1294.threeDLayer = true;\r\n_Mesh_1294.source.name = \"_Mesh_1294\";\r\n_Mesh_1294.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1294.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1294.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1293 = newComp.layers.addNull();\r\n_Mesh_1293.threeDLayer = true;\r\n_Mesh_1293.source.name = \"_Mesh_1293\";\r\n_Mesh_1293.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1293.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1293.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1292 = newComp.layers.addNull();\r\n_Mesh_1292.threeDLayer = true;\r\n_Mesh_1292.source.name = \"_Mesh_1292\";\r\n_Mesh_1292.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1292.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1292.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1290 = newComp.layers.addNull();\r\n_Mesh_1290.threeDLayer = true;\r\n_Mesh_1290.source.name = \"_Mesh_1290\";\r\n_Mesh_1290.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1290.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1290.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1299 = newComp.layers.addNull();\r\n_Mesh_1299.threeDLayer = true;\r\n_Mesh_1299.source.name = \"_Mesh_1299\";\r\n_Mesh_1299.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1299.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1299.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1298 = newComp.layers.addNull();\r\n_Mesh_1298.threeDLayer = true;\r\n_Mesh_1298.source.name = \"_Mesh_1298\";\r\n_Mesh_1298.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1298.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1298.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1078 = newComp.layers.addNull();\r\n_Mesh_1078.threeDLayer = true;\r\n_Mesh_1078.source.name = \"_Mesh_1078\";\r\n_Mesh_1078.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1078.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1078.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1077 = newComp.layers.addNull();\r\n_Mesh_1077.threeDLayer = true;\r\n_Mesh_1077.source.name = \"_Mesh_1077\";\r\n_Mesh_1077.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1077.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1077.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1076 = newComp.layers.addNull();\r\n_Mesh_1076.threeDLayer = true;\r\n_Mesh_1076.source.name = \"_Mesh_1076\";\r\n_Mesh_1076.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1076.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1076.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1075 = newComp.layers.addNull();\r\n_Mesh_1075.threeDLayer = true;\r\n_Mesh_1075.source.name = \"_Mesh_1075\";\r\n_Mesh_1075.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1075.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1075.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1074 = newComp.layers.addNull();\r\n_Mesh_1074.threeDLayer = true;\r\n_Mesh_1074.source.name = \"_Mesh_1074\";\r\n_Mesh_1074.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1074.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1074.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1073 = newComp.layers.addNull();\r\n_Mesh_1073.threeDLayer = true;\r\n_Mesh_1073.source.name = \"_Mesh_1073\";\r\n_Mesh_1073.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1073.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1073.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1072 = newComp.layers.addNull();\r\n_Mesh_1072.threeDLayer = true;\r\n_Mesh_1072.source.name = \"_Mesh_1072\";\r\n_Mesh_1072.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1072.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1072.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1071 = newComp.layers.addNull();\r\n_Mesh_1071.threeDLayer = true;\r\n_Mesh_1071.source.name = \"_Mesh_1071\";\r\n_Mesh_1071.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1071.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1071.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1070 = newComp.layers.addNull();\r\n_Mesh_1070.threeDLayer = true;\r\n_Mesh_1070.source.name = \"_Mesh_1070\";\r\n_Mesh_1070.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1070.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1070.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1279 = newComp.layers.addNull();\r\n_Mesh_1279.threeDLayer = true;\r\n_Mesh_1279.source.name = \"_Mesh_1279\";\r\n_Mesh_1279.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1279.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1279.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1278 = newComp.layers.addNull();\r\n_Mesh_1278.threeDLayer = true;\r\n_Mesh_1278.source.name = \"_Mesh_1278\";\r\n_Mesh_1278.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1278.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1278.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1271 = newComp.layers.addNull();\r\n_Mesh_1271.threeDLayer = true;\r\n_Mesh_1271.source.name = \"_Mesh_1271\";\r\n_Mesh_1271.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1271.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1271.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1270 = newComp.layers.addNull();\r\n_Mesh_1270.threeDLayer = true;\r\n_Mesh_1270.source.name = \"_Mesh_1270\";\r\n_Mesh_1270.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1270.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1270.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1273 = newComp.layers.addNull();\r\n_Mesh_1273.threeDLayer = true;\r\n_Mesh_1273.source.name = \"_Mesh_1273\";\r\n_Mesh_1273.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1273.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1273.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1272 = newComp.layers.addNull();\r\n_Mesh_1272.threeDLayer = true;\r\n_Mesh_1272.source.name = \"_Mesh_1272\";\r\n_Mesh_1272.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1272.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1272.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1275 = newComp.layers.addNull();\r\n_Mesh_1275.threeDLayer = true;\r\n_Mesh_1275.source.name = \"_Mesh_1275\";\r\n_Mesh_1275.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1275.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1275.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1274 = newComp.layers.addNull();\r\n_Mesh_1274.threeDLayer = true;\r\n_Mesh_1274.source.name = \"_Mesh_1274\";\r\n_Mesh_1274.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1274.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1274.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1277 = newComp.layers.addNull();\r\n_Mesh_1277.threeDLayer = true;\r\n_Mesh_1277.source.name = \"_Mesh_1277\";\r\n_Mesh_1277.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1277.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1277.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1276 = newComp.layers.addNull();\r\n_Mesh_1276.threeDLayer = true;\r\n_Mesh_1276.source.name = \"_Mesh_1276\";\r\n_Mesh_1276.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1276.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1276.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1189 = newComp.layers.addNull();\r\n_Mesh_1189.threeDLayer = true;\r\n_Mesh_1189.source.name = \"_Mesh_1189\";\r\n_Mesh_1189.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1189.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1189.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1188 = newComp.layers.addNull();\r\n_Mesh_1188.threeDLayer = true;\r\n_Mesh_1188.source.name = \"_Mesh_1188\";\r\n_Mesh_1188.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1188.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1188.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1183 = newComp.layers.addNull();\r\n_Mesh_1183.threeDLayer = true;\r\n_Mesh_1183.source.name = \"_Mesh_1183\";\r\n_Mesh_1183.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1183.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1183.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1182 = newComp.layers.addNull();\r\n_Mesh_1182.threeDLayer = true;\r\n_Mesh_1182.source.name = \"_Mesh_1182\";\r\n_Mesh_1182.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1182.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1182.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1181 = newComp.layers.addNull();\r\n_Mesh_1181.threeDLayer = true;\r\n_Mesh_1181.source.name = \"_Mesh_1181\";\r\n_Mesh_1181.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1181.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1181.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1180 = newComp.layers.addNull();\r\n_Mesh_1180.threeDLayer = true;\r\n_Mesh_1180.source.name = \"_Mesh_1180\";\r\n_Mesh_1180.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1180.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1180.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1187 = newComp.layers.addNull();\r\n_Mesh_1187.threeDLayer = true;\r\n_Mesh_1187.source.name = \"_Mesh_1187\";\r\n_Mesh_1187.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1187.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1187.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1186 = newComp.layers.addNull();\r\n_Mesh_1186.threeDLayer = true;\r\n_Mesh_1186.source.name = \"_Mesh_1186\";\r\n_Mesh_1186.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1186.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1186.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1185 = newComp.layers.addNull();\r\n_Mesh_1185.threeDLayer = true;\r\n_Mesh_1185.source.name = \"_Mesh_1185\";\r\n_Mesh_1185.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1185.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1185.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1184 = newComp.layers.addNull();\r\n_Mesh_1184.threeDLayer = true;\r\n_Mesh_1184.source.name = \"_Mesh_1184\";\r\n_Mesh_1184.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1184.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1184.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_448 = newComp.layers.addNull();\r\n_Mesh_448.threeDLayer = true;\r\n_Mesh_448.source.name = \"_Mesh_448\";\r\n_Mesh_448.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_448.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_448.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_449 = newComp.layers.addNull();\r\n_Mesh_449.threeDLayer = true;\r\n_Mesh_449.source.name = \"_Mesh_449\";\r\n_Mesh_449.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_449.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_449.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_440 = newComp.layers.addNull();\r\n_Mesh_440.threeDLayer = true;\r\n_Mesh_440.source.name = \"_Mesh_440\";\r\n_Mesh_440.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_440.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_440.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_441 = newComp.layers.addNull();\r\n_Mesh_441.threeDLayer = true;\r\n_Mesh_441.source.name = \"_Mesh_441\";\r\n_Mesh_441.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_441.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_441.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_442 = newComp.layers.addNull();\r\n_Mesh_442.threeDLayer = true;\r\n_Mesh_442.source.name = \"_Mesh_442\";\r\n_Mesh_442.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_442.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_442.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_443 = newComp.layers.addNull();\r\n_Mesh_443.threeDLayer = true;\r\n_Mesh_443.source.name = \"_Mesh_443\";\r\n_Mesh_443.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_443.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_443.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_444 = newComp.layers.addNull();\r\n_Mesh_444.threeDLayer = true;\r\n_Mesh_444.source.name = \"_Mesh_444\";\r\n_Mesh_444.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_444.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_444.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_445 = newComp.layers.addNull();\r\n_Mesh_445.threeDLayer = true;\r\n_Mesh_445.source.name = \"_Mesh_445\";\r\n_Mesh_445.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_445.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_445.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_446 = newComp.layers.addNull();\r\n_Mesh_446.threeDLayer = true;\r\n_Mesh_446.source.name = \"_Mesh_446\";\r\n_Mesh_446.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_446.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_446.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_447 = newComp.layers.addNull();\r\n_Mesh_447.threeDLayer = true;\r\n_Mesh_447.source.name = \"_Mesh_447\";\r\n_Mesh_447.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_447.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_447.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_844 = newComp.layers.addNull();\r\n_Mesh_844.threeDLayer = true;\r\n_Mesh_844.source.name = \"_Mesh_844\";\r\n_Mesh_844.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_844.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_844.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_845 = newComp.layers.addNull();\r\n_Mesh_845.threeDLayer = true;\r\n_Mesh_845.source.name = \"_Mesh_845\";\r\n_Mesh_845.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_845.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_845.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_846 = newComp.layers.addNull();\r\n_Mesh_846.threeDLayer = true;\r\n_Mesh_846.source.name = \"_Mesh_846\";\r\n_Mesh_846.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_846.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_846.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_847 = newComp.layers.addNull();\r\n_Mesh_847.threeDLayer = true;\r\n_Mesh_847.source.name = \"_Mesh_847\";\r\n_Mesh_847.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_847.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_847.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_840 = newComp.layers.addNull();\r\n_Mesh_840.threeDLayer = true;\r\n_Mesh_840.source.name = \"_Mesh_840\";\r\n_Mesh_840.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_840.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_840.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_841 = newComp.layers.addNull();\r\n_Mesh_841.threeDLayer = true;\r\n_Mesh_841.source.name = \"_Mesh_841\";\r\n_Mesh_841.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_841.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_841.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_842 = newComp.layers.addNull();\r\n_Mesh_842.threeDLayer = true;\r\n_Mesh_842.source.name = \"_Mesh_842\";\r\n_Mesh_842.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_842.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_842.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_843 = newComp.layers.addNull();\r\n_Mesh_843.threeDLayer = true;\r\n_Mesh_843.source.name = \"_Mesh_843\";\r\n_Mesh_843.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_843.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_843.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_848 = newComp.layers.addNull();\r\n_Mesh_848.threeDLayer = true;\r\n_Mesh_848.source.name = \"_Mesh_848\";\r\n_Mesh_848.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_848.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_848.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_849 = newComp.layers.addNull();\r\n_Mesh_849.threeDLayer = true;\r\n_Mesh_849.source.name = \"_Mesh_849\";\r\n_Mesh_849.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_849.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_849.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_628 = newComp.layers.addNull();\r\n_Mesh_628.threeDLayer = true;\r\n_Mesh_628.source.name = \"_Mesh_628\";\r\n_Mesh_628.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_628.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_628.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_629 = newComp.layers.addNull();\r\n_Mesh_629.threeDLayer = true;\r\n_Mesh_629.source.name = \"_Mesh_629\";\r\n_Mesh_629.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_629.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_629.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_624 = newComp.layers.addNull();\r\n_Mesh_624.threeDLayer = true;\r\n_Mesh_624.source.name = \"_Mesh_624\";\r\n_Mesh_624.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_624.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_624.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_625 = newComp.layers.addNull();\r\n_Mesh_625.threeDLayer = true;\r\n_Mesh_625.source.name = \"_Mesh_625\";\r\n_Mesh_625.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_625.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_625.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_626 = newComp.layers.addNull();\r\n_Mesh_626.threeDLayer = true;\r\n_Mesh_626.source.name = \"_Mesh_626\";\r\n_Mesh_626.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_626.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_626.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_627 = newComp.layers.addNull();\r\n_Mesh_627.threeDLayer = true;\r\n_Mesh_627.source.name = \"_Mesh_627\";\r\n_Mesh_627.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_627.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_627.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_620 = newComp.layers.addNull();\r\n_Mesh_620.threeDLayer = true;\r\n_Mesh_620.source.name = \"_Mesh_620\";\r\n_Mesh_620.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_620.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_620.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_621 = newComp.layers.addNull();\r\n_Mesh_621.threeDLayer = true;\r\n_Mesh_621.source.name = \"_Mesh_621\";\r\n_Mesh_621.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_621.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_621.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_622 = newComp.layers.addNull();\r\n_Mesh_622.threeDLayer = true;\r\n_Mesh_622.source.name = \"_Mesh_622\";\r\n_Mesh_622.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_622.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_622.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_623 = newComp.layers.addNull();\r\n_Mesh_623.threeDLayer = true;\r\n_Mesh_623.source.name = \"_Mesh_623\";\r\n_Mesh_623.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_623.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_623.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_938 = newComp.layers.addNull();\r\n_Mesh_938.threeDLayer = true;\r\n_Mesh_938.source.name = \"_Mesh_938\";\r\n_Mesh_938.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_938.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_938.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_939 = newComp.layers.addNull();\r\n_Mesh_939.threeDLayer = true;\r\n_Mesh_939.source.name = \"_Mesh_939\";\r\n_Mesh_939.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_939.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_939.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_930 = newComp.layers.addNull();\r\n_Mesh_930.threeDLayer = true;\r\n_Mesh_930.source.name = \"_Mesh_930\";\r\n_Mesh_930.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_930.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_930.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_931 = newComp.layers.addNull();\r\n_Mesh_931.threeDLayer = true;\r\n_Mesh_931.source.name = \"_Mesh_931\";\r\n_Mesh_931.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_931.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_931.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_932 = newComp.layers.addNull();\r\n_Mesh_932.threeDLayer = true;\r\n_Mesh_932.source.name = \"_Mesh_932\";\r\n_Mesh_932.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_932.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_932.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_933 = newComp.layers.addNull();\r\n_Mesh_933.threeDLayer = true;\r\n_Mesh_933.source.name = \"_Mesh_933\";\r\n_Mesh_933.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_933.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_933.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_934 = newComp.layers.addNull();\r\n_Mesh_934.threeDLayer = true;\r\n_Mesh_934.source.name = \"_Mesh_934\";\r\n_Mesh_934.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_934.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_934.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_935 = newComp.layers.addNull();\r\n_Mesh_935.threeDLayer = true;\r\n_Mesh_935.source.name = \"_Mesh_935\";\r\n_Mesh_935.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_935.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_935.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_936 = newComp.layers.addNull();\r\n_Mesh_936.threeDLayer = true;\r\n_Mesh_936.source.name = \"_Mesh_936\";\r\n_Mesh_936.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_936.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_936.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_937 = newComp.layers.addNull();\r\n_Mesh_937.threeDLayer = true;\r\n_Mesh_937.source.name = \"_Mesh_937\";\r\n_Mesh_937.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_937.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_937.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_710 = newComp.layers.addNull();\r\n_Mesh_710.threeDLayer = true;\r\n_Mesh_710.source.name = \"_Mesh_710\";\r\n_Mesh_710.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_710.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_710.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_711 = newComp.layers.addNull();\r\n_Mesh_711.threeDLayer = true;\r\n_Mesh_711.source.name = \"_Mesh_711\";\r\n_Mesh_711.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_711.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_711.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_712 = newComp.layers.addNull();\r\n_Mesh_712.threeDLayer = true;\r\n_Mesh_712.source.name = \"_Mesh_712\";\r\n_Mesh_712.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_712.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_712.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_713 = newComp.layers.addNull();\r\n_Mesh_713.threeDLayer = true;\r\n_Mesh_713.source.name = \"_Mesh_713\";\r\n_Mesh_713.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_713.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_713.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_714 = newComp.layers.addNull();\r\n_Mesh_714.threeDLayer = true;\r\n_Mesh_714.source.name = \"_Mesh_714\";\r\n_Mesh_714.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_714.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_714.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_715 = newComp.layers.addNull();\r\n_Mesh_715.threeDLayer = true;\r\n_Mesh_715.source.name = \"_Mesh_715\";\r\n_Mesh_715.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_715.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_715.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_716 = newComp.layers.addNull();\r\n_Mesh_716.threeDLayer = true;\r\n_Mesh_716.source.name = \"_Mesh_716\";\r\n_Mesh_716.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_716.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_716.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_717 = newComp.layers.addNull();\r\n_Mesh_717.threeDLayer = true;\r\n_Mesh_717.source.name = \"_Mesh_717\";\r\n_Mesh_717.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_717.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_717.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_718 = newComp.layers.addNull();\r\n_Mesh_718.threeDLayer = true;\r\n_Mesh_718.source.name = \"_Mesh_718\";\r\n_Mesh_718.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_718.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_718.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_719 = newComp.layers.addNull();\r\n_Mesh_719.threeDLayer = true;\r\n_Mesh_719.source.name = \"_Mesh_719\";\r\n_Mesh_719.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_719.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_719.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_156 = newComp.layers.addNull();\r\n_Mesh_156.threeDLayer = true;\r\n_Mesh_156.source.name = \"_Mesh_156\";\r\n_Mesh_156.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_156.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_156.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_157 = newComp.layers.addNull();\r\n_Mesh_157.threeDLayer = true;\r\n_Mesh_157.source.name = \"_Mesh_157\";\r\n_Mesh_157.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_157.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_157.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_154 = newComp.layers.addNull();\r\n_Mesh_154.threeDLayer = true;\r\n_Mesh_154.source.name = \"_Mesh_154\";\r\n_Mesh_154.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_154.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_154.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_155 = newComp.layers.addNull();\r\n_Mesh_155.threeDLayer = true;\r\n_Mesh_155.source.name = \"_Mesh_155\";\r\n_Mesh_155.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_155.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_155.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_152 = newComp.layers.addNull();\r\n_Mesh_152.threeDLayer = true;\r\n_Mesh_152.source.name = \"_Mesh_152\";\r\n_Mesh_152.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_152.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_152.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_153 = newComp.layers.addNull();\r\n_Mesh_153.threeDLayer = true;\r\n_Mesh_153.source.name = \"_Mesh_153\";\r\n_Mesh_153.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_153.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_153.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_150 = newComp.layers.addNull();\r\n_Mesh_150.threeDLayer = true;\r\n_Mesh_150.source.name = \"_Mesh_150\";\r\n_Mesh_150.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_150.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_150.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_151 = newComp.layers.addNull();\r\n_Mesh_151.threeDLayer = true;\r\n_Mesh_151.source.name = \"_Mesh_151\";\r\n_Mesh_151.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_151.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_151.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_158 = newComp.layers.addNull();\r\n_Mesh_158.threeDLayer = true;\r\n_Mesh_158.source.name = \"_Mesh_158\";\r\n_Mesh_158.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_158.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_158.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_159 = newComp.layers.addNull();\r\n_Mesh_159.threeDLayer = true;\r\n_Mesh_159.source.name = \"_Mesh_159\";\r\n_Mesh_159.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_159.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_159.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1464 = newComp.layers.addNull();\r\n_Mesh_1464.threeDLayer = true;\r\n_Mesh_1464.source.name = \"_Mesh_1464\";\r\n_Mesh_1464.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1464.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1464.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1465 = newComp.layers.addNull();\r\n_Mesh_1465.threeDLayer = true;\r\n_Mesh_1465.source.name = \"_Mesh_1465\";\r\n_Mesh_1465.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1465.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1465.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1466 = newComp.layers.addNull();\r\n_Mesh_1466.threeDLayer = true;\r\n_Mesh_1466.source.name = \"_Mesh_1466\";\r\n_Mesh_1466.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1466.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1466.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1467 = newComp.layers.addNull();\r\n_Mesh_1467.threeDLayer = true;\r\n_Mesh_1467.source.name = \"_Mesh_1467\";\r\n_Mesh_1467.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1467.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1467.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1460 = newComp.layers.addNull();\r\n_Mesh_1460.threeDLayer = true;\r\n_Mesh_1460.source.name = \"_Mesh_1460\";\r\n_Mesh_1460.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1460.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1460.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1461 = newComp.layers.addNull();\r\n_Mesh_1461.threeDLayer = true;\r\n_Mesh_1461.source.name = \"_Mesh_1461\";\r\n_Mesh_1461.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1461.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1461.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1462 = newComp.layers.addNull();\r\n_Mesh_1462.threeDLayer = true;\r\n_Mesh_1462.source.name = \"_Mesh_1462\";\r\n_Mesh_1462.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1462.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1462.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1463 = newComp.layers.addNull();\r\n_Mesh_1463.threeDLayer = true;\r\n_Mesh_1463.source.name = \"_Mesh_1463\";\r\n_Mesh_1463.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1463.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1463.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1468 = newComp.layers.addNull();\r\n_Mesh_1468.threeDLayer = true;\r\n_Mesh_1468.source.name = \"_Mesh_1468\";\r\n_Mesh_1468.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1468.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1468.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1469 = newComp.layers.addNull();\r\n_Mesh_1469.threeDLayer = true;\r\n_Mesh_1469.source.name = \"_Mesh_1469\";\r\n_Mesh_1469.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1469.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1469.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_911 = newComp.layers.addNull();\r\n_Mesh_911.threeDLayer = true;\r\n_Mesh_911.source.name = \"_Mesh_911\";\r\n_Mesh_911.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_911.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_911.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1510 = newComp.layers.addNull();\r\n_Mesh_1510.threeDLayer = true;\r\n_Mesh_1510.source.name = \"_Mesh_1510\";\r\n_Mesh_1510.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1510.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1510.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1511 = newComp.layers.addNull();\r\n_Mesh_1511.threeDLayer = true;\r\n_Mesh_1511.source.name = \"_Mesh_1511\";\r\n_Mesh_1511.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1511.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1511.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1512 = newComp.layers.addNull();\r\n_Mesh_1512.threeDLayer = true;\r\n_Mesh_1512.source.name = \"_Mesh_1512\";\r\n_Mesh_1512.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1512.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1512.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1513 = newComp.layers.addNull();\r\n_Mesh_1513.threeDLayer = true;\r\n_Mesh_1513.source.name = \"_Mesh_1513\";\r\n_Mesh_1513.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1513.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1513.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1514 = newComp.layers.addNull();\r\n_Mesh_1514.threeDLayer = true;\r\n_Mesh_1514.source.name = \"_Mesh_1514\";\r\n_Mesh_1514.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1514.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1514.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1515 = newComp.layers.addNull();\r\n_Mesh_1515.threeDLayer = true;\r\n_Mesh_1515.source.name = \"_Mesh_1515\";\r\n_Mesh_1515.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1515.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1515.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1516 = newComp.layers.addNull();\r\n_Mesh_1516.threeDLayer = true;\r\n_Mesh_1516.source.name = \"_Mesh_1516\";\r\n_Mesh_1516.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1516.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1516.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1517 = newComp.layers.addNull();\r\n_Mesh_1517.threeDLayer = true;\r\n_Mesh_1517.source.name = \"_Mesh_1517\";\r\n_Mesh_1517.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1517.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1517.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1518 = newComp.layers.addNull();\r\n_Mesh_1518.threeDLayer = true;\r\n_Mesh_1518.source.name = \"_Mesh_1518\";\r\n_Mesh_1518.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1518.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1518.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1519 = newComp.layers.addNull();\r\n_Mesh_1519.threeDLayer = true;\r\n_Mesh_1519.source.name = \"_Mesh_1519\";\r\n_Mesh_1519.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1519.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1519.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_521 = newComp.layers.addNull();\r\n_Mesh_521.threeDLayer = true;\r\n_Mesh_521.source.name = \"_Mesh_521\";\r\n_Mesh_521.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_521.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_521.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_520 = newComp.layers.addNull();\r\n_Mesh_520.threeDLayer = true;\r\n_Mesh_520.source.name = \"_Mesh_520\";\r\n_Mesh_520.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_520.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_520.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_917 = newComp.layers.addNull();\r\n_Mesh_917.threeDLayer = true;\r\n_Mesh_917.source.name = \"_Mesh_917\";\r\n_Mesh_917.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_917.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_917.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_527 = newComp.layers.addNull();\r\n_Mesh_527.threeDLayer = true;\r\n_Mesh_527.source.name = \"_Mesh_527\";\r\n_Mesh_527.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_527.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_527.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_526 = newComp.layers.addNull();\r\n_Mesh_526.threeDLayer = true;\r\n_Mesh_526.source.name = \"_Mesh_526\";\r\n_Mesh_526.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_526.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_526.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_525 = newComp.layers.addNull();\r\n_Mesh_525.threeDLayer = true;\r\n_Mesh_525.source.name = \"_Mesh_525\";\r\n_Mesh_525.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_525.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_525.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1082 = newComp.layers.addNull();\r\n_Mesh_1082.threeDLayer = true;\r\n_Mesh_1082.source.name = \"_Mesh_1082\";\r\n_Mesh_1082.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1082.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1082.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1083 = newComp.layers.addNull();\r\n_Mesh_1083.threeDLayer = true;\r\n_Mesh_1083.source.name = \"_Mesh_1083\";\r\n_Mesh_1083.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1083.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1083.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1081 = newComp.layers.addNull();\r\n_Mesh_1081.threeDLayer = true;\r\n_Mesh_1081.source.name = \"_Mesh_1081\";\r\n_Mesh_1081.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1081.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1081.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1086 = newComp.layers.addNull();\r\n_Mesh_1086.threeDLayer = true;\r\n_Mesh_1086.source.name = \"_Mesh_1086\";\r\n_Mesh_1086.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1086.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1086.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1087 = newComp.layers.addNull();\r\n_Mesh_1087.threeDLayer = true;\r\n_Mesh_1087.source.name = \"_Mesh_1087\";\r\n_Mesh_1087.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1087.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1087.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1084 = newComp.layers.addNull();\r\n_Mesh_1084.threeDLayer = true;\r\n_Mesh_1084.source.name = \"_Mesh_1084\";\r\n_Mesh_1084.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1084.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1084.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1085 = newComp.layers.addNull();\r\n_Mesh_1085.threeDLayer = true;\r\n_Mesh_1085.source.name = \"_Mesh_1085\";\r\n_Mesh_1085.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1085.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1085.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1088 = newComp.layers.addNull();\r\n_Mesh_1088.threeDLayer = true;\r\n_Mesh_1088.source.name = \"_Mesh_1088\";\r\n_Mesh_1088.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1088.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1088.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1089 = newComp.layers.addNull();\r\n_Mesh_1089.threeDLayer = true;\r\n_Mesh_1089.source.name = \"_Mesh_1089\";\r\n_Mesh_1089.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1089.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1089.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1248 = newComp.layers.addNull();\r\n_Mesh_1248.threeDLayer = true;\r\n_Mesh_1248.source.name = \"_Mesh_1248\";\r\n_Mesh_1248.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1248.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1248.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1249 = newComp.layers.addNull();\r\n_Mesh_1249.threeDLayer = true;\r\n_Mesh_1249.source.name = \"_Mesh_1249\";\r\n_Mesh_1249.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1249.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1249.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1244 = newComp.layers.addNull();\r\n_Mesh_1244.threeDLayer = true;\r\n_Mesh_1244.source.name = \"_Mesh_1244\";\r\n_Mesh_1244.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1244.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1244.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1245 = newComp.layers.addNull();\r\n_Mesh_1245.threeDLayer = true;\r\n_Mesh_1245.source.name = \"_Mesh_1245\";\r\n_Mesh_1245.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1245.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1245.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1246 = newComp.layers.addNull();\r\n_Mesh_1246.threeDLayer = true;\r\n_Mesh_1246.source.name = \"_Mesh_1246\";\r\n_Mesh_1246.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1246.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1246.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1247 = newComp.layers.addNull();\r\n_Mesh_1247.threeDLayer = true;\r\n_Mesh_1247.source.name = \"_Mesh_1247\";\r\n_Mesh_1247.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1247.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1247.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1240 = newComp.layers.addNull();\r\n_Mesh_1240.threeDLayer = true;\r\n_Mesh_1240.source.name = \"_Mesh_1240\";\r\n_Mesh_1240.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1240.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1240.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1241 = newComp.layers.addNull();\r\n_Mesh_1241.threeDLayer = true;\r\n_Mesh_1241.source.name = \"_Mesh_1241\";\r\n_Mesh_1241.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1241.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1241.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1242 = newComp.layers.addNull();\r\n_Mesh_1242.threeDLayer = true;\r\n_Mesh_1242.source.name = \"_Mesh_1242\";\r\n_Mesh_1242.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1242.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1242.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1243 = newComp.layers.addNull();\r\n_Mesh_1243.threeDLayer = true;\r\n_Mesh_1243.source.name = \"_Mesh_1243\";\r\n_Mesh_1243.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1243.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1243.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_439 = newComp.layers.addNull();\r\n_Mesh_439.threeDLayer = true;\r\n_Mesh_439.source.name = \"_Mesh_439\";\r\n_Mesh_439.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_439.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_439.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_438 = newComp.layers.addNull();\r\n_Mesh_438.threeDLayer = true;\r\n_Mesh_438.source.name = \"_Mesh_438\";\r\n_Mesh_438.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_438.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_438.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_435 = newComp.layers.addNull();\r\n_Mesh_435.threeDLayer = true;\r\n_Mesh_435.source.name = \"_Mesh_435\";\r\n_Mesh_435.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_435.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_435.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_437 = newComp.layers.addNull();\r\n_Mesh_437.threeDLayer = true;\r\n_Mesh_437.source.name = \"_Mesh_437\";\r\n_Mesh_437.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_437.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_437.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_436 = newComp.layers.addNull();\r\n_Mesh_436.threeDLayer = true;\r\n_Mesh_436.source.name = \"_Mesh_436\";\r\n_Mesh_436.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_436.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_436.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_433 = newComp.layers.addNull();\r\n_Mesh_433.threeDLayer = true;\r\n_Mesh_433.source.name = \"_Mesh_433\";\r\n_Mesh_433.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_433.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_433.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_432 = newComp.layers.addNull();\r\n_Mesh_432.threeDLayer = true;\r\n_Mesh_432.source.name = \"_Mesh_432\";\r\n_Mesh_432.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_432.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_432.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_383 = newComp.layers.addNull();\r\n_Mesh_383.threeDLayer = true;\r\n_Mesh_383.source.name = \"_Mesh_383\";\r\n_Mesh_383.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_383.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_383.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_382 = newComp.layers.addNull();\r\n_Mesh_382.threeDLayer = true;\r\n_Mesh_382.source.name = \"_Mesh_382\";\r\n_Mesh_382.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_382.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_382.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_381 = newComp.layers.addNull();\r\n_Mesh_381.threeDLayer = true;\r\n_Mesh_381.source.name = \"_Mesh_381\";\r\n_Mesh_381.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_381.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_381.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_380 = newComp.layers.addNull();\r\n_Mesh_380.threeDLayer = true;\r\n_Mesh_380.source.name = \"_Mesh_380\";\r\n_Mesh_380.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_380.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_380.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_387 = newComp.layers.addNull();\r\n_Mesh_387.threeDLayer = true;\r\n_Mesh_387.source.name = \"_Mesh_387\";\r\n_Mesh_387.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_387.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_387.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_386 = newComp.layers.addNull();\r\n_Mesh_386.threeDLayer = true;\r\n_Mesh_386.source.name = \"_Mesh_386\";\r\n_Mesh_386.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_386.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_386.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_385 = newComp.layers.addNull();\r\n_Mesh_385.threeDLayer = true;\r\n_Mesh_385.source.name = \"_Mesh_385\";\r\n_Mesh_385.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_385.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_385.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_384 = newComp.layers.addNull();\r\n_Mesh_384.threeDLayer = true;\r\n_Mesh_384.source.name = \"_Mesh_384\";\r\n_Mesh_384.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_384.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_384.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_388 = newComp.layers.addNull();\r\n_Mesh_388.threeDLayer = true;\r\n_Mesh_388.source.name = \"_Mesh_388\";\r\n_Mesh_388.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_388.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_388.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_541 = newComp.layers.addNull();\r\n_Mesh_541.threeDLayer = true;\r\n_Mesh_541.source.name = \"_Mesh_541\";\r\n_Mesh_541.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_541.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_541.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_540 = newComp.layers.addNull();\r\n_Mesh_540.threeDLayer = true;\r\n_Mesh_540.source.name = \"_Mesh_540\";\r\n_Mesh_540.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_540.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_540.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_543 = newComp.layers.addNull();\r\n_Mesh_543.threeDLayer = true;\r\n_Mesh_543.source.name = \"_Mesh_543\";\r\n_Mesh_543.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_543.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_543.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_542 = newComp.layers.addNull();\r\n_Mesh_542.threeDLayer = true;\r\n_Mesh_542.source.name = \"_Mesh_542\";\r\n_Mesh_542.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_542.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_542.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_545 = newComp.layers.addNull();\r\n_Mesh_545.threeDLayer = true;\r\n_Mesh_545.source.name = \"_Mesh_545\";\r\n_Mesh_545.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_545.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_545.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_544 = newComp.layers.addNull();\r\n_Mesh_544.threeDLayer = true;\r\n_Mesh_544.source.name = \"_Mesh_544\";\r\n_Mesh_544.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_544.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_544.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_547 = newComp.layers.addNull();\r\n_Mesh_547.threeDLayer = true;\r\n_Mesh_547.source.name = \"_Mesh_547\";\r\n_Mesh_547.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_547.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_547.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_546 = newComp.layers.addNull();\r\n_Mesh_546.threeDLayer = true;\r\n_Mesh_546.source.name = \"_Mesh_546\";\r\n_Mesh_546.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_546.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_546.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_549 = newComp.layers.addNull();\r\n_Mesh_549.threeDLayer = true;\r\n_Mesh_549.source.name = \"_Mesh_549\";\r\n_Mesh_549.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_549.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_549.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_548 = newComp.layers.addNull();\r\n_Mesh_548.threeDLayer = true;\r\n_Mesh_548.source.name = \"_Mesh_548\";\r\n_Mesh_548.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_548.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_548.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_895 = newComp.layers.addNull();\r\n_Mesh_895.threeDLayer = true;\r\n_Mesh_895.source.name = \"_Mesh_895\";\r\n_Mesh_895.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_895.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_895.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_894 = newComp.layers.addNull();\r\n_Mesh_894.threeDLayer = true;\r\n_Mesh_894.source.name = \"_Mesh_894\";\r\n_Mesh_894.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_894.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_894.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_893 = newComp.layers.addNull();\r\n_Mesh_893.threeDLayer = true;\r\n_Mesh_893.source.name = \"_Mesh_893\";\r\n_Mesh_893.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_893.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_893.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_892 = newComp.layers.addNull();\r\n_Mesh_892.threeDLayer = true;\r\n_Mesh_892.source.name = \"_Mesh_892\";\r\n_Mesh_892.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_892.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_892.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_891 = newComp.layers.addNull();\r\n_Mesh_891.threeDLayer = true;\r\n_Mesh_891.source.name = \"_Mesh_891\";\r\n_Mesh_891.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_891.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_891.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_890 = newComp.layers.addNull();\r\n_Mesh_890.threeDLayer = true;\r\n_Mesh_890.source.name = \"_Mesh_890\";\r\n_Mesh_890.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_890.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_890.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_949 = newComp.layers.addNull();\r\n_Mesh_949.threeDLayer = true;\r\n_Mesh_949.source.name = \"_Mesh_949\";\r\n_Mesh_949.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_949.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_949.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_948 = newComp.layers.addNull();\r\n_Mesh_948.threeDLayer = true;\r\n_Mesh_948.source.name = \"_Mesh_948\";\r\n_Mesh_948.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_948.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_948.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_944 = newComp.layers.addNull();\r\n_Mesh_944.threeDLayer = true;\r\n_Mesh_944.source.name = \"_Mesh_944\";\r\n_Mesh_944.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_944.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_944.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_947 = newComp.layers.addNull();\r\n_Mesh_947.threeDLayer = true;\r\n_Mesh_947.source.name = \"_Mesh_947\";\r\n_Mesh_947.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_947.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_947.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_946 = newComp.layers.addNull();\r\n_Mesh_946.threeDLayer = true;\r\n_Mesh_946.source.name = \"_Mesh_946\";\r\n_Mesh_946.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_946.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_946.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_941 = newComp.layers.addNull();\r\n_Mesh_941.threeDLayer = true;\r\n_Mesh_941.source.name = \"_Mesh_941\";\r\n_Mesh_941.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_941.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_941.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_940 = newComp.layers.addNull();\r\n_Mesh_940.threeDLayer = true;\r\n_Mesh_940.source.name = \"_Mesh_940\";\r\n_Mesh_940.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_940.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_940.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_943 = newComp.layers.addNull();\r\n_Mesh_943.threeDLayer = true;\r\n_Mesh_943.source.name = \"_Mesh_943\";\r\n_Mesh_943.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_943.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_943.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_942 = newComp.layers.addNull();\r\n_Mesh_942.threeDLayer = true;\r\n_Mesh_942.source.name = \"_Mesh_942\";\r\n_Mesh_942.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_942.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_942.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_765 = newComp.layers.addNull();\r\n_Mesh_765.threeDLayer = true;\r\n_Mesh_765.source.name = \"_Mesh_765\";\r\n_Mesh_765.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_765.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_765.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_764 = newComp.layers.addNull();\r\n_Mesh_764.threeDLayer = true;\r\n_Mesh_764.source.name = \"_Mesh_764\";\r\n_Mesh_764.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_764.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_764.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_767 = newComp.layers.addNull();\r\n_Mesh_767.threeDLayer = true;\r\n_Mesh_767.source.name = \"_Mesh_767\";\r\n_Mesh_767.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_767.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_767.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_766 = newComp.layers.addNull();\r\n_Mesh_766.threeDLayer = true;\r\n_Mesh_766.source.name = \"_Mesh_766\";\r\n_Mesh_766.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_766.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_766.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_761 = newComp.layers.addNull();\r\n_Mesh_761.threeDLayer = true;\r\n_Mesh_761.source.name = \"_Mesh_761\";\r\n_Mesh_761.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_761.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_761.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_760 = newComp.layers.addNull();\r\n_Mesh_760.threeDLayer = true;\r\n_Mesh_760.source.name = \"_Mesh_760\";\r\n_Mesh_760.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_760.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_760.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_763 = newComp.layers.addNull();\r\n_Mesh_763.threeDLayer = true;\r\n_Mesh_763.source.name = \"_Mesh_763\";\r\n_Mesh_763.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_763.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_763.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_762 = newComp.layers.addNull();\r\n_Mesh_762.threeDLayer = true;\r\n_Mesh_762.source.name = \"_Mesh_762\";\r\n_Mesh_762.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_762.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_762.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_769 = newComp.layers.addNull();\r\n_Mesh_769.threeDLayer = true;\r\n_Mesh_769.source.name = \"_Mesh_769\";\r\n_Mesh_769.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_769.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_769.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_768 = newComp.layers.addNull();\r\n_Mesh_768.threeDLayer = true;\r\n_Mesh_768.source.name = \"_Mesh_768\";\r\n_Mesh_768.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_768.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_768.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_099 = newComp.layers.addNull();\r\n_Mesh_099.threeDLayer = true;\r\n_Mesh_099.source.name = \"_Mesh_099\";\r\n_Mesh_099.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_099.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_099.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_098 = newComp.layers.addNull();\r\n_Mesh_098.threeDLayer = true;\r\n_Mesh_098.source.name = \"_Mesh_098\";\r\n_Mesh_098.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_098.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_098.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_169 = newComp.layers.addNull();\r\n_Mesh_169.threeDLayer = true;\r\n_Mesh_169.source.name = \"_Mesh_169\";\r\n_Mesh_169.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_169.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_169.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_168 = newComp.layers.addNull();\r\n_Mesh_168.threeDLayer = true;\r\n_Mesh_168.source.name = \"_Mesh_168\";\r\n_Mesh_168.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_168.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_168.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_163 = newComp.layers.addNull();\r\n_Mesh_163.threeDLayer = true;\r\n_Mesh_163.source.name = \"_Mesh_163\";\r\n_Mesh_163.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_163.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_163.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_162 = newComp.layers.addNull();\r\n_Mesh_162.threeDLayer = true;\r\n_Mesh_162.source.name = \"_Mesh_162\";\r\n_Mesh_162.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_162.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_162.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_161 = newComp.layers.addNull();\r\n_Mesh_161.threeDLayer = true;\r\n_Mesh_161.source.name = \"_Mesh_161\";\r\n_Mesh_161.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_161.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_161.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_160 = newComp.layers.addNull();\r\n_Mesh_160.threeDLayer = true;\r\n_Mesh_160.source.name = \"_Mesh_160\";\r\n_Mesh_160.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_160.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_160.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_167 = newComp.layers.addNull();\r\n_Mesh_167.threeDLayer = true;\r\n_Mesh_167.source.name = \"_Mesh_167\";\r\n_Mesh_167.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_167.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_167.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_166 = newComp.layers.addNull();\r\n_Mesh_166.threeDLayer = true;\r\n_Mesh_166.source.name = \"_Mesh_166\";\r\n_Mesh_166.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_166.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_166.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_165 = newComp.layers.addNull();\r\n_Mesh_165.threeDLayer = true;\r\n_Mesh_165.source.name = \"_Mesh_165\";\r\n_Mesh_165.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_165.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_165.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_164 = newComp.layers.addNull();\r\n_Mesh_164.threeDLayer = true;\r\n_Mesh_164.source.name = \"_Mesh_164\";\r\n_Mesh_164.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_164.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_164.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_369 = newComp.layers.addNull();\r\n_Mesh_369.threeDLayer = true;\r\n_Mesh_369.source.name = \"_Mesh_369\";\r\n_Mesh_369.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_369.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_369.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_368 = newComp.layers.addNull();\r\n_Mesh_368.threeDLayer = true;\r\n_Mesh_368.source.name = \"_Mesh_368\";\r\n_Mesh_368.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_368.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_368.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_361 = newComp.layers.addNull();\r\n_Mesh_361.threeDLayer = true;\r\n_Mesh_361.source.name = \"_Mesh_361\";\r\n_Mesh_361.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_361.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_361.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_360 = newComp.layers.addNull();\r\n_Mesh_360.threeDLayer = true;\r\n_Mesh_360.source.name = \"_Mesh_360\";\r\n_Mesh_360.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_360.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_360.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_363 = newComp.layers.addNull();\r\n_Mesh_363.threeDLayer = true;\r\n_Mesh_363.source.name = \"_Mesh_363\";\r\n_Mesh_363.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_363.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_363.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_362 = newComp.layers.addNull();\r\n_Mesh_362.threeDLayer = true;\r\n_Mesh_362.source.name = \"_Mesh_362\";\r\n_Mesh_362.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_362.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_362.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_365 = newComp.layers.addNull();\r\n_Mesh_365.threeDLayer = true;\r\n_Mesh_365.source.name = \"_Mesh_365\";\r\n_Mesh_365.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_365.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_365.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_364 = newComp.layers.addNull();\r\n_Mesh_364.threeDLayer = true;\r\n_Mesh_364.source.name = \"_Mesh_364\";\r\n_Mesh_364.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_364.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_364.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_367 = newComp.layers.addNull();\r\n_Mesh_367.threeDLayer = true;\r\n_Mesh_367.source.name = \"_Mesh_367\";\r\n_Mesh_367.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_367.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_367.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_366 = newComp.layers.addNull();\r\n_Mesh_366.threeDLayer = true;\r\n_Mesh_366.source.name = \"_Mesh_366\";\r\n_Mesh_366.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_366.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_366.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1507 = newComp.layers.addNull();\r\n_Mesh_1507.threeDLayer = true;\r\n_Mesh_1507.source.name = \"_Mesh_1507\";\r\n_Mesh_1507.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1507.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1507.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1506 = newComp.layers.addNull();\r\n_Mesh_1506.threeDLayer = true;\r\n_Mesh_1506.source.name = \"_Mesh_1506\";\r\n_Mesh_1506.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1506.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1506.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1505 = newComp.layers.addNull();\r\n_Mesh_1505.threeDLayer = true;\r\n_Mesh_1505.source.name = \"_Mesh_1505\";\r\n_Mesh_1505.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1505.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1505.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1504 = newComp.layers.addNull();\r\n_Mesh_1504.threeDLayer = true;\r\n_Mesh_1504.source.name = \"_Mesh_1504\";\r\n_Mesh_1504.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1504.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1504.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1503 = newComp.layers.addNull();\r\n_Mesh_1503.threeDLayer = true;\r\n_Mesh_1503.source.name = \"_Mesh_1503\";\r\n_Mesh_1503.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1503.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1503.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1502 = newComp.layers.addNull();\r\n_Mesh_1502.threeDLayer = true;\r\n_Mesh_1502.source.name = \"_Mesh_1502\";\r\n_Mesh_1502.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1502.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1502.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1501 = newComp.layers.addNull();\r\n_Mesh_1501.threeDLayer = true;\r\n_Mesh_1501.source.name = \"_Mesh_1501\";\r\n_Mesh_1501.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1501.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1501.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1500 = newComp.layers.addNull();\r\n_Mesh_1500.threeDLayer = true;\r\n_Mesh_1500.source.name = \"_Mesh_1500\";\r\n_Mesh_1500.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1500.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1500.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1509 = newComp.layers.addNull();\r\n_Mesh_1509.threeDLayer = true;\r\n_Mesh_1509.source.name = \"_Mesh_1509\";\r\n_Mesh_1509.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1509.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1509.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1508 = newComp.layers.addNull();\r\n_Mesh_1508.threeDLayer = true;\r\n_Mesh_1508.source.name = \"_Mesh_1508\";\r\n_Mesh_1508.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1508.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1508.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1479 = newComp.layers.addNull();\r\n_Mesh_1479.threeDLayer = true;\r\n_Mesh_1479.source.name = \"_Mesh_1479\";\r\n_Mesh_1479.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1479.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1479.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1478 = newComp.layers.addNull();\r\n_Mesh_1478.threeDLayer = true;\r\n_Mesh_1478.source.name = \"_Mesh_1478\";\r\n_Mesh_1478.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1478.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1478.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1473 = newComp.layers.addNull();\r\n_Mesh_1473.threeDLayer = true;\r\n_Mesh_1473.source.name = \"_Mesh_1473\";\r\n_Mesh_1473.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1473.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1473.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1472 = newComp.layers.addNull();\r\n_Mesh_1472.threeDLayer = true;\r\n_Mesh_1472.source.name = \"_Mesh_1472\";\r\n_Mesh_1472.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1472.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1472.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1471 = newComp.layers.addNull();\r\n_Mesh_1471.threeDLayer = true;\r\n_Mesh_1471.source.name = \"_Mesh_1471\";\r\n_Mesh_1471.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1471.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1471.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1470 = newComp.layers.addNull();\r\n_Mesh_1470.threeDLayer = true;\r\n_Mesh_1470.source.name = \"_Mesh_1470\";\r\n_Mesh_1470.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1470.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1470.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1477 = newComp.layers.addNull();\r\n_Mesh_1477.threeDLayer = true;\r\n_Mesh_1477.source.name = \"_Mesh_1477\";\r\n_Mesh_1477.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1477.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1477.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1476 = newComp.layers.addNull();\r\n_Mesh_1476.threeDLayer = true;\r\n_Mesh_1476.source.name = \"_Mesh_1476\";\r\n_Mesh_1476.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1476.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1476.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1475 = newComp.layers.addNull();\r\n_Mesh_1475.threeDLayer = true;\r\n_Mesh_1475.source.name = \"_Mesh_1475\";\r\n_Mesh_1475.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1475.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1475.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1474 = newComp.layers.addNull();\r\n_Mesh_1474.threeDLayer = true;\r\n_Mesh_1474.source.name = \"_Mesh_1474\";\r\n_Mesh_1474.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1474.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1474.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1091 = newComp.layers.addNull();\r\n_Mesh_1091.threeDLayer = true;\r\n_Mesh_1091.source.name = \"_Mesh_1091\";\r\n_Mesh_1091.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1091.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1091.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1090 = newComp.layers.addNull();\r\n_Mesh_1090.threeDLayer = true;\r\n_Mesh_1090.source.name = \"_Mesh_1090\";\r\n_Mesh_1090.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1090.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1090.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1093 = newComp.layers.addNull();\r\n_Mesh_1093.threeDLayer = true;\r\n_Mesh_1093.source.name = \"_Mesh_1093\";\r\n_Mesh_1093.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1093.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1093.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1092 = newComp.layers.addNull();\r\n_Mesh_1092.threeDLayer = true;\r\n_Mesh_1092.source.name = \"_Mesh_1092\";\r\n_Mesh_1092.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1092.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1092.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1095 = newComp.layers.addNull();\r\n_Mesh_1095.threeDLayer = true;\r\n_Mesh_1095.source.name = \"_Mesh_1095\";\r\n_Mesh_1095.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1095.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1095.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1094 = newComp.layers.addNull();\r\n_Mesh_1094.threeDLayer = true;\r\n_Mesh_1094.source.name = \"_Mesh_1094\";\r\n_Mesh_1094.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1094.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1094.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1097 = newComp.layers.addNull();\r\n_Mesh_1097.threeDLayer = true;\r\n_Mesh_1097.source.name = \"_Mesh_1097\";\r\n_Mesh_1097.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1097.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1097.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1096 = newComp.layers.addNull();\r\n_Mesh_1096.threeDLayer = true;\r\n_Mesh_1096.source.name = \"_Mesh_1096\";\r\n_Mesh_1096.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1096.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1096.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1099 = newComp.layers.addNull();\r\n_Mesh_1099.threeDLayer = true;\r\n_Mesh_1099.source.name = \"_Mesh_1099\";\r\n_Mesh_1099.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1099.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1099.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1098 = newComp.layers.addNull();\r\n_Mesh_1098.threeDLayer = true;\r\n_Mesh_1098.source.name = \"_Mesh_1098\";\r\n_Mesh_1098.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1098.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1098.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1253 = newComp.layers.addNull();\r\n_Mesh_1253.threeDLayer = true;\r\n_Mesh_1253.source.name = \"_Mesh_1253\";\r\n_Mesh_1253.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1253.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1253.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1252 = newComp.layers.addNull();\r\n_Mesh_1252.threeDLayer = true;\r\n_Mesh_1252.source.name = \"_Mesh_1252\";\r\n_Mesh_1252.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1252.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1252.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1251 = newComp.layers.addNull();\r\n_Mesh_1251.threeDLayer = true;\r\n_Mesh_1251.source.name = \"_Mesh_1251\";\r\n_Mesh_1251.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1251.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1251.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1250 = newComp.layers.addNull();\r\n_Mesh_1250.threeDLayer = true;\r\n_Mesh_1250.source.name = \"_Mesh_1250\";\r\n_Mesh_1250.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1250.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1250.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1257 = newComp.layers.addNull();\r\n_Mesh_1257.threeDLayer = true;\r\n_Mesh_1257.source.name = \"_Mesh_1257\";\r\n_Mesh_1257.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1257.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1257.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1256 = newComp.layers.addNull();\r\n_Mesh_1256.threeDLayer = true;\r\n_Mesh_1256.source.name = \"_Mesh_1256\";\r\n_Mesh_1256.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1256.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1256.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1255 = newComp.layers.addNull();\r\n_Mesh_1255.threeDLayer = true;\r\n_Mesh_1255.source.name = \"_Mesh_1255\";\r\n_Mesh_1255.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1255.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1255.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1254 = newComp.layers.addNull();\r\n_Mesh_1254.threeDLayer = true;\r\n_Mesh_1254.source.name = \"_Mesh_1254\";\r\n_Mesh_1254.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1254.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1254.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1259 = newComp.layers.addNull();\r\n_Mesh_1259.threeDLayer = true;\r\n_Mesh_1259.source.name = \"_Mesh_1259\";\r\n_Mesh_1259.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1259.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1259.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1258 = newComp.layers.addNull();\r\n_Mesh_1258.threeDLayer = true;\r\n_Mesh_1258.source.name = \"_Mesh_1258\";\r\n_Mesh_1258.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1258.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1258.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_303 = newComp.layers.addNull();\r\n_Mesh_303.threeDLayer = true;\r\n_Mesh_303.source.name = \"_Mesh_303\";\r\n_Mesh_303.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_303.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_303.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_428 = newComp.layers.addNull();\r\n_Mesh_428.threeDLayer = true;\r\n_Mesh_428.source.name = \"_Mesh_428\";\r\n_Mesh_428.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_428.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_428.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_429 = newComp.layers.addNull();\r\n_Mesh_429.threeDLayer = true;\r\n_Mesh_429.source.name = \"_Mesh_429\";\r\n_Mesh_429.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_429.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_429.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_426 = newComp.layers.addNull();\r\n_Mesh_426.threeDLayer = true;\r\n_Mesh_426.source.name = \"_Mesh_426\";\r\n_Mesh_426.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_426.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_426.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_427 = newComp.layers.addNull();\r\n_Mesh_427.threeDLayer = true;\r\n_Mesh_427.source.name = \"_Mesh_427\";\r\n_Mesh_427.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_427.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_427.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_424 = newComp.layers.addNull();\r\n_Mesh_424.threeDLayer = true;\r\n_Mesh_424.source.name = \"_Mesh_424\";\r\n_Mesh_424.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_424.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_424.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_425 = newComp.layers.addNull();\r\n_Mesh_425.threeDLayer = true;\r\n_Mesh_425.source.name = \"_Mesh_425\";\r\n_Mesh_425.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_425.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_425.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_422 = newComp.layers.addNull();\r\n_Mesh_422.threeDLayer = true;\r\n_Mesh_422.source.name = \"_Mesh_422\";\r\n_Mesh_422.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_422.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_422.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_423 = newComp.layers.addNull();\r\n_Mesh_423.threeDLayer = true;\r\n_Mesh_423.source.name = \"_Mesh_423\";\r\n_Mesh_423.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_423.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_423.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_420 = newComp.layers.addNull();\r\n_Mesh_420.threeDLayer = true;\r\n_Mesh_420.source.name = \"_Mesh_420\";\r\n_Mesh_420.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_420.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_420.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_421 = newComp.layers.addNull();\r\n_Mesh_421.threeDLayer = true;\r\n_Mesh_421.source.name = \"_Mesh_421\";\r\n_Mesh_421.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_421.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_421.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_399 = newComp.layers.addNull();\r\n_Mesh_399.threeDLayer = true;\r\n_Mesh_399.source.name = \"_Mesh_399\";\r\n_Mesh_399.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_399.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_399.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_880 = newComp.layers.addNull();\r\n_Mesh_880.threeDLayer = true;\r\n_Mesh_880.source.name = \"_Mesh_880\";\r\n_Mesh_880.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_880.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_880.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_881 = newComp.layers.addNull();\r\n_Mesh_881.threeDLayer = true;\r\n_Mesh_881.source.name = \"_Mesh_881\";\r\n_Mesh_881.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_881.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_881.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_882 = newComp.layers.addNull();\r\n_Mesh_882.threeDLayer = true;\r\n_Mesh_882.source.name = \"_Mesh_882\";\r\n_Mesh_882.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_882.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_882.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_883 = newComp.layers.addNull();\r\n_Mesh_883.threeDLayer = true;\r\n_Mesh_883.source.name = \"_Mesh_883\";\r\n_Mesh_883.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_883.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_883.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_884 = newComp.layers.addNull();\r\n_Mesh_884.threeDLayer = true;\r\n_Mesh_884.source.name = \"_Mesh_884\";\r\n_Mesh_884.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_884.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_884.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_885 = newComp.layers.addNull();\r\n_Mesh_885.threeDLayer = true;\r\n_Mesh_885.source.name = \"_Mesh_885\";\r\n_Mesh_885.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_885.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_885.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_886 = newComp.layers.addNull();\r\n_Mesh_886.threeDLayer = true;\r\n_Mesh_886.source.name = \"_Mesh_886\";\r\n_Mesh_886.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_886.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_886.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_887 = newComp.layers.addNull();\r\n_Mesh_887.threeDLayer = true;\r\n_Mesh_887.source.name = \"_Mesh_887\";\r\n_Mesh_887.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_887.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_887.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_888 = newComp.layers.addNull();\r\n_Mesh_888.threeDLayer = true;\r\n_Mesh_888.source.name = \"_Mesh_888\";\r\n_Mesh_888.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_888.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_888.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_889 = newComp.layers.addNull();\r\n_Mesh_889.threeDLayer = true;\r\n_Mesh_889.source.name = \"_Mesh_889\";\r\n_Mesh_889.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_889.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_889.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_558 = newComp.layers.addNull();\r\n_Mesh_558.threeDLayer = true;\r\n_Mesh_558.source.name = \"_Mesh_558\";\r\n_Mesh_558.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_558.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_558.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_559 = newComp.layers.addNull();\r\n_Mesh_559.threeDLayer = true;\r\n_Mesh_559.source.name = \"_Mesh_559\";\r\n_Mesh_559.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_559.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_559.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_958 = newComp.layers.addNull();\r\n_Mesh_958.threeDLayer = true;\r\n_Mesh_958.source.name = \"_Mesh_958\";\r\n_Mesh_958.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_958.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_958.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_959 = newComp.layers.addNull();\r\n_Mesh_959.threeDLayer = true;\r\n_Mesh_959.source.name = \"_Mesh_959\";\r\n_Mesh_959.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_959.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_959.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_956 = newComp.layers.addNull();\r\n_Mesh_956.threeDLayer = true;\r\n_Mesh_956.source.name = \"_Mesh_956\";\r\n_Mesh_956.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_956.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_956.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_957 = newComp.layers.addNull();\r\n_Mesh_957.threeDLayer = true;\r\n_Mesh_957.source.name = \"_Mesh_957\";\r\n_Mesh_957.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_957.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_957.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_954 = newComp.layers.addNull();\r\n_Mesh_954.threeDLayer = true;\r\n_Mesh_954.source.name = \"_Mesh_954\";\r\n_Mesh_954.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_954.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_954.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_955 = newComp.layers.addNull();\r\n_Mesh_955.threeDLayer = true;\r\n_Mesh_955.source.name = \"_Mesh_955\";\r\n_Mesh_955.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_955.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_955.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_952 = newComp.layers.addNull();\r\n_Mesh_952.threeDLayer = true;\r\n_Mesh_952.source.name = \"_Mesh_952\";\r\n_Mesh_952.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_952.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_952.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_953 = newComp.layers.addNull();\r\n_Mesh_953.threeDLayer = true;\r\n_Mesh_953.source.name = \"_Mesh_953\";\r\n_Mesh_953.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_953.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_953.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_950 = newComp.layers.addNull();\r\n_Mesh_950.threeDLayer = true;\r\n_Mesh_950.source.name = \"_Mesh_950\";\r\n_Mesh_950.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_950.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_950.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_951 = newComp.layers.addNull();\r\n_Mesh_951.threeDLayer = true;\r\n_Mesh_951.source.name = \"_Mesh_951\";\r\n_Mesh_951.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_951.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_951.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_088 = newComp.layers.addNull();\r\n_Mesh_088.threeDLayer = true;\r\n_Mesh_088.source.name = \"_Mesh_088\";\r\n_Mesh_088.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_088.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_088.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_089 = newComp.layers.addNull();\r\n_Mesh_089.threeDLayer = true;\r\n_Mesh_089.source.name = \"_Mesh_089\";\r\n_Mesh_089.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_089.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_089.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_080 = newComp.layers.addNull();\r\n_Mesh_080.threeDLayer = true;\r\n_Mesh_080.source.name = \"_Mesh_080\";\r\n_Mesh_080.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_080.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_080.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_082 = newComp.layers.addNull();\r\n_Mesh_082.threeDLayer = true;\r\n_Mesh_082.source.name = \"_Mesh_082\";\r\n_Mesh_082.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_082.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_082.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_083 = newComp.layers.addNull();\r\n_Mesh_083.threeDLayer = true;\r\n_Mesh_083.source.name = \"_Mesh_083\";\r\n_Mesh_083.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_083.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_083.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_084 = newComp.layers.addNull();\r\n_Mesh_084.threeDLayer = true;\r\n_Mesh_084.source.name = \"_Mesh_084\";\r\n_Mesh_084.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_084.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_084.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_085 = newComp.layers.addNull();\r\n_Mesh_085.threeDLayer = true;\r\n_Mesh_085.source.name = \"_Mesh_085\";\r\n_Mesh_085.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_085.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_085.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_086 = newComp.layers.addNull();\r\n_Mesh_086.threeDLayer = true;\r\n_Mesh_086.source.name = \"_Mesh_086\";\r\n_Mesh_086.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_086.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_086.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_087 = newComp.layers.addNull();\r\n_Mesh_087.threeDLayer = true;\r\n_Mesh_087.source.name = \"_Mesh_087\";\r\n_Mesh_087.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_087.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_087.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_776 = newComp.layers.addNull();\r\n_Mesh_776.threeDLayer = true;\r\n_Mesh_776.source.name = \"_Mesh_776\";\r\n_Mesh_776.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_776.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_776.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_777 = newComp.layers.addNull();\r\n_Mesh_777.threeDLayer = true;\r\n_Mesh_777.source.name = \"_Mesh_777\";\r\n_Mesh_777.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_777.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_777.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_774 = newComp.layers.addNull();\r\n_Mesh_774.threeDLayer = true;\r\n_Mesh_774.source.name = \"_Mesh_774\";\r\n_Mesh_774.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_774.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_774.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_775 = newComp.layers.addNull();\r\n_Mesh_775.threeDLayer = true;\r\n_Mesh_775.source.name = \"_Mesh_775\";\r\n_Mesh_775.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_775.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_775.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_772 = newComp.layers.addNull();\r\n_Mesh_772.threeDLayer = true;\r\n_Mesh_772.source.name = \"_Mesh_772\";\r\n_Mesh_772.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_772.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_772.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_773 = newComp.layers.addNull();\r\n_Mesh_773.threeDLayer = true;\r\n_Mesh_773.source.name = \"_Mesh_773\";\r\n_Mesh_773.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_773.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_773.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_770 = newComp.layers.addNull();\r\n_Mesh_770.threeDLayer = true;\r\n_Mesh_770.source.name = \"_Mesh_770\";\r\n_Mesh_770.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_770.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_770.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_771 = newComp.layers.addNull();\r\n_Mesh_771.threeDLayer = true;\r\n_Mesh_771.source.name = \"_Mesh_771\";\r\n_Mesh_771.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_771.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_771.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_653 = newComp.layers.addNull();\r\n_Mesh_653.threeDLayer = true;\r\n_Mesh_653.source.name = \"_Mesh_653\";\r\n_Mesh_653.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_653.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_653.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_778 = newComp.layers.addNull();\r\n_Mesh_778.threeDLayer = true;\r\n_Mesh_778.source.name = \"_Mesh_778\";\r\n_Mesh_778.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_778.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_778.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_779 = newComp.layers.addNull();\r\n_Mesh_779.threeDLayer = true;\r\n_Mesh_779.source.name = \"_Mesh_779\";\r\n_Mesh_779.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_779.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_779.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_652 = newComp.layers.addNull();\r\n_Mesh_652.threeDLayer = true;\r\n_Mesh_652.source.name = \"_Mesh_652\";\r\n_Mesh_652.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_652.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_652.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_655 = newComp.layers.addNull();\r\n_Mesh_655.threeDLayer = true;\r\n_Mesh_655.source.name = \"_Mesh_655\";\r\n_Mesh_655.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_655.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_655.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_654 = newComp.layers.addNull();\r\n_Mesh_654.threeDLayer = true;\r\n_Mesh_654.source.name = \"_Mesh_654\";\r\n_Mesh_654.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_654.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_654.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_657 = newComp.layers.addNull();\r\n_Mesh_657.threeDLayer = true;\r\n_Mesh_657.source.name = \"_Mesh_657\";\r\n_Mesh_657.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_657.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_657.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_656 = newComp.layers.addNull();\r\n_Mesh_656.threeDLayer = true;\r\n_Mesh_656.source.name = \"_Mesh_656\";\r\n_Mesh_656.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_656.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_656.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_178 = newComp.layers.addNull();\r\n_Mesh_178.threeDLayer = true;\r\n_Mesh_178.source.name = \"_Mesh_178\";\r\n_Mesh_178.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_178.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_178.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_179 = newComp.layers.addNull();\r\n_Mesh_179.threeDLayer = true;\r\n_Mesh_179.source.name = \"_Mesh_179\";\r\n_Mesh_179.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_179.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_179.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_174 = newComp.layers.addNull();\r\n_Mesh_174.threeDLayer = true;\r\n_Mesh_174.source.name = \"_Mesh_174\";\r\n_Mesh_174.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_174.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_174.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_176 = newComp.layers.addNull();\r\n_Mesh_176.threeDLayer = true;\r\n_Mesh_176.source.name = \"_Mesh_176\";\r\n_Mesh_176.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_176.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_176.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_177 = newComp.layers.addNull();\r\n_Mesh_177.threeDLayer = true;\r\n_Mesh_177.source.name = \"_Mesh_177\";\r\n_Mesh_177.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_177.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_177.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_170 = newComp.layers.addNull();\r\n_Mesh_170.threeDLayer = true;\r\n_Mesh_170.source.name = \"_Mesh_170\";\r\n_Mesh_170.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_170.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_170.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_171 = newComp.layers.addNull();\r\n_Mesh_171.threeDLayer = true;\r\n_Mesh_171.source.name = \"_Mesh_171\";\r\n_Mesh_171.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_171.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_171.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_172 = newComp.layers.addNull();\r\n_Mesh_172.threeDLayer = true;\r\n_Mesh_172.source.name = \"_Mesh_172\";\r\n_Mesh_172.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_172.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_172.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_173 = newComp.layers.addNull();\r\n_Mesh_173.threeDLayer = true;\r\n_Mesh_173.source.name = \"_Mesh_173\";\r\n_Mesh_173.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_173.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_173.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_378 = newComp.layers.addNull();\r\n_Mesh_378.threeDLayer = true;\r\n_Mesh_378.source.name = \"_Mesh_378\";\r\n_Mesh_378.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_378.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_378.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_379 = newComp.layers.addNull();\r\n_Mesh_379.threeDLayer = true;\r\n_Mesh_379.source.name = \"_Mesh_379\";\r\n_Mesh_379.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_379.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_379.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_372 = newComp.layers.addNull();\r\n_Mesh_372.threeDLayer = true;\r\n_Mesh_372.source.name = \"_Mesh_372\";\r\n_Mesh_372.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_372.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_372.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_373 = newComp.layers.addNull();\r\n_Mesh_373.threeDLayer = true;\r\n_Mesh_373.source.name = \"_Mesh_373\";\r\n_Mesh_373.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_373.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_373.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_370 = newComp.layers.addNull();\r\n_Mesh_370.threeDLayer = true;\r\n_Mesh_370.source.name = \"_Mesh_370\";\r\n_Mesh_370.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_370.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_370.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_371 = newComp.layers.addNull();\r\n_Mesh_371.threeDLayer = true;\r\n_Mesh_371.source.name = \"_Mesh_371\";\r\n_Mesh_371.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_371.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_371.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_376 = newComp.layers.addNull();\r\n_Mesh_376.threeDLayer = true;\r\n_Mesh_376.source.name = \"_Mesh_376\";\r\n_Mesh_376.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_376.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_376.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_377 = newComp.layers.addNull();\r\n_Mesh_377.threeDLayer = true;\r\n_Mesh_377.source.name = \"_Mesh_377\";\r\n_Mesh_377.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_377.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_377.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_374 = newComp.layers.addNull();\r\n_Mesh_374.threeDLayer = true;\r\n_Mesh_374.source.name = \"_Mesh_374\";\r\n_Mesh_374.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_374.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_374.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_375 = newComp.layers.addNull();\r\n_Mesh_375.threeDLayer = true;\r\n_Mesh_375.source.name = \"_Mesh_375\";\r\n_Mesh_375.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_375.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_375.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1312 = newComp.layers.addNull();\r\n_Mesh_1312.threeDLayer = true;\r\n_Mesh_1312.source.name = \"_Mesh_1312\";\r\n_Mesh_1312.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1312.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1312.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1313 = newComp.layers.addNull();\r\n_Mesh_1313.threeDLayer = true;\r\n_Mesh_1313.source.name = \"_Mesh_1313\";\r\n_Mesh_1313.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1313.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1313.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1310 = newComp.layers.addNull();\r\n_Mesh_1310.threeDLayer = true;\r\n_Mesh_1310.source.name = \"_Mesh_1310\";\r\n_Mesh_1310.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1310.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1310.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1311 = newComp.layers.addNull();\r\n_Mesh_1311.threeDLayer = true;\r\n_Mesh_1311.source.name = \"_Mesh_1311\";\r\n_Mesh_1311.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1311.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1311.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1316 = newComp.layers.addNull();\r\n_Mesh_1316.threeDLayer = true;\r\n_Mesh_1316.source.name = \"_Mesh_1316\";\r\n_Mesh_1316.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1316.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1316.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1314 = newComp.layers.addNull();\r\n_Mesh_1314.threeDLayer = true;\r\n_Mesh_1314.source.name = \"_Mesh_1314\";\r\n_Mesh_1314.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1314.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1314.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1318 = newComp.layers.addNull();\r\n_Mesh_1318.threeDLayer = true;\r\n_Mesh_1318.source.name = \"_Mesh_1318\";\r\n_Mesh_1318.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1318.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1318.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1319 = newComp.layers.addNull();\r\n_Mesh_1319.threeDLayer = true;\r\n_Mesh_1319.source.name = \"_Mesh_1319\";\r\n_Mesh_1319.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1319.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1319.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1408 = newComp.layers.addNull();\r\n_Mesh_1408.threeDLayer = true;\r\n_Mesh_1408.source.name = \"_Mesh_1408\";\r\n_Mesh_1408.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1408.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1408.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1409 = newComp.layers.addNull();\r\n_Mesh_1409.threeDLayer = true;\r\n_Mesh_1409.source.name = \"_Mesh_1409\";\r\n_Mesh_1409.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1409.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1409.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1406 = newComp.layers.addNull();\r\n_Mesh_1406.threeDLayer = true;\r\n_Mesh_1406.source.name = \"_Mesh_1406\";\r\n_Mesh_1406.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1406.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1406.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1407 = newComp.layers.addNull();\r\n_Mesh_1407.threeDLayer = true;\r\n_Mesh_1407.source.name = \"_Mesh_1407\";\r\n_Mesh_1407.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1407.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1407.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1404 = newComp.layers.addNull();\r\n_Mesh_1404.threeDLayer = true;\r\n_Mesh_1404.source.name = \"_Mesh_1404\";\r\n_Mesh_1404.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1404.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1404.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1405 = newComp.layers.addNull();\r\n_Mesh_1405.threeDLayer = true;\r\n_Mesh_1405.source.name = \"_Mesh_1405\";\r\n_Mesh_1405.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1405.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1405.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1402 = newComp.layers.addNull();\r\n_Mesh_1402.threeDLayer = true;\r\n_Mesh_1402.source.name = \"_Mesh_1402\";\r\n_Mesh_1402.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1402.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1402.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1403 = newComp.layers.addNull();\r\n_Mesh_1403.threeDLayer = true;\r\n_Mesh_1403.source.name = \"_Mesh_1403\";\r\n_Mesh_1403.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1403.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1403.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1400 = newComp.layers.addNull();\r\n_Mesh_1400.threeDLayer = true;\r\n_Mesh_1400.source.name = \"_Mesh_1400\";\r\n_Mesh_1400.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1400.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1400.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1401 = newComp.layers.addNull();\r\n_Mesh_1401.threeDLayer = true;\r\n_Mesh_1401.source.name = \"_Mesh_1401\";\r\n_Mesh_1401.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1401.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1401.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1226 = newComp.layers.addNull();\r\n_Mesh_1226.threeDLayer = true;\r\n_Mesh_1226.source.name = \"_Mesh_1226\";\r\n_Mesh_1226.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1226.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1226.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1227 = newComp.layers.addNull();\r\n_Mesh_1227.threeDLayer = true;\r\n_Mesh_1227.source.name = \"_Mesh_1227\";\r\n_Mesh_1227.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1227.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1227.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1224 = newComp.layers.addNull();\r\n_Mesh_1224.threeDLayer = true;\r\n_Mesh_1224.source.name = \"_Mesh_1224\";\r\n_Mesh_1224.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1224.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1224.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1225 = newComp.layers.addNull();\r\n_Mesh_1225.threeDLayer = true;\r\n_Mesh_1225.source.name = \"_Mesh_1225\";\r\n_Mesh_1225.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1225.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1225.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1222 = newComp.layers.addNull();\r\n_Mesh_1222.threeDLayer = true;\r\n_Mesh_1222.source.name = \"_Mesh_1222\";\r\n_Mesh_1222.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1222.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1222.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1223 = newComp.layers.addNull();\r\n_Mesh_1223.threeDLayer = true;\r\n_Mesh_1223.source.name = \"_Mesh_1223\";\r\n_Mesh_1223.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1223.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1223.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1220 = newComp.layers.addNull();\r\n_Mesh_1220.threeDLayer = true;\r\n_Mesh_1220.source.name = \"_Mesh_1220\";\r\n_Mesh_1220.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1220.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1220.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1221 = newComp.layers.addNull();\r\n_Mesh_1221.threeDLayer = true;\r\n_Mesh_1221.source.name = \"_Mesh_1221\";\r\n_Mesh_1221.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1221.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1221.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1228 = newComp.layers.addNull();\r\n_Mesh_1228.threeDLayer = true;\r\n_Mesh_1228.source.name = \"_Mesh_1228\";\r\n_Mesh_1228.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1228.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1228.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1229 = newComp.layers.addNull();\r\n_Mesh_1229.threeDLayer = true;\r\n_Mesh_1229.source.name = \"_Mesh_1229\";\r\n_Mesh_1229.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1229.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1229.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_912 = newComp.layers.addNull();\r\n_Mesh_912.threeDLayer = true;\r\n_Mesh_912.source.name = \"_Mesh_912\";\r\n_Mesh_912.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_912.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_912.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_913 = newComp.layers.addNull();\r\n_Mesh_913.threeDLayer = true;\r\n_Mesh_913.source.name = \"_Mesh_913\";\r\n_Mesh_913.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_913.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_913.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_910 = newComp.layers.addNull();\r\n_Mesh_910.threeDLayer = true;\r\n_Mesh_910.source.name = \"_Mesh_910\";\r\n_Mesh_910.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_910.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_910.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1138 = newComp.layers.addNull();\r\n_Mesh_1138.threeDLayer = true;\r\n_Mesh_1138.source.name = \"_Mesh_1138\";\r\n_Mesh_1138.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1138.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1138.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1139 = newComp.layers.addNull();\r\n_Mesh_1139.threeDLayer = true;\r\n_Mesh_1139.source.name = \"_Mesh_1139\";\r\n_Mesh_1139.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1139.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1139.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1132 = newComp.layers.addNull();\r\n_Mesh_1132.threeDLayer = true;\r\n_Mesh_1132.source.name = \"_Mesh_1132\";\r\n_Mesh_1132.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1132.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1132.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1133 = newComp.layers.addNull();\r\n_Mesh_1133.threeDLayer = true;\r\n_Mesh_1133.source.name = \"_Mesh_1133\";\r\n_Mesh_1133.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1133.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1133.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1130 = newComp.layers.addNull();\r\n_Mesh_1130.threeDLayer = true;\r\n_Mesh_1130.source.name = \"_Mesh_1130\";\r\n_Mesh_1130.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1130.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1130.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1131 = newComp.layers.addNull();\r\n_Mesh_1131.threeDLayer = true;\r\n_Mesh_1131.source.name = \"_Mesh_1131\";\r\n_Mesh_1131.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1131.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1131.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1136 = newComp.layers.addNull();\r\n_Mesh_1136.threeDLayer = true;\r\n_Mesh_1136.source.name = \"_Mesh_1136\";\r\n_Mesh_1136.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1136.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1136.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1137 = newComp.layers.addNull();\r\n_Mesh_1137.threeDLayer = true;\r\n_Mesh_1137.source.name = \"_Mesh_1137\";\r\n_Mesh_1137.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1137.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1137.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1134 = newComp.layers.addNull();\r\n_Mesh_1134.threeDLayer = true;\r\n_Mesh_1134.source.name = \"_Mesh_1134\";\r\n_Mesh_1134.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1134.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1134.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1135 = newComp.layers.addNull();\r\n_Mesh_1135.threeDLayer = true;\r\n_Mesh_1135.source.name = \"_Mesh_1135\";\r\n_Mesh_1135.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1135.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1135.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_914 = newComp.layers.addNull();\r\n_Mesh_914.threeDLayer = true;\r\n_Mesh_914.source.name = \"_Mesh_914\";\r\n_Mesh_914.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_914.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_914.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_915 = newComp.layers.addNull();\r\n_Mesh_915.threeDLayer = true;\r\n_Mesh_915.source.name = \"_Mesh_915\";\r\n_Mesh_915.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_915.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_915.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_413 = newComp.layers.addNull();\r\n_Mesh_413.threeDLayer = true;\r\n_Mesh_413.source.name = \"_Mesh_413\";\r\n_Mesh_413.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_413.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_413.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_412 = newComp.layers.addNull();\r\n_Mesh_412.threeDLayer = true;\r\n_Mesh_412.source.name = \"_Mesh_412\";\r\n_Mesh_412.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_412.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_412.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_411 = newComp.layers.addNull();\r\n_Mesh_411.threeDLayer = true;\r\n_Mesh_411.source.name = \"_Mesh_411\";\r\n_Mesh_411.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_411.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_411.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_410 = newComp.layers.addNull();\r\n_Mesh_410.threeDLayer = true;\r\n_Mesh_410.source.name = \"_Mesh_410\";\r\n_Mesh_410.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_410.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_410.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_417 = newComp.layers.addNull();\r\n_Mesh_417.threeDLayer = true;\r\n_Mesh_417.source.name = \"_Mesh_417\";\r\n_Mesh_417.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_417.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_417.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_416 = newComp.layers.addNull();\r\n_Mesh_416.threeDLayer = true;\r\n_Mesh_416.source.name = \"_Mesh_416\";\r\n_Mesh_416.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_416.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_416.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_415 = newComp.layers.addNull();\r\n_Mesh_415.threeDLayer = true;\r\n_Mesh_415.source.name = \"_Mesh_415\";\r\n_Mesh_415.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_415.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_415.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_414 = newComp.layers.addNull();\r\n_Mesh_414.threeDLayer = true;\r\n_Mesh_414.source.name = \"_Mesh_414\";\r\n_Mesh_414.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_414.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_414.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_419 = newComp.layers.addNull();\r\n_Mesh_419.threeDLayer = true;\r\n_Mesh_419.source.name = \"_Mesh_419\";\r\n_Mesh_419.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_419.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_419.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_418 = newComp.layers.addNull();\r\n_Mesh_418.threeDLayer = true;\r\n_Mesh_418.source.name = \"_Mesh_418\";\r\n_Mesh_418.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_418.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_418.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_567 = newComp.layers.addNull();\r\n_Mesh_567.threeDLayer = true;\r\n_Mesh_567.source.name = \"_Mesh_567\";\r\n_Mesh_567.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_567.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_567.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_566 = newComp.layers.addNull();\r\n_Mesh_566.threeDLayer = true;\r\n_Mesh_566.source.name = \"_Mesh_566\";\r\n_Mesh_566.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_566.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_566.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_565 = newComp.layers.addNull();\r\n_Mesh_565.threeDLayer = true;\r\n_Mesh_565.source.name = \"_Mesh_565\";\r\n_Mesh_565.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_565.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_565.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_564 = newComp.layers.addNull();\r\n_Mesh_564.threeDLayer = true;\r\n_Mesh_564.source.name = \"_Mesh_564\";\r\n_Mesh_564.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_564.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_564.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_563 = newComp.layers.addNull();\r\n_Mesh_563.threeDLayer = true;\r\n_Mesh_563.source.name = \"_Mesh_563\";\r\n_Mesh_563.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_563.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_563.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_562 = newComp.layers.addNull();\r\n_Mesh_562.threeDLayer = true;\r\n_Mesh_562.source.name = \"_Mesh_562\";\r\n_Mesh_562.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_562.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_562.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_561 = newComp.layers.addNull();\r\n_Mesh_561.threeDLayer = true;\r\n_Mesh_561.source.name = \"_Mesh_561\";\r\n_Mesh_561.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_561.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_561.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_560 = newComp.layers.addNull();\r\n_Mesh_560.threeDLayer = true;\r\n_Mesh_560.source.name = \"_Mesh_560\";\r\n_Mesh_560.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_560.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_560.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_569 = newComp.layers.addNull();\r\n_Mesh_569.threeDLayer = true;\r\n_Mesh_569.source.name = \"_Mesh_569\";\r\n_Mesh_569.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_569.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_569.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_568 = newComp.layers.addNull();\r\n_Mesh_568.threeDLayer = true;\r\n_Mesh_568.source.name = \"_Mesh_568\";\r\n_Mesh_568.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_568.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_568.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_963 = newComp.layers.addNull();\r\n_Mesh_963.threeDLayer = true;\r\n_Mesh_963.source.name = \"_Mesh_963\";\r\n_Mesh_963.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_963.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_963.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_962 = newComp.layers.addNull();\r\n_Mesh_962.threeDLayer = true;\r\n_Mesh_962.source.name = \"_Mesh_962\";\r\n_Mesh_962.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_962.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_962.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_961 = newComp.layers.addNull();\r\n_Mesh_961.threeDLayer = true;\r\n_Mesh_961.source.name = \"_Mesh_961\";\r\n_Mesh_961.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_961.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_961.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_960 = newComp.layers.addNull();\r\n_Mesh_960.threeDLayer = true;\r\n_Mesh_960.source.name = \"_Mesh_960\";\r\n_Mesh_960.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_960.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_960.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_967 = newComp.layers.addNull();\r\n_Mesh_967.threeDLayer = true;\r\n_Mesh_967.source.name = \"_Mesh_967\";\r\n_Mesh_967.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_967.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_967.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_966 = newComp.layers.addNull();\r\n_Mesh_966.threeDLayer = true;\r\n_Mesh_966.source.name = \"_Mesh_966\";\r\n_Mesh_966.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_966.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_966.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_965 = newComp.layers.addNull();\r\n_Mesh_965.threeDLayer = true;\r\n_Mesh_965.source.name = \"_Mesh_965\";\r\n_Mesh_965.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_965.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_965.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_964 = newComp.layers.addNull();\r\n_Mesh_964.threeDLayer = true;\r\n_Mesh_964.source.name = \"_Mesh_964\";\r\n_Mesh_964.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_964.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_964.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_969 = newComp.layers.addNull();\r\n_Mesh_969.threeDLayer = true;\r\n_Mesh_969.source.name = \"_Mesh_969\";\r\n_Mesh_969.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_969.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_969.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_968 = newComp.layers.addNull();\r\n_Mesh_968.threeDLayer = true;\r\n_Mesh_968.source.name = \"_Mesh_968\";\r\n_Mesh_968.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_968.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_968.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_749 = newComp.layers.addNull();\r\n_Mesh_749.threeDLayer = true;\r\n_Mesh_749.source.name = \"_Mesh_749\";\r\n_Mesh_749.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_749.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_749.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_748 = newComp.layers.addNull();\r\n_Mesh_748.threeDLayer = true;\r\n_Mesh_748.source.name = \"_Mesh_748\";\r\n_Mesh_748.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_748.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_748.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_743 = newComp.layers.addNull();\r\n_Mesh_743.threeDLayer = true;\r\n_Mesh_743.source.name = \"_Mesh_743\";\r\n_Mesh_743.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_743.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_743.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_742 = newComp.layers.addNull();\r\n_Mesh_742.threeDLayer = true;\r\n_Mesh_742.source.name = \"_Mesh_742\";\r\n_Mesh_742.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_742.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_742.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_741 = newComp.layers.addNull();\r\n_Mesh_741.threeDLayer = true;\r\n_Mesh_741.source.name = \"_Mesh_741\";\r\n_Mesh_741.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_741.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_741.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_740 = newComp.layers.addNull();\r\n_Mesh_740.threeDLayer = true;\r\n_Mesh_740.source.name = \"_Mesh_740\";\r\n_Mesh_740.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_740.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_740.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_747 = newComp.layers.addNull();\r\n_Mesh_747.threeDLayer = true;\r\n_Mesh_747.source.name = \"_Mesh_747\";\r\n_Mesh_747.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_747.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_747.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_746 = newComp.layers.addNull();\r\n_Mesh_746.threeDLayer = true;\r\n_Mesh_746.source.name = \"_Mesh_746\";\r\n_Mesh_746.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_746.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_746.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_745 = newComp.layers.addNull();\r\n_Mesh_745.threeDLayer = true;\r\n_Mesh_745.source.name = \"_Mesh_745\";\r\n_Mesh_745.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_745.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_745.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_744 = newComp.layers.addNull();\r\n_Mesh_744.threeDLayer = true;\r\n_Mesh_744.source.name = \"_Mesh_744\";\r\n_Mesh_744.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_744.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_744.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_989 = newComp.layers.addNull();\r\n_Mesh_989.threeDLayer = true;\r\n_Mesh_989.source.name = \"_Mesh_989\";\r\n_Mesh_989.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_989.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_989.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_988 = newComp.layers.addNull();\r\n_Mesh_988.threeDLayer = true;\r\n_Mesh_988.source.name = \"_Mesh_988\";\r\n_Mesh_988.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_988.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_988.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_981 = newComp.layers.addNull();\r\n_Mesh_981.threeDLayer = true;\r\n_Mesh_981.source.name = \"_Mesh_981\";\r\n_Mesh_981.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_981.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_981.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_980 = newComp.layers.addNull();\r\n_Mesh_980.threeDLayer = true;\r\n_Mesh_980.source.name = \"_Mesh_980\";\r\n_Mesh_980.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_980.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_980.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_983 = newComp.layers.addNull();\r\n_Mesh_983.threeDLayer = true;\r\n_Mesh_983.source.name = \"_Mesh_983\";\r\n_Mesh_983.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_983.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_983.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_982 = newComp.layers.addNull();\r\n_Mesh_982.threeDLayer = true;\r\n_Mesh_982.source.name = \"_Mesh_982\";\r\n_Mesh_982.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_982.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_982.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_984 = newComp.layers.addNull();\r\n_Mesh_984.threeDLayer = true;\r\n_Mesh_984.source.name = \"_Mesh_984\";\r\n_Mesh_984.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_984.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_984.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_987 = newComp.layers.addNull();\r\n_Mesh_987.threeDLayer = true;\r\n_Mesh_987.source.name = \"_Mesh_987\";\r\n_Mesh_987.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_987.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_987.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_181 = newComp.layers.addNull();\r\n_Mesh_181.threeDLayer = true;\r\n_Mesh_181.source.name = \"_Mesh_181\";\r\n_Mesh_181.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_181.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_181.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_180 = newComp.layers.addNull();\r\n_Mesh_180.threeDLayer = true;\r\n_Mesh_180.source.name = \"_Mesh_180\";\r\n_Mesh_180.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_180.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_180.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_183 = newComp.layers.addNull();\r\n_Mesh_183.threeDLayer = true;\r\n_Mesh_183.source.name = \"_Mesh_183\";\r\n_Mesh_183.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_183.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_183.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_182 = newComp.layers.addNull();\r\n_Mesh_182.threeDLayer = true;\r\n_Mesh_182.source.name = \"_Mesh_182\";\r\n_Mesh_182.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_182.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_182.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_185 = newComp.layers.addNull();\r\n_Mesh_185.threeDLayer = true;\r\n_Mesh_185.source.name = \"_Mesh_185\";\r\n_Mesh_185.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_185.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_185.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_184 = newComp.layers.addNull();\r\n_Mesh_184.threeDLayer = true;\r\n_Mesh_184.source.name = \"_Mesh_184\";\r\n_Mesh_184.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_184.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_184.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_187 = newComp.layers.addNull();\r\n_Mesh_187.threeDLayer = true;\r\n_Mesh_187.source.name = \"_Mesh_187\";\r\n_Mesh_187.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_187.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_187.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_186 = newComp.layers.addNull();\r\n_Mesh_186.threeDLayer = true;\r\n_Mesh_186.source.name = \"_Mesh_186\";\r\n_Mesh_186.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_186.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_186.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_189 = newComp.layers.addNull();\r\n_Mesh_189.threeDLayer = true;\r\n_Mesh_189.source.name = \"_Mesh_189\";\r\n_Mesh_189.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_189.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_189.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_188 = newComp.layers.addNull();\r\n_Mesh_188.threeDLayer = true;\r\n_Mesh_188.source.name = \"_Mesh_188\";\r\n_Mesh_188.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_188.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_188.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_349 = newComp.layers.addNull();\r\n_Mesh_349.threeDLayer = true;\r\n_Mesh_349.source.name = \"_Mesh_349\";\r\n_Mesh_349.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_349.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_349.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_348 = newComp.layers.addNull();\r\n_Mesh_348.threeDLayer = true;\r\n_Mesh_348.source.name = \"_Mesh_348\";\r\n_Mesh_348.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_348.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_348.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_347 = newComp.layers.addNull();\r\n_Mesh_347.threeDLayer = true;\r\n_Mesh_347.source.name = \"_Mesh_347\";\r\n_Mesh_347.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_347.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_347.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_346 = newComp.layers.addNull();\r\n_Mesh_346.threeDLayer = true;\r\n_Mesh_346.source.name = \"_Mesh_346\";\r\n_Mesh_346.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_346.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_346.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_345 = newComp.layers.addNull();\r\n_Mesh_345.threeDLayer = true;\r\n_Mesh_345.source.name = \"_Mesh_345\";\r\n_Mesh_345.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_345.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_345.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_344 = newComp.layers.addNull();\r\n_Mesh_344.threeDLayer = true;\r\n_Mesh_344.source.name = \"_Mesh_344\";\r\n_Mesh_344.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_344.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_344.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_343 = newComp.layers.addNull();\r\n_Mesh_343.threeDLayer = true;\r\n_Mesh_343.source.name = \"_Mesh_343\";\r\n_Mesh_343.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_343.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_343.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_342 = newComp.layers.addNull();\r\n_Mesh_342.threeDLayer = true;\r\n_Mesh_342.source.name = \"_Mesh_342\";\r\n_Mesh_342.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_342.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_342.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_341 = newComp.layers.addNull();\r\n_Mesh_341.threeDLayer = true;\r\n_Mesh_341.source.name = \"_Mesh_341\";\r\n_Mesh_341.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_341.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_341.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_340 = newComp.layers.addNull();\r\n_Mesh_340.threeDLayer = true;\r\n_Mesh_340.source.name = \"_Mesh_340\";\r\n_Mesh_340.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_340.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_340.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1301 = newComp.layers.addNull();\r\n_Mesh_1301.threeDLayer = true;\r\n_Mesh_1301.source.name = \"_Mesh_1301\";\r\n_Mesh_1301.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1301.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1301.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1300 = newComp.layers.addNull();\r\n_Mesh_1300.threeDLayer = true;\r\n_Mesh_1300.source.name = \"_Mesh_1300\";\r\n_Mesh_1300.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1300.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1300.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1303 = newComp.layers.addNull();\r\n_Mesh_1303.threeDLayer = true;\r\n_Mesh_1303.source.name = \"_Mesh_1303\";\r\n_Mesh_1303.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1303.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1303.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1302 = newComp.layers.addNull();\r\n_Mesh_1302.threeDLayer = true;\r\n_Mesh_1302.source.name = \"_Mesh_1302\";\r\n_Mesh_1302.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1302.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1302.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1305 = newComp.layers.addNull();\r\n_Mesh_1305.threeDLayer = true;\r\n_Mesh_1305.source.name = \"_Mesh_1305\";\r\n_Mesh_1305.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1305.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1305.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1304 = newComp.layers.addNull();\r\n_Mesh_1304.threeDLayer = true;\r\n_Mesh_1304.source.name = \"_Mesh_1304\";\r\n_Mesh_1304.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1304.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1304.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1307 = newComp.layers.addNull();\r\n_Mesh_1307.threeDLayer = true;\r\n_Mesh_1307.source.name = \"_Mesh_1307\";\r\n_Mesh_1307.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1307.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1307.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1306 = newComp.layers.addNull();\r\n_Mesh_1306.threeDLayer = true;\r\n_Mesh_1306.source.name = \"_Mesh_1306\";\r\n_Mesh_1306.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1306.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1306.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1309 = newComp.layers.addNull();\r\n_Mesh_1309.threeDLayer = true;\r\n_Mesh_1309.source.name = \"_Mesh_1309\";\r\n_Mesh_1309.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1309.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1309.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1308 = newComp.layers.addNull();\r\n_Mesh_1308.threeDLayer = true;\r\n_Mesh_1308.source.name = \"_Mesh_1308\";\r\n_Mesh_1308.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1308.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1308.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1419 = newComp.layers.addNull();\r\n_Mesh_1419.threeDLayer = true;\r\n_Mesh_1419.source.name = \"_Mesh_1419\";\r\n_Mesh_1419.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1419.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1419.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1418 = newComp.layers.addNull();\r\n_Mesh_1418.threeDLayer = true;\r\n_Mesh_1418.source.name = \"_Mesh_1418\";\r\n_Mesh_1418.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1418.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1418.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1415 = newComp.layers.addNull();\r\n_Mesh_1415.threeDLayer = true;\r\n_Mesh_1415.source.name = \"_Mesh_1415\";\r\n_Mesh_1415.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1415.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1415.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1414 = newComp.layers.addNull();\r\n_Mesh_1414.threeDLayer = true;\r\n_Mesh_1414.source.name = \"_Mesh_1414\";\r\n_Mesh_1414.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1414.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1414.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1417 = newComp.layers.addNull();\r\n_Mesh_1417.threeDLayer = true;\r\n_Mesh_1417.source.name = \"_Mesh_1417\";\r\n_Mesh_1417.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1417.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1417.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1416 = newComp.layers.addNull();\r\n_Mesh_1416.threeDLayer = true;\r\n_Mesh_1416.source.name = \"_Mesh_1416\";\r\n_Mesh_1416.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1416.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1416.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1411 = newComp.layers.addNull();\r\n_Mesh_1411.threeDLayer = true;\r\n_Mesh_1411.source.name = \"_Mesh_1411\";\r\n_Mesh_1411.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1411.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1411.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1410 = newComp.layers.addNull();\r\n_Mesh_1410.threeDLayer = true;\r\n_Mesh_1410.source.name = \"_Mesh_1410\";\r\n_Mesh_1410.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1410.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1410.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1413 = newComp.layers.addNull();\r\n_Mesh_1413.threeDLayer = true;\r\n_Mesh_1413.source.name = \"_Mesh_1413\";\r\n_Mesh_1413.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1413.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1413.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1412 = newComp.layers.addNull();\r\n_Mesh_1412.threeDLayer = true;\r\n_Mesh_1412.source.name = \"_Mesh_1412\";\r\n_Mesh_1412.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1412.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1412.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1235 = newComp.layers.addNull();\r\n_Mesh_1235.threeDLayer = true;\r\n_Mesh_1235.source.name = \"_Mesh_1235\";\r\n_Mesh_1235.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1235.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1235.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1234 = newComp.layers.addNull();\r\n_Mesh_1234.threeDLayer = true;\r\n_Mesh_1234.source.name = \"_Mesh_1234\";\r\n_Mesh_1234.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1234.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1234.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1237 = newComp.layers.addNull();\r\n_Mesh_1237.threeDLayer = true;\r\n_Mesh_1237.source.name = \"_Mesh_1237\";\r\n_Mesh_1237.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1237.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1237.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1236 = newComp.layers.addNull();\r\n_Mesh_1236.threeDLayer = true;\r\n_Mesh_1236.source.name = \"_Mesh_1236\";\r\n_Mesh_1236.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1236.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1236.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1231 = newComp.layers.addNull();\r\n_Mesh_1231.threeDLayer = true;\r\n_Mesh_1231.source.name = \"_Mesh_1231\";\r\n_Mesh_1231.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1231.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1231.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1230 = newComp.layers.addNull();\r\n_Mesh_1230.threeDLayer = true;\r\n_Mesh_1230.source.name = \"_Mesh_1230\";\r\n_Mesh_1230.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1230.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1230.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1233 = newComp.layers.addNull();\r\n_Mesh_1233.threeDLayer = true;\r\n_Mesh_1233.source.name = \"_Mesh_1233\";\r\n_Mesh_1233.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1233.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1233.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1232 = newComp.layers.addNull();\r\n_Mesh_1232.threeDLayer = true;\r\n_Mesh_1232.source.name = \"_Mesh_1232\";\r\n_Mesh_1232.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1232.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1232.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1239 = newComp.layers.addNull();\r\n_Mesh_1239.threeDLayer = true;\r\n_Mesh_1239.source.name = \"_Mesh_1239\";\r\n_Mesh_1239.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1239.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1239.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1238 = newComp.layers.addNull();\r\n_Mesh_1238.threeDLayer = true;\r\n_Mesh_1238.source.name = \"_Mesh_1238\";\r\n_Mesh_1238.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1238.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1238.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1129 = newComp.layers.addNull();\r\n_Mesh_1129.threeDLayer = true;\r\n_Mesh_1129.source.name = \"_Mesh_1129\";\r\n_Mesh_1129.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1129.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1129.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1128 = newComp.layers.addNull();\r\n_Mesh_1128.threeDLayer = true;\r\n_Mesh_1128.source.name = \"_Mesh_1128\";\r\n_Mesh_1128.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1128.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1128.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1121 = newComp.layers.addNull();\r\n_Mesh_1121.threeDLayer = true;\r\n_Mesh_1121.source.name = \"_Mesh_1121\";\r\n_Mesh_1121.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1121.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1121.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1120 = newComp.layers.addNull();\r\n_Mesh_1120.threeDLayer = true;\r\n_Mesh_1120.source.name = \"_Mesh_1120\";\r\n_Mesh_1120.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1120.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1120.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1123 = newComp.layers.addNull();\r\n_Mesh_1123.threeDLayer = true;\r\n_Mesh_1123.source.name = \"_Mesh_1123\";\r\n_Mesh_1123.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1123.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1123.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1122 = newComp.layers.addNull();\r\n_Mesh_1122.threeDLayer = true;\r\n_Mesh_1122.source.name = \"_Mesh_1122\";\r\n_Mesh_1122.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1122.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1122.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1125 = newComp.layers.addNull();\r\n_Mesh_1125.threeDLayer = true;\r\n_Mesh_1125.source.name = \"_Mesh_1125\";\r\n_Mesh_1125.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1125.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1125.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1124 = newComp.layers.addNull();\r\n_Mesh_1124.threeDLayer = true;\r\n_Mesh_1124.source.name = \"_Mesh_1124\";\r\n_Mesh_1124.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1124.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1124.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1127 = newComp.layers.addNull();\r\n_Mesh_1127.threeDLayer = true;\r\n_Mesh_1127.source.name = \"_Mesh_1127\";\r\n_Mesh_1127.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1127.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1127.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1126 = newComp.layers.addNull();\r\n_Mesh_1126.threeDLayer = true;\r\n_Mesh_1126.source.name = \"_Mesh_1126\";\r\n_Mesh_1126.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1126.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1126.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_404 = newComp.layers.addNull();\r\n_Mesh_404.threeDLayer = true;\r\n_Mesh_404.source.name = \"_Mesh_404\";\r\n_Mesh_404.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_404.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_404.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_405 = newComp.layers.addNull();\r\n_Mesh_405.threeDLayer = true;\r\n_Mesh_405.source.name = \"_Mesh_405\";\r\n_Mesh_405.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_405.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_405.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_406 = newComp.layers.addNull();\r\n_Mesh_406.threeDLayer = true;\r\n_Mesh_406.source.name = \"_Mesh_406\";\r\n_Mesh_406.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_406.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_406.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_407 = newComp.layers.addNull();\r\n_Mesh_407.threeDLayer = true;\r\n_Mesh_407.source.name = \"_Mesh_407\";\r\n_Mesh_407.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_407.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_407.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_400 = newComp.layers.addNull();\r\n_Mesh_400.threeDLayer = true;\r\n_Mesh_400.source.name = \"_Mesh_400\";\r\n_Mesh_400.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_400.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_400.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_402 = newComp.layers.addNull();\r\n_Mesh_402.threeDLayer = true;\r\n_Mesh_402.source.name = \"_Mesh_402\";\r\n_Mesh_402.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_402.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_402.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_403 = newComp.layers.addNull();\r\n_Mesh_403.threeDLayer = true;\r\n_Mesh_403.source.name = \"_Mesh_403\";\r\n_Mesh_403.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_403.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_403.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_408 = newComp.layers.addNull();\r\n_Mesh_408.threeDLayer = true;\r\n_Mesh_408.source.name = \"_Mesh_408\";\r\n_Mesh_408.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_408.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_408.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_409 = newComp.layers.addNull();\r\n_Mesh_409.threeDLayer = true;\r\n_Mesh_409.source.name = \"_Mesh_409\";\r\n_Mesh_409.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_409.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_409.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_578 = newComp.layers.addNull();\r\n_Mesh_578.threeDLayer = true;\r\n_Mesh_578.source.name = \"_Mesh_578\";\r\n_Mesh_578.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_578.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_578.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_579 = newComp.layers.addNull();\r\n_Mesh_579.threeDLayer = true;\r\n_Mesh_579.source.name = \"_Mesh_579\";\r\n_Mesh_579.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_579.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_579.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_570 = newComp.layers.addNull();\r\n_Mesh_570.threeDLayer = true;\r\n_Mesh_570.source.name = \"_Mesh_570\";\r\n_Mesh_570.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_570.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_570.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_571 = newComp.layers.addNull();\r\n_Mesh_571.threeDLayer = true;\r\n_Mesh_571.source.name = \"_Mesh_571\";\r\n_Mesh_571.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_571.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_571.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_572 = newComp.layers.addNull();\r\n_Mesh_572.threeDLayer = true;\r\n_Mesh_572.source.name = \"_Mesh_572\";\r\n_Mesh_572.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_572.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_572.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_573 = newComp.layers.addNull();\r\n_Mesh_573.threeDLayer = true;\r\n_Mesh_573.source.name = \"_Mesh_573\";\r\n_Mesh_573.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_573.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_573.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_574 = newComp.layers.addNull();\r\n_Mesh_574.threeDLayer = true;\r\n_Mesh_574.source.name = \"_Mesh_574\";\r\n_Mesh_574.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_574.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_574.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_575 = newComp.layers.addNull();\r\n_Mesh_575.threeDLayer = true;\r\n_Mesh_575.source.name = \"_Mesh_575\";\r\n_Mesh_575.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_575.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_575.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_576 = newComp.layers.addNull();\r\n_Mesh_576.threeDLayer = true;\r\n_Mesh_576.source.name = \"_Mesh_576\";\r\n_Mesh_576.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_576.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_576.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_577 = newComp.layers.addNull();\r\n_Mesh_577.threeDLayer = true;\r\n_Mesh_577.source.name = \"_Mesh_577\";\r\n_Mesh_577.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_577.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_577.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_974 = newComp.layers.addNull();\r\n_Mesh_974.threeDLayer = true;\r\n_Mesh_974.source.name = \"_Mesh_974\";\r\n_Mesh_974.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_974.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_974.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_975 = newComp.layers.addNull();\r\n_Mesh_975.threeDLayer = true;\r\n_Mesh_975.source.name = \"_Mesh_975\";\r\n_Mesh_975.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_975.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_975.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_976 = newComp.layers.addNull();\r\n_Mesh_976.threeDLayer = true;\r\n_Mesh_976.source.name = \"_Mesh_976\";\r\n_Mesh_976.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_976.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_976.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_977 = newComp.layers.addNull();\r\n_Mesh_977.threeDLayer = true;\r\n_Mesh_977.source.name = \"_Mesh_977\";\r\n_Mesh_977.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_977.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_977.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_970 = newComp.layers.addNull();\r\n_Mesh_970.threeDLayer = true;\r\n_Mesh_970.source.name = \"_Mesh_970\";\r\n_Mesh_970.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_970.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_970.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_971 = newComp.layers.addNull();\r\n_Mesh_971.threeDLayer = true;\r\n_Mesh_971.source.name = \"_Mesh_971\";\r\n_Mesh_971.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_971.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_971.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_972 = newComp.layers.addNull();\r\n_Mesh_972.threeDLayer = true;\r\n_Mesh_972.source.name = \"_Mesh_972\";\r\n_Mesh_972.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_972.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_972.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_973 = newComp.layers.addNull();\r\n_Mesh_973.threeDLayer = true;\r\n_Mesh_973.source.name = \"_Mesh_973\";\r\n_Mesh_973.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_973.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_973.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_978 = newComp.layers.addNull();\r\n_Mesh_978.threeDLayer = true;\r\n_Mesh_978.source.name = \"_Mesh_978\";\r\n_Mesh_978.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_978.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_978.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_979 = newComp.layers.addNull();\r\n_Mesh_979.threeDLayer = true;\r\n_Mesh_979.source.name = \"_Mesh_979\";\r\n_Mesh_979.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_979.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_979.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_758 = newComp.layers.addNull();\r\n_Mesh_758.threeDLayer = true;\r\n_Mesh_758.source.name = \"_Mesh_758\";\r\n_Mesh_758.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_758.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_758.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_759 = newComp.layers.addNull();\r\n_Mesh_759.threeDLayer = true;\r\n_Mesh_759.source.name = \"_Mesh_759\";\r\n_Mesh_759.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_759.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_759.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_754 = newComp.layers.addNull();\r\n_Mesh_754.threeDLayer = true;\r\n_Mesh_754.source.name = \"_Mesh_754\";\r\n_Mesh_754.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_754.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_754.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_755 = newComp.layers.addNull();\r\n_Mesh_755.threeDLayer = true;\r\n_Mesh_755.source.name = \"_Mesh_755\";\r\n_Mesh_755.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_755.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_755.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_756 = newComp.layers.addNull();\r\n_Mesh_756.threeDLayer = true;\r\n_Mesh_756.source.name = \"_Mesh_756\";\r\n_Mesh_756.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_756.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_756.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_757 = newComp.layers.addNull();\r\n_Mesh_757.threeDLayer = true;\r\n_Mesh_757.source.name = \"_Mesh_757\";\r\n_Mesh_757.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_757.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_757.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_750 = newComp.layers.addNull();\r\n_Mesh_750.threeDLayer = true;\r\n_Mesh_750.source.name = \"_Mesh_750\";\r\n_Mesh_750.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_750.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_750.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_751 = newComp.layers.addNull();\r\n_Mesh_751.threeDLayer = true;\r\n_Mesh_751.source.name = \"_Mesh_751\";\r\n_Mesh_751.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_751.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_751.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_752 = newComp.layers.addNull();\r\n_Mesh_752.threeDLayer = true;\r\n_Mesh_752.source.name = \"_Mesh_752\";\r\n_Mesh_752.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_752.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_752.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_753 = newComp.layers.addNull();\r\n_Mesh_753.threeDLayer = true;\r\n_Mesh_753.source.name = \"_Mesh_753\";\r\n_Mesh_753.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_753.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_753.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_998 = newComp.layers.addNull();\r\n_Mesh_998.threeDLayer = true;\r\n_Mesh_998.source.name = \"_Mesh_998\";\r\n_Mesh_998.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_998.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_998.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_999 = newComp.layers.addNull();\r\n_Mesh_999.threeDLayer = true;\r\n_Mesh_999.source.name = \"_Mesh_999\";\r\n_Mesh_999.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_999.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_999.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_992 = newComp.layers.addNull();\r\n_Mesh_992.threeDLayer = true;\r\n_Mesh_992.source.name = \"_Mesh_992\";\r\n_Mesh_992.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_992.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_992.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_993 = newComp.layers.addNull();\r\n_Mesh_993.threeDLayer = true;\r\n_Mesh_993.source.name = \"_Mesh_993\";\r\n_Mesh_993.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_993.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_993.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_990 = newComp.layers.addNull();\r\n_Mesh_990.threeDLayer = true;\r\n_Mesh_990.source.name = \"_Mesh_990\";\r\n_Mesh_990.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_990.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_990.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_991 = newComp.layers.addNull();\r\n_Mesh_991.threeDLayer = true;\r\n_Mesh_991.source.name = \"_Mesh_991\";\r\n_Mesh_991.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_991.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_991.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_996 = newComp.layers.addNull();\r\n_Mesh_996.threeDLayer = true;\r\n_Mesh_996.source.name = \"_Mesh_996\";\r\n_Mesh_996.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_996.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_996.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_997 = newComp.layers.addNull();\r\n_Mesh_997.threeDLayer = true;\r\n_Mesh_997.source.name = \"_Mesh_997\";\r\n_Mesh_997.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_997.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_997.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_994 = newComp.layers.addNull();\r\n_Mesh_994.threeDLayer = true;\r\n_Mesh_994.source.name = \"_Mesh_994\";\r\n_Mesh_994.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_994.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_994.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_995 = newComp.layers.addNull();\r\n_Mesh_995.threeDLayer = true;\r\n_Mesh_995.source.name = \"_Mesh_995\";\r\n_Mesh_995.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_995.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_995.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_192 = newComp.layers.addNull();\r\n_Mesh_192.threeDLayer = true;\r\n_Mesh_192.source.name = \"_Mesh_192\";\r\n_Mesh_192.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_192.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_192.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_193 = newComp.layers.addNull();\r\n_Mesh_193.threeDLayer = true;\r\n_Mesh_193.source.name = \"_Mesh_193\";\r\n_Mesh_193.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_193.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_193.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_190 = newComp.layers.addNull();\r\n_Mesh_190.threeDLayer = true;\r\n_Mesh_190.source.name = \"_Mesh_190\";\r\n_Mesh_190.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_190.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_190.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_191 = newComp.layers.addNull();\r\n_Mesh_191.threeDLayer = true;\r\n_Mesh_191.source.name = \"_Mesh_191\";\r\n_Mesh_191.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_191.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_191.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_196 = newComp.layers.addNull();\r\n_Mesh_196.threeDLayer = true;\r\n_Mesh_196.source.name = \"_Mesh_196\";\r\n_Mesh_196.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_196.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_196.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_197 = newComp.layers.addNull();\r\n_Mesh_197.threeDLayer = true;\r\n_Mesh_197.source.name = \"_Mesh_197\";\r\n_Mesh_197.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_197.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_197.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_194 = newComp.layers.addNull();\r\n_Mesh_194.threeDLayer = true;\r\n_Mesh_194.source.name = \"_Mesh_194\";\r\n_Mesh_194.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_194.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_194.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_195 = newComp.layers.addNull();\r\n_Mesh_195.threeDLayer = true;\r\n_Mesh_195.source.name = \"_Mesh_195\";\r\n_Mesh_195.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_195.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_195.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_198 = newComp.layers.addNull();\r\n_Mesh_198.threeDLayer = true;\r\n_Mesh_198.source.name = \"_Mesh_198\";\r\n_Mesh_198.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_198.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_198.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_199 = newComp.layers.addNull();\r\n_Mesh_199.threeDLayer = true;\r\n_Mesh_199.source.name = \"_Mesh_199\";\r\n_Mesh_199.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_199.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_199.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_350 = newComp.layers.addNull();\r\n_Mesh_350.threeDLayer = true;\r\n_Mesh_350.source.name = \"_Mesh_350\";\r\n_Mesh_350.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_350.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_350.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_351 = newComp.layers.addNull();\r\n_Mesh_351.threeDLayer = true;\r\n_Mesh_351.source.name = \"_Mesh_351\";\r\n_Mesh_351.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_351.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_351.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_352 = newComp.layers.addNull();\r\n_Mesh_352.threeDLayer = true;\r\n_Mesh_352.source.name = \"_Mesh_352\";\r\n_Mesh_352.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_352.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_352.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_353 = newComp.layers.addNull();\r\n_Mesh_353.threeDLayer = true;\r\n_Mesh_353.source.name = \"_Mesh_353\";\r\n_Mesh_353.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_353.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_353.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_354 = newComp.layers.addNull();\r\n_Mesh_354.threeDLayer = true;\r\n_Mesh_354.source.name = \"_Mesh_354\";\r\n_Mesh_354.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_354.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_354.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_355 = newComp.layers.addNull();\r\n_Mesh_355.threeDLayer = true;\r\n_Mesh_355.source.name = \"_Mesh_355\";\r\n_Mesh_355.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_355.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_355.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_356 = newComp.layers.addNull();\r\n_Mesh_356.threeDLayer = true;\r\n_Mesh_356.source.name = \"_Mesh_356\";\r\n_Mesh_356.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_356.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_356.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_357 = newComp.layers.addNull();\r\n_Mesh_357.threeDLayer = true;\r\n_Mesh_357.source.name = \"_Mesh_357\";\r\n_Mesh_357.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_357.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_357.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_358 = newComp.layers.addNull();\r\n_Mesh_358.threeDLayer = true;\r\n_Mesh_358.source.name = \"_Mesh_358\";\r\n_Mesh_358.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_358.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_358.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_359 = newComp.layers.addNull();\r\n_Mesh_359.threeDLayer = true;\r\n_Mesh_359.source.name = \"_Mesh_359\";\r\n_Mesh_359.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_359.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_359.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_044 = newComp.layers.addNull();\r\n_Mesh_044.threeDLayer = true;\r\n_Mesh_044.source.name = \"_Mesh_044\";\r\n_Mesh_044.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_044.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_044.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_045 = newComp.layers.addNull();\r\n_Mesh_045.threeDLayer = true;\r\n_Mesh_045.source.name = \"_Mesh_045\";\r\n_Mesh_045.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_045.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_045.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_040 = newComp.layers.addNull();\r\n_Mesh_040.threeDLayer = true;\r\n_Mesh_040.source.name = \"_Mesh_040\";\r\n_Mesh_040.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_040.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_040.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_041 = newComp.layers.addNull();\r\n_Mesh_041.threeDLayer = true;\r\n_Mesh_041.source.name = \"_Mesh_041\";\r\n_Mesh_041.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_041.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_041.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_042 = newComp.layers.addNull();\r\n_Mesh_042.threeDLayer = true;\r\n_Mesh_042.source.name = \"_Mesh_042\";\r\n_Mesh_042.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_042.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_042.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_043 = newComp.layers.addNull();\r\n_Mesh_043.threeDLayer = true;\r\n_Mesh_043.source.name = \"_Mesh_043\";\r\n_Mesh_043.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_043.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_043.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1334 = newComp.layers.addNull();\r\n_Mesh_1334.threeDLayer = true;\r\n_Mesh_1334.source.name = \"_Mesh_1334\";\r\n_Mesh_1334.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1334.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1334.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1335 = newComp.layers.addNull();\r\n_Mesh_1335.threeDLayer = true;\r\n_Mesh_1335.source.name = \"_Mesh_1335\";\r\n_Mesh_1335.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1335.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1335.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1336 = newComp.layers.addNull();\r\n_Mesh_1336.threeDLayer = true;\r\n_Mesh_1336.source.name = \"_Mesh_1336\";\r\n_Mesh_1336.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1336.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1336.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1337 = newComp.layers.addNull();\r\n_Mesh_1337.threeDLayer = true;\r\n_Mesh_1337.source.name = \"_Mesh_1337\";\r\n_Mesh_1337.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1337.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1337.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1330 = newComp.layers.addNull();\r\n_Mesh_1330.threeDLayer = true;\r\n_Mesh_1330.source.name = \"_Mesh_1330\";\r\n_Mesh_1330.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1330.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1330.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1331 = newComp.layers.addNull();\r\n_Mesh_1331.threeDLayer = true;\r\n_Mesh_1331.source.name = \"_Mesh_1331\";\r\n_Mesh_1331.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1331.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1331.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1332 = newComp.layers.addNull();\r\n_Mesh_1332.threeDLayer = true;\r\n_Mesh_1332.source.name = \"_Mesh_1332\";\r\n_Mesh_1332.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1332.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1332.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1333 = newComp.layers.addNull();\r\n_Mesh_1333.threeDLayer = true;\r\n_Mesh_1333.source.name = \"_Mesh_1333\";\r\n_Mesh_1333.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1333.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1333.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1338 = newComp.layers.addNull();\r\n_Mesh_1338.threeDLayer = true;\r\n_Mesh_1338.source.name = \"_Mesh_1338\";\r\n_Mesh_1338.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1338.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1338.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1339 = newComp.layers.addNull();\r\n_Mesh_1339.threeDLayer = true;\r\n_Mesh_1339.source.name = \"_Mesh_1339\";\r\n_Mesh_1339.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1339.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1339.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1420 = newComp.layers.addNull();\r\n_Mesh_1420.threeDLayer = true;\r\n_Mesh_1420.source.name = \"_Mesh_1420\";\r\n_Mesh_1420.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1420.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1420.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1421 = newComp.layers.addNull();\r\n_Mesh_1421.threeDLayer = true;\r\n_Mesh_1421.source.name = \"_Mesh_1421\";\r\n_Mesh_1421.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1421.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1421.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1422 = newComp.layers.addNull();\r\n_Mesh_1422.threeDLayer = true;\r\n_Mesh_1422.source.name = \"_Mesh_1422\";\r\n_Mesh_1422.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1422.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1422.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1423 = newComp.layers.addNull();\r\n_Mesh_1423.threeDLayer = true;\r\n_Mesh_1423.source.name = \"_Mesh_1423\";\r\n_Mesh_1423.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1423.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1423.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1424 = newComp.layers.addNull();\r\n_Mesh_1424.threeDLayer = true;\r\n_Mesh_1424.source.name = \"_Mesh_1424\";\r\n_Mesh_1424.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1424.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1424.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1425 = newComp.layers.addNull();\r\n_Mesh_1425.threeDLayer = true;\r\n_Mesh_1425.source.name = \"_Mesh_1425\";\r\n_Mesh_1425.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1425.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1425.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1426 = newComp.layers.addNull();\r\n_Mesh_1426.threeDLayer = true;\r\n_Mesh_1426.source.name = \"_Mesh_1426\";\r\n_Mesh_1426.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1426.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1426.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1427 = newComp.layers.addNull();\r\n_Mesh_1427.threeDLayer = true;\r\n_Mesh_1427.source.name = \"_Mesh_1427\";\r\n_Mesh_1427.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1427.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1427.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1428 = newComp.layers.addNull();\r\n_Mesh_1428.threeDLayer = true;\r\n_Mesh_1428.source.name = \"_Mesh_1428\";\r\n_Mesh_1428.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1428.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1428.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1429 = newComp.layers.addNull();\r\n_Mesh_1429.threeDLayer = true;\r\n_Mesh_1429.source.name = \"_Mesh_1429\";\r\n_Mesh_1429.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1429.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1429.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1208 = newComp.layers.addNull();\r\n_Mesh_1208.threeDLayer = true;\r\n_Mesh_1208.source.name = \"_Mesh_1208\";\r\n_Mesh_1208.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1208.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1208.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1209 = newComp.layers.addNull();\r\n_Mesh_1209.threeDLayer = true;\r\n_Mesh_1209.source.name = \"_Mesh_1209\";\r\n_Mesh_1209.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1209.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1209.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1200 = newComp.layers.addNull();\r\n_Mesh_1200.threeDLayer = true;\r\n_Mesh_1200.source.name = \"_Mesh_1200\";\r\n_Mesh_1200.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1200.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1200.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1201 = newComp.layers.addNull();\r\n_Mesh_1201.threeDLayer = true;\r\n_Mesh_1201.source.name = \"_Mesh_1201\";\r\n_Mesh_1201.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1201.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1201.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1202 = newComp.layers.addNull();\r\n_Mesh_1202.threeDLayer = true;\r\n_Mesh_1202.source.name = \"_Mesh_1202\";\r\n_Mesh_1202.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1202.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1202.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1203 = newComp.layers.addNull();\r\n_Mesh_1203.threeDLayer = true;\r\n_Mesh_1203.source.name = \"_Mesh_1203\";\r\n_Mesh_1203.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1203.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1203.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1204 = newComp.layers.addNull();\r\n_Mesh_1204.threeDLayer = true;\r\n_Mesh_1204.source.name = \"_Mesh_1204\";\r\n_Mesh_1204.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1204.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1204.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1205 = newComp.layers.addNull();\r\n_Mesh_1205.threeDLayer = true;\r\n_Mesh_1205.source.name = \"_Mesh_1205\";\r\n_Mesh_1205.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1205.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1205.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1206 = newComp.layers.addNull();\r\n_Mesh_1206.threeDLayer = true;\r\n_Mesh_1206.source.name = \"_Mesh_1206\";\r\n_Mesh_1206.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1206.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1206.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1207 = newComp.layers.addNull();\r\n_Mesh_1207.threeDLayer = true;\r\n_Mesh_1207.source.name = \"_Mesh_1207\";\r\n_Mesh_1207.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1207.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1207.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1118 = newComp.layers.addNull();\r\n_Mesh_1118.threeDLayer = true;\r\n_Mesh_1118.source.name = \"_Mesh_1118\";\r\n_Mesh_1118.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1118.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1118.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1119 = newComp.layers.addNull();\r\n_Mesh_1119.threeDLayer = true;\r\n_Mesh_1119.source.name = \"_Mesh_1119\";\r\n_Mesh_1119.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1119.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1119.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1114 = newComp.layers.addNull();\r\n_Mesh_1114.threeDLayer = true;\r\n_Mesh_1114.source.name = \"_Mesh_1114\";\r\n_Mesh_1114.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1114.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1114.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1115 = newComp.layers.addNull();\r\n_Mesh_1115.threeDLayer = true;\r\n_Mesh_1115.source.name = \"_Mesh_1115\";\r\n_Mesh_1115.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1115.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1115.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1116 = newComp.layers.addNull();\r\n_Mesh_1116.threeDLayer = true;\r\n_Mesh_1116.source.name = \"_Mesh_1116\";\r\n_Mesh_1116.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1116.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1116.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1117 = newComp.layers.addNull();\r\n_Mesh_1117.threeDLayer = true;\r\n_Mesh_1117.source.name = \"_Mesh_1117\";\r\n_Mesh_1117.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1117.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1117.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1110 = newComp.layers.addNull();\r\n_Mesh_1110.threeDLayer = true;\r\n_Mesh_1110.source.name = \"_Mesh_1110\";\r\n_Mesh_1110.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1110.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1110.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1111 = newComp.layers.addNull();\r\n_Mesh_1111.threeDLayer = true;\r\n_Mesh_1111.source.name = \"_Mesh_1111\";\r\n_Mesh_1111.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1111.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1111.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1112 = newComp.layers.addNull();\r\n_Mesh_1112.threeDLayer = true;\r\n_Mesh_1112.source.name = \"_Mesh_1112\";\r\n_Mesh_1112.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1112.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1112.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_1113 = newComp.layers.addNull();\r\n_Mesh_1113.threeDLayer = true;\r\n_Mesh_1113.source.name = \"_Mesh_1113\";\r\n_Mesh_1113.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_1113.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_1113.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_509 = newComp.layers.addNull();\r\n_Mesh_509.threeDLayer = true;\r\n_Mesh_509.source.name = \"_Mesh_509\";\r\n_Mesh_509.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_509.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_509.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_508 = newComp.layers.addNull();\r\n_Mesh_508.threeDLayer = true;\r\n_Mesh_508.source.name = \"_Mesh_508\";\r\n_Mesh_508.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_508.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_508.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_505 = newComp.layers.addNull();\r\n_Mesh_505.threeDLayer = true;\r\n_Mesh_505.source.name = \"_Mesh_505\";\r\n_Mesh_505.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_505.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_505.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_504 = newComp.layers.addNull();\r\n_Mesh_504.threeDLayer = true;\r\n_Mesh_504.source.name = \"_Mesh_504\";\r\n_Mesh_504.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_504.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_504.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_507 = newComp.layers.addNull();\r\n_Mesh_507.threeDLayer = true;\r\n_Mesh_507.source.name = \"_Mesh_507\";\r\n_Mesh_507.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_507.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_507.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_506 = newComp.layers.addNull();\r\n_Mesh_506.threeDLayer = true;\r\n_Mesh_506.source.name = \"_Mesh_506\";\r\n_Mesh_506.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_506.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_506.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_501 = newComp.layers.addNull();\r\n_Mesh_501.threeDLayer = true;\r\n_Mesh_501.source.name = \"_Mesh_501\";\r\n_Mesh_501.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_501.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_501.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_500 = newComp.layers.addNull();\r\n_Mesh_500.threeDLayer = true;\r\n_Mesh_500.source.name = \"_Mesh_500\";\r\n_Mesh_500.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_500.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_500.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_503 = newComp.layers.addNull();\r\n_Mesh_503.threeDLayer = true;\r\n_Mesh_503.source.name = \"_Mesh_503\";\r\n_Mesh_503.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_503.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_503.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_502 = newComp.layers.addNull();\r\n_Mesh_502.threeDLayer = true;\r\n_Mesh_502.source.name = \"_Mesh_502\";\r\n_Mesh_502.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_502.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_502.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_211 = newComp.layers.addNull();\r\n_Mesh_211.threeDLayer = true;\r\n_Mesh_211.source.name = \"_Mesh_211\";\r\n_Mesh_211.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_211.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_211.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_210 = newComp.layers.addNull();\r\n_Mesh_210.threeDLayer = true;\r\n_Mesh_210.source.name = \"_Mesh_210\";\r\n_Mesh_210.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_210.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_210.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_213 = newComp.layers.addNull();\r\n_Mesh_213.threeDLayer = true;\r\n_Mesh_213.source.name = \"_Mesh_213\";\r\n_Mesh_213.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_213.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_213.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_212 = newComp.layers.addNull();\r\n_Mesh_212.threeDLayer = true;\r\n_Mesh_212.source.name = \"_Mesh_212\";\r\n_Mesh_212.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_212.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_212.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_215 = newComp.layers.addNull();\r\n_Mesh_215.threeDLayer = true;\r\n_Mesh_215.source.name = \"_Mesh_215\";\r\n_Mesh_215.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_215.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_215.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_214 = newComp.layers.addNull();\r\n_Mesh_214.threeDLayer = true;\r\n_Mesh_214.source.name = \"_Mesh_214\";\r\n_Mesh_214.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_214.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_214.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_217 = newComp.layers.addNull();\r\n_Mesh_217.threeDLayer = true;\r\n_Mesh_217.source.name = \"_Mesh_217\";\r\n_Mesh_217.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_217.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_217.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_216 = newComp.layers.addNull();\r\n_Mesh_216.threeDLayer = true;\r\n_Mesh_216.source.name = \"_Mesh_216\";\r\n_Mesh_216.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_216.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_216.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_219 = newComp.layers.addNull();\r\n_Mesh_219.threeDLayer = true;\r\n_Mesh_219.source.name = \"_Mesh_219\";\r\n_Mesh_219.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_219.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_219.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_218 = newComp.layers.addNull();\r\n_Mesh_218.threeDLayer = true;\r\n_Mesh_218.source.name = \"_Mesh_218\";\r\n_Mesh_218.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_218.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_218.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_699 = newComp.layers.addNull();\r\n_Mesh_699.threeDLayer = true;\r\n_Mesh_699.source.name = \"_Mesh_699\";\r\n_Mesh_699.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_699.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_699.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_698 = newComp.layers.addNull();\r\n_Mesh_698.threeDLayer = true;\r\n_Mesh_698.source.name = \"_Mesh_698\";\r\n_Mesh_698.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_698.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_698.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_695 = newComp.layers.addNull();\r\n_Mesh_695.threeDLayer = true;\r\n_Mesh_695.source.name = \"_Mesh_695\";\r\n_Mesh_695.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_695.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_695.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_694 = newComp.layers.addNull();\r\n_Mesh_694.threeDLayer = true;\r\n_Mesh_694.source.name = \"_Mesh_694\";\r\n_Mesh_694.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_694.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_694.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_697 = newComp.layers.addNull();\r\n_Mesh_697.threeDLayer = true;\r\n_Mesh_697.source.name = \"_Mesh_697\";\r\n_Mesh_697.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_697.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_697.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_696 = newComp.layers.addNull();\r\n_Mesh_696.threeDLayer = true;\r\n_Mesh_696.source.name = \"_Mesh_696\";\r\n_Mesh_696.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_696.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_696.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_691 = newComp.layers.addNull();\r\n_Mesh_691.threeDLayer = true;\r\n_Mesh_691.source.name = \"_Mesh_691\";\r\n_Mesh_691.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_691.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_691.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_690 = newComp.layers.addNull();\r\n_Mesh_690.threeDLayer = true;\r\n_Mesh_690.source.name = \"_Mesh_690\";\r\n_Mesh_690.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_690.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_690.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_693 = newComp.layers.addNull();\r\n_Mesh_693.threeDLayer = true;\r\n_Mesh_693.source.name = \"_Mesh_693\";\r\n_Mesh_693.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_693.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_693.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_692 = newComp.layers.addNull();\r\n_Mesh_692.threeDLayer = true;\r\n_Mesh_692.source.name = \"_Mesh_692\";\r\n_Mesh_692.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_692.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_692.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_325 = newComp.layers.addNull();\r\n_Mesh_325.threeDLayer = true;\r\n_Mesh_325.source.name = \"_Mesh_325\";\r\n_Mesh_325.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_325.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_325.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_324 = newComp.layers.addNull();\r\n_Mesh_324.threeDLayer = true;\r\n_Mesh_324.source.name = \"_Mesh_324\";\r\n_Mesh_324.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_324.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_324.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_327 = newComp.layers.addNull();\r\n_Mesh_327.threeDLayer = true;\r\n_Mesh_327.source.name = \"_Mesh_327\";\r\n_Mesh_327.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_327.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_327.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_326 = newComp.layers.addNull();\r\n_Mesh_326.threeDLayer = true;\r\n_Mesh_326.source.name = \"_Mesh_326\";\r\n_Mesh_326.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_326.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_326.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_321 = newComp.layers.addNull();\r\n_Mesh_321.threeDLayer = true;\r\n_Mesh_321.source.name = \"_Mesh_321\";\r\n_Mesh_321.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_321.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_321.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_320 = newComp.layers.addNull();\r\n_Mesh_320.threeDLayer = true;\r\n_Mesh_320.source.name = \"_Mesh_320\";\r\n_Mesh_320.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_320.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_320.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_323 = newComp.layers.addNull();\r\n_Mesh_323.threeDLayer = true;\r\n_Mesh_323.source.name = \"_Mesh_323\";\r\n_Mesh_323.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_323.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_323.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_322 = newComp.layers.addNull();\r\n_Mesh_322.threeDLayer = true;\r\n_Mesh_322.source.name = \"_Mesh_322\";\r\n_Mesh_322.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_322.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_322.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_329 = newComp.layers.addNull();\r\n_Mesh_329.threeDLayer = true;\r\n_Mesh_329.source.name = \"_Mesh_329\";\r\n_Mesh_329.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_329.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_329.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_328 = newComp.layers.addNull();\r\n_Mesh_328.threeDLayer = true;\r\n_Mesh_328.source.name = \"_Mesh_328\";\r\n_Mesh_328.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_328.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_328.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_039 = newComp.layers.addNull();\r\n_Mesh_039.threeDLayer = true;\r\n_Mesh_039.source.name = \"_Mesh_039\";\r\n_Mesh_039.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_039.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_039.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_038 = newComp.layers.addNull();\r\n_Mesh_038.threeDLayer = true;\r\n_Mesh_038.source.name = \"_Mesh_038\";\r\n_Mesh_038.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_038.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_038.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_031 = newComp.layers.addNull();\r\n_Mesh_031.threeDLayer = true;\r\n_Mesh_031.source.name = \"_Mesh_031\";\r\n_Mesh_031.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_031.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_031.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_030 = newComp.layers.addNull();\r\n_Mesh_030.threeDLayer = true;\r\n_Mesh_030.source.name = \"_Mesh_030\";\r\n_Mesh_030.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_030.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_030.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_033 = newComp.layers.addNull();\r\n_Mesh_033.threeDLayer = true;\r\n_Mesh_033.source.name = \"_Mesh_033\";\r\n_Mesh_033.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_033.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_033.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_032 = newComp.layers.addNull();\r\n_Mesh_032.threeDLayer = true;\r\n_Mesh_032.source.name = \"_Mesh_032\";\r\n_Mesh_032.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_032.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_032.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_035 = newComp.layers.addNull();\r\n_Mesh_035.threeDLayer = true;\r\n_Mesh_035.source.name = \"_Mesh_035\";\r\n_Mesh_035.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_035.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_035.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_034 = newComp.layers.addNull();\r\n_Mesh_034.threeDLayer = true;\r\n_Mesh_034.source.name = \"_Mesh_034\";\r\n_Mesh_034.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_034.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_034.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_037 = newComp.layers.addNull();\r\n_Mesh_037.threeDLayer = true;\r\n_Mesh_037.source.name = \"_Mesh_037\";\r\n_Mesh_037.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_037.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_037.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\nvar _Mesh_036 = newComp.layers.addNull();\r\n_Mesh_036.threeDLayer = true;\r\n_Mesh_036.source.name = \"_Mesh_036\";\r\n_Mesh_036.property(\"position\").setValue([960.000000,540.000000,0.000000],);\r\n_Mesh_036.property(\"orientation\").setValue([0.000009,-0.000000,0.000000],);\r\n_Mesh_036.property(\"scale\").setValue([0.719434,0.719434,0.719434],);\r\n\r\n\r\n// ************** LIGHTS **************\r\n\r\n\r\n// ************** CAMERAS **************\r\n\r\n\r\nvar _Camera = newComp.layers.addCamera(\"_Camera\",[0,0]);\r\n_Camera.autoOrient = AutoOrientType.NO_AUTO_ORIENT;\r\n_Camera.property(\"position\").setValue([1708.113155,5.633488,-650.763988],);\r\n_Camera.property(\"orientation\").setValue([-36.096345,-40.909176,-24.830890],);\r\n_Camera.property(\"zoom\").setValue(2100.000000,);\r\n\r\n\r\n\r\n}else{alert (\"Exit Import Blender animation data \\nNo Comp's name has been chosen\",\"EXIT\")};}", "function SelectFurniComponent(main){\n\n\tvar intersects = main.getIntersects( main.onUpPosition, main.furniture.getObjects());\n\n\tif ( intersects.length > 0 ) {\n\n\t\tvar object = intersects[ 0 ].object;\n\t\t//if select the same component, record the click position\n\t\tif(main.component == object){\n\t\t\tmain.fixpointball = true;\n\t\t\tmain.AddRodFunc();\n\t\t}\n\n\t\tif ( object.userData.object !== undefined ) {\n\t\t\tmain.select( object.userData.object );\n\t\t\tmain.component = object.userData.object;\n\t\t} else {\n\t\t\tmain.select( object );\n\t\t\tmain.component = object;\n\t\t}\n\t} else {\n\t\t//it also calls select, to detach\n\t\tmain.select( null );\n\t}\n\n}", "minus1Life() {\n console.log(\"entered\")\n if (this.lifesGroup.getTotalUsed() == 0) {\n console.log(\"game over\")\n this.scene.scene.stop();\n this.scene.music.stop();\n console.log(this.scene.pontos)\n this.scene.scene.start(\"GameOver\",{points: this.scene.pontos})\n\n } else {\n console.log(\" a tirar vida\")\n let heartzito = this.lifesGroup.getFirstAlive();\n heartzito.active = false;\n heartzito.visible = false;\n //heartzito.killAndHide()\n console.log(this.lifesGroup.getTotalUsed())\n }\n\n }", "function Start () {\n\n\t//controlCenter = GameObject.Find(\"Control Center\");\n\tgameManager = GameObject.Find(\"Control Center2\").GetComponent(GameManager_F);//###\n\tfPCamera= GameObject.Find(\"Main Camera\");\n\tfPController = GameObject.Find(\"First Person Controller\");\n\t\n\t//initialize GUI \n\twalkSpeed = fPController.GetComponent(CharacterMotor).movement.maxForwardSpeed;\n\tturnSpeed = fPController.GetComponent(FPAdventurerInputController_F).rotationSpeed;\n\tuseText = gameManager.useText; \n\tobjectDescriptions = gameManager.useLongDesc;\n\tmoColor = gameManager.mouseOverColor; // get color, since there is no element\n\t\n\tUpdateSettings(); // update the array that holds the settings\t\n}", "init() { \n this.ecs.set(this, \"Game\", \"game\", \"scene\")\n }", "function Start()\n{\n\tcol=gameObject.GetComponent(BoxCollider2D);\n}", "function Update ()\t{\n\n if (white==\"w\")\n {\n whiteb.gameObject.SetActive(true);\n blackb.gameObject.SetActive(false);\n }else\n {\n whiteb.gameObject.SetActive(false);\n blackb.gameObject.SetActive(true);\n }\n\n // added to restart if game Over !!!!!!!!!!!!!!!!!!!!!!!!\n\tif (gameover){Application.LoadLevel (0);}\n\n if (restart) { \n Application.LoadLevel (0); \n } \n if (quit) {\n Application.Quit();\n }\n \n\t\n\t\n if(!C0.c0_moving)\tActivateCamera(false);\n if(FirstStart) {// could be right in Start(), anyway it's the same..., sometimes good to wait a bit while all the objects are being created...\t\t\n if(mode==1 || mode==2) {\n PlanesOnBoard();\t\t\t\t\t// Planes needed for mouse drag... (a ray from camera to this rigibody object is catched)...\n TransformVisualAllToH1();\t\t// The board contains blank-pieces (to clone from) just on some squares. Moving all of them to h1... \n\t\t\n //1.FEN startup test (ok):\t\n //C0.c0_start_FEN=\"8/p3r1k1/6p1/3P2Bp/p4N1P/p5P1/5PK1/8 w - - 0 1\";\n //C0.c0_set_start_position(\"\");\n //print(C0.c0_get_FEN());\n\t\t\t\t\n //C0.c0_start_FEN=\"7k/Q7/2P2K2/8/8/8/8/8 w - - 0 70\";\t\t// a checkmate position just for tests...\n\t\t\n C0.c0_side=1;\t\t\t\t\t\t\t// This side is white. For black set -1\n C0.c0_waitmove=true;\t\t\t\t\t// Waiting for mouse drag...\n C0.c0_set_start_position(\"\");\t\t// Set the initial position... \n }\n }\n\t\n DoPieceMovements();\t\t\t\t\t\t\t// All the movements of pieces (constant frames per second for rigidbody x,y,z)...\n if(mode==1) DoEngineMovements();\t\t\t\t\t\t\t// If chess engine should do a move...\n else if(mode==2) checkGameover();\n MouseMovement();\t\t\t\t\t\t\t\t// Mouse movement events, suggest legal moves...\n RollBackAction();\t\t\t\t\t\t\t\t\t// If a takeback should be performed/ or new game started..\n\n if(FirstStart)\t{\n position2board();\t\t\t\t\t// Set current position on the board visually...\n HideBlankPieces();\t\t\t\t\t// Hide blank-pieces...\n if(mode==1 || mode==2) {\n FirstStart=false;\n }\n }\n else\t{\n DragDetect();\t\t\t\t\t\t// If mouse pressed on any square...\n }\n\n\n // added here *********************************************\n if(FirstStart) {\n mode=2;\n }else\n\t\t{ if(engineStatus==1) { engineStatus=2; }}\n\t\t//*****************************************************************\n\n }", "setActive() {\n GameManager.activeGame = this;\n }", "function Start() {\n barn.obj.collider.SetSphereCall(BarnCollCallback);\n game.CowsSavedByLevelZero();\n game.SetLevelBounds(fence);\n\n barnBarrier.mdlHdlr.active = true;\n barnBarrier.mdlHdlr.SetTintAlpha(1.0);\n barnBarrier.collider.SetActive(true);\n barnBarrier.collider.SetSphereCall(BarrierCollCallback);\n\n ufo.SetTractorBeamingCallback(ReleaseCowCallback);\n ufo.SetActive(false);\n ufo.SetVisible(false);\n ufo.SetAlpha(0.0);\n\n player.ResetMotion();\n player.obj.trfmBase.SetPosByAxes(0.0, 0.0, 20);\n game.RaiseToGroundLevel(player.obj);\n player.AddAmmoContainer(game.AmmoTypes.hayBale);\n\n for(var i = 0; i < cows.length; i++ ) {\n cows[i].SetVisible(false);\n cows[i].trfmBase.SetUpdatedRot(VEC3_UP, Math.random() * 360.0);\n }\n // Start off with just three cows.\n for(var i = 0; i < NUM_COWS_PHASE_1; i++ ) {\n cows[i].SetVisible(true);\n cows[i].trfmBase.SetPosByAxes(phase1CowPos[i][0], phase1CowPos[i][1], phase1CowPos[i][2]);\n game.RaiseToGroundLevel(cows[i]);\n activeCows.push(cows[i]);\n }\n game.CowsEncounteredAdd(activeCows.length);\n\n for(var i = 0; i < haybales.length; i++ ) {\n haybales[i].SetVisible(true);\n haybales[i].trfmBase.SetPosByAxes(balePos[i][0], balePos[i][1], balePos[i][2]);\n game.RaiseToGroundLevel(haybales[i]);\n }\n activeHaybales = haybales.slice();\n\n for(var i = 0; i < MAX_PROBES; i++) {\n allProbes[i].SetVisible(true);\n allProbes[i].obj.trfmBase.SetPosByAxes(probePos[i][0], probePos[i][1], probePos[i][2]);\n }\n activeProbes = allProbes.slice();\n\n InGameMsgr.ChangeMsgSequence(\"level02\");\n scene.SetLoopCallback(MsgUpdate);\n player.SetControlActive(false);\n msgLimit = 6;\n lvlPhases = 0;\n\n hud.guiTextObjs[\"caughtBaleInfo\"].SetActive(true);\n\n GameMngr.assets.sounds['windSoft'].play();\n GameMngr.assets.sounds['windSoft'].loop = true;\n }", "function Awake(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// --> Awake\n\tPhysics.IgnoreLayerCollision(8, 9, true);\t\t\t\t\t\t\t\t\t\t// Ignore collision between Layer 8 : \"Board\" and Layer 9 : \"Paddle\"\n\tPhysics.IgnoreLayerCollision(10, 9, true);\t\t\t\t\t\t\t\t\t\t// Ignore collision between Layer 8 : \"Board\" and Layer 9 : \"Paddle\"\n\tPhysics.IgnoreLayerCollision(11, 9, true);\t\t\t\t\t\t\t\t\t\t// Ignore collision between Layer 8 : \"Board\" and Layer 9 : \"Paddle\"\n\tPhysics.IgnoreLayerCollision(12, 9, true);\t\t\t\t\t\t\t\t\t\t// Ignore collision between Layer 8 : \"Board\" and Layer 9 : \"Paddle\"\n\tPhysics.IgnoreLayerCollision(13, 9, true);\t\t\t\t\t\t\t\t\t\t// Ignore collision between Layer 8 : \"Board\" and Layer 9 : \"Paddle\"\n\tPhysics.IgnoreLayerCollision(0, 9, true);\t\t\t\t\t\t\t\t\t\t// Ignore collision between Layer 8 : \"Default\" and Layer 9 : \"Paddle\"\n\tsource = GetComponent.<AudioSource>();\t\t\t\t\t\t\t\t\t\t\t// Access GetComponent.<AudioSource>()\n\tobj_Game_Manager = GameObject.Find(\"Manager_Game\");\t\t\t\t\t\t\t \n\tif(obj_Game_Manager!=null)\n\tgameManager_Input = obj_Game_Manager.GetComponent.<Manager_Input_Setting>();\t// \tAccess GetComponent..<Manager_Input_Setting>() from the gameObject Manager_Game on the hierarchy\n}", "addComponent () {\n if ( this.data.components[this.data.location-1] < CONSTS.MAX_COMPONENTS ) {\n this.data.components[this.data.location-1] += 1\n }\n }", "function test07(){\n console.log(\"Test 07: Lose life when bird hits the obstacle: \");\n myObstacles[0] = new component(down_img, 20, 100, \"green\", game.bird.x+5, game.bird.y+5);\n if(myObstacles[0].crashWith(game.bird))\n console.log(\"Passed.\");\n else\n console.log(\"Failed.\");\n}", "function Start () {\n\told_color = GetComponent.<Renderer>().material.color;\n//\tcs1 = GetComponent(\"testC\");\n// print(\"c#变量\" + cs1.GetType().GetField(\"move_speed\").GetValue(cs1) + \"在js中调用 \");//调用C#变量\n// cs1.PrintCS(\"testC\");\n DataHandler.handler = GetComponent(\"DataHandler\");// = GetComponent(\"DataHandler\");\n (DataHandler.handler.GetType().GetField(\"m_MyEvent\").GetValue(DataHandler.handler) as MyEvent).AddListener(callback);\n Application.ExternalCall(\"loadGameComplete\");\n}", "isActive() {\r\n return this.gameActive;\r\n }", "function Awake () {\n\tmotor = GetComponent(CharacterMotor);\n}", "function Awake () {\n\tmotor = GetComponent(CharacterMotor);\n}", "constructor(scene) {\n //\n this.lightBlue = new BABYLON.StandardMaterial('lightBlue', scene);\n this.lightBlue.diffuseColor = new BABYLON.Color3(.2,.6,.9);\n\n this.olive = new BABYLON.StandardMaterial('olive', scene);\n this.olive.diffuseColor = BF.ColorRGB(128,128,0);\n\n this.yellow = new BABYLON.StandardMaterial('yellow', scene);\n this.yellow.diffuseColor = BF.ColorRGB(255,255,0);\n\n this.red = new BABYLON.StandardMaterial('red', scene);\n this.red.diffuseColor = BF.ColorRGB(255,0,0);\n\n this.blue = new BABYLON.StandardMaterial('blue', scene);\n this.blue.diffuseColor = BF.ColorRGB(0,0,255);\n\n this.black = new BABYLON.StandardMaterial('black', scene);\n this.black.diffuseColor = BF.ColorRGB(0,0,0);\n\n this.chill = new BABYLON.StandardMaterial(\"chill\", scene);\n this.chill.diffuseTexture = new BABYLON.Texture(\"https://images.squarespace-cdn.com/content/537cfc28e4b0785074d4ae25/1471358583532-I9LQ4LV67S3I8Y4XH7DA/?content-type=image%2Fpng\", scene);\n\n this.bwPattern = new BABYLON.StandardMaterial(\"bwPattern\", scene);\n this.bwPattern.diffuseTexture = new BABYLON.Texture(\"https://i.imgur.com/QqKNS1o.png\", scene);\n\n this.blueWavy = new BABYLON.StandardMaterial(\"bwPattern\", scene);\n this.blueWavy.diffuseTexture = new BABYLON.Texture(\"https://i.imgur.com/CRfSAXN.png\", scene);\n\n this.wArrow = new BABYLON.StandardMaterial(\"wArrow\", scene);\n this.wArrow.diffuseTexture = new BABYLON.Texture(\"https://i.imgur.com/HhdoVoA.png\", scene);\n this.wArrow.emissiveColor = BF.ColorRGB(40,40,40);\n\n this.wArrow2 = new BABYLON.StandardMaterial(\"wArrow2\", scene);\n this.wArrow2.diffuseTexture = new BABYLON.Texture(\"https://i.imgur.com/kczDhDm.png\", scene);\n\n this.xAxis = new BABYLON.StandardMaterial(\"xAxis\", scene);\n this.xAxis.diffuseColor = new BABYLON.Color3(1,0,0);\n\n this.yAxis = new BABYLON.StandardMaterial(\"yAxis\", scene);\n this.yAxis.diffuseColor = new BABYLON.Color3(0,1,0);\n\n this.zAxis = new BABYLON.StandardMaterial(\"zAxis\", scene);\n this.zAxis.diffuseColor = new BABYLON.Color3(0,0,1);\n\n this.zAxis = new BABYLON.StandardMaterial(\"zAxis\", scene);\n this.zAxis.diffuseColor = new BABYLON.Color3(0,0,1);\n\n this.axesSphere = new BABYLON.StandardMaterial(\"axesSphere\", scene);\n this.axesSphere.diffuseColor = BF.ColorRGB(200,200,200);\n\n this.sun = new BABYLON.StandardMaterial('sun', scene);\n this.sun.emissiveColor = BF.ColorRGB(255,255,100);\n\n this.darkSun = new BABYLON.StandardMaterial('sun', scene);\n this.darkSun.emissiveColor = BF.ColorRGB(55,55,10);\n\n this.moon = new BABYLON.StandardMaterial('moon', scene);\n this.moon.diffuseTexture = new BABYLON.Texture('https://i.imgur.com/i2iDYgn.png', scene);\n this.moon.emissiveColor = BF.ColorRGB(220,220,220);\n\n this.darkMoon = new BABYLON.StandardMaterial('darkMoon', scene);\n this.darkMoon.diffuseTexture = this.moon.diffuseTexture;\n this.darkMoon.emissiveColor = BF.ColorRGB(100,100,100);\n\n this.darkMoonUB = new BABYLON.StandardMaterial('darkMoonUB', scene);\n this.darkMoonUB.diffuseTexture = this.moon.diffuseTexture;\n\n this.galaxy = new BABYLON.StandardMaterial('galaxy', scene);\n this.galaxy.diffuseTexture = new BABYLON.Texture('https://i.imgur.com/eZiIipX.png', scene);\n this.galaxy.emissiveColor = BF.ColorRGB(150,150,150);\n\n this.bluePlanet = new BABYLON.StandardMaterial('bluePlanet', scene);\n this.bluePlanet.diffuseTexture = new BABYLON.Texture('https://i.imgur.com/WuDcHxN.png', scene);\n this.bluePlanet.emissiveColor = BF.ColorRGB(150,150,150);\n\n this.jupiter = new BABYLON.StandardMaterial('jupiter', scene);\n this.jupiter.diffuseTexture = new BABYLON.Texture('https://i.imgur.com/wAGQBuU.png', scene);\n\n this.nebula = new BABYLON.StandardMaterial('nebula', scene);\n this.nebula.diffuseTexture = new BABYLON.Texture('https://i.imgur.com/cPAh4KM.png', scene);\n this.nebula.emissiveColor = BF.ColorRGB(100,100,100);\n\n this.underBlock = new BABYLON.StandardMaterial('underBlock', scene);\n this.underBlock.diffuseTexture = new BABYLON.Texture(\"https://i.imgur.com/B2vjChP.png\", scene);\n\n this.starry = new BABYLON.StandardMaterial('starry', scene);\n this.starry.diffuseTexture = new BABYLON.Texture('https://i.imgur.com/yRbRwyD.png', scene);\n\n this.skyBox = new BABYLON.StandardMaterial(\"skyBox\", scene);\n this.skyBox.backFaceCulling = false;\n this.skyBox.reflectionTexture = new BABYLON.CubeTexture(\"https://i.imgur.com/0XiOCjt.png\", scene);\n this.skyBox.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;\n this.skyBox.diffuseColor = new BABYLON.Color3(0, 0, 0);\n this.skyBox.specularColor = new BABYLON.Color3(0, 0, 0);\n\n window.axesMats = [this.xAxis, this.yAxis, this.zAxis, this.axesSphere];\n }", "function Awake()\n{\n\tplayer = GameObject.FindWithTag (\"Player\");\n\t//pyramid = GameObject.FindWithTag (\"Pyramid\");\n\tdaemonHealth = transform.parent.GetComponent.<Health>();\n}", "_activate() {\n\n if (global.activeCard) global.activeCard.classList.remove('active-card');\n this.card.classList.add('active-card');\n global.activeCard = this.card;\n global.activeVideo = this;\n }", "function OnCollisionEnter (col : Collision)\n{\n if(manager.turn != color)\n {\t\n \tif(col.gameObject.tag == \"Active White Piece\" || col.gameObject.tag == \"Inactive White Piece\" || col.gameObject.tag == \"Active Black Piece\" || col.gameObject.tag == \"Inactive Black Piece\")\n {\n \tDestroy(gameObject);\n }\n } \n}", "create() {\n this.cameras.main.fadeIn(550);\n\n let that = this;\n\n this.width = this.sys.game.config.width;\n this.height = this.sys.game.config.height;\n\n var background = this.add.sprite(UsefulMethods.RelativePosition(50, \"x\", this), UsefulMethods.RelativePosition(50, \"y\", this), 'SettingsBackground');\n background.setDepth(-100);\n background.setAlpha(0.3);\n var gnome = this.add.image(UsefulMethods.RelativePosition(27.5, \"x\", this), UsefulMethods.RelativePosition(45, \"y\", this), 'gnome-dead');\n gnome.scaleX = UsefulMethods.RelativeScale(0.062, \"x\", this);\n gnome.scaleY = gnome.scaleX;\n\n // this.lights.enable();\n if (!(this.sys.game.device.os.android || this.sys.game.device.os.iOS || this.sys.game.device.os.iPad || this.sys.game.device.os.iPhone)) {\n\n this.input.on('pointermove', function (pointer) {\n light.x = pointer.x;\n light.y = pointer.y;\n });\n\n }\n var light = this.lights.addLight(0, 0, 100000, 0xe6fcf5, 0.2);\n this.lights.enable().setAmbientColor(0xc3c3c3);\n background.setPipeline('Light2D');\n gnome.setPipeline('Light2D');\n var lightGnome = this.lights.addLight(UsefulMethods.RelativePosition(50, \"x\", this), UsefulMethods.RelativePosition(50, \"y\", this), 100000, 0xe6fcf5, 0.8);\n\n gnome.setTint(0xb8b7b8);\n\n UsefulMethods.print(\"Game Over\");\n\n background.scaleX = UsefulMethods.RelativeScale(0.08, \"x\", this);\n background.scaleY = background.scaleX;\n\n let gameOver = 'GAME OVER';\n let tryAgain = 'Try again?';\n\n switch (this.sys.game.language) {\n case \"en\":\n gameOver = 'GAME OVER';\n tryAgain = 'Try again?';\n break;\n case \"es\":\n gameOver = 'FIN DEL JUEGO';\n tryAgain = '¿Volver a intentarlo?';\n break;\n default:\n break;\n }\n\n this.gameOverText = this.add.text(UsefulMethods.RelativePosition(72, \"x\", this), UsefulMethods.RelativePosition(25, \"y\", this), gameOver, { fontFamily: '\"amazingkids_font\"', fontSize: 102, color: '#ff5e5e' });\n this.gameOverText.setOrigin(0.5, 0.5);\n\n this.axeIcon = this.add.image(UsefulMethods.RelativePosition(68, \"x\", this), UsefulMethods.RelativePosition(38, \"y\", this), 'AxeIconBorderless');\n this.axeIcon.scaleX = UsefulMethods.RelativeScale(0.008, 'x', this);\n this.axeIcon.scaleY = this.axeIcon.scaleX;\n\n this.scoreText = this.add.text(UsefulMethods.RelativePosition(72, \"x\", this), UsefulMethods.RelativePosition(38, \"y\", this), this.sys.game.score, { fontFamily: '\"amazingkids_font\"', fontSize: 42, color: 'white' });\n this.scoreText.setOrigin(0.5, 0.5);\n\n this.confirmationText = this.add.text(UsefulMethods.RelativePosition(72, \"x\", this), UsefulMethods.RelativePosition(55, \"y\", this), tryAgain, { fontFamily: '\"amazingkids_font\"', fontSize: 52, color: 'white' });\n this.confirmationText.setOrigin(0.5, 0.5);\n\n this.confButton = new Button({ scene: this, x: 80, y: 73, texture: 'Tick', frame: 0, scale: 0.0135 });\n this.confButton.create();\n this.confButton.setAlpha(1);\n\n this.confButton.pointerUp = function () {\n UsefulMethods.print(\"Pointerup1\");\n that.cameras.main.fadeOut(200);\n that.scene.get(\"GameOver\").time.addEvent({ delay: 210, callback: function () { that.scene.start('Level_' + that.sys.game.levelIndex); }, callbackScope: this, loop: false });\n\n }\n\n this.denyButton = new Button({ scene: this, x: 63.5, y: 73, texture: 'Cross', frame: 0, scale: 0.0135 });\n this.denyButton.create();\n this.denyButton.setAlpha(1);\n\n this.denyButton.pointerUp = function () {\n UsefulMethods.print(\"Pointerup1\");\n that.cameras.main.fadeOut(200);\n that.scene.get(\"GameOver\").time.addEvent({ delay: 210, callback: function () { that.scene.start('mainMenu'); }, callbackScope: this, loop: false });\n }\n\n this.gameOverText.setDepth(100);\n this.gameOverText.scaleX = UsefulMethods.RelativeScale(0.08, 'x', this)\n this.gameOverText.scaleY = this.gameOverText.scaleX;\n\n this.scoreText.setDepth(100);\n this.scoreText.scaleX = UsefulMethods.RelativeScale(0.08, 'x', this)\n this.scoreText.scaleY = this.scoreText.scaleX;\n\n this.confirmationText.setDepth(100);\n this.confirmationText.scaleX = UsefulMethods.RelativeScale(0.08, 'x', this)\n this.confirmationText.scaleY = this.confirmationText.scaleX;\n }", "function Awake ()\n{\n\tplayersinv = GetComponent(Inventory);\n\n\tif (useCustomPosition == false)\n\t{\n\t\twindowRect = Rect(Screen.width-windowSize.x-70,Screen.height-windowSize.y-(162.5+70*2),windowSize.x,windowSize.y);\n\t}\n\telse\n\t{\n\t\twindowRect = Rect(customPosition.x,customPosition.y,windowSize.x,windowSize.y);\n\t}\n\tinvAudio = GetComponent(InvAudio);\n\tif (GetComponent(InventoryDisplay).onOffButton == onOffButton)\n\t{\n\t\tinvDispKeyIsSame = true;\n\t}\n}", "constructor(scene, x, y, frame) {\n super(scene, x, y);\n this.scene = scene;\n this.sprite = this.scene.add.sprite(x, y, 'chara');\n this.sprite.name = 'finePeople';\n this.scene.physics.world.enable(this.sprite, Phaser.Physics.ARCADE);\n\n this.sprite.body.collideWorldBounds = true;\n this.sprite.body.bounce.setTo(0, 0);\n this.sprite.body.immovable = true;\n this.sprite.body.onCollide = true;\n this.sprite.hasFeeling = true;\n this.sprite.parent = this;\n this.scene.add.existing(this);\n }", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "function Start () {\n\ntargetScript = GameObject.Find(\"Station\").GetComponent(TargetingSystem);\nradarScript = GameObject.Find(\"RadarZone\").GetComponent(Radar);\n\n\n}", "function Update () { \n\tif (Input.GetMouseButton(0)){\n\t\tvar hit : RaycastHit;\n\t\tif (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), hit, 50)){\n\t\t\tif (hit.transform.tag == \"Item\"){\n\t\t\t\thit.transform.gameObject.BroadcastMessage(\"changeActivation\");\n\t\t\t}\n\t\t}\n\t\t//test.BroadcastMessage(\"changeActivation\");\n\t}\n}", "function choque(){\n\n isChoque = true;\n bntRestart = this.add.sprite(130,300,'btnNuevaPartida').setInteractive();\n //game.state.start(game.state.current);\n bntRestart.setOrigin(0);\n bntRestart.setScale(1.5);\n asteroids.setVelocity(0,0);\n stars.setVelocity(0,0);\n }", "function Awake()\n{\n levelGoal.GetComponent(MeshCollider).isTrigger = false;\n playerLink = GameObject.Find(\"Player\");\n if (!playerLink)\n Debug.Log(\"Could not get link to Lerpz\");\n levelGoal.GetComponent(MeshCollider).isTrigger = false; // make very sure of this!\n}", "onTime(timeInsecond) {\n if (Constants.isSlowDown()) {\n for (let i = 0; i < 2*1e8; ++i) {\n let y = i * i;\n }\n }\n\n let ds = timeInsecond - this._time;\n this._time = timeInsecond;\n\n //this._camera.setBoundary(this._world.getLevelBoundary());\n this._gameOverseer.notifyBegin();\n\n let margin = Constants.blockSize() * 6;\n let objectsInScreen = this._world.select(\n this._camera.getX() - margin,\n this._camera.getY() - margin,\n this.getScreenGeometry()[0] + 2 * margin,\n this.getScreenGeometry()[1] + 2 * margin);\n\n if (objectsInScreen.length == 0) {\n this.forceFocusOnHero();\n objectsInScreen = this._world.objectsIterator();\n console.log('forcing all');\n }\n\n for (let obj of objectsInScreen) {\n // Camera\n if (obj.traits.has('tracked_by_camera')) {\n this._camera.notifyTrackedObject(obj);\n }\n\n // Ticks trigger...\n this._gameOverseer.tick(obj);\n obj.tick();\n obj.traits.tick();\n\n // Remove objects out of ttl.\n if (obj.traits.has('engine_rm')) {\n this._world.deleteObject(obj);\n }\n\n if (obj.traits.has('controllable')) {\n for (let l of this._input) {\n obj.input(l);\n }\n }\n\n // Gravity\n //\n // y+\n // ^\n // |\n // |\n // -----> x+\n if (obj.traits.has('gravity')) {\n let pullForce = 0.5;\n let friction = 0.1;\n\n if (obj.traits.has('on_surface')) {\n friction *= 1.5;\n }\n\n // ::-: instead of having this, gravity override should be\n // in state which is associated with gravity.\n if (obj.traits.has('low_gravity')) {\n pullForce /= 2.0;\n friction /= 2.0;\n }\n\n // Left-right friction.\n let pos = obj.vx >= 0;\n if (!pos) obj.vx = -obj.vx;\n obj.vx = obj.vx - obj.vx * friction;\n if (!pos) obj.vx = -obj.vx;\n\n // Pull-down.\n if (!obj.traits.has('jumping')) {\n obj.vy -= pullForce;\n\n let vyMax = 10;\n if (obj.vy < 0) {\n obj.vy = Math.max(obj.vy, -vyMax);\n } else {\n obj.vy = Math.min(obj.vy, 1.5*vyMax);\n }\n }\n }\n\n if (obj.traits.has('velocity')) {\n obj.x = obj.x + (obj.vx);\n obj.y = obj.y + (obj.vy);\n\n if (Math.abs(obj.vx) < 0.001) obj.vx = 0;\n if (Math.abs(obj.vy) < 0.001) obj.vy = 0;\n }\n\n // Kill objects that fall-off stage.\n if (obj.y <= -100) {\n obj.traits.set('kill', 0);\n }\n\n } // while world objects iteration\n\n // We apply collisions in a seperate loop to avoid having the following\n // sequence of events:\n // - obj1 removed from colision with obj2.\n // - obj1 applied gravity down\n //\n // This could also be resolved by making sure the object action on\n // in collision function is always the same one that was already\n // moved.\n for (let obj of objectsInScreen) {\n if (obj.traits.has('background')) {\n continue;\n }\n\n // Apply collisions; don't dedup so (l, r) then (r, l) will happen.\n for (let nearbyObj of this._world.getNearbyObjects(obj)) {\n if (nearbyObj.traits.has('background')) {\n continue;\n }\n\n // Convention: current object is on RHS.\n if (nearbyObj != obj) {\n if (Collisions.isCollide(nearbyObj, obj)) {\n Collisions.collide(nearbyObj, obj, this._world, this);\n }\n }\n }\n }\n\n // Update position for display engine -- do last.\n for (let obj of objectsInScreen) {\n //for (let obj of this._world.objectsIterator()) {\n this._world.notifyObjectMoved(obj);\n\n if (obj.traits.has('displayable')) {\n if (obj.traits.has('background_slow_scroll')) {\n // We want the background to be at initial position as per\n // the tile editor, so we preserve the first position. \n // Afterways, we just reduce the X-this._camera.getX().\n //\n if (isNaN(obj.initDisplacement)) {\n obj.initDisplacement = this._camera.getX();\n }\n\n obj.sprite.x -= this._camera.getX() - 0.7 * (this._camera.getX() - obj.initDisplacement);\n } else {\n obj.sprite.x -= this._camera.getX();\n }\n\n obj.sprite.y -= -this._camera.getY();\n }\n }\n\n // Control game state.\n this._gameOverseer.notifyEnd();\n }", "function infolistener() {\r\n\tgame.physics.arcade.gravity.y = 1000;\r\n\tball.body.velocity.setTo(0, 0);\r\n\tcharacter.visible = false;\r\n\tflipcharacter.visible = false;\r\n\tball.visible = false;\r\n\tipage.visible = true;\r\n\tmainbutton.visible = true;\r\n}", "constructor()\n {\n this.radarType = Radar.TYPE_PORTAL; // in the original this is TYPE_NONE\n\n let gibMesh = new THREE.Mesh(Gib.GEOMETRY, Gib.MATERIAL);\n gibMesh.scale.x = Gib.SCALE_X;\n gibMesh.scale.y = Gib.SCALE_Y;\n\n this.add(gibMesh);\n this.mesh = gibMesh; // provide an explicit ref to first and only child\n\n // update is a closure passed to Actor, so we need to pass 'self' for gib state\n var self = this;\n var update = function(timeDeltaMillis)\n {\n // move the parent\n var actualMoveSpeed = timeDeltaMillis * Gib.SPEED;\n self.translateZ(-actualMoveSpeed);\n\n // rotate the child\n self.mesh.rotateOnAxis(MY3.Y_AXIS, Gib.ROTATE_SPEED * timeDeltaMillis);\n\n Gib.collideWithObelisks(self);\n Gib.collideWithPlayer(self);\n };\n\n this.actor = new Actors.Actor(this, update, this.radarType);\n }", "function BackgroundComponent() {\n\tthis.sprite = null;\n\tthis.anim = null;\n\tthis.pos = new Vector2(0, 0);\n\tthis.layer = 0;\n\tthis.priority = 0;\n}", "function Start () {\n\nctrlHub = GameObject.Find(\"gameScenario\");//link to GameObject with script \"controlHub\"\noutsideControls = ctrlHub.GetComponent(controlHub);//to connect c# mobile control script to this one\n\nmyAnimator = GetComponent(Animator);\nlookPoint = camPoint;//use it if you want to rider look at anything when riding\n\n//need to know when bike crashed to launch a ragdoll\nbikeStatusCrashed = bikeRideOn.GetComponent(bicycle_code);\nmyAnimator.SetLayerWeight(2, 0); //to turn off layer with reverse animation which override all other\n\n}", "function whoIsActive() { // Player.js (179) if (move)\n if (player1Active) {\n activePlayer = 2;\n notActivePlayer = 1;\n setActivePlayer(player2, player1, powerDiv2); // Info.js (21) Set attributes to the active player to use them by replacing weapon\n setActiveBoard(notActivePlayer, activePlayer); //Info.js (27) Add a class for a playerDiv of the active player to display current information about game flow\n displayMessageOnBoard(activePlayer); // Info.js (32) Display random message on active player's div\n } else {\n activePlayer = 1; \n notActivePlayer = 2;\n setActivePlayer(player1, player2, powerDiv1);\n setActiveBoard(notActivePlayer, activePlayer,);\n displayMessageOnBoard(activePlayer);\n }\n\n}", "activate() {\n this.update();\n }", "function main() {\n // instantiate game conatainer\n x = 0;\n game = new createjs.Container();\n //add car object to stage\n road = new objects.Road(assets.getResult(\"road\"));\n game.addChild(road);\n //add fuelcan object to stage\n fuelcan = new objects.FuelCan(assets.getResult(\"fuelcan\"));\n for (var stone = 0; stone < 3; stone++) {\n stones[stone] = new objects.Stone(assets.getResult(\"stone\"));\n }\n // add car object to stage\n car = new objects.Car(assets.getResult(\"car\"));\n start = new createjs.Bitmap(assets.getResult(\"start\"));\n game.addChild(start);\n startbutton = new objects.Button(assets.getResult(\"startbutton\"), 440, 320);\n game.addChild(startbutton);\n startbutton.on(\"click\", startButtonClicked);\n gameover = new createjs.Bitmap(assets.getResult(\"gameover\"));\n tryagain = new objects.Button(assets.getResult(\"tryagain\"), 440, 340);\n tryagain.on(\"click\", tryagainButtonClicked);\n scoreboard = new objects.ScoreBoard();\n //add collision manager\n collision = new managers.Collision();\n //add game conatiner to stage\n stage.addChild(game);\n console.log(game);\n}", "function create()\n{\n // Background nebula image is created\n this.add.image(400, 300, 'nebula');\n\n // Player is created\n player = this.physics.add.image(50,300,'player');\n player.setBounce(0);\n player.setCollideWorldBounds(true);\n\n //Baddie\n for(var i = 0;i<20;i++)\n {\n baddie[i] = this.physics.add.image(700, 100 + 20*i, 'baddie');\n baddie[i].setVelocityX(-100);\n }\n\n // Accept input form keyboard\n cursors = this.input.keyboard.createCursorKeys();player\n cursors.addCapture;\n\n // Bullets construction\n var Bullet = new Phaser.Class({\n Extends: Phaser.GameObjects.Image,\n initialize: function Bullet (scene)\n {\n Phaser.GameObjects.Image.call(this, scene, 0, 0, 'bullet');\n this.speed = Phaser.Math.GetSpeed(400, 1);\n },\n fire: function (x, y)\n {\n this.setPosition(x, y);\n\n this.setActive(true);\n this.setVisible(true);\n },\n update: function (time, delta)\n {\n this.x += this.speed * delta;\n\n if (this.x > 800)\n {\n this.setActive(false);\n this.setVisible(false);\n }\n }\n });\n\n bullets = this.physics.add.group({\n classType: Bullet,\n maxSize: 100,\n runChildUpdate: true\n });\n/*\n var Baddiebullet = new Phaser.Class({\n Extends: Phaser.GameObjects.Image,\n initialize: function Baddiebullet (scene)\n {\n Phaser.GameObjects.Image.call(this, scene, 0, 0, 'baddiebullet');\n this.speed = Phaser.Math.GetSpeed(400, 1);\n },\n fire: function (x, y)\n {\n this.setPosition(x, y);\n\n this.setActive(true);\n this.setVisible(true);\n },\n update: function (time, delta)\n {\n this.x += this.speed * delta;\n\n if (this.x > 800)\n {\n this.setActive(false);\n this.setVisible(false);\n }\n }\n });\n\n baddiebullets = this.physics.add.group({\n classType: Baddiebullet,\n maxSize: 100,\n runChildUpdate: true\n });\n*/\n for(var i = 0;i<20;i++)\n {\n this.physics.add.collider(baddie[i], bullets, hitBaddie, null, this);\n this.physics.add.collider(baddie[i], player, playerhit, null, this);\n }\n // Text in game is added\n scoreText = this.add.text(16, 16, 'score: 0', { fontSize: '32px', fill: '#ffffff ' }); \n\n startText = this.add.text(400, 16, 'SPACE IMPACT', { fontSize: '40px', fill: '#ffffff ' }); \n\n\n}", "function Start () {\n// newGame = GameObject.Find(\"NovoJogo\");\n// howToPlay = GameObject.Find(\"HowtoPlay\");\n// credits = GameObject.Find(\"Creditos\");\n// exit = GameObject.Find(\"Sair\");\n}", "renderui(){\n this.events.emit('updateresources', {\n currenthp: this.player.currenthp,\n maxhp: this.player.maxhp,\n currentend: this.player.currentend,\n maxend: this.player.maxend,\n currentmana: this.player.currentmana,\n maxmana: this.player.maxmana,\n target: this.player.target ? this.player.target : null\n })\n this.events.emit('updateabilities',{\n gcd: this.GCD.timer ? Math.floor(this.GCD.timer.getProgress() * 1000) : 1000, //it starts in sub 1 levels \n value: this.GCD.value\n })\n }", "function component(width, height, type, x, y){\n this.width = width;\n this.height = height;\n this.speedX = 50;\n this.speedY = 50;\n this.type = type;\n this.x = x;\n this.y = y;\n\n //update the component(do this every frame?)\n this.update = function() {\n var xPos = this.x;\n var yPos = this.y;\n var heightVal = this.height;\n var widthVal = this.width;\n\n if(this.type == types.WALL){\n ctx.fillStyle = 'blue';\n ctx.fillRect(this.x, this.y, this.width, this.height);\n }else if(this.type == types.ZOMBIE){\n var img = new Image;\n img.src = \"/resources/Zombies/zombie-head.png\";\n img.onload = function () {\n ctx.drawImage(img, xPos, yPos, widthVal, heightVal);\n }\n }else if(this.type == types.UNICORN){\n var img = new Image;\n img.src = \"/resources/Unicorns/cute-unicorn-cropped.png\";\n img.onload = function () {\n ctx.drawImage(img, xPos, yPos, widthVal, heightVal);\n }\n }else if(this.type == types.PINEAPPLE){\n var img = new Image;\n img.src = \"/resources/pineapple.png\";\n img.onload = function () {\n ctx.drawImage(img, xPos, yPos, widthVal, heightVal);\n }\n }else{\n throw err;\n }\n }\n\n this.moveRight = function() {\n if (this.x < 600) {\n this.x += this.speedX;\n }\n }\n\n this.moveLeft = function() {\n if (this.x > 20) {\n this.x -= this.speedX;\n }\n }\n\n this.moveUp = function() {\n if (this.y > 20) {\n this.y -= this.speedY;\n\n }\n }\n\n this.moveDown = function() {\n if (this.y < 420) {\n this.y += this.speedY;\n }\n }\n\n //this will let us know if it crashed with something else\n this.crashWith = function(otherobj) {\n var myleft = this.x;\n var myright = this.x + (this.width);\n var mytop = this.y;\n var mybottom = this.y + (this.height);\n var otherleft = otherobj.x;\n var otherright = otherobj.x + (otherobj.width-10);\n var othertop = otherobj.y;\n var otherbottom = otherobj.y + (otherobj.height-10);\n var crash = true;\n if ((mybottom < othertop) ||\n (mytop > otherbottom) ||\n (myright < otherleft) ||\n (myleft > otherright)) {\n crash = false;\n }\n return crash;\n }\n}", "function QuandoColidirPeixeAnzol (anzol, peixe) {\n if (anzol.children.length == 0) {\n peixe.tint = (anzol == anzolJ1) ? corJ1 : corJ2;\n peixe.body.velocity.setTo(0,0);\n peixe.body.enable = false;\n anzol.addChild (peixe);\n peixe.x = 0;\n peixe.y = 15;\n if (!somFisgou.isPlaying) somFisgou.play();\n }\n else {\n if (!somTrombou.isPlaying) somTrombou.play();\n }\n} // fim: QuandoColidirPeixeAnzol", "function Awake () {\n SpriteRenderer = GetComponent.<SpriteRenderer>();\n}", "onRender () {\n console.log(this.component);\n if(undefined !== this.component) {\n this.el.querySelector(`[data-id=\"${this.component}\"]`).classList.add(\"active\");\n }\n\n var Navigation = new NavigationView();\n App.getNavigationContainer().show(Navigation);\n Navigation.setItemAsActive(\"components\");\n this.showComponent(this.component);\n\n }", "function Component() {\n\t/**\n\t * If the component should be processed for containing entities.\n\t * @type {boolean}\n\t */\n\tthis.enabled = true;\n\n\t/**\n\t * The entity the component is added to.\n\t * @type {Entity|null}\n\t */\n\tthis.entity = null;\n\n\tthis.installedAPI = new Set();\n\n\t/**\n\t * Debug level for the component. Can be 'none', 'normal' or 'full'.\n\t * None will prevent the rendering of any debug meshes for the component.\n\t * @type {string}\n\t */\n\tthis.debugLevel = 'normal';\n}", "function GetPrefab() : GameObject \n{\n\treturn prefab;\n}", "function Start ()\n{\nDebug.Log(cl);\nGetComponent.<Renderer>().material.color = Color(0.85, 0.85, 0.85);\n/*\ntextUp = GameObject.Find(\"Lift_text1\");\ntextUp.GetComponent.<Renderer>().enabled = false;\n*/\n\n}", "shouldComponentUpdate(){\n console.log(\"LifeCcyleB shouldComponeentUpdate\")\n return true\n }", "function component(width, height, color, x, y, type) {\n //set speed all monster\n if (score <= 0) {\n speedAll = 0.5;\n }\n else { \n speedAll = 0.5*((score + 50) / 50);\n }\n this.type = type;\n if (type == \"image\") {\n this.image = new Image();\n this.image.src = color;\n }\n this.width = width;\n this.height = height;\n this.speedX = 2*speedAll;\n this.speedY = 1*speedAll;\n this.speedXBig = (Math.round(Math.random())*2-1)*2*speedAll; //(Math.round(Math.random())*2-1) = 1 or -1\n this.speedYBig = (Math.round(Math.random())*2-1)*2*speedAll;\n this.x = x;\n this.y = y;\n //draw all\n this.update = function() {\n ctx = gameArea.context;\n //draw image\n if (type == \"image\") {\n ctx.drawImage(this.image, this.x, this.y, this.width, this.height);\n }\n //draw text\n else if (type == \"text\") {\n ctx.font = this.width + \" \" + this.height;\n ctx.fillStyle = color;\n ctx.fillText(this.text, this.x, this.y);\n }\n else {\n ctx.fillStyle = color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n }\n }\n //update new position for monster\n this.newPos = function() {\n if (width == 70) {\n if (this.x <= 232) {\n this.x += this.speedX;\n if (this.x > 232) {\n this.x = 232;\n this.speedX = -this.speedX;\n }\n }\n if (this.y <= 116) {\n this.y += this.speedY;\n if (this.y > 116) {\n this.y = 116;\n this.speedY = -this.speedY;\n }\n }\n if (this.x >= 498) {\n this.x -= this.speedX;\n if (this.x < 498) {\n this.x = 498;\n this.speedX = -this.speedX;\n }\n }\n if (this.y >= 266) {\n this.y -= this.speedY;\n if (this.y < 266) {\n this.y = 266;\n this.speedY = -this.speedY;\n }\n }\n if (monster1.x <= -70 || monster1.x >= 800 || monster1.y <= -70 || monster1.y >= 450) {\n createMonster.one();\n score -= 5;\n heart.splice(heart.length - 1, 1);\n }\n if (monster2.x <= -70 || monster2.x >= 800 || monster2.y <= -70 || monster2.y >= 450) {\n createMonster.two();\n score -= 5;\n heart.splice(heart.length - 1, 1);\n }\n }\n if (color == \"img/dragon.png\") {\n this.x += this.speedXBig;\n this.y += this.speedYBig;\n if (this.x <= 0 || this.x >= 650) {\n this.speedXBig = -this.speedXBig;\n }\n if (this.y <= 0 || this.y >= 294) {\n this.speedYBig = -this.speedYBig;\n }\n }\n }\n //return a value when click\n this.clicked = function() {\n var left = this.x;\n var right = this.x + this.width;\n var top = this.y;\n var bot = this.y + this.height;\n\n if (gameArea.x < left || gameArea.x > right || gameArea.y < top || gameArea.y > bot) {\n clicked = false;\n }\n else {\n clicked = true;\n }\n return clicked;\n }\n}" ]
[ "0.65457183", "0.65092015", "0.64623725", "0.63458455", "0.6283822", "0.61846244", "0.614194", "0.6100298", "0.6001252", "0.59877", "0.5986141", "0.5972454", "0.5970727", "0.59693336", "0.5962489", "0.5929339", "0.59270525", "0.59270525", "0.59270525", "0.59270525", "0.592635", "0.5874311", "0.58545554", "0.5828043", "0.5826262", "0.58158773", "0.58158773", "0.58158773", "0.58158773", "0.5813372", "0.581045", "0.57946855", "0.57946855", "0.57946855", "0.57946855", "0.57849145", "0.5784666", "0.57839006", "0.57790965", "0.57581466", "0.575346", "0.57496417", "0.57495826", "0.5747319", "0.5744549", "0.57328737", "0.57293034", "0.5726307", "0.5726307", "0.57089406", "0.5706832", "0.57028705", "0.56952494", "0.56944495", "0.568874", "0.56818116", "0.56805545", "0.5675843", "0.5667319", "0.5666023", "0.5662064", "0.5661386", "0.5660089", "0.5659932", "0.5654973", "0.5654973", "0.56544274", "0.56497556", "0.5647203", "0.5647165", "0.56455207", "0.5638916", "0.56372255", "0.563123", "0.563123", "0.563123", "0.563123", "0.5606535", "0.55952907", "0.55929995", "0.55917645", "0.55849576", "0.55740035", "0.55696386", "0.55643815", "0.5559465", "0.5559236", "0.555204", "0.5550166", "0.55434364", "0.554123", "0.5535977", "0.5533913", "0.5533663", "0.55245805", "0.5521685", "0.55186266", "0.5515238", "0.55093396", "0.5507776", "0.54998344" ]
0.0
-1
button callback: context naam of object callback is functie
function Button(iButton, iImage) { _super.call(this, "Button"); //callback, context en sound this._mCallbackFunction = iButton.mCallback; this._mContext = iButton.mContext; this._mSoundEffect = iButton.mSoundEffect; //button image info this._mKey = iImage.mKey; this._mSheet = iImage.mSheet; this._mAnchor = iImage.mAnchor; this._mGroup = iImage.mGroup; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleButton() {}", "buttonClick(ev) {\n\n\t\t// Get the button using the index\n\t\tvar btn = this.props.buttons[ev.currentTarget.dataset.index];\n\n\t\t// If there's a callback\n\t\tif(typeof btn.callback == 'function') {\n\t\t\tbtn.callback(btn);\n\t\t} else {\n\t\t\tthis.props.close();\n\t\t}\n\t}", "function myCallback(event) {\n console.log(\"The button was clicked\", event);\n}", "_buttonClickHandler() { }", "function buttonOkClickFunc(){\r\n\t\tself.close(); //关闭对话框\r\n\t\tconsole.log(\"button ok clicked!\");\r\n\t\tif(self.buttonOkCallback!=null){\r\n\t\t\tself.buttonOkCallback();\r\n\t\t}\r\n\t}", "buttonClicked() {\n alert(\"buttonclicked of button\");\n }", "initButtons() {\n this.setupButton(\"efecBtn\", (e) => {\n\n })\n\n }", "function cb_beforeClick(cb, pos) { }", "function saved_text_cb(button) {\n return function(data) {\n button.text('Saved');\n }\n}", "handleClick() {}", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n }\n\n }", "function do_btn( )\n{ \n\n g_button2 = createButton( \"Save Image\" );\n g_button2.position( 150, 900 );\n g_button2.mousePressed( save_image ); // the callback // will call mousePressed( ) function below\n}", "function processButton(param) {\n switch (param.element) {\n case \"조회\":\n processRetrieve({});\n break;\n case \"닫기\":\n processClose({});\n break;\n case \"실행\":\n processRetrieve({});\n break;\n }\n }", "function _buttonListener(event) {\n codeMirror.focus();\n var msgObj;\n try {\n msgObj = JSON.parse(event.data);\n } catch (e) {\n return;\n }\n\n if(msgObj.commandCategory === \"menuCommand\"){\n CommandManager.execute(Commands[msgObj.command]);\n }\n else if (msgObj.commandCategory === \"viewCommand\") {\n ViewCommand[msgObj.command](msgObj.params);\n }\n }", "function ButtonControl() {\n}", "function Button(parentInterface, name, topLeftX, topLeftY, width, height) {\n // assert(width >= 0);\n // assert(height >= 0);\n this.x = topLeftX;\n this.y = topLeftY;\n this.width = width;\n this.height = height;\n this.name = name;\n this.isVisible = true;\n this.parentInterface = parentInterface;\n this.isPressed = false;\n\n if (this.parentInterface.push) {\n this.parentInterface.push(this); // this button is pushed into parentInterface's array when instanced\n }\n\n //TODO I think this is ok in javascript with varable scope\n this.leftMouseClick = function(x=mouseX, y=mouseY) {\n if(isInPane(this, x, y) && this.isVisible) {\n this.isPressed = true;\n }\n };\n\n this.mouseOver = function(x=mouseX, y=mouseY) {\n if (!mouseHeld && isInPane(this, x, y)) {\n //mouse released while inside pane\n if(this.isPressed) {\n this.action();\n }\n this.isPressed = false;\n } else if (!isInPane(this, x, y)) {\n this.isPressed = false;\n }\n };\n\n // This function will be called when button is triggered\n this.action = function() {\n // assign custom function to do something\n };\n\n this.draw = function() {\n if(this.isVisible) {\n var drawColor;\n drawColor = (this.isPressed) ? buttonColorPressed : buttonColor;\n colorRect(this.x, this.y, this.width, this.height, drawColor);\n\n var str = this.name;\n var strWidth = canvasContext.measureText(this.name).width;\n //center text\n var textX = this.x + (this.width*0.5) - (strWidth*0.5);\n //TODO magic numbers going here.\n var textY = this.y + (this.height*0.5) + 4;\n colorText(str, textX, textY, \"black\");\n\n }\n }\n\n\n}", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n {\n var args = {\n target: [{ id: \"frmOption\", focus: true }]\n };\n gw_com_module.objToggle(args);\n }\n break;\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n }\n\n }", "function pressButton(callback) {\n console.log('Button is pressed');\n callback();\n}", "onClick() {\n // Verifica se existe a função para processar o click e a invoca\n if(this.handleClick) {\n this.handleClick(this);\n }\n }", "onAddButtonClick(fn) { this.onAddButtonClickFn = fn }", "function buttonCancelClickFunc(){\r\n\t\tself.close(); //关闭对话框\r\n\t\tif(self.buttonCancelCallback!=null){\r\n\t\t\tself.buttonCancelCallback();\r\n\t\t}\r\n\t}", "menuButtonClicked() {}", "function the_click_callback(){\n\t\t\t\tif(typeof click_callback == 'function'){\n\t\t\t\t\tvar id = $container.attr('id');\n\t\t\t\t\tif(id==undefined || !id){\n\t\t\t\t\t\tid = '[no id]';\n\t\t\t\t\t}\n\t\t\t\t\tclick_callback(id, activenode);\n\t\t\t\t}\n\t\t\t}", "handleCancelButton(){\n console.log(\"handleCancelButton\");\n }", "function buttonClick(){\r\n\r\n var buttonTriggered = this.innerHTML;\r\n clickPress(buttonTriggered);\r\n buttonAnimation(buttonTriggered);\r\n\r\n}", "action(type, px, py, evt) { console.log('Action callback'); }", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n {\n var args = {\n target: [{ id: \"frmOption\", focus: true }]\n };\n gw_com_module.objToggle(args);\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"취소\":\n {\n closeOption({});\n }\n break;\n }\n\n }", "function buttonClicked () {\n let clickedButton = event.target;\n\n valueHTML();\n\n}", "function test_generic_object_button_execute_playbook() {}", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "bindTurnCards(handler) {\n let turnButton = this.getElement(\"#turnCards\");\n turnButton.addEventListener('click', MemoryEvent=>{\n handler();\n })\n }", "constructor(){\n super();\n\n this.getButton = this.getButton.bind(this);\n}", "activateButton(){\n //If the button already exists, we want to remove and rebuilt it\n if(this.button)\n this.button.dispose();\n\n //Create button called but with Activate SpeedBoost as its text\n this.button = Button.CreateSimpleButton(\"but\", \"Activate\\nSpeedBoost\");\n this.button.width = 0.8;\n this.button.height = 0.8;\n this.button.color = \"white\";\n this.button.background = \"red\";\n this.button.alpha = 0.8;\n this.stackPanel.addControl(this.button);\n //Scope these attributes so they can be used below\n var button = this.button;\n var app = this.app;\n\n //Function for if they click it\n //Function is a member of the button object, not of this class\n this.button.onPointerDownObservable.add(function() {\n if(button.textBlock.text != \"Activate\\nSpeedBoost\")\n return;\n app.buttonPressed(\"speedBoost\");\n button.textBlock.text = \"SpeedBoost\\nActivated\";\n }); \n }", "function clickedTheButton(){\r\n greet();\r\n}", "handleClick( event ){ }", "HAXCMSButtonClick(e) {\n // stub, the classes implementing this will actually do something\n // you always will call super.HAXCMS\n }", "function rawSubmitKomodo(thisbtn) {\n\n}", "_evtClick(event) { }", "function handleBtnClick(event) {\n handleEvent(event);\n}", "function processButton(param) {\n\n if (param.object == \"lyrMenu\") {\n switch (param.element) {\n case \"저장\":\n processSave();\n break;\n case \"닫기\":\n processClose();\n break;\n }\n }\n\n}", "_addClickFunctionality(button, option){\n\t\tvar config = this;\n\t\tbutton.click(function(){\n\t\t\tconfig.clicked_button = event.target;\n\t\t\tconfig._updatePrice(config.clicked_button)\n\t\t\tconfig._sortButtonColoring(config.clicked_button);\n\t\t\tconfig._updateMagento(config.clicked_button);\n\t\t\tconfig._eraseCategories(config.clicked_button);\n\t\t\tconfig._hideCategories(config.clicked_button);\n\t\t\tconfig._decideNext(config.clicked_button, option);\n\t\t});\n\t}", "locationButton_onClick () {\n viewModel.changeCurrentLocation(this);\n }", "function buttonSaveCallback(data)\n{\n alert(data);\n}", "click_extra() {\r\n }", "metodoClick(){\n console.log(\"diste click\")\n }", "_handleButtonCopyWorkflow()\n {\n }", "bindStartGame(handler){\n let startbutton = this.getElement(\"#start\");\n startbutton.addEventListener('click',MemoryEvent =>{\n handler();\n })\n }", "onClick() {\n }", "initButtons() {\n let buttons = document.querySelectorAll('.btn');\n buttons.forEach(btn => { \n btn.addEventListener('click', e => {\n let btnClick = btn.innerHTML;\n this.actionCalc(btnClick); \n }, false);\n }); \n }", "function callCB(event) {\n console.log('SimpleCTI.callCB | event: ', event);\n }", "function advanchButtonHandler(ev) {\n var btnFid = Number($(this).attr('fid'));\n var formID = $(ev.target).closest('form').attr('id');\n\n var planeID = $(ev.target).closest('.form-item').attr('ns-id');\n\n var $elementParentDom = $(ev.target).closest('.form-td');\n\n formID = formID.substr(5, formID.length);\n var returnFunc = nsForm.data[formID].formInput[planeID].button[btnFid].handler;\n if (returnFunc) {\n returnFunc(planeID, $elementParentDom);\n }\n }", "function makeCallbackButton(labelIndex) {\n return function() {\n if (modalWindow) {\n modalWindow.removeEventListener('unload', onUnload, false);\n modalWindow.close();\n }\n // checking if prompt\n var promptInput = modalDocument.getElementById('prompt-input');\n var response;\n if (promptInput) {\n response = {\n input1: promptInput.value,\n buttonIndex: labelIndex\n };\n }\n response = response || labelIndex;\n callback(response);\n };\n }", "initButtons(scene){\n var obj = { Undo:function(){ scene.undo() }, Replay:function(){ scene.replay() }};\n\n this.gui.add(obj,'Undo');\n this.gui.add(obj,'Replay');\n }", "function testButtonClicked(){\n\n var button = $(this);\n setActiveTest(button);\n\n var buttonID = button.attr(\"id\");\n\n // Get the function that matches the button\n var f = codeValidationFunctions[buttonID]\n\n executeAndMark([f]);\n \n}", "buttonHandler(){\n\t\tvar items = this.props.hey.questions.present;\n\t\tlet conditions = this.props.hey.conditions.present;\n\t\tlet counter = this.props.hey.counter.present;\n\t\tconst action = this.props.action;\n\t\tconst increment = this.props.increment;\n\t\tconst hide = this.props.hideState;\n\t\tsendButtonHandler(items,conditions,counter,action,increment,hide);\n\t}", "function selectButtonHandler() {\n var self = this;\n\n makeButtonActive(self); //highlights this button\n\n thingView.clearStatus(); //clears whatever's in the status window \n\n //if this is the makeNewThing button, show the makeThing form\n if ($(this).hasClass(\"makeNewThing\")) { //generates a new form\n thingForm = new ThingForm();\n thingForm.newForm($('div#status'));\n\n } else //get object current li relates to, print status of that object\n {\n thingView.printThing(thingModel.allThings[$(this).attr(\"data\")]);\n }\n\n}", "clicked(x, y) {}", "function updatingButtonLabel(self, val){\n self.val(val);\n self.callback(val);\n }", "handleOnClick () {\n this.props.callback()\n }", "function processButton(param) {\n\n if (param.object == \"lyrMenu\") {\n switch (param.element) {\n case \"저장\":\n if(v_global.logic.pstat == \"대여\")\n processRetrieve({ chk: true });\n else\n processSave({});\n break;\n case \"닫기\":\n processClose();\n break;\n }\n }\n\n}", "function onButton(){\n input();\n output();\n\n}", "initButtonsEventClick(){\n let buttons = document.querySelectorAll(\".row > button\");\n buttons.forEach(btn=>{\n btn.addEventListener(\"click\", e=>{\n let txtBtn = btn.innerHTML;\n this.excBtn(txtBtn);\n //console.log(txtBtn+\" \"+e.type);\n //console.log(txtBtn);\n });\n });\n }", "clickHandler(event) {\n declarativeClickHandler(this);\n }", "function commandButtonHandle(){\n\t\tswitch(this.id){\n\t\t\tcase \"commandbutton_1\":\n\t\t\t\tonDealCardsClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_2\":\n\t\t\t\tonMaxBetClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_3\":\n\t\t\t\tonAddFiveClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_4\":\n\t\t\t\tonRemoveFiveClicked();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function init() {\n\tbutton.addEventListener('click', function(event) {\n\t\tbuttonClicked(event.target.innerText);\n\t});\n}", "handleClick(){\n alert(\"hey!!\");\n }", "function observeButtonClick(element, handler) {\r\n var toolbar = this;\r\n $(element).observe('click', function(event) {\r\n toolbar.hasMouseDown = true;\r\n handler(toolbar.editArea);\r\n toolbar.editArea.fire(\"wysihat:change\");\r\n Event.stop(event);\r\n toolbar.hasMouseDown = false;\r\n });\r\n }", "addCustomButton(btn)\n {\n var exec = window[btn.func];\n if (typeof exec === \"function\") {\n this.oEditor.addCommand('cmd_' + btn.func, {exec: function(oEditor) {window[btn.func](oEditor);}});\n this.oEditor.ui.addButton(btn.func, {label: btn.name, command: 'cmd_' + btn.func, icon: btn.icon});\n } else if (typeof displayJSError === \"function\") {\n displayJSError('Handler for Custom Button [' + btn.func + '] is not defined!', 'error');\n }\n }", "CallbackHell()\n {\n\n }", "connectedCallback(){super.connectedCallback();this.__a11y=this.$.button}", "function onConfirm(buttonIndex) {}", "function Procedure_button(main, str){\n\n\t//creat button, set class\n\tvar btn = document.createElement(\"button\");\n\tbtn.classList.add(\"ui\", \"circular\",\"icon\",\"button\",\"procedure\",\n\t\t\t\t\t main.stepObject.length.toString());\n\tbtn.setAttribute ('id', \"ui circular icon button procedure \" + \n\t\t\t\t\t main.stepObject.length.toString())\n\t//set button string\n\tvar t = document.createTextNode(str);\n\tbtn.appendChild(t);\n\t\n //add button to Web\n document.getElementById(\"Procedure_List\").appendChild(btn);\n\n //record scene object\n RecordObjects(main);\n main.stepNumber += 1;\n\n //set the click action\n btn.addEventListener(\"click\", function(){\n\n \t//if is the last step, create the step button\n\t if(main.lastStep == true){\n\t \tmain.lastStep = false;\n\t \tProcedure_button(main, main.stepOperationName);\n\t }\n\n\t //console.log(btn.classList[5]);\n\t buttonClicked(main, btn.classList[5]);\n\t main.stepNumber = btn.classList[5];\n\t main.stepOperationName = btn.firstChild.nodeValue;\n\n\t //Initialise the model button\n\t main.processor.executeDesign(\"MODEL_ALIGN\", \"initial\");\n\t main.processor.executeDesign(\"MODEL_PAINTING\", \"initial\");\n main.processor.executeDesign(\"MODEL_WRAP\", \"initial\");\n main.processor.executeDesign(\"MODEL_ROTATION\", \"initial\");\n main.processor.executeDesign(\"MODEL_ADDBETWEEN\", \"initial\");\n main.processor.executeDesign(\"MODEL_CUT\", \"initial\");\n main.processor.executeDesign(\"MODEL_ADD\", \"initial\");\n\t //show the control buttons\n\t if(btn.firstChild.nodeValue != 'Initial')\n\t \t$('#parameter_control_tool_' + btn.firstChild.nodeValue).show();\t \n\n\t});\n\t\n}", "function tagClickCallback() {\n if (status.applied) {\n sg.tracker.push(\"TagUnapply\", null, {\n Tag: properties.tag,\n Label_Type: properties.label_type\n });\n unapply();\n } else {\n sg.tracker.push(\"TagApply\", null, {\n Tag: properties.tag,\n Label_Type: properties.label_type\n });\n apply();\n }\n\n sg.cardFilter.update();\n }", "get button () {return this._p.button;}", "onBtnNew(){\n this._doOpenModalPost();\n }", "function onClickEvent() {\n 'use strict';\n var sender = this.id;\n\n switch (sender) {\n case \"btnCreateCourse\":\n onCreateCourse();\n break;\n case \"btnModifyCourse\":\n onModifyCourse();\n break;\n case \"btnDeleteCourse\":\n onDeleteCourse();\n break;\n case \"btnRefreshCourses\":\n onRefreshCourse();\n break;\n }\n }", "_onClick({x,y,object}) {\n console.log(\"Clicked icon:\",object);\n }", "bindCheckBtnHandler(checkButton) {\n checkButton.addEventListener(\"click\", (e) => {\n this.onClickCheckBtn(e);\n });\n }", "bindButtonEvents() {\n var self = this;\n\n this.button.addEventListener(\n 'click',\n self.onButtonClick.bind(self)\n );\n }", "function fButtonPress( vButtonName )\r\n{\r\n\tmain_onRemoteControl(vButtonName);\r\n}", "onClickEstimate() {\r\n \r\n }", "clicked() {\n this.get('onOpen')();\n }", "featureClickEventHandler(event) {\r\n this.featureEventResponse(event);\r\n }", "function bindButtons() {\n $('button', context).click(function() {\n switch(this.name) {\n case 'cancel':\n mainWindow.overlay.toggleWindow('export', false);\n break;\n\n case 'reset':\n mainWindow.resetSettings();\n break;\n\n case 'reselect':\n exportData.pickFile(function(filePath) {\n if (filePath) {\n exportData.filePath = filePath;\n mainWindow.overlay.toggleWindow('overlay', true);\n }\n });\n break;\n\n case 'export':\n exportData.saveData();\n break;\n\n case 'print':\n exportData.enqueueData();\n break;\n }\n });\n\n // Bind ESC key exit.\n // TODO: Build this off data attr global bind thing.\n $(context).keydown(function(e){\n if (e.keyCode === 27) { // Global escape key exit window\n $('button[name=cancel]', context).click();\n }\n });\n }", "function handleClick(){\n console.log(\"clicked\");\n}", "button(text, fcn, id){\n\t\tif (typeof fcn !== \"undefined\" && typeof text !== \"undefined\"){\n\t\t\ttext = String(text);\n\t\t\tfcn = String(fcn);\n\t\t\tlet foo = document.createElement(\"input\");\n\t\t\tfoo.setAttribute(\"type\", \"button\");\n\t\t\tfoo.setAttribute(\"value\", text);\n\t\t\tfoo.setAttribute(\"onclick\", fcn);\n\t\t\tif(typeof id !== \"undefined\"){\n\t\t\t\tid = String(id);\n\t\t\t\tfoo.setAttribute(\"id\", id);\n\t\t\t} // end if\n\t\t\tdocument.body.appendChild(foo);\n\t\t}else {\n\t\t\tconsole.log(\"button - \" + \"(\" + \"ERROR - invalid parameter (text, function, id)\" + \")\");\n\t\t} // end if\n }", "function handleClick(event)\n{\n}", "setButtonState() {\n // this.view.setButtonState(this.runner.busy,this.synchronizing,this.synchronize_type)\n }", "createButton(x, y, text, callback){\n const button = this.add.text(x, y, text, { fill: '#0f0' });\n button.setOrigin(0.5, 0.5);\n button.setInteractive()\n .on('pointerup', () => callback())\n .on('pointerover', () => this.enterButtonHoverState(button) )\n .on('pointerout', () => this.enterButtonRestState(button) );\n return button;\n }", "handleVelocityClick(that){\n return function (){\n that.handleChartClick(\"#velocity-chart\", \"Velocity Chart\");\n }\n }", "function callback(){}", "function click_on() {\n console.log('called click function');\n}", "isButtonPressed(button)\n {\n //console.log(this.current[button]);\n return this.current[button];\n }", "_previousButtonClickHandler() {\n const that = this;\n\n that.prev();\n }", "function callWxBtn() {\n let btnValue = ($(this).data('name'))\n callWxData(btnValue)\n }", "buttonTwoClick(evt) {\n alert(\"Button Two Clicked\");\n }", "handleClick() {\n console.log(this)\n console.log(this.props.bing)\n console.log(this.props.func())\n }", "function buttonPublish(evt) {\n var btn = evt.currentTarget;\n btn.blur(); // Allow button to be defocused without clicking elsewhere\n $.publish(btn.id);\n }", "function Window_PDButtonCommand() {\n this.initialize.apply(this, arguments);\n}", "function processVariableEditButtonCallback() { \n \n }", "bindButtonEvents() {\n var self = this;\n\n this.button.addEventListener('click', self.onButtonClick.bind(self));\n }" ]
[ "0.7049072", "0.7018743", "0.67045593", "0.6546951", "0.6546742", "0.64738196", "0.6413516", "0.62902", "0.61315125", "0.6113609", "0.6079787", "0.6030448", "0.6002051", "0.5983992", "0.5982074", "0.5981315", "0.5951969", "0.59450907", "0.59358037", "0.59348625", "0.5921149", "0.590839", "0.590642", "0.5895172", "0.58620125", "0.58586216", "0.5830426", "0.5826564", "0.5826299", "0.58236855", "0.5811482", "0.5799084", "0.5790978", "0.57829034", "0.5776657", "0.5763714", "0.57628465", "0.57504237", "0.5739799", "0.57334566", "0.57273734", "0.5692065", "0.56918705", "0.5690297", "0.56846464", "0.56813896", "0.56768113", "0.5655837", "0.56432045", "0.564224", "0.56416875", "0.5629727", "0.56251466", "0.56158555", "0.5615283", "0.5612951", "0.56037056", "0.5599279", "0.55961776", "0.55854446", "0.5583635", "0.5582563", "0.55805385", "0.557555", "0.5572942", "0.5572547", "0.5569683", "0.5549458", "0.5524391", "0.55130666", "0.5510689", "0.5505826", "0.5504436", "0.5495778", "0.5494801", "0.5493353", "0.54882866", "0.54878855", "0.5485753", "0.54828554", "0.5479293", "0.54787", "0.5477221", "0.54735136", "0.54729116", "0.54678226", "0.5465445", "0.54634416", "0.5461627", "0.5455073", "0.5450569", "0.5450332", "0.54498625", "0.54467803", "0.54455227", "0.544515", "0.54442436", "0.5443201", "0.5442736", "0.54415417", "0.5430862" ]
0.0
-1
Uploads image locally in the browser To be used in ./UploadImage.js
function UploadImage(props) { const handleFileUpload = function(e) { e.stopPropagation() e.preventDefault() const file = e.target.files ? e.target.files[0] : e.dataTransfer.files[0] const reader = new FileReader() reader.onload = e => { props.handleImageUpload(e.target.result) } reader.onerror = e => { console.log('error') } reader.readAsDataURL(file) } const handleDragOver = function(e) { e.stopPropagation() e.preventDefault() } return ( <div className="uploadimage-container" onDragOver={handleDragOver} onDrop={handleFileUpload} > <span className="uploadimage-info"> <form> <label tabIndex="1" htmlFor="upload-button"> <div style={{ backgroundColor: props.secondaryColor, color: props.primaryColor, }} className="choose-file-button" > choose file </div> </label> <input id="upload-button" style={{ width: '1px', visibility: 'hidden' }} type="file" onChange={e => handleFileUpload(e)} ></input> </form> </span> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitImage() {\n let image = document.querySelector('input[type=file]').files[0];\n if (image) {\n encodeImageFileAsURL(image);\n } else {\n errorMessage(\"No Selected File\");\n }\n }", "function submitImage() {\n let image = document.querySelector('input[type=file]').files[0];\n if (image) {\n encodeImageFileAsURL(image);\n } else {\n errorMessage(\"No Selected File\");\n }\n }", "function uploadImage() {\n const file = buttonLoad.files[0];\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => {\n const img = new Image();\n img.src = reader.result\n image.src = img.src;\n }\n}", "function _doImageUpload(){\n var dataUrl = _getDataUrl($img),\n metaTransferId = (function(){\n if(metaTransfer && metaTransfer.getServerSideId())\n return metaTransfer.getServerSideId();\n else if(_locInfo.argumenta.metadata)\n return _locInfo.argumenta.metadata;\n else\n return 'null';\n })()\n transfer = basiin.tell(dataUrl);\n\n transfer.event.add({\n 'onAfterFinalize':function(event){\n frameProgressBar.setProgress(0);\n window.location = srv.location\n +'/'+ srv.basiin\n +'/image/uploaded/'+ basiin.transaction().id\n +'/'+ transfer.getServerSideId()\n +'/'+ metaTransferId\n },\n 'onAfterPacketLoad':function(event){\n frameProgressBar.setProgress(\n event.object.getProgress());\n }\n });\n }", "function uploadImg(e) {\n var reader = new FileReader();\n reader.onload = function (event) {\n var img = new Image();\n img.onload = function () {\n const resultImage = document.querySelector('#result-image');\n resultImage.setAttribute('src', event.target.result);\n };\n img.src = event.target.result;\n };\n reader.readAsDataURL(e.target.files[0]);\n}", "function imageUpload(e) {\n var reader = new FileReader();\n reader.onload = async function (event) {\n var imgObj = await new Image();\n imgObj.src = await event.target.result;\n setImage([...getImage, imgObj.src]);\n };\n let p = e.target.files[0];\n\n reader.readAsDataURL(p);\n }", "function upload_image()\n{\n\n const file = document.querySelector('input[type=file]').files[0];\n //const reader = new FileReader();\n send_request_and_receive_payload(file)\n\n\n/*\n reader.addEventListener(\"load\", () => {\n\tsend_request_and_receive_payload(reader.result);\n });\n\n if (file) {\n\treader.readAsDataURL(file);\n }\n*/\n\n}", "function uploadImage(file){\n setShowAlert(false);\n setImgFile(URL.createObjectURL(file));\n setFormImg(file);\n }", "function uploadPhoto()\r\n{\r\n\talert(\"upload start\");\r\n\tvar myImg = document.getElementById('myImg');\r\n\tvar options = new FileUploadOptions();\r\n\toptions.key=\"file.jpg\"; // temporary key for testing\r\n\toptions.AWSAccessKeyId=\"\"; // value removed for privacy reasons\r\n\toptions.acl=\"private\";\r\n\toptions.policy=\"\"; // value removed for privacy reasons\r\n\toptions.signature=\"\"; // value removed for privacy reasons\r\n\t\r\n\tvar ft = new FileTransfer();\r\n\tft.upload(myImg.src, encodeURI(\"https://andrewscm-bucket.s3.amazonaws.com/\"), onUploadSuccess, onUploadFail, options);\r\n}", "function imageupload() {\n var request = new XMLHttpRequest();\n\n request.open( \"POST\", \"/upload\", false );\n \n var pdata\t= new FormData();\n var dataURI\t= photo.getAttribute( \"src\" );\n var imageData = dataURItoBlob( dataURI );\n var imageName = \"image\"+Date.now()+\".png\"\n pdata.append( \"file\", imageData, imageName );\n\n request.send( pdata );\n console.log(request.responseURL); \n return imageName\n }", "_initSingleImageUpload() {\n if (typeof SingleImageUpload !== 'undefined' && document.getElementById('singleImageUploadExample')) {\n const singleImageUpload = new SingleImageUpload(document.getElementById('singleImageUploadExample'), {\n fileSelectCallback: (image) => {\n console.log(image);\n // Upload the file with fetch method\n // let formData = new FormData();\n // formData.append(\"file\", image.file);\n // fetch('/upload/image', { method: \"POST\", body: formData });\n },\n });\n }\n }", "uploadFile(e) {\n // get the file and send\n const selectedFile = this.postcardEle.getElementsByTagName(\"input\")[0].files[0];\n const formData = new FormData();\n formData.append('newImage', selectedFile, selectedFile.name);\n // build a browser-style HTTP request data structure\n const xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/upload\", true);\n xhr.addEventListener('loadend', (e) => {\n this.onImageLoad(e, xhr);\n });\n xhr.send(formData);\n }", "function sendImage() {\n console.log(\"attempting upload\");\n console.log($('#imgInp'));\n\n if ($('#imgInp')[0].files[0]) {\n var file = $('#imgInp')[0].files[0];\n targetFileRef.put(file).then(function (snapshot) {\n console.log('Uploaded.');\n });\n } else {\n console.log(\"No new image to upload.\");\n }\n\n}", "function uploadImage() {\n if (state.photoSnapped) {\n var canvas = document.getElementById('canvas');\n var image = getImageAsBlobFromCanvas(canvas);\n\n // TODO!!! Well this is for you ... YES you!!!\n // Good luck!\n\n // Create Form Data. Here you should put all data\n // requested by the face plus plus services and\n // pass it to ajaxRequest\n var data = new FormData();\n data.append('api_key', faceAPI.apiKey);\n data.append('api_secret', faceAPI.apiSecret);\n data.append('image_file', image);\n // add also other query parameters based on the request\n // you have to send\n\n // You have to implement the ajaxRequest. Here you can\n // see an example of how you should call this\n // First argument: the HTTP method\n // Second argument: the URI where we are sending our request\n // Third argument: the data (the parameters of the request)\n // ajaxRequest function should be general and support all your ajax requests...\n // Think also about the handler\n ajaxRequest('POST', faceAPI.detect, data,setUserID);\n\n } else {\n alert('No image has been taken!');\n }\n }", "function uploadImage(imageToSend) {\n if (imageToSend == \"\") {\n alert(\"please choose image\");\n return;\n }\n imageToSend = setToBase64(imageToSend);\n document.getElementById('loading').hidden = false;\n document.getElementById('formDrop').hidden = true;\n window.parent.postMessage({\n 'image': imageToSend\n }, \"*\");\n }", "async function uploadByUrl(imgUrl, serverUrl) {\n const image = await resizeImage( await getImage(imgUrl) )\n \n const formData = new FormData()\n formData.append('file', image, 'img.png')\n\n return fetch(serverUrl, {\n method : 'post',\n body : formData,\n }).then(r => {\n return r.json()\n }).catch( err => {\n console.warn('Upload to vk request error')\n })\n}", "async uploadImage(file) {\n let client = this.helpers['WebDriverIO'].browser;\n let upload = await client.uploadFile(file);\n return upload;\n }", "_uploadImage(file) {\n if (!this._isImage(file)) {\n return;\n }\n\n const userFileAttachment = new RB.UserFileAttachment({\n caption: file.name,\n });\n\n userFileAttachment.save()\n .then(() => {\n this.insertLine(\n `![Image](${userFileAttachment.get('downloadURL')})`);\n\n userFileAttachment.set('file', file);\n userFileAttachment.save()\n .catch(err => alert(err.message));\n })\n .catch(err => alert(err.message));\n }", "function uploadImage(input) {\n const label = $('[data-js-label]');\n if (input.files && input.files[0]) {\n console.log(input.files[0]);\n if (input.files[0].size < MAX_FILE_UPLOAD_SIZE) {\n if (input.files[0].type === 'image/jpeg' || input.files[0].type === 'image/png') {\n label.text(input.files[0].name)\n var reader = new FileReader();\n reader.onload = function (e) {\n // Show logo if all conditions are true\n LOGO.show();\n $('.logo').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]); // convert to base64 string\n } else {\n alert('We only support JPF/PNG images');\n }\n } else {\n alert('File size should be less than 5 MB')\n }\n }\n}", "function uploadImg() {\n\treturn new Promise((resolve, reject) => {\n\t\tconsole.log('store.getters.is_login_in---',store.getters.is_login_in)\n\t\tif (!store.getters.is_login_in) {\n\t\t\t//#ifdef MP-WEIXIN\n\t\t\tweixin();\n\t\t\t//#endif\n\t\t\t//#ifdef H5 || APP-PLUS || MP-ALIPAY\n\t\t\tpromptLogin();\n\t\t\t//#endif\n\t\t\treject(false);\n\t\t\treturn;\n\t\t}\n\t\tuni.chooseImage({\n\t\t\tcount: 1, \n\t\t\tsizeType: ['compressed'],\n\t\t\tsuccess: chooseImageRes => {\n\t\t\t\tlet url = chooseImageRes.tempFilePaths[0];\n\t\t\t\tconsole.log('ChooseURL ', url)\n\t\t\t\tlet timestamp = new Date().valueOf();\n\t\t\t\tlet pickey = '';\n\t\t\t\tif (url.indexOf('blob:') == -1) {\n\t\t\t\t\t//非浏览器\n\t\t\t\t\tlet ret = url.lastIndexOf(\".\");\n\t\t\t\t\tpickey = timestamp + url.slice(ret, url.length);\n\t\t\t\t} else {\n\t\t\t\t\tpickey = timestamp + '.jpg'\n\t\t\t\t}\n\n\t\t\t\thttp\n\t\t\t\t\t.get(\"/qiniu/userGetQiniuUpToken?key=\" + pickey)\n\t\t\t\t\t.then(res => {\n\t\t\t\t\t\tresolve(saveInQiniu(res, url));\n\t\t\t\t\t}).catch(err => {\n\t\t\t\t\t\treject(err)\n\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t})\n\n}", "function uploadImage() {\n const regex = /image.*/;\n let currentImg = document.querySelector('input[type=file]').files[0];\n let myReader = new FileReader();\n myReader.addEventListener(\"load\", function () {\n img.src = myReader.result;\n }, false);\n\n if (currentImg.type.match(regex)) {\n myReader.readAsDataURL(currentImg);\n showFileContent(currentImg);\n showDropIcon();\n } else {\n showErrorFile();\n hideDropIcon();\n }\n}", "function upload() {\n var file = addFile.files[0];\n const formData = new FormData()\n formData.append('photo', file)\n formData.append('username', userName.innerHTML)\n const xhr = new XMLHttpRequest()\n xhr.open('POST', 'https://recruit-exam.topviewclub.cn/api/recruit/uploadPhoto')\n xhr.send(formData);\n xhr.onload = () => {\n userImg.src = JSON.parse(xhr.responseText).data;\n }\n}", "function uploadImage(image) {\n if (!checkImage(image)) return false;\n //add to image list\n showLoader()\n .then(() => Menkule.post(\"/adverts/photo\", image))\n .then((data) => {\n appendFile(data);\n renderImages();\n $(\"#uploader\").val('');\n })\n .catch((err) => {\n $(\"#uploader\").val('');\n hideLoader()\n .then(() => App.parseJSON(err.responseText))\n .then(o => App.notifyDanger(o.result || o.Message, 'Üzgünüz'))\n .catch(o => App.notifyDanger(o, 'Beklenmeyen bir hata'));\n })\n }", "async function sendimg(){\n img = document.getElementById('file').files[0]\n let response = await fetch('/imageprocessing', {\n method: \"POST\",\n header:{\n 'content-type': 'image/png'\n },\n body: img\n });\n if (response.status == 200) {\n let result = await response.text()\n window.location.hash = '#home'\n window.location.reload()\n}\n}", "function imageUpload (){\n loader.style.display = \"block\";\n loader.innerHTML = \"reading file\";\n document.getElementById(\"file-input\").style.display = \"none\";\n var file = document.getElementById('upload-image').files[0];\n //using file reader to load the image.\n var reader = new FileReader();\n if(file){\n reader.readAsDataURL(file);\n }\n reader.onloadend = function () {\n loader.innerHTML = \"image loaded\";\n preview.src = reader.result;\n }\n}", "function uploadImg(urlimg){\n\t\t\tfabric.Image.fromURL(urlimg, function(img) {\n\t\t\t\tcanvas.add(img.set({ left: 5, top: 5, }).scale(0.5)).setActiveObject(img);\n\t\t\t\tselectObjParam();\n\t\t\t});\n\t\t\tcanvas.renderAll();\t \t\n\t\t}", "function uploadImage() {\n $('input[type=file]').click();\n}", "function uploadImg(elForm, ev) {\n ev.preventDefault();\n\n document.getElementById('imgData').value = canvas.toDataURL(\"image/jpeg\");\n\n // A function to be called if request succeeds\n function onSuccess(uploadedImgUrl) {\n console.log('uploadedImgUrl', uploadedImgUrl);\n\n uploadedImgUrl = encodeURIComponent(uploadedImgUrl)\n document.querySelector('.share-container').innerHTML = `\n <a class=\"w-inline-block social-share-btn fb\" href=\"https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}\" title=\"Share on Facebook\" target=\"_blank\" onclick=\"window.open('https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}'); return false;\">\n Share \n </a>`\n }\n\n doUploadImg(elForm, onSuccess);\n}", "upload(event){\n let image = document.getElementById('output');\n url.push(URL.createObjectURL(event.target.files[0]));\n image.src = URL.createObjectURL(event.target.files[0])\n }", "async function addImage() {\n const file = document.querySelector(\"#fileInput\").files[0]\n const title = $('#albumTitel').val()\n const desc = $('#albumDisc').val()\n const image = await toBase64(file)\n const hash = urlParams.get('hash');\n const id = urlParams.get('id');\n uploadImage(image, hash, id, title, desc)\n}", "function uploadImage(img) {\n console.log(img, 'from uploadImage');\n var drive = google.drive({version: 'v3', auth: googleAuth.oauth2Client});\n fs.readFile('client_secret.json', function processClientSecrets(err, content) {\n if (err) {\n console.log('Error loading client secret file: ' + err);\n return;\n }\n fs.readFile(img, function(erro, imgFile) {\n if (erro) {\n console.log('Error loading image:', err);\n return;\n }\n googleAuth.authorize(JSON.parse(content), function(auth) {\n drive.files.create({\n auth: auth,\n resource: {\n parents: ['0B9eTEQ8345yWb0pscmF1cFFCRmM'],\n name: `IMG${camera.getImgCount()}.jpg`,\n mimeType: 'image/jpg'\n },\n media: {\n mimeType: 'image/jpg',\n body: imgFile\n }\n });\n })\n fs.unlinkSync(img);\n });\n });\n}", "function uploadPic() {\n\tfile = fileInput.files[0];\n\tconsole.log(file)\n\tlet fileData = new FileReader();\n\tconsole.log(fileData)\n\tfileData.readAsDataURL(file)\n\tfileData.onload = function displayPic () {\n\t\tlet fileURL = fileData.result;\n\t\timage.src = fileURL\n\t\tconsole.log(image.src)\n\t};\n\tpicLabel.style.display = \"none\"\nconsole.log(fileInput)\n\n}", "function saveImage(input){\n console.log(input);\n if (input.files && input.files[0]) {\n // Create a new filereader, get the selected image\n var reader = new FileReader();\n reader.readAsDataURL(input.files[0]);\n \n reader.onload = function (e) {\n // Make the ajax request to update the user's avatar\n var data = {};\n data.database = \"chattest\";\n data.action = \"change_avatar\";\n data.image = e.target.result;\n data.username = USER;\n \n // Send request\n $.post(\"Control/messages.php\", data, processChooseAvatar);\n }\n }\n}", "function onSuccess(imageURI) {\r\n\r\n // Set image source\r\n var image = document.getElementById('img');\r\n image.src = imageURI + '?' + Math.random();\r\n \r\n var options = new FileUploadOptions();\r\n options.fileKey = \"file\";\r\n options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);\r\n options.mimeType = \"image/jpeg\";\r\n \r\n var params = {};\r\n params.value1 = \"test\";\r\n params.value2 = \"param\";\r\n\r\n options.params = params;\r\n options.chunkedMode = false;\r\n\r\n var ft = new FileTransfer();\r\n ft.upload(imageURI, \"http://demo.makitweb.com/phonegap_camera/upload.php\", function(result){\r\n alert('successfully uploaded ' + result.response);\r\n }, function(error){\r\n //alert('error : ' + JSON.stringify(error));\r\n }, options);\r\n \r\n }", "async uploadImage(context, { file, name }) {\n const storage = firebase.storage().ref();\n const doc = storage.child(`uploads/${name}`);\n\n await doc.put(file);\n const downloadURL = await doc.getDownloadURL();\n return downloadURL;\n }", "function saveImage() {\n $('#avatar-form').submit();\n}", "async function handleImageFile(e) {\n\t\tconst file = e.target.files[0];\n\t\tsetFileName(file.name);\n\t\tif (file) {\n\t\t\tlet imageData;\n\t\t\tconst data = new FormData();\n\t\t\tdata.append('file', file);\n\t\t\tdata.append('upload_preset', 'ljxjnqss');\n\t\t\timageData = await uploadPostImage(data);\n\t\t\tsetImgFromCloud(imageData);\n\t\t}\n\t}", "function saveUserPhoto(base64) {\n var urlvariable = \"/rest/update/picture\";\n var URL = \"https://voluntier-317915.appspot.com\" + urlvariable; //LookUp REST URL\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"POST\", URL, false);\n xmlhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n var userId = localStorage.getItem(\"email\"), token = localStorage.getItem(\"jwt\");\n var ItemJSON = '{\"email\": \"' + userId +\n '\", \"token\": \"' + token +\n '\", \"data\": \"' + 'data:image/'+imgext+';base64,' + base64 + '\"}';\n xmlhttp.send(ItemJSON);\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n document.getElementById(\"user64img\").src = ('data:image/' + imgext + ';base64,' + base64);\n const obj = JSON.parse(xmlhttp.responseText);\n let cloudURL = obj.url;\n sendFile(cloudURL, fileData);\n return false;\n }\n console.log(\"update request: \" + xmlhttp.status);\n}", "uploadImage(imageFormData) {\n \n return axios.post(\"http://localhost:5000/api/infer\", imageFormData, {\n \"Content-Type\" : \"multipart/form-data\"\n })\n }", "function uploadImage(loc, img, callback = undefined) {\n var storageRef = firebase.storage().ref(loc).put(img, { contentType: 'image/jpeg' });\n storageRef.on(firebase.storage.TaskEvent.STATE_CHANGED, function (snapshot) {\n //var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n app.showIndicator();\n break;\n }\n }, function (error) {\n app.hideIndicator();\n app.alert('There was an error attempting to upload the image.', 'Error');\n return;\n }, function () {\n // Upload completed successfully, now we can get the download URL\n app.hideIndicator();\n if (typeof callback !== 'undefined') {\n callback(storageRef.snapshot.downloadURL);\n }\n });\n}", "function uploadImage(fileName){\n\t // Create a root reference\n\t var ref = firebase.storage().ref();\n\n\t const file = fileName.get(0).files[0]\n\t const name = (+new Date()) + '-' + file.name\n\t const metadata = {\n\t \tcontentType: file.type\n\t }\n\t const task = ref.child(name).put(file, metadata)\n\n\t var image_url = '';\n\t task\n\t .then(snapshot => snapshot.ref.getDownloadURL())\n\t .then(url => {\n\n\t \timage_url = url ;\n\t \tconsole.log('image name : ' + name)\n\t \tconsole.log('image url : ' + image_url );\n\t \t$('#showimg').attr('src',image_url)\n\t })\n\n\n\t }", "function uploadImage(uri, progress, response, error) {\n const timestamp = (Date.now() / 1000 | 0).toString();\n const api_key = ''\n const api_secret = ''\n const cloud = ''\n const hash_string = 'timestamp=' + timestamp + api_secret\n const signature = CryptoJS.SHA1(hash_string).toString();\n const upload_url = 'https://api.cloudinary.com/v1_1/' + cloud + '/image/upload'\n\n let xhr = new XMLHttpRequest();\n xhr.open('POST', upload_url);\n xhr.onload = () => {\n console.log(xhr);\n };\n\n xhr.upload.addEventListener('progress', function(e) {\n //console.log('progress: ' + (e.loaded * 100/ e.total).toFixed(2) + '%');\n progress(parseFloat(e.loaded * 100/ e.total).toFixed(2))\n }, false);\n\n xhr.onreadystatechange = (e) => {\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (xhr.status === 200) {\n response(xhr.responseText)\n // console.log('success', xhr.responseText);\n } else {\n console.log('errors');\n console.log(xhr);\n error('errors')\n }\n };\n\n let formdata = new FormData();\n formdata.append('file', { uri: uri, type: 'image/png', name: 'upload.png' });\n formdata.append('timestamp', timestamp);\n formdata.append('api_key', api_key);\n formdata.append('signature', signature);\n xhr.send(formdata);\n}", "function RequestImageUpload(url, callbackFunction, imageDataUrl, mimeType) {\r\n\r\n\tvar request= new XMLHttpRequest();\r\n\t\r\n request.onload = function() {\r\n\t\tcallbackFunction( request.responseText);\r\n };\r\n\t\r\n\t// Upload\r\n\tvar form = document.createElement('form');\r\n var input = document.createElement('input');\r\n input.type = 'file';\r\n input.name = 'displayImage';\r\n\tinput.href=imageDataUrl;\r\n form.appendChild(input);\r\n\t\r\n request.open('POST', url); // Rappelons qu'il est obligatoire d'utiliser la méthode POST quand on souhaite utiliser un FormData\r\n\trequest.setRequestHeader(\"Content-Type\", mimeType ); // multipart/form-data\r\n\trequest.send(form);\r\n\r\n}", "function PreviewImage() {\n var oFReader = new FileReader();\n oFReader.readAsDataURL(document.getElementById(\"uploadImage\").files[0]);\n\n oFReader.onload = function(oFREvent) {\n document.getElementById(\"uploadPreview\").src = oFREvent.target.result;\n };\n}", "function onMzgPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.png';\n }\n options.fileName = newfname;\n options.mimeType = \"png\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n options.chunkedMode = true;\n var ft = new FileTransfer();\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=mzgimageupload\"), win, fail, options);\n\n function win(r) {\n localStorage.setItem('sendimage', JSON.stringify(r.response));\n // var resp = JSON.parse(r.response);\n window.location.reload();\n \n }\n\n function fail(error) { \n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "function AddFileServer(name_img) {\n let name_file = document.getElementById(\"formfile\");\n let formData = new FormData(name_file);\n const url = window.origin + \"/upload2/\";\n formData.append(\"name_img\",name_img);\n \n fetch(url, {\n method: \"POST\",\n body: formData\n })\n .then(function (response) {\n if (response.status !== 200) {\n console.log(`Looks like there was a problem. Status code: ${response.status}`);\n return;\n }\n response.json().then(function (data) {\n console.log(data);\n Change_img_prod()\n \n });\n })\n .catch(function (error) {\n console.log(\"Fetch error: \" + error);\n }); \n}", "function uploadFile(blob) {\n var imageDropzone = document.getElementById('reg-image-uploader').dropzone;\n var oldFile = imageDropzone.files[0];\n blob.accepted = oldFile.accepted;\n blob.lastModified = Date.now();\n blob.lastModifiedDate = new Date();\n blob.name = oldFile.name;\n blob.previewElement = oldFile.previewElement;\n blob.previewTemplate = oldFile.previewTemplate;\n blob.status = oldFile.status;\n blob.upload = {\n bytesSent: 0,\n progress: 0,\n total: blob.size\n };\n blob.webkitRelativePath = oldFile.webkitRelativePath;\n // left as blob because of potential incompatibilities with File API\n imageDropzone.files[0] = blob;\n imageDropzone.processQueue();\n }", "function uploadImage(req, res) {\n var base64image = req.body.base64image;\n var imageName = req.body.name;\n\n // for deploy\n var savePath = path.join(__dirname, `../../dist/assets/images/${imageName}`); \n // /Instagram-levi9-internship-heroku\n console.log(savePath);\n fs.writeFileSync(savePath, base64image, 'base64');\n\n // for developing\n // savePath = path.join(__dirname, `../../src/assets/images/${imageName}`); \n // console.log(savePath);\n\n fs.writeFileSync(savePath, base64image, 'base64');\n\n res.send({});\n}", "function upload(file) {\n\n\t/* Is the file an image? */\n\tif (!file || !file.type.match(/image.*/)) return;\n\n\t/* It is! */\n\tdocument.body.className = \"uploading\";\n\tvar d = document.querySelector(\".sceditor-button-imgur div\");\n\td.className = d.className + \" imgurup\";\n\n\t/* Lets build a FormData object*/\n\tvar fd = new FormData(); // I wrote about it: https://hacks.mozilla.org/2011/01/how-to-develop-a-html5-image-uploader/\n\tfd.append(\"image\", file); // Append the file\n\tvar xhr = new XMLHttpRequest(); // Create the XHR (Cross-Domain XHR FTW!!!) Thank you sooooo much imgur.com\n\txhr.open(\"POST\", \"https://api.imgur.com/3/image.json\"); // Boooom!\n\txhr.onload = function() {\n\t\tvar code = '[img]' + JSON.parse(xhr.responseText).data.link + '[/img]';\n\t\t$('#message, #signature, textarea[name*=\"value\"]').data('sceditor').insert(code);\n\t\tvar d = document.querySelector(\".sceditor-button-imgur div.imgurup\");\n\t\td.className = d.className - \" imgurup\";\n\t\tdocument.querySelector('input.imgur').remove();\n\t}\n\t// Ok, I don't handle the errors. An exercice for the reader.\n\txhr.setRequestHeader('Authorization', 'Client-ID '+iclid+'');\n\t/* And now, we send the formdata */\n\txhr.send(fd);\n}", "async function uploadImage() {\n const payload = new FormData();\n const desc = document.querySelector('#imageDescInput').value;\n\n payload.append('desc', desc);\n const imageUpload = document.querySelector('#fileUpload');\n console.log(imageUpload.files.length);\n\n if (imageUpload.files.length) payload.append('photo', imageUpload.files[0]);\n\n const response = await util.uploadImageToServer(util.currentProfile, payload);\n console.log('reponse: ', response);\n\n const imgObj = await util.getImagesById(util.currentProfile);\n\n for (const img of imgObj.rows) {\n if (document.querySelector(`#img-${img.img_id}`) === null) createImageElement(img);\n }\n addEventListeners();\n}", "uploadImage(e) {\n let imageFormObj = new FormData();\n\n imageFormObj.append(\"imageName\", \"multer-image-\" + Date.now());\n imageFormObj.append(\"imageData\", e.target.files[0]);\n\n // stores a readable instance of the image being uploaded using multer\n this.setState({\n multerImage: URL.createObjectURL(e.target.files[0])\n });\n\n axios.post(`${API_URL}/image/uploadmulter`, imageFormObj).then(data => {\n if (data.data.success) {\n alert(\"Image has been successfully uploaded using multer\");\n this.setDefaultImage();\n }\n });\n }", "function upload (file) {\n Upload.upload({\n url: 'http://localhost/Control/Laravel/public/api/image/upload',\n data: {file: file}\n }).then(function (resp) {\n swal(\"Exito!\", \"Imagen subida correctamente!\", \"success\");\n //console.log('Success ' + resp.config.data.file.name + 'uploaded. Response: ' + resp.data);\n }, function (resp) {\n //console.log('Error status: ' + resp.status);\n }, function (evt) {\n var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\n //console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);\n });\n }", "function updateImage() {\n const file = document.getElementById('user-picture').files[0];\n // check media type e.g. image/png, text/html\n if (!file.type.startsWith(\"image/\")) {\n alert(\"Not an image!\");\n } else {\n const preview = document.getElementById('meme-picture');\n\n preview.src = window.URL.createObjectURL(file);\n // We cannot revoke the object URL at this\n // point as html2canvas will need it.\n // preview.onload = function() {\n // window.URL.revokeObjectURL(this.src);\n // }\n }\n}", "function saveCanvas() {\n var base64PNG = canvas.toDataURL().split(',')[1];\n var fd = new FormData();\n fd.append(\"base64Image\", base64PNG);\n fd.append(\"client\", \"stjudes.demo\");\n var xhr = new XMLHttpRequest();\n xhr.addEventListener('load', imageUploaded, false);\n xhr.open('POST', 'http://stjudes.mercury.io/upload/');\n xhr.send(fd);\n}", "async function handleUploadImage(e){\n if(e.target.files[0]){\n setImage(e.target.files[0])\n }\n }", "function toEditImage() {\n // convert the canvas image to base64 and save it to session\n imgData = canvas.canvas.toDataURL('image/jpeg')\n sessionStorage.setItem(\"imgdata\", imgData);\n//SessionStorage used to store data locally within the user's browser. \n//The data is deleted when the user closes the specific browser tab.\n let url = \"./editImage.html\";\n window.location.href=url;\n}", "async UploadImage(url) {\n const ClientId = 'Client-ID '+'546c25a59c58ad7'\n const reqOpts = {\n headers: {\n Accept: \"application/json\",\n Authorization: ClientId,\n \"Content-Type\": \"application/json\"\n },\n method: \"POST\",\n body: JSON.stringify({\n image : url,\n type:'base64'\n })\n };\n let resp = await fetch('https://api.imgur.com/3/image', reqOpts); //Envío de formulario de actividad\n let response = await resp.json();\n return response;\n }", "function imagePreviewToSelectedFile() {\n let reader = new FileReader();\n reader.onload = function (e) {\n let resultingImage = e.target.result;\n let imageElement = document.getElementById(\"currentImg\");\n imageElement.src = resultingImage;\n }\n reader.readAsDataURL(document.getElementById(\"picUpload\").files[0]);\n }", "function upload(){\n var cc1=document.getElementById(\"c1\");\n var\n fileinput=document.getElementById(\"finput\");\n img = new SimpleImage(fileinput);\n img.drawTo(cc1);\n}", "function upload(blob, bucket, callback) {\n \"use strict\";\n //generate form data\n var data = new FormData();\n data.append(\"image\", blob, \"blob.\" + (blob.type === \"image/jpeg\" ? \"jpg\" : \"png\"));\n data.append(\"bucket\", bucket);\n //send\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://kland.smilebasicsource.com/uploadimage\");\n xhr.onload = callback;\n xhr.send(data);\n}", "function uploadFile() {\n ImagePicker.openPicker({\n width: 300,\n height: 400,\n cropping: true,\n }).then(image => {\n let formData = new FormData();\n let file = {\n uri: image.path,\n type: \"multipart/form-data\",\n name: \"image.png\",\n };\n formData.append(\"files\", file);\n if (profileInfo?.id) {\n formData.append(\"id\", profileInfo.id);\n }\n formData.append(\"userId\", global.userInfo.uId);\n updateProfile(formData)\n .then(res => {\n dispatch({\n type: PROFILE_INFO,\n profileInfo: res.profileInfo,\n });\n })\n .catch(res => {\n Toast.showToast(\"update theme failed!\" + res.msg);\n });\n });\n }", "function uploadImage() {\n \n //Creando una cadena con la informacion que necesitamos del formulario para agruparla dentro del objero BLOB\n var title =$(\"#title\").val();\n var author =$(\"#author\").val();\n var license =$(\"#license\").val();\n var string1 = {name: title, author: author, license: license}\n\n //Creating a Blob object(contiene una cadena con todos los campos que necesitamos del formulario(menos la imagen))\n\n var blob = new Blob([JSON.stringify(string1)], {type : 'application/json'});\n\n //Cogiendo la imagen del formulario\n var myForm = document.getElementById(\"file\");\n\n //Creating a FormData object y metiendo en el blob object y la imagen\n var myFormData = new FormData();\n myFormData.append(\"metadata\", blob);\n myFormData.append(\"rawdata\", myForm.files[0]);\n\n\n fetch(buildUrl(''), {method: 'POST', body: myFormData})\n ///in myFormData we appended a BLOB objetc (metadata) and the picture(file-rawdata)\n .then(function (response) {\n if (response.status !== 200) {\n throw new Error('Request return status code !== 200: ' + response.status + ' - ')\n }\n return response.json();\n })\n .then(function (json) {\n console.log('Request to upload images succeeded: ');\n console.log(json);\n\n })\n .catch(function (err) {\n console.error('Request to upload failed: ', err);\n });\n \n}", "storeImage () {\n // get input element user used to select local image\n var input = document.getElementById('files');\n // have all fields in the form been completed\n if (this.newImageTitle && input.files.length > 0) {\n var file = input.files[0];\n // get reference to a storage location and\n storageRef.child('images/' + file.name)\n .put(file)\n .then(snapshot => this.addImage(this.newImageTitle, snapshot.downloadURL));\n // reset input values so user knows to input new data\n input.value = '';\n }\n }", "function onPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = true;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=imageupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.reload();\n \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "function listenForImage() {\n document.getElementById(\"img\").addEventListener(\"change\", function() {\n const file = document.getElementById(\"img\").files[0];\n if (!file) return;\n signRequest(file, function(signed) {\n uploader(file, signed.signed_request, signed.url, function() {\n document.getElementById(\"preview\").src = signed.url;\n })\n })\n })\n}", "function uploadImagePreview() {\n var $form = $(this).form();\n var $preview = $form.find('[data-attr=\"previewImage\"]');\n var file = this.files;\n var reader = new FileReader();\n var spinnerTemplate = `\n <span class=\"spinner\">\n <i class=\"fa fa-spinner fa-spin\" style=\"font-size:1.2em\"></i> Uploading...\n </span>\n `;\n\n if (file[0] !== undefined) {\n reader.readAsDataURL(file[0]);\n\n $preview.parent().append(spinnerTemplate);\n\n reader.onload = function (e) {\n var src = e.target.result;\n\n $preview.parent().find('.spinner').remove();\n\n if (file[0].type === 'image/jpeg' || file[0].type === 'image/png') {\n $preview.attr('src', src).parent().addClass('has-img-fit');\n } else {\n $(this).val('');\n alert('Invalid format!');\n }\n };\n }\n}", "async function choosingPicture() {\n const fileName = document.getElementById('profile-image-upload-field').files[0];\n const fileReader = new FileReader();\n\n fileReader.addEventListener('loadend', async function () {\n const res = fileReader.result;\n const base64 = arrayBufferToBase64(res);\n const imgSrc = 'data:image/png;base64,' + base64;\n\n document.getElementById('header-profile-inner-img').src = imgSrc;\n document.getElementById('profile-image-field').src = imgSrc;\n\n // res ist Array-Buffer -> Server speichert es in DB -> beim Auslesen später wird der Byte-String noch mit Base64 encodiert, da readAsArrayBuffer im Ggs. zu readAsDataURL nicht vorkodiert\n await sendByteData(HOST + ':' + PORT + '/addImageToUser', window.localStorage.getItem('DatingApp-accessToken'), res);\n });\n\n // readAsDataURL bringt bereits Base64-encodeten String (also inklusive: data:image/png;base64)\n // readAsArrayBuffer bringt Array-Buffer\n // ArrayBuffer sind reine Binärdaten (mithilfe von Uint8Array können sie in Bytes zusammengefasst werden)\n fileReader.readAsArrayBuffer(fileName);\n}", "function uploadImage(file, name) {\n return new Promise(function (resolve, reject) {\n console.log(file.name);\n //Get image extension\n var ext = getExtension(file.name);\n\n // The name of the input field (i.e. \"image\") is used to retrieve the uploaded file\n let sampleFile = file;\n\n var file_name = `${name}-${Math.floor(Math.random() * 1000)}-${Math.floor(Date.now() / 1000)}.${ext}`;\n\n // Use the mv() method to place the file somewhere on your server\n sampleFile.mv(`${SERVERIMAGEUPLOADPATH}offer/${file_name}`, function (err) {\n if (err) {\n console.log('err', err);\n return reject('error');\n } else {\n return resolve(file_name);\n }\n });\n });\n}", "success(result) {\n var formData = new FormData();\n\n // The third parameter is required for server\n formData.append('file', result, result.name);\n\n // Send the compressed image file to server with XMLHttpRequest.\n // axios.post('/path/to/upload', formData).then(() => {\n // console.log('Upload success');\n // });\n\n\n // setImageFromFile(result, \"#previewOutputImg\");\n\n $(\"#previewOutputImg\").attr('src', URL.createObjectURL(result));\n }", "function setImageFromInput() {\n let imageFile = function () {\n var fileInput = document.querySelector(\"#uploadImage\");\n\n // File Reader and set SRC\n var reader = new FileReader();\n reader.onload = function (e) {\n imageOrigin.src = e.target.result;\n };\n reader.readAsDataURL(fileInput.files[0]);\n\n // Render Image Processed\n renderHtml('html/image-processed.html');\n\n // Render Image Filters\n renderHtml('html/image-filters.html');\n }\n document.querySelector(\"#uploadImage\").onchange = imageFile;\n\n}", "function uploadImage() {\n console.log(\"name\" + image_name);\n var praveen = {\n // image: fs.readFileSync(`../../FinalProject-master/public/img/${image_name}`),\n image: fs.readFileSync(`./public/uploads/${image_name}`),\n name: image_name,\n };\n connection.query(\"INSERT INTO images SET ? \", praveen, function (\n err,\n result\n ) {\n console.log(result);\n });\n }", "function uploadLocal() {\n console.log(\"ENTRAMOS!\");\n //var files = $(this)[0].files;\n\n $(\".retorno-upload\").css(\"padding-bottom\", \"24px\");\n\n $(\".retorno-upload\").html(\n `<img src=\"assets/images/loading.gif\" style=\"width:32px;height:auto;\"> Estamos enviando suas imagens, aguarde.`\n );\n\n /* Efetua o Upload \n $('.fileForm').ajaxForm({\n dataType: 'json',\n success: processJson \n }).submit();\n */\n}", "function onAvatarURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = false;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=avatarupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.assign(\"edit-profile.html\"); \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "onSubmitImage (){\n const formData = new FormData();\n formData.append('file', this.state.image);\n formData.append('upload_preset', preset);\n const link = ManageItemsService.updloadImage(formData).then(\n response => {\n return response\n }\n )\n return link;\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('#uploadedImg').attr('src', e.target.result);\n }\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "function uploadFile(file) {\n var url = 'https://api.cloudinary.com/v1_1/' + cloudName + '/upload';\n var xhr = new XMLHttpRequest();\n var fd = new FormData();\n xhr.open('POST', url, true);\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n xhr.onreadystatechange = function(e) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n // File uploaded successfully\n var response = JSON.parse(xhr.responseText);\n // https://res.cloudinary.com/cloudName/image/upload/v1483481128/public_id.jpg\n var url = response.secure_url;\n // Create a thumbnail of the uploaded image, with 150px width\n var tokens = url.split('/');\n tokens.splice(-2, 0, 'w_150,c_scale');\n var img = new Image(); // HTML5 Constructor\n img.src = tokens.join('/');\n img.alt = response.public_id;\n document.body.appendChild(img);\n }\n };\n\n fd.append('upload_preset', unsignedUploadPreset);\n fd.append('tags', 'browser_upload'); // Optional - add tag for image admin in Cloudinary\n fd.append('file', file);\n xhr.send(fd);\n}", "function showImage() {\n var files = document.getElementById(\"file_upload\").files;\n var imageHolder = document.getElementById(\"user_pic\");\n\n\n if (window.File && window.FileReader) {\n if (!files[0].type.match(\"image.*\")) {\n alert(\"Selected file is not an image\");\n document.getElementById(\"file_upload\").value = \"\";\n return;\n }\n \n var reader = new FileReader();\n \n reader.onload = function() {\n imageHolder.src = reader.result;\n };\n \n reader.readAsDataURL(files[0]);\n }\n else\n alert(\"File API's are not supported by your browser\");\n}", "function ProcessImage(imgGotten) {\r\n //AnonLog();\r\n var control = document.getElementById(\"fileToUpload\");\r\n // var file = control.files[0];\r\n var file = img; \r\n\r\n // Load base64 encoded image \r\n // var reader = new FileReader();\r\n // reader.onload = (function (theFile) {\r\n // return function (e) {\r\n var img = document.createElement('img');\r\n var image = null;\r\n img.src = imgGotten;\r\n var jpg = true;\r\n try {\r\n image = atob(imgGotten.split(\"data:image/jpeg;base64,\")[1]);\r\n\r\n } catch (e) {\r\n jpg = false;\r\n }\r\n if (jpg == false) {\r\n try {\r\n image = atob(imgGotten.split(\"data:image/png;base64,\")[1]);\r\n } catch (e) {\r\n alert(\"Not an image file Rekognition can process\");\r\n return;\r\n }\r\n }\r\n //unencode image bytes for Rekognition DetectFaces API \r\n var length = image.length;\r\n imageBytes = new ArrayBuffer(length);\r\n var ua = new Uint8Array(imageBytes);\r\n for (var i = 0; i < length; i++) {\r\n ua[i] = image.charCodeAt(i);\r\n }\r\n\r\n addImageToS3(imageBytes)\r\n\r\n }", "function processImage (imageUrl, callback) {\n var imageStream = fs.createWriteStream('tmp-image')\n request(imageUrl).pipe(imageStream)\n\n imageStream.on('close', () => {\n ImageService.post(\n 'tmp-image',\n (err, ret) => {\n if (err) {\n console.log('error posting image ', imageUrl, 'to GroupMe')\n callback(err, null)\n } else {\n callback(null, ret.url)\n }\n })\n })\n}", "function saveCanvasImage() {\n let stream = canvas.createPNGStream();\n minioClient.putObject(imageBucketName, imagePath, stream, function(err, etag) {\n if (err) {\n console.log('Failed to upload canvas image.');\n return console.log(err);\n }\n return console.log('Saved canvas image successfully as:' + etag);\n });\n}", "function saveImageToCloud(){\n cloudinary.v2.uploader.upload(path,\n { crop : \"fill\", aspect_ratio: \"1:1\" },\n function(error, result) {\n if(error)\n return next(error);\n\n channel.image = result.url;\n saveChannel();\n });\n }", "function serveBlob(blobKey, imageId) {\n const image = document.getElementById(imageId);\n image.src = \"/serve?blob-key=\" + blobKey;\n}", "function uploadEventImage() {\n // Clear messages\n vm.success = vm.error = null;\n\n // Start upload\n vm.uploader.uploadAll();\n }", "function uploadIMG(){\r\n image = new SimpleImage(fileinput);\r\n image1 = new SimpleImage(fileinput);\r\n image2 = new SimpleImage(fileinput);\r\n image3 = new SimpleImage(fileinput);\r\n image.drawTo(imgcanvas);\r\n clearAnon();\r\n}", "function onPhotoURISuccess(imageURI) {\n var loginid = localStorage.getItem('id');\n //alert(loginid);\n var imageData = imageURI;\n var photo_ur = imageData;\n var options = new FileUploadOptions();\n var imageURI = photo_ur;\n options.fileKey = \"image\";\n if (imageURI.substr(imageURI.lastIndexOf('/') + 1).indexOf(\".\") >= 0) {\n var newfname = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n } else {\n var newfname = jQuery.trim(imageURI.substr(imageURI.lastIndexOf('/') + 1)) + '.jpg';\n }\n options.fileName = newfname;\n //alert(newfname);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n params.loginid =loginid;\n\n options.params = params;\n //options.headers = \"Content-Type: multipart/form-data; boundary=38516d25820c4a9aad05f1e42cb442f4\";\n options.chunkedMode = false;\n var ft = new FileTransfer();\n // alert(imageURI);\n ft.upload(imageURI, encodeURI(\"http://qeneqt.us/index2.php?option=com_content&view=appcode&task=imageupload\"), win, fail, options);\n\n function win(r) {\n var resp = JSON.parse(r.response);\n window.location.reload(); \n }\n\n function fail(error) {\n alert(\"An error has occurred: Code = \" + error.code + \"upload error source \" + error.source + \"upload error target \" + error.target);\n }\n}", "function handleImageFromInput(ev, onImageReady) {\n document.querySelector('.share-container').innerHTML = ''\n var reader = new FileReader();\n console.log(ev)\n reader.onload = function (event) {\n var img = new Image();\n img.onload = onImageReady.bind(null, img);\n img.src = event.target.result;\n }\n reader.readAsDataURL(ev.target.files[0]);\n }", "uploadImage(imageUrl) {\n try {\n var result = uploadSync(Telescope.utils.addHttp(imageUrl));\n const data = {\n cloudinaryId: result.public_id,\n result: result,\n urls: CloudinaryUtils.getUrls(result.public_id)\n };\n return data;\n } catch (error) {\n console.log(\"// Cloudinary upload failed for URL: \"+imageUrl);\n console.log(error.stack);\n }\n }", "function setImage() {\n\n var file = document.querySelector('input[type=file]').files[0];\n var reader = new FileReader();\n\n reader.onloadend = function () {\n\t$('#thumbnail').attr('src',reader.result);\n\tsaved.setItem('image', reader.result);\n }\n\n if (file) {\n\treader.readAsDataURL(file);\n } else {\n $('#preview').attr('src','...');\n }\n}", "function uploadImage (file, range, e) {\n var uploadAPIEndpoint = '/orchestra/api/interface/upload_image/'\n var supportedTypes = ['image/jpeg', 'image/png', 'image/gif']\n\n if (supportedTypes.indexOf(file.type) === -1) {\n window.alert('Files type ' + file.type + ' not supported.')\n return\n } else if (e) {\n // Cancel default browser action only if file is actually an image\n e.preventDefault()\n }\n\n // If nothing is selected in the editor, append the image to its end\n if (range === null) {\n var endIndex = scope.editor.getLength()\n range = {\n 'start': endIndex,\n 'end': endIndex\n }\n }\n\n var reader = new window.FileReader()\n reader.onload = function (e) {\n var rawData = e.target.result\n // Remove prepended image type from data string\n var imageData = rawData.substring(rawData.indexOf(',') + 1, rawData.length)\n\n // Calculate data size of b64-encoded string\n var imageSize = imageData.length * 3 / 4\n\n if (imageSize > scope.uploadLimitMb * Math.pow(10, 6)) {\n window.alert('Files larger than ' + scope.uploadLimitMb + 'MB cannot be uploaded')\n return\n }\n // Post image data to API; response should contain the uploaded image url\n $http.post(uploadAPIEndpoint, {\n 'image_data': imageData,\n 'image_type': file.type,\n 'prefix': scope.imagePrefix\n })\n .then(function (response, status, headers, config) {\n // Replace selected range with new image\n scope.editor.deleteText(range)\n scope.editor.insertEmbed(range.start, 'image', response.data.url, 'user')\n })\n }\n reader.readAsDataURL(file)\n }", "function sendImageToPanelAfterUplaod(image_name) {\n var token = uniqueid();\n var image_url = \"/img/customImage/\" + image_name;\n setImageToCanvas(image_url);\n}", "function uploadImage(event) {\n\n event.preventDefault();\n\n const imageUploadForm = document.getElementById('imageUploadForm');\n\n if (document.getElementById('file').value !== '') {\n\n imageUploadForm.style.display = 'none';\n document.getElementById('uploading').style.display = 'block';\n\n let fileData = new FormData(imageUploadForm);\n\n fetch('/image/upload', {method: 'post', body: fileData},\n ).then(response => response.json()\n ).then(data => {\n\n if (data.hasOwnProperty('error')) {\n alert(data.error);\n } else {\n document.getElementById('file').value = '';\n loadImages();\n }\n imageUploadForm.style.visibility = 'visible';\n\n document.getElementById('uploading').style.display = 'none';\n }\n );\n } else {\n alert('No file specified');\n }\n\n\n}", "function testAddFile() {\n let f_req = new XMLHttpRequest();\n f_req.responseType = 'arraybuffer';\n\n\tf_req.onreadystatechange = function() {\n if (this.readyState === 4 && this.status === 200) {\n file = new File([this.response], 'test.jpg');\n updatePic(file);\n }\n };\n\tf_req.open(\"GET\", \"/static/img/test/sample.jpg\");\n\tf_req.send();\n}", "uploadImage(e) {\n const { onUpload } = this.props;\n let file = e.target.files[0]\n this.orientImage(file, (src) => {\n onUpload({\n file,\n name: file.name,\n src\n })\n });\n }", "previewUpload(e) {\n let files = e.target.files;\n let reader = new FileReader();\n\n reader.onload = e => {\n this.refs.logo.src = e.target.result;\n };\n\n reader.readAsDataURL(files[0]);\n }", "function InputUpload(e){\n var files = e.target.files;\n var file = files[0];\n if (isValid(file)){\n loadPreview(file);\n uploadImage(file);\n }\n}", "async function handleImageUpload(event) {\n\t\tconst imageFile = event.target.files[0];\n\n\t\tconsole.log('originalFile instanceof Blob', imageFile instanceof Blob); // true\n\t\tconsole.log(`originalFile size ${imageFile.size / 1024 / 1024} `);\n\n\t\tconst options = {\n\t\t\tmaxSizeMB: 0.1,\n\t\t\tmaxWidthOrHeight: 1920,\n\t\t\tuseWebWorker: true\n\t\t};\n\t\ttry {\n\t\t\tconst compressedFile = await imageCompression(imageFile, options);\n\t\t\tlet imgBlobToFile = new File([ compressedFile ], imageFile.name, {\n\t\t\t\tlastModified: Date.now(),\n\t\t\t\ttype: 'image/jpeg'\n\t\t\t});\n\t\t\tsetUploadPhoto(imgBlobToFile);\n\n\t\t\tconsole.log('compressedFile instanceof Blob', uploadPhoto instanceof Blob); // true\n\t\t\tconsole.log(`compressedFile size ${uploadPhoto.size / 1024 / 1024} MB`); // smaller than maxSizeMB\n\n\t\t\t// await uploadToServer(compressedFile); // write your own logic\n\t\t\tconsole.log(uploadPhoto);\n\t\t\tconsole.log('uploaded successfully');\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}", "function processImage(path, name) {\n\tvar new_location = 'public/uploads/';\n\n\tfs.copy(path, new_location + name, function(err) {\n\t\tif (err) {\n\t\t\tconsole.error(err);\n\t\t} else {\n\t\t\tconsole.log(\"success!\")\n\t\t}\n\t});\n}", "async uploadImage(e) {\n const { files } = e.target;\n const data = new FormData();\n data.append('file', files[0]);\n // Append websiteImages preset\n data.append('upload_preset', 'websiteImages');\n\n // Delete Auth header to prevent cors error\n delete axios.defaults.headers.common['Authorization'];\n\n // Send and wait for the post request\n const file = await axios({\n method: 'POST',\n url: 'https://api.cloudinary.com/v1_1/jwalkercreations-com/image/upload',\n data\n });\n\n // Grab the image id for react components\n const imageId = file.data.public_id;\n\n // Update profile's state with new id\n this.props.updateImageId(this.props.imageIndex, imageId);\n }", "function uploadImage() {\n\t\tif (state.photoSnapped) {\n\t\t\tvar canvas = document.getElementById('canvas');\n\t\t\tvar image = getImageAsBlobFromCanvas(canvas);\n\n\t\t\t// ============================================\n\n\t\t\t// TODO!!! Well this is for you ... YES you!!!\n\t\t\t// Good luck!\n\n\t\t\t// Create Form Data. Here you should put all data\n\t\t\t// requested by the face plus plus services and\n\t\t\t// pass it to ajaxRequest\n\t\t\tvar data = new FormData();\n\t\t\tdata.append('api_key', faceAPI.apiKey);\n\t\t\tdata.append('api_secret', faceAPI.apiSecret);\n\t\t\tdata.append('image_file', getImageAsBlobFromCanvas(canvas));\n\t\t\t// data.append('image_file', faceAPI.apiSecret);\n\t\t\t// add also other query parameters based on the request\n\t\t\t// you have to send\n\n\t\t\t// You have to implement the ajaxRequest. Here you can\n\t\t\t// see an example of how you should call this\n\t\t\t// First argument: the HTTP method\n\t\t\t// Second argument: the URI where we are sending our request\n\t\t\t// Third argument: the data (the parameters of the request)\n\t\t\t// ajaxRequest function should be general and support all your ajax requests...\n\t\t\t// Think also about the handler\n\t\t\t// ajaxRequest('POST', faceAPI.search, data);\n\t\t\tajaxRequest('POST', faceAPI.detect, data, (jsonData) => {\n\t\t\t\tconsole.log(jsonData);\n\t\t\t\tconst { faces } = jsonData;\n\t\t\t\tconst faceToken = faces[0].face_token;\n\t\t\t\tconsole.log(faces[0].face_rectangle);\n\t\t\t\tshowBoxBoundsInCanvas(canvas, faces[0].face_rectangle);\n\t\t\t\tlet tmpData = new FormData();\n\t\t\t\ttmpData.append('api_key', faceAPI.apiKey);\n\t\t\t\ttmpData.append('api_secret', faceAPI.apiSecret);\n\t\t\t\ttmpData.append('face_token', faceToken);\n\t\t\t\ttmpData.append('user_id', document.getElementById('username').value);\n\n\t\t\t\t// perform another ajax request\n\t\t\t\tajaxRequest('POST', faceAPI.setuserId, tmpData, (jsonResponse) => {\n\t\t\t\t\tconsole.log(jsonResponse);\n\t\t\t\t\tlet tmpData2 = new FormData();\n\t\t\t\t\ttmpData2.append('api_key', faceAPI.apiKey);\n\t\t\t\t\ttmpData2.append('api_secret', faceAPI.apiSecret);\n\t\t\t\t\ttmpData2.append('face_tokens', faceToken);\n\t\t\t\t\ttmpData2.append('outer_id', 'hy359');\n\n\t\t\t\t\t// perform another ajax request\n\t\t\t\t\tajaxRequest('POST', faceAPI.addFace, tmpData2, (jsonRes) => {\n\t\t\t\t\t\tdocument.getElementById('video-spinner').style.display = 'none';\n\t\t\t\t\t\tconsole.log(jsonRes);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t} else {\n\t\t\talert('No image has been taken!');\n\t\t}\n\t}", "handleFileChange(e) {\n this.setState({\n image:\n e.target\n .value /**URL.createObjectURL(e.target.files[0]) to display image before submit (for file uploads, not URLs) */,\n });\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('#uploadimg')\n .attr('src', e.target.result).width(200)\n .height(250);\n $('#uploadimg').css('display', 'block');\n\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n}" ]
[ "0.7295836", "0.7295836", "0.72433865", "0.7166959", "0.71283275", "0.7034273", "0.7034118", "0.6974571", "0.6921538", "0.6919557", "0.6905386", "0.68774486", "0.6866051", "0.6850128", "0.6784523", "0.67219996", "0.6712172", "0.6634322", "0.66182846", "0.6613366", "0.6586653", "0.65805596", "0.6556573", "0.65251577", "0.649689", "0.6483057", "0.64790225", "0.6447974", "0.6431014", "0.64107424", "0.640656", "0.64032096", "0.6398977", "0.6393937", "0.6362209", "0.635795", "0.63453805", "0.63324654", "0.63171625", "0.63129324", "0.6300115", "0.62957585", "0.62903976", "0.6283701", "0.6267653", "0.6264735", "0.62642133", "0.62575215", "0.6248788", "0.6246169", "0.6243688", "0.6242746", "0.6235069", "0.6233173", "0.6230725", "0.6221983", "0.6218409", "0.62133455", "0.6213236", "0.62127644", "0.6202152", "0.6194802", "0.6194569", "0.6182109", "0.6173384", "0.61693895", "0.6166701", "0.61608726", "0.61590487", "0.6158707", "0.6158551", "0.6132911", "0.61315346", "0.61310023", "0.61230105", "0.6121555", "0.6116471", "0.6112221", "0.6111594", "0.61082846", "0.610523", "0.6104644", "0.6103891", "0.60995567", "0.60977185", "0.609132", "0.6080612", "0.6078599", "0.607711", "0.60659796", "0.60628337", "0.60604537", "0.60561675", "0.6054675", "0.60535526", "0.6051658", "0.6049285", "0.6048129", "0.6046592", "0.6046104", "0.6032816" ]
0.0
-1
todo: merge with getNamedNodeByNameOrFindFunction
function getSymbolByNameOrFindFunction(items, nameOrFindFunc) { var findFunc; if (typeof nameOrFindFunc === "string") findFunc = function (dec) { return dec.getName() === nameOrFindFunc; }; else findFunc = nameOrFindFunc; return utils_1.ArrayUtils.find(items, findFunc); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $n( root, nodeName ) { return findNodeByName(root,nodeName); }", "getNodeName() {}", "function getNodeByName(node, name) {\n\tfor (var i=0;i<node.childNodes.length;i++) {\n\t\tif (node.childNodes[i].name==name)\n\t\t\treturn node.childNodes[i];\n\t}\n}", "function nodeByName(name, root) {\n return dojo.query(\"[name='\" + name + \"']\", root)[0];\n}", "function findNode(nodes, type, name) {\n for(let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if(node.nodeType === type && node.name === name) return node;\n }\n return null;\n }", "function findNode(name) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].name === name) {\n return nodes[i];\n }\n }\n return null;\n }", "query(name) {\n for (let node of this) {\n if (node.name === name) {\n return node;\n }\n }\n }", "function hc_namednodemapgetnameditem() {\n var success;\n var doc;\n var elementList;\n var testEmployee;\n var attributes;\n var domesticAttr;\n var attrName;\n doc = load(\"hc_staff\");\n elementList = doc.getElementsByTagName(\"acronym\");\n testEmployee = elementList.item(1);\n attributes = testEmployee.attributes;\n\n domesticAttr = attributes.getNamedItem(\"title\");\n attrName = domesticAttr.nodeName;\n\n assertEqualsAutoCase(\"attribute\", \"nodeName\",\"title\",attrName);\n \n}", "function getNode(names) {\n if (typeof names === 'string') {\n names = [names];\n }\n const selector = names\n .map((dataSelector) => {\n return '[data-' + dataSelector.type + '=\"' + dataSelector.name + '\"]';\n })\n .join(' ');\n\n return container.querySelector(selector);\n }", "function byTagName(node, tagName) {\n // Your code here.\n}", "function dfSearch(node, target) {}", "function getNodeName(node) {\n return 'foo';\n }", "function Xml_GetNamedAncestor(objNode,strAncestorName,blnEexcludSelf)\r\n{\r\n // Validate recieved arguments.\r\n if(objNode && !Aux_IsNullOrEmpty(strAncestorName))\r\n {\r\n return Xml_SelectSingleNode(\"ancestor\"+(blnEexcludSelf?\"\":\"-or-self\")+\"::\"+strAncestorName+\"[1]\",objNode);\r\n }\r\n \r\n return null;\r\n}", "get_node( bname ){\r\n\t\tlet idx = this.names[ bname ];\r\n\t\tif( idx == null ){ console.error( \"Armature.get_node - Bone name not found : %s\", bname ); return null; }\r\n\t\treturn this.nodes[ idx ];\r\n\t}", "function findByNodeName(el, nodeName) {\n\t if (!el.prop) {\n\t // not a jQuery or jqLite object -> wrap it\n\t el = angular.element(el);\n\t }\n\t\n\t if (el.prop(\"nodeName\") === nodeName.toUpperCase()) {\n\t return el;\n\t }\n\t\n\t var c = el.children();\n\t for (var i = 0; c && i < c.length; i++) {\n\t var node = findByNodeName(c[i], nodeName);\n\t if (node) {\n\t return node;\n\t }\n\t }\n\t}", "function findByNodeName(el, nodeName) {\n\t if (!el.prop) {\n\t // not a jQuery or jqLite object -> wrap it\n\t el = _angularFix2['default'].element(el);\n\t }\n\n\t if (el.prop('nodeName') === nodeName.toUpperCase()) {\n\t return el;\n\t }\n\n\t var c = el.children();\n\t for (var i = 0; c && i < c.length; i++) {\n\t var node = findByNodeName(c[i], nodeName);\n\t if (node) {\n\t return node;\n\t }\n\t }\n\t}", "function find(name, data) {\r\n var node = map[name], i;\r\n if (!node) {\r\n node = map[name] = data || {name: name, children: []};\r\n if (name.length) {\r\n node.parent = find(name.substring(0, i = name.lastIndexOf(\"#\")));\r\n node.parent.children.push(node);\r\n node.key = name.substring(i + 1);\r\n }\r\n }\r\n return node;\r\n }", "function hc_nodeelementnodename() {\n var success;\n var doc;\n var elementNode;\n var elementName;\n doc = load(\"hc_staff\");\n elementNode = doc.documentElement;\n\n elementName = elementNode.nodeName;\n\n \n\tif(\n\t\n\t(builder.contentType == \"image/svg+xml\")\n\n\t) {\n\tassertEquals(\"svgNodeName\",\"svg\",elementName);\n \n\t}\n\t\n\t\telse {\n\t\t\tassertEqualsAutoCase(\"element\", \"nodeName\",\"html\",elementName);\n \n\t\t}\n\t\n}", "function find() {}", "function funGetElement(xPath, idName, backupXPath = \"\")\n{\n\tlet ele = document.evaluate(xPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n\t\n\tif (ele == null)\n\t{\n\t\tele = document.evaluate(backupXPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\t\t\n\t}\n\t\n\tif (ele != null)\n\t{\n\t\tele.id = idName;\n\t}\n\n\treturn ele;\n}", "function find(obj, n) {\n // if(obj instanceof Object !=='Object'){\n // throw new TypeError('type error!')\n // }\n if (obj.id === undefined || obj.id !== n && !obj.children) return null;\n if (obj.id === n) {\n return obj.name;\n } else {\n return find(obj.children, n);\n }\n\n}", "function NamedNodeMap() {}", "function NamedNodeMap() {}", "function NamedNodeMap() {}", "function lookupNodes(){\n\t\tif( typeof(arg) == 'string') {\n\t\tvar selector = arg;\n\t\tsatellite.cssQuery(selector, function(matched) {\n\t\t\tnodes = matched;\n\t\t});\n\t\t} else if(Array.isArray(arg) == true){\n\t\t\tnodes = arg;\n\t\t} else if(arg == eam.global || arg == eam.context || arg && arg.parentNode){\n\t\t\tnodes = [arg];\n\t\t} else {\n\t\t\tnodes = [];\n\t\t}\n\t\tnode = nodes[0];\n\t}", "function ufEvalnode(path,document,node) {\r\n\tvar ret = document.evaluate(path,node,null,\r\n\t\t\tXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n\treturn ret;\r\n\r\n}", "function TNodes_doFindNodeByIdent(id){\t\t\n\t\t\tvar i=1;\n\t\t\tvar obj = null;\n \t\tif (this.Item[0]!=undefined){ \t\t \n \tif (id==this.Item[0].Ident){\n \t\t\t\tobj = this.Item[0];\n \t\t\t\treturn obj;\n\t\t\t }\n\t\t\t}\n\t\t\t// look case zero-node has containerlist\n//obj=this.Item[0].doCheckContainerIdent(id);\n\t\t\tif (obj != undefined) {\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\t\n\n\t\t\tdo {\t\t\t\t\n\t\t\t\t\tif (this.Item[i] == undefined) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// look upnode\n\t\t\t\t\tif (id==this.Item[i].UpNode.Ident){\n\t\t\t\t\t\tobj = this.Item[i].UpNode;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// look downnode\t\n\t\t\t\t\tif (id==this.Item[i].DownNode.Ident){\n\t\t\t\t\t\tobj = this.Item[i].DownNode;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// look upnode-container\n\t\t\t\t\t//obj=this.Item[i].UpNode.doCheckContainerIdent(id);\n\t\t\t\t\tif (obj != undefined) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n \n \n\n\t\t\t\t\t// look downnode-container\n\t\t\t\t\t//obj = this.Item[i].DownNode.doCheckContainerIdent(id);\n\t\t\t\t\tif (obj != undefined) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t} while (i++ < this.Count);\n\t\t\treturn obj;\n\t\t}", "getNodeValue() {}", "function getImmediateChildByName (object3d, value) {\n\t for (var i = 0, l = object3d.children.length; i < l; i++) {\n\t var obj = object3d.children[i];\n\t if (obj && obj['name'] === value) {\n\t return obj;\n\t }\n\t }\n\t return undefined;\n\t }", "function getFirstEleByIDXPath(rootNode, xpath){\r\n\tvar names = xpath.split(\"/\");\r\n\tvar node = rootNode;\r\n\tfor(var i=0;i<names.length;++i){\r\n\t\tnode = getFirstEleById(node, names[i]);\r\n\t\tif(node == null)\r\n\t\t\treturn null;\r\n\t}\r\n\treturn node;\r\n}", "function findNode(node)\n\t{\n \t\tif(m_xmlDOM.documentElement.querySelector)\n\t\t\t value = m_xmlDOM.documentElement.querySelector(node);\n\t\telse\n\t\t\t value = LumisPortalUtil.selectSingleNode(node.replace(\">\",\"/\"), m_xmlDOM.documentElement);\n \t\treturn value;\n\t}", "function get_node(id)\n {\n return indexbyid[id];\n }", "function getName(elem){return elem.name;}", "getIdOfNode(nodes, name) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].name == name) {\n return nodes[i].id;\n }\n }\n }", "function searchBy(tree,searchName,searchValue){\r\n\tif (tree[searchName] == searchValue) return tree;\r\n\t\r\n\tvar temp;\r\n\tvar children = tree.children;\r\n\t\r\n\tif (children){\r\n\t\tfor (var i in children){\r\n\t\t\ttemp=searchBy(children[i],searchName,searchValue);\r\n\t\t\tif (temp) return temp;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}", "get termType() {\n return 'NamedNode';\n }", "get termType() {\n return 'NamedNode';\n }", "function Xml_IsNodeName(objNode, strName)\r\n{\r\n return objNode.nodeName == strName;\r\n}", "function get_element(doc_el, name, idx) {\n var element = doc_el.getElementsByTagName(name);\n return element[idx].firstChild.data;\n }", "function findNode(nodePath) {\n const selector = nodePath\n .map((pathElement) => {\n return Object.keys(pathElement)\n .map((dataKey) => {\n const dataValue = pathElement[dataKey];\n return '[data-' + dataKey + '=\"' + dataValue + '\"]';\n })\n .join('');\n })\n .join(' ');\n\n return container.querySelector(selector);\n }", "function node(){}", "function nodeById(node, id){\n if (\n node.hasOwnProperty('$')\n && node['$'].hasOwnProperty('ID') // for the root node.\n && node['$']['ID'] == id) return node;\n\n let result = null;\n if (node.hasOwnProperty('node')){\n node['node'].forEach( sub_node => {\n if (result != null) return;\n result = nodeById(sub_node, id);\n } );\n }\n\n return result;\n}", "function nodeName( elem, name ) { // 2842\n // 2843\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); // 2844\n // 2845\n}", "function FindNode(nodes, shortcode) {\n node = null;\n $(nodes).each(function() { if (this.value.shortcode == shortcode) { node = this.value; return false; } });\n return node;\n }", "function Xml_GetChildByIndex(objNode,intIndex,strTag)\r\n{\r\n if(objNode)\r\n {\r\n var objCurrentNode = objNode.childNodes[intIndex];\r\n if(strTag==null || (objCurrentNode!=null && objCurrentNode.nodeName == strTag))\r\n {\r\n return objCurrentNode;\r\n }\r\n }\r\n}", "function retrivedLoockupName2(attributeTable, attributeid, attibuteValue, attributeName) {\n var entityRetrive = getEntityNodes(attributeTable, attributeid, attibuteValue);\n if (entityRetrive.length != 0) {\n var entityNodeRetrive = entityRetrive[0];\n var name = entityNodeRetrive.selectSingleNode(\"q1:\" + attributeName);\n name = name.text;\n return name;\n } else {\n return null;\n }\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function NamedNodeMap() {\n}", "function searchNodeTag(objElem,tagNameNode){\n var exist=false;\n var parent=objElem.parentNode;\n while(exist===false){\n if(parent.tagName===tagNameNode){\n exist=true;\n }else if(parent.tagName===\"BODY\"){\n console.log(\"ERROR: No se encontro un NodoPadre de tipo \" + tagNameNode + \"...\");\n return null;\n }else{\n parent=parent.parentNode;\n }\n }\n return parent;\n}", "function isNamedNode(term) {\n return !!term && term.termType === 'NamedNode';\n}", "function getChildByTagNames(item, names) {\n// if (!(item.hasChildNodes())) return null; // not supported by IE\n if (!item.childNodes || !item.childNodes.length) return null;\n var nodeList = item.childNodes;\n for (var i=0;i<nodeList.length;i++) {\n var node = nodeList[i];\n var nodeTag = node.tagName;\n if (nodeTag) {\n for (var j=0; j<names.length; j++) {\n if (nodeTag == names[j]) return node;\n }\n }\n }\n return null;\n }", "function nodename(_ndname){\n myNodeName = _ndname;\n dpost(\"my myNodeName is set: '\" + myNodeName + \"'\\n\");\n}", "getHostNode() {}", "get nodeName() { return this.name; }", "function getImmediateChildByName (object3d, value) {\n for (var i = 0, l = object3d.children.length; i < l; i++) {\n var obj = object3d.children[i];\n if (obj && obj['name'] === value) {\n return obj;\n }\n }\n return undefined;\n }", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function selectSingleNode(xPath,params){\r\n\t\tparams=params||{}; params['type']=9;\r\n\t\treturn selectNodes(xPath,params).singleNodeValue;\r\n\t}", "function getNode(name) {\r\n for (let i = 0; i < nodes.length; i++) {\r\n if (nodes[i].name == name) {\r\n return i;\r\n }\r\n }\r\n nodes.push({ name: name });\r\n return nodes.length - 1;\r\n}", "function _getNode(key){\n\treturn $(\"#tree\").fancytree(\"getTree\").getNodeByKey(key);\n}", "function findNodeByID(id) {\n var ret = null;\n \n $.each(nodes, function(i, node) {\n if (node['id'] == id) {\n ret = node;\n }\n });\n \n return ret;\n}", "get name(){\n return this.nodeName;\n }", "get name(){\n return this.nodeName;\n }", "function getNodes(kind, name) {\n return d3.selectAll(\"#synoptic svg .\" + kind)\n .filter(function (d) {return d[kind] == name;});\n }", "function getNamedChild (node, name) {\n var ret\n visitChildren (\n node,\n function(x){if(x.nodeName == name) ret = x},\n Node.ELEMENT_NODE\n )\n return ret\n}", "function searchNodes(nodes, name) {\n var len = nodes.length;\n var begin = 0;\n var end = len;\n var comp = 0;\n var target = len;\n while (begin <= end) {\n target = ~~((begin + end) / 2);\n if (target >= len) {\n break;\n }\n var targetNode = nodes[target];\n renderOrderString(targetNode);\n var targetName = targetNode.dataset.order;\n comp = name.localeCompare(targetName);\n if (comp < 0) {\n end = target - 1;\n } else if (comp > 0) {\n begin = target + 1;\n } else {\n return target;\n }\n }\n\n if (target >= len) {\n return len;\n }\n\n if (comp <= 0) {\n return target;\n }\n\n return target + 1;\n }", "function find_message_in_tree(desired_name, root_node) {\n return root_node.name === desired_name ? root_node : (0, _find3.default)(root_node.replies.map((0, _partial3.default)(find_message_in_tree, desired_name)));\n}", "function getTitleNode()\r\n{\r\n\t// Amazon has a number of different page layouts that put the title in different tags\r\n // This is an array of xpaths that can contain an item's title\r\n var titlePaths = [\r\n \t\"//span[@id='btAsinTitle']/node()[not(self::span)]\",\r\n \"//h1[@id='title']/node()[not(self::span)]\"\r\n ];\r\n \r\n for(var i in titlePaths) {\r\n \tvar nodes = document.evaluate(titlePaths[ i ], document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);\r\n\r\n\t\tvar thisNode = nodes.iterateNext(); \r\n\t\tvar titleNode;\r\n\t\t// Get the last node\r\n\t\twhile(thisNode){\r\n\t\t\tif(DEBUG) GM_log( thisNode.textContent );\r\n\t\t\ttitleNode = thisNode;\r\n \r\n if(titleNode) {\r\n \tbreak;\r\n \t}\r\n \r\n\t\t\tthisNode = nodes.iterateNext();\r\n\t\t}\r\n }\r\n\r\n\tif (titleNode == null || !nodes) {\r\n GM_log(\"can't find title node\");\r\n\t\treturn null;\r\n\t} else {\r\n if(DEBUG) GM_log(\"Found title node: \" + titleNode.textContent);\r\n\t}\r\n\treturn titleNode;\r\n}", "function lookup(node){\n \tfor (var i=0;i<node.childNodes.length;i++){\n var tag = node.childNodes[i]; //console.log(subgroup.childNodes);\n \t\tif(tag.childNodes.length > 0){ lookup(tag); } //keep digging\n \t\tif( tag.getAttribute && \n tag.getAttribute('class') && \n tag.getAttribute('class').split(\" \").indexOf(className) >= 0){ //console.log(subgroup.getAttribute('class'));\n \t\t\t targets.push(tag);\n \t\t}\n \t}\n\t}", "function getRandomNode(numOfNodes){\n\t\tvar id = getRandomInt(0,numOfNodes-1);\n\t\tvar node = _3DATA.search('name',id,false);\n\t\treturn node;\n\t}", "function zXPath() {\n\n}", "function findNode (path) {\n return editor.node.findNodeByInternalPath(path)\n }", "findChild(tagName) {\n const children = this.getChildren()\n for (let i = 0; i < children.length; i++) {\n const child = children[i]\n if (child.type === tagName) return child\n }\n }", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function getNode(xml,value,name,com)\n {\n if(value!=\"\"){ return xml.com(com).ele(name).txt(value).up(); }\n\n else { return xml.com(com).ele(name).up(); }\n }", "function get1(node, tagName, callback) {\n\t const n = node.getElementsByTagName(tagName);\n\t const result = n.length ? n[0] : null;\n\t if (result && callback)\n\t callback(result);\n\t return result;\n\t}", "function findNode(target, targetNodeName, stopAt) {\n if(target.nodeName == targetNodeName) {\n return target;\n } else if(target.nodeName == stopAt) {\n return false;\n } else {\n return findNode(target.parentNode, targetNodeName, stopAt);\n }\n}", "function findNode(value, node) {\n var e_1, _a;\n if (value === node.value)\n return node;\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n var node_1 = findNode(value, child);\n if (node_1)\n return node_1;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return null;\n}", "function findNode(value, node) {\n var e_1, _a;\n if (value === node.value)\n return node;\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n var node_1 = findNode(value, child);\n if (node_1)\n return node_1;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return null;\n}", "function findNode(value, node) {\n var e_1, _a;\n if (value === node.value)\n return node;\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n var node_1 = findNode(value, child);\n if (node_1)\n return node_1;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return null;\n}", "function findNodeBySID(text) {\n \t\"use strict\";\n \tvar i;\n \tfor (i = 0; i < nodes_data.length; i += 1) {\n \t if (nodes_data[i].sid === text) {\n \t return nodes_data[i];\n \t }\n \t}\n \treturn null;\n }", "function findNode(value, node) {\n var e_1, _a;\n if (value === node.value)\n return node;\n try {\n for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n var node_1 = findNode(value, child);\n if (node_1)\n return node_1;\n }\n }\n catch (e_1_1) {\n e_1 = { error: e_1_1 };\n }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return))\n _a.call(_b);\n }\n finally {\n if (e_1)\n throw e_1.error;\n }\n }\n return null;\n}" ]
[ "0.7234405", "0.7213357", "0.6847762", "0.6753413", "0.667247", "0.64504325", "0.6433099", "0.61442745", "0.6089772", "0.60751873", "0.60433406", "0.60325", "0.60161674", "0.6013289", "0.59773445", "0.5946763", "0.5925504", "0.5894859", "0.588466", "0.5840062", "0.5824268", "0.5794485", "0.5794485", "0.5794485", "0.57936966", "0.57901585", "0.57613623", "0.57299316", "0.57293385", "0.57147074", "0.5713364", "0.57066524", "0.5701765", "0.56731844", "0.56728643", "0.5669257", "0.5669257", "0.5652575", "0.56421", "0.5631486", "0.5614293", "0.56141055", "0.5609305", "0.55966014", "0.5587417", "0.5578098", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.55657053", "0.5548776", "0.5545334", "0.55386335", "0.55377775", "0.55377656", "0.55333686", "0.55312264", "0.550456", "0.550456", "0.550456", "0.5490187", "0.54870576", "0.5463938", "0.5462814", "0.5462814", "0.54588866", "0.5456046", "0.5448266", "0.54395854", "0.54390985", "0.5430456", "0.5419753", "0.5417269", "0.5409717", "0.5403574", "0.53939646", "0.53939646", "0.53939646", "0.53939646", "0.53939646", "0.53939646", "0.53938496", "0.53934205", "0.5386088", "0.5384239", "0.5384239", "0.5384239", "0.5381545", "0.53724176" ]
0.0
-1
LOGIC HERE: CHECK OUT COMPONENT MOUNTING IF YOU WANT TO TRY IT OUT
render(){ //RENDER LOGIC HERE return( <div class="five columns offset-by-half text-center payCell"> <Pricing /> <Options /> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isValid(){\n let component = this.props.component\n let key = this.props.attribute\n return !component.state.data[key].error\n }", "isValid(): boolean {\n return this.innerComponent.isValid();\n }", "function validateComponent(component) {\n const {componentUrl, componentId, requestType, payload, componentName, checkInterval} = component; \n console.log(`Validating components (${componentName})`);\n\n if (componentId && componentUrl && requestType && componentName && checkInterval){\n if(requestType.toLowerCase() == 'post' && !payload) {\n \n console.log(`The Component with url: ${componentUrl} has a requestType of post and as such must have a payload eg \n payload:{\n component: value\n }`);\n return false;\n }\n else if(checkInterval <= 60000){\n console.log(`The Component with url: ${componentUrl} must have a setInterval greater than 45secs`);\n return false;\n } else {\n console.log(`Components (${componentName}) validated`);\n return true;\n } \n } \n else{\n console.log(`your component parameters are incomplete, check to make sure these \nparameters exist\n componentUrl\n componentId \n requestType \n setInterval\n payload\n componentName\n `);\n return false;\n }\n}", "function component_viewer_res_data_componentRequiresEstimate(component_object) {\n\t//Given the UID of a component determine if it requires an estimate\n\tif (typeof(component_object)==\"undefined\") {\n\t\tconsole.log(\"Warning - passing undefined object to component_viewer_res_data_componentRequiresEstimate\");\n\t\treturn false;\n\t};\n\tif (typeof(component_object.status)==\"undefined\") {\n\t\tconsole.log(\"Warning - passing object with no status to component_viewer_res_data_componentRequiresEstimate\");\n\t\treturn false;\n\t};\n\tfor (var x in component_viewer_res_data_glob.skipped_component_object_status) {\n\t\tif (component_object.status==component_viewer_res_data_glob.skipped_component_object_status[x]) return false;\n\t};\n\treturn true;\n}", "function _checkFail() {\n\tif(!_charger.revealed || _currentCharger < _numChargers) {\n\t\t_fail();\n\t}\n}", "function hasBehavior (component) {\n return component.tick || component.tock;\n}", "function hasBehavior (component) {\n return component.tick || component.tock;\n}", "validateNoReviewComponent() {\n return this\n .waitForElementVisible('@productCardWithoutReviewComponent', 10000, () => {}, '[STEP] - Product Card should not have review component')\n .assert.visible('@productCardWithoutReviewComponent');\n }", "function checkNoChanges(component){setCheckNoChangesMode(true);try{detectChanges(component);}finally{setCheckNoChangesMode(false);}}", "function validateComponents(listComponentsName, clear) {\n var listCmp = listComponentsName;\n for (var i = 0; i < listCmp.length; i++) {\n var idCmp = listCmp[i].toString();\n var element = $(\"#\" + idCmp);\n var tagName = element.prop('tagName');\n var isOk = true;\n var defaultOptions = new Object();\n defaultOptions[\"elementPaint\"] = element;\n defaultOptions[\"focus\"] = element;\n if (tagName === \"INPUT\") {\n var type = element.prop('type');\n var notification = false;\n if (type === \"text\") {\n if (element.val() === '') {\n notification = true;\n }\n } else if (type === \"date\") {\n var valueDate = $(element).val();\n if (!Date.parse(valueDate)) {\n notification = true;\n }\n }\n } else if (tagName === \"SELECT\") {\n defaultOptions[\"elementPaint\"] = element.parent();\n defaultOptions[\"focus\"] = element;\n var valueSelect = $(element).val();\n if (!valueSelect) {\n notification = true;\n }\n } else if (tagName === \"DIV\") {\n if ($(element).hasClass(\"edit\")) {\n var getTextKey = $(element).children(\".editKey\");\n defaultOptions[\"elementPaint\"] = element;\n defaultOptions[\"focus\"] = getTextKey;\n if (element.attr(\"value\") === undefined || element.attr(\"value\") === \"\") {\n notification = true;\n }\n }\n }\n if (clear === undefined) {\n if (notification) {\n $(defaultOptions[\"elementPaint\"]).css('box-shadow', '0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9');\n defaultOptions[\"focus\"].focus();\n isOk = false;\n alert(\"Este componente esta vacio\");\n break;\n } else {\n $(defaultOptions[\"elementPaint\"]).css(\"box-shadow\", \"none\");\n }\n }\n else {\n $(defaultOptions[\"elementPaint\"]).css(\"box-shadow\", \"none\");\n }\n }\n //Start validation\n return isOk;\n}", "function hasBehavior (component) {\n\t return component.tick || component.tock;\n\t}", "function checkCompleted(selectComponent){\n if(selectComponent.length == 0){\n showToast(\"All translations done.\", \"G\");\n changeActive('exportItem');\n }\n}", "pass(space) {\r\n if(space.occupied === this.color){\r\n return false;\r\n } else if(space.terrain === 3){\r\n console.log('Cannot enter mountains')\r\n return false;\r\n } else if(this.mounted === true && space.terrain === 2){\r\n console.log('Mounted units cannot enter rough terrain');\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }", "function CheckComponent(component, type)\n{\n\tif (component.typeName == \"EC_Sound\")\n\t{\n\t\tif (component.name == \"Collision\")\n\t\t\tCollisionSound = component;\n\t}\n\n\telse if (component.typeName == \"RigidBody\")\n\t\tRigidBody = true;\n\n\tif (CollisionSound && RigidBody && Water)\n\t{\n\t\tConnectSignals();\n\t\tme.ComponentAdded.disconnect(CheckComponent);\n\t}\n}", "get elseChainIsAlreadySatisfied () { return false }", "get elseChainIsAlreadySatisfied () { return false }", "function pitCheck() {\n\tif (GreenChar.currentTile.isPit()) {\n\t\tGreenChar.pitShake();\n\t\taudioSourceInvalid = invalidSound.AddComponent(\"AudioSource\");\n\t\taudioSourceInvalid.audio.clip = Resources.Load(\"Sounds/invalid_move_2\");\n\t\taudioSourceInvalid.audio.PlayOneShot(audioSourceInvalid.audio.clip ,.9);\n\t}\n\tif (PurpleChar.currentTile.isPit()) {\n\t\tPurpleChar.pitShake();\n\t\taudioSourceInvalid = invalidSound.AddComponent(\"AudioSource\");\n\t\taudioSourceInvalid.audio.clip = Resources.Load(\"Sounds/invalid_move_2\");\n\t\taudioSourceInvalid.audio.PlayOneShot(audioSourceInvalid.audio.clip ,.9);\n\t}\n\treturn (!GreenChar.currentTile.isPit() && !PurpleChar.currentTile.isPit());\n}", "isValidateLocation() {\n return !this.state.transitioning && !this.props.delay\n }", "function checkComponent(component, props = null) {\n\t\tswitch (component) {\n\t\t\tcase 'Inbox':\n\t\t\t\tchangeCurrentComponent(goTo(Inbox));\n\t\t\t\tbreak;\n\t\t\tcase 'Contacts':\n\t\t\t\tchangeCurrentComponent(goTo(Contacts));\n\t\t\t\tbreak;\n\t\t\tcase 'NewContact':\n\t\t\t\tchangeCurrentComponent(goTo(NewContact, props));\n\t\t\t\tbreak;\n\t\t\tcase 'Settings':\n\t\t\t\tchangeCurrentComponent(goTo(Settings, props));\n\t\t\t\tbreak;\n\t\t\tcase 'Login':\n\t\t\t\tchangeCurrentComponent(goTo(Login));\n\t\t\t\tbreak;\n\t\t\tcase 'Thread':\n\t\t\t\tchangeCurrentComponent(goTo(Thread, props));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tchangeCurrentComponent(goTo(Login));\n\t\t\t\tbreak;\n\t\t}\n\t}", "function checkNoChanges(component) {\n checkNoChangesMode = true;\n try {\n detectChanges(component);\n }\n finally {\n checkNoChangesMode = false;\n }\n}", "function isValidStep() {\n if ($scope.inputs.enterpriseLabel === '' || !$scope.inputs.enterpriseLabel) {\n trackClientLabelFail('Missing Enterprise Name');\n $scope.setFormError('Please enter organization name.');\n return false;\n }\n if ($scope.inputs.enterpriseLabel.indexOf('.') !== -1) {\n trackClientLabelFail('Invalid Organization Name');\n $scope.setFormError('Organization names cannot contain periods.');\n return false;\n }\n if ($scope.inputs.enterpriseLabel.length > 50) {\n trackClientLabelFail('Invalid Organization Name Length');\n $scope.setFormError('Organization names cannot be longer than 50 characters.');\n return false;\n }\n return true;\n }", "function checkEmpty(el) {\n if(el.value.length == 0){\n //get invalid prompts\n getInvalidFormatEl(el);\n switcher = false;\n //console.log(el + 'this is throwing the switch, here the switch status currently' + switcher)\n return switcher;\n } else {\n //console.log('this is not throwing the switch, here the switch status currently' + switcher)\n //get invalid prompts\n removeInvalidFormatEl(el);\n };\n }", "function findcomponents() {\r\n if (!status.componentsfound) {\r\n var i,len=components.length;\r\n var allfound = true; //optimistic\r\n for (i=0;i<len;i++) {\r\n if (!components[i].found) {\r\n var component = $(components[i].path).closest('div.component');\r\n if (component.length) {\r\n components[i].found=true;\r\n enableoption(components[i].option);\r\n component.addClass(components[i].css);\r\n if (defined(components[i]['callback'], 'function')) {\r\n components[i].callback(component);\r\n }\r\n } else {\r\n allfound = false;\r\n }\r\n }\r\n }\r\n status.componentsfound = allfound;\r\n }\r\n }", "checkRequirement(index, berryReq) {\n const plot = App.game.farming.plotList[index];\n if (!plot.isUnlocked) {\n return false;\n }\n if (plot.berry !== berryReq) {\n return false;\n }\n if (plot.stage() !== PlotStage.Berry) {\n return false;\n }\n return true;\n }", "checkRequirement(index, berryReq) {\n const plot = App.game.farming.plotList[index];\n if (!plot.isUnlocked) {\n return false;\n }\n if (plot.berry !== berryReq) {\n return false;\n }\n if (plot.stage() !== PlotStage.Berry) {\n return false;\n }\n return true;\n }", "function checkBasicInputs() {\n if (!productName || !productBarcode) {\n const snackBar = {\n data: 'Veuillez remplir tous les champs requis.',\n position: WSnackBar.position.BOTTOM,\n duration: WSnackBar.duration.SHORT,\n textColor: 'white',\n backgroundColor: 'red',\n }\n WSnackBar.show(snackBar)\n return false\n }\n if (productBarcode.length != 13) {\n const snackBar = {\n data: 'Code barre invalide',\n position: WSnackBar.position.BOTTOM,\n duration: WSnackBar.duration.SHORT,\n textColor: 'white',\n backgroundColor: 'red',\n }\n WSnackBar.show(snackBar)\n return false\n }\n return true\n }", "get cantFireEvent(){\n return (!this._config || !this.hass || !this._firstRendered);\n }", "_checkDependencies(entity) {\n let missingDependencies = [];\n\n this.dependencies.forEach((dependency) => {\n let isMissing = true;\n\n for(let i=0; i < Object.keys(entity.components).length; i++) {\n if(Object.keys(entity.components)[i] == dependency) {\n isMissing = false;\n }\n }\n\n if(isMissing) missingDependencies.push(dependency);\n });\n\n if(missingDependencies.length > 0) {\n throw new Error(`${this.id} requires ${missingDependencies.length} other component dependencies. Make sure ${this.id} is added after it's dependencies.`);\n }\n }", "function checkInput() {\n if (source === undefined) {\n document.getElementById(\"info\").innerHTML = \"Source is not defined\";\n setVisibility(\"info\");\n return 0;\n }\n if (dest === undefined) {\n document.getElementById(\"info\").innerHTML = \"Destination is not defined\";\n setVisibility(\"info\");\n return 0;\n }\n return 1;\n}", "isValidated() {\n\t\tif (this.currentStage.currentState.isValidated()) {\n\t\t\tthis.log(\"Progressing\");\n\t\t\tthis.progressGameMode();\n\t\t}\n\t}", "isValid(el) {\n var hasEndpoint = Picker.getEndpoint(el)\n\n return [ hasEndpoint ].every(Boolean)\n }", "function done() {\n //if (count == ready && that.components + 1 >= _cmps.length) {\n if (count == ready ) {\n callback(null, that.template); //module return\n } else {\n return false;\n }\n }", "_verifyStep() {\n const divisor = (this.props.max - this.props.min) / this.props.step;\n if (divisor % 1 !== 0) {\n throw new Error(`Given step ( ${this.props.step} ) must be \\\n a divisor of max ( ${this.props.max} )`);\n }\n }", "check_if_passed() {\n const passed = this.input_area.value === this.text;\n if (!passed) {\n console.error(this.describe() + \" failed!\");\n }\n return passed;\n }", "shouldComponentUpdate(){\n console.log(\"LifeCcyleB shouldComponeentUpdate\")\n return true\n }", "function isItWrong() {\n cutAnyWire(this);\n\n if (green_light.style.opacity == \"1\") {\n // RIGHT\n\n // resetFunc();\n wireArray.forEach(element => {\n element.removeEventListener(\"click\", isItWrong);\n element.removeEventListener(\"click\", cutRightWire);\n });\n\n document.querySelector(\n `.svg_container${moduleCounter} .wire-shadow`\n ).style.display = \"none\";\n } else {\n // WRONG\n strikeFunc();\n\n red_light.style.opacity = \"1\";\n setTimeout(function () {\n red_light.style.opacity = \"0\";\n }, 1000);\n\n scene.classList.add(\"shake\");\n setTimeout(function () {\n scene.classList.remove(\"shake\");\n }, 100);\n }\n }", "hasComponent(name){\n return this.#components.has(name);\n }", "blackPawnDoubleSteppedFrom(position){\n return this.previousLayouts.length && this.positionEmpty(position) && this.pieceObjectFromLastLayout(position).color === \"black\" && this.pieceObjectFromLastLayout(position).species === \"Pawn\"\n }", "function componentStillLoadingError(compType){var error$$1=Error(\"Can't compile synchronously as \"+stringify(compType)+\" is still being loaded!\");error$$1[ERROR_COMPONENT_TYPE]=compType;return error$$1;}", "check() { \r\n if (this.movement.x === 0 && this.movement.y === 0) {\r\n if(this.game.player.unit === this) { //Check if unit belongs to client's player\r\n this.socket.emit('Desync check', this.number, 0, 0, this.side); //Desync check sent to server\r\n }\r\n this.moving = false; //Stops any movement\r\n this.mouseMovement = false;\r\n if(this.side) { //Changes png to Idle\r\n this.image = this.idleRight;\r\n } else {\r\n this.image = this.idleLeft;\r\n }\r\n }\r\n }", "checkComponentsForDifferences() {\n if (\n this.entity &&\n this.entity.hasLoaded &&\n this.haveComponentsBeenUpdated\n ) {\n // https://github.com/aframevr/aframe/blob/master/docs/core/utils.md#object-utils\n const componentDifferences = {};\n\n for (const componentName in this.entity.components) {\n if (\n componentName in this.entity.components &&\n this.entity.components[componentName].initialized &&\n !this.componentsWaitingToBeInitialized.has(componentName) &&\n !(\n this.isPhysicsEnabled &&\n this.entity.components[componentName].isPositionRotationScale\n ) // skip position/rotation/scale if physics is enabled\n ) {\n const entityComponentData = this.getEntityComponentData(\n componentName\n );\n\n let componentDifference = entityComponentData;\n\n // checks if the model even has this component value, using the data itself as the difference if it doesn't exist at all\n if (componentName in this.model.components) {\n componentDifference = AFRAME.utils.diff(\n this.model.components[componentName],\n entityComponentData\n );\n }\n\n // add to componentDifferences if this component has at least 1 difference\n if (Object.keys(componentDifference).length) {\n componentDifferences[componentName] = componentDifference;\n if (this.entity.components[componentName].isPositionRotationScale || componentName === \"croquet\") {\n this.entity.components[componentName].flushToDOM();\n }\n \n // undefined values, e.g. {x: undefined} don't get sent to the model via this.publish (it'll just receive {}) so we'll replace them with null\n for (const propertyName in componentDifferences[componentName]) {\n if (\n componentDifferences[componentName][propertyName] === undefined\n ) {\n componentDifferences[componentName][propertyName] = null;\n }\n }\n }\n }\n }\n\n if (Object.keys(componentDifferences).length) {\n this.log(\n \"Detected difference in component values\",\n componentDifferences\n );\n this.publish(this.model.id, \"set-components\", {\n componentDifferences,\n userViewId: this.viewId\n });\n }\n }\n }", "checkPickingState() {\n return false;\n }", "validateReviewComponent() {\n return this\n .waitForElementVisible('@reviewComponent', 10000, () => {}, '[STEP] - Product Card should have review component')\n .assert.visible('@reviewComponent');\n }", "checkCorectness(element, index) {\n const questions = this.state.submitedQuestions;\n let errorMessage = '';\n this.checkCorectnessTitle(questions);\n const thisObject = this.state.errors;\n if (element.type === 'match') {\n errorMessage = checkMatch(element);\n } else if (element.type === 'multiple_choice' || element.type === 'single_choice') {\n errorMessage = checkMultiple(element);\n } else if (element.type === 'mix') {\n errorMessage = checkMix(element);\n } else if (element.type === 'cloze') {\n errorMessage = checkCloze(element);\n } else if (element.type === 'cross') {\n errorMessage = checkCross(element);\n }\n if (errorMessage !== '') {\n const thisError = this.state.hasErrors;\n thisError[index + 1] = true;\n this.setState({ hasErrors: thisError });\n }\n if (errorMessage === '') {\n const thisError = this.state.hasErrors;\n thisError[index + 1] = false;\n this.setState({ hasErrors: thisError });\n }\n thisObject.quiz.questions_attributes[index] = errorMessage;\n this.setState({ errors: thisObject });\n }", "get composing() { return this.inputState.composing > 0; }", "anyProgress() {\n let oc = this.orbCounts;\n return (oc.speed > 0 || oc.stamina > 0 || oc.accel > 0 || oc.vigor > 0);\n }", "function checkWinningCondition() {\n\tif (matchedCards.length === 16) {\n\t\tstopTimer();\n\t\toverlay();\n\t} else {\n\t\treturn false;\n\t}\n}", "isBoxValid(index) {\n return (\n !this.boxes[index].classList.contains(\"wall\") &&\n !this.boxes[index].classList.contains(\"start\") &&\n !this.boxes[index].classList.contains(\"wall\")\n );\n }", "_checkComponentInView() {\n const $window = $(window);\n const componentOffsetTop = this._$mountPoint.offset().top;\n const windowScrollTop = $window.scrollTop();\n const windowHeight = $window.height();\n // the component is in view or upper than current view (throttle time)\n return (windowScrollTop > (componentOffsetTop - windowHeight));\n }", "isActionAvailable(actionObject){\n\n let manaCost = (actionObject.props.mana_points_cost !== undefined) ? actionObject.props.mana_points_cost : 0;\n let staminaCost = (actionObject.props.stamina_points_cost !== undefined) ? actionObject.props.stamina_points_cost : 0;\n let vigorCost = (actionObject.props.vigor_points_cost !== undefined) ? actionObject.props.vigor_points_cost : 0;\n let requirements = (actionObject.props.requirements !== undefined) ? actionObject.props.requirements : [];\n\n let actionCheck = {\n availability: true,\n reason: ''\n };\n\n if (!this.checkMana(manaCost)){\n actionCheck = {\n availability: false,\n reason: 'Insufficient Mana'\n }\n }\n\n if (!this.checkStamina(staminaCost)){\n actionCheck = {\n availability: false,\n reason: 'Insufficient Stamina'\n }\n }\n\n if (!this.checkVigor(vigorCost)){\n actionCheck = {\n availability: false,\n reason: 'Insufficient Vigor'\n }\n }\n\n if (requirements){\n requirements.forEach(eachRequirement=>{\n if(this.props.stats_current[eachRequirement.key] !== eachRequirement.value){\n actionCheck.availability = false;\n actionCheck.reason = eachRequirement.failure_message\n }\n })\n }\n\n return actionCheck;\n\n /*\n if(requirements){\n let requirementKeys = Object.keys(requirements);\n\n requirementKeys.forEach(eachRequirementKey=>{\n if(_.get(this.props, eachRequirementKey) === requirements[eachRequirementKey]){\n actionCheck = {\n availability: false\n }\n }\n });\n\n requirements.forEach(eachRequirement=>{\n _.get(this.props, eachRequirement)\n })\n }*/\n\n //What if there are other properties, stats needed to determine if an action is available?\n\n //For example, backstab is only available if the character is hidden\n\n //For each action, look at the \"requirements\" property to see what is required:\n\n /*Backstab:\n\n .requirements_to_display: {\n\n }\n .requirements_to_use: {\n is_hidden: 1\n }\n .requirements_to_use: [\n {\n key: 'is_hidden'\n value: 1\n error: 'You must be hidden to use this skill'\n }\n ]\n .cost: {\n mana: 0\n stamina: 0\n spirit: 0\n }\n\n\n */\n }", "validate(step) {\n switch (step) {\n case 0:\n if (this.state.title.length > 2) {\n return true;\n }\n break;\n case 1:\n if (this.state.image) {\n return true;\n }\n break;\n default:\n return false;\n }\n return false;\n }", "function onComponentUpdate() {\n if (application.get().code === 500) {\n // manually set code, stay failed\n return;\n }\n\n let starting = 0;\n let error = 0;\n let ready = 0;\n let total = 0;\n _.forEach(components, c => {\n if (c.componentName === 'Linkurious') { return; }\n const code = c.get().code;\n ++total;\n if (code < 200) { ++starting; }\n if (code >= 200 && code < 300) { ++ready; }\n if (code >= 400) { ++error; }\n });\n\n if (error > 0) {\n application.set('error');\n } else if (starting > 0) {\n application.set('starting');\n } else if (ready === total) {\n application.set('initialized');\n }\n }", "_checkIfComplete() {\n\n\t\tif(this._matchedCards === this.rows*this.cols) {\n\n\t\t\t// Delay for the animations\n\t\t\tsetTimeout(() => {\n\n\t\t\t\talert(`You have scored ${this._score} points`);\n\n\t\t\t\tclearInterval(this._timer);\n\n\t\t\t\tthis.initGame();\n\t\t\t}, 400);\n\t\t}\n\t}", "checkValidity() {\n this.validState = this.currentDataState.name && \n +this.currentDataState.amount && +this.currentDataState.maximumRides;\n }", "function checkNoChanges(component) {\n setCheckNoChangesMode(true);\n try {\n detectChanges(component);\n }\n finally {\n setCheckNoChangesMode(false);\n }\n}", "function checkNoChanges(component) {\n setCheckNoChangesMode(true);\n try {\n detectChanges(component);\n }\n finally {\n setCheckNoChangesMode(false);\n }\n}", "canHandle(trouble) {\n // ˅\n return false;\n // ˄\n }", "bookTestDriveSlot()\n {\n this.loadSpinner=true;\n\n let startMeter = this.startMeterReading ? parseFloat(this.startMeterReading) : 0.0;\n let endMeter = this.endMeterReading ? parseFloat(this.endMeterReading) : 0.0;\n\n if(this.isCommercial && (endMeter < startMeter)){\n let error_Msg = 'End Meter Reading should be greater than Start Meter Reading';\n this.tostMessage( error_Msg, 1, 'Error', 0);\n this.loadSpinner=false;\n return;\n }\n\n const allValid = [...this.template.querySelectorAll('lightning-combobox')]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n let dealerEmpId='';\n if(this.userDetail.fields.Dealer_Employee_Code__c.value!==null && this.userDetail.fields.Dealer_Employee_Code__c.value!==undefined && this.userDetail.fields.Dealer_Employee_Code__c.value.includes('_'))\n {\n dealerEmpId=this.userDetail.fields.Dealer_Employee_Code__c.value.split('_')[1];\n }\n if(this.testDriveType==='S')\n {\n console.log(this.loadSpinner);\n console.log(allValid);\n if(this.selectedSlot===undefined || this.selectedSlot.length===0 || this.selectedSlot==='')\n {\n this.template.querySelector('c-multi-select-cmp').setPickListName(this.selectedSlot);\n this.loadSpinner=false;\n }\n else if(this.selectedDate!==undefined && this.selectedDate!=='' && allValid){\n console.log('Inside Else if');\n //this.loadSpinner=true;\n this.bookingDate=this.selectedDate;\n if(this.selectedSlot.length===1)\n {\n this.startTime=this.selectedSlot[0].Name.split(' to ')[0];\n this.endTime=this.selectedSlot[0].Name.split(' to ')[1];\n }\n else if(this.selectedSlot.length>1)\n {\n this.startTime=this.selectedSlot[0].Name.split(' to ')[0];\n this.endTime=this.selectedSlot[this.selectedSlot.length-1].Name.split(' to ')[1];\n }\n \n let tdrd={\n \"optType\" : this.testDriveType,\n \"mspin\": this.record.fields.DSE_MSPIN__c.value,\n \"model\": this.selectedVariant, \n \"variant\": this.variantSelected,\n \"location\": this.loc,\n \"status\":this.testDriveType==='C'?\"COMPLETED\":\"RESERVED\", //\"RESERVED\",\n \"owner\": \"1\",\n \"enquiryId\": this.record.fields.DMS_Enquiry_Name__c.value, //\"19000050\",\n \"salesPersonId\": dealerEmpId,//\"EMP2096\",\n \"scheduleStartTime\": this.bookingDate+'T'+this.startTime+':00.090Z',\n \"scheduleEndTime\": this.bookingDate+'T'+this.endTime+':00.090Z' ,\n \"duration\":0,\n \"drivenKM\" : this.testDriveType==='C'?this.kmDriven:0,\n \"signature\": false,\n \"vin\": this.vin,\n \"orgId\": 1,\n \"salesforceId\": \"\" \n };\n console.log(tdrd);\n this.callBookTestDriveAPI(tdrd);\n }\n else{\n //console.log('Inside else');\n this.loadSpinner=false;\n }\n \n }\n else{\n\n const allValidCreate = [...this.template.querySelectorAll('lightning-input')]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n const allValidCreateSatisfied = [...this.template.querySelectorAll('lightning-radio-group')]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n const checkTextAreaFeedBack = [...this.template.querySelectorAll('lightning-textarea')]\n .reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n console.log(this.todayDate);\n console.log(this.sTime);\n console.log(this.eTime);\n if(allValidCreate && this.padTOuched===true && allValidCreateSatisfied && checkTextAreaFeedBack)\n {\n let dateSplit=this.todayDate.split('-');\n let startTimeSplit=this.startTime.split(':');\n let endTimeSplit=this.endTime.split(':');\n this.dateTimeDiff=Math.abs(new Date(dateSplit[0], dateSplit[1], dateSplit[2], endTimeSplit[0], endTimeSplit[1], '00', '00')- new Date(dateSplit[0], dateSplit[1], dateSplit[2], startTimeSplit[0], startTimeSplit[1], '00', '00'));\n this.dateTimeDiff=Math.floor((this.dateTimeDiff/1000)/60);\n let tdrd={\n \"optType\" : this.testDriveType,\n \"mspin\": this.record.fields.DSE_MSPIN__c.value,\n \"model\": this.selectedVariant, \n \"variant\": this.variantSelected,\n \"location\": this.loc,\n \"status\":this.testDriveType==='C'?\"COMPLETED\":\"RESERVED\", //\"RESERVED\",\n \"owner\": \"1\",\n \"enquiryId\": this.record.fields.DMS_Enquiry_Name__c.value, //\"19000050\",\n \"salesPersonId\": dealerEmpId,\n \"scheduleStartTime\": this.todayDate+'T'+this.startTime+'Z',\n \"scheduleEndTime\": this.todayDate+'T'+this.endTime+'Z' ,\n \"duration\": this.dateTimeDiff,\n \"drivenKM\" : this.kmDriven,\n \"signature\": false,\n \"startReading\": startMeter,\n \"endReading\": endMeter,\n \"isLoad\": this.loadedTestDrive ? \"Y\" : \"N\",\n \"orgId\": 1,\n \"salesforceId\": \"\" \n };\n this.callBookTestDriveAPI(tdrd);\n }\n else{\n this.tostMessage(missingFieldnSignature,0,'Error','');\n this.loadSpinner=false;\n }\n \n }\n //this.loadSpinner=false;\n \n }", "function afterSub (e) {\n let counter = 0,\n clases = document.querySelectorAll('.fieldp input');\n \n clases.forEach(function (elem) {\n //real validation is in html in here we are just checked if not valid write it down\n if(!elem.checkValidity()){\n counter += 1\n }\n })\n //if all html validattion was right its js validation Time\n if(counter == 0){\n //see if pss s are same or not\n let confirm = ui.validpass(clases);\n if(confirm === 'yes'){\n //if pss math send info and show user that it s Done \n ui.gifdone();\n radyInfo(clases);\n }\n else if(confirm === 'no'){\n //if not math show error to user\n ui.massage('please match the passworads','error');\n }\n}\n //if Html validations are not right(not valid)\n else if(counter > 0){\n ui.massage('please fill all the fields','error');\n counter = 0;\n } \n}", "checkCollision(that) {\n\t\tif (that.state == \"LIVE\") {\n\t\t\tthat.parts.forEach( part => {\n\t\t\t\tconst dis = dist(part.x, part.y, this.x, this.y)\n\t\t\t\t// console.log(dis)\n\t\t\t\tif (dis < 20) {\n\t\t\t\t\tthis.state = 'DEAD'\n\t\t\t\t\treturn true\n\t\t\t\t} \n\t\t\t})\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\n\t\t\n\t}", "get compositionStarted() { return this.inputState.composing >= 0; }", "function test($elem)\n {\n if($elem == 1)\n {\n $( \"#left ul\" ).find( \".placeholder\" ).show('slow');\n }\n else\n {\n if($elem >= 4)\n {\n $( \"#left ul\" ).droppable('option', 'disabled', true);\n $('#error01').css('display', 'block');\n }\n else\n {\n $( \"#left ul\" ).droppable('option', 'disabled', false);\n $('#error01').css('display', 'none');\n }\n }\n }", "checkValidity() {\n return this.state.name && +this.state.amount && +this.state.maximumRides;\n }", "function verification() {\r\n countTrue();\r\n if (choice == 'c') {\r\n render(complete);\r\n } else if (choice == 'l') {\r\n render(laziness);\r\n } else {\r\n render(mass);\r\n }\r\n }", "function queueComponentIndexForCheck(previousOrParentTNode){ngDevMode&&assertEqual(getFirstTemplatePass(),true,'Should only be called in first template pass.');var tView=getLView()[TVIEW];(tView.components||(tView.components=[])).push(previousOrParentTNode.index);}", "checkError() {\n this.state.Qty > this.props.item.stock ? this.setState({QtyError: true}) : this.setState({QtyError: false})\n }", "function isCompelete() {\n if (Math.abs(x - target.x) <= 50) {\n console.log(\"done\");\n document.querySelector(\".container__mission\").style.display = \"flex\";\n document.querySelector(\".container__mission_status p\").innerHTML=\"Mission Complete\"\n document.querySelector(\".container__mission_status\").style.backgroundColor = \"#4aa96c\";\n\n\n } else {\n document.querySelector(\".container__mission\").style.display = \"flex\";\n document.querySelector(\".container__mission_status\").style.backgroundColor = \"#fb3640\";\n document.querySelector(\".container__mission_status p\").innerHTML=\"Mission Failed\"\n }\n}", "validateNoStockStatus() {\n this\n .waitForElementNotPresent('@stockIndicator', 10000, (res) => {\n if (res.value) {\n // eslint-disable-next-line no-unused-expressions\n this\n .expect.element('@stockIndicator').to.be.not.present;\n } else {\n this\n .assert.ok(false, '[FAIL] - Something went wrong when validating stock status is not displayed');\n }\n }, '[STEP] - Stock Status should not be displayed in Product Card');\n return this;\n }", "function CheckIfOver() {\n if((bike2.crashB2(trail2)===true) ||\n (bike2.crashWithBorderB2(trail2)===true)||\n (bike1.crashB1(trail)===true)||\n (bike1.crashWithBorderB1(trail)===true)||\n (bike1.crashB1WithTrail2(trail2)===true)||\n (bike2.crashB2WithTrail(trail) ===true)||\n (bike1.inCaseOfDraw()===true)||\n (bike2.inCaseOfDraw()===true)){\n setTimeout(() => {\n gameArea.clear();\n }, 0);\n } \n}", "function checkEject()\n{\n\tif (_ejectedCount > 0)\n\t{\n\t\t_log.error('%d reading(s) ejected', _ejectedCount);\n\t\t_ejectedCount = 0;\n\t}\n}", "function checkVisible()\n{\n\tcheckElementRunThough(\"slide-card\");\n\tcheckElementRunThough(\"cardSec\");\n}", "function checkInputOnCombo(me){\r\n\tcheckInput(me, null); \r\n}", "canDrop(props) {\n return !props.piece\n }", "verifyItemNotPresent() {\n return this.cartItem.isDisplayed().should.be.false;\n }", "function checkComponentContainers(){\r\n\t\tif(_containersToLoad === undefined || _containersToLoad === null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// check if all containers are ready and containing no\r\n\t\t// component\r\n\t\t// instances\r\n\t\tfor(let i = 0; i < _containersToLoad.length; ++i) {\r\n\t\t\tif(!_containersToLoad[i].isReady() || _containersToLoad[i].getComponentInstance() !== null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "_detectCollision () {\n let doContinue = true\n app.needleSelection.getNeedles().each(d => {\n if (d.passed) return\n const mm = app.getMmByLevel(app.ctx.level)\n const fromY = d.y + constant.NEEDLE_HOLE_DY\n const toY = fromY + mm\n const thread = app.threadDS\n if (thread.cx >= d.x) {\n if (fromY <= thread.cy - thread.r && thread.cy + thread.r <= toY) { // Passed\n app.statusTextScore++\n app.ctx.level = this._calcLevelByScore(app.statusTextScore) // May Lv. Up\n d.passed = true\n } else { // Failed\n doContinue = false\n }\n }\n })\n return doContinue\n }", "function isValidOutput(){\r\n \r\n for (const iterator of outputTiles) {\r\n\r\n if(iterator === \"\")\r\n {\r\n errorMessage = \" -1 (No solution exist)\";\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function checkCollition(){\n pipes.forEach(function(pipe){\n if(flappy.isTouching(pipe)) gameOver();\n });\n\n}", "checkInteractValidity() {\n if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_top_mid_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y-75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown) {\n \n if(roomProgress <= 2000)\n this.coin0.alpha = 1.0;\n roomProgress = 2005;\n \n //this.coin0.alpha = 1.0;\n this.room2_activity1A.alpha = 1.0;\n\t\t// this.resetArrows();\n this.room2_characterMoveable = false;\n this.checkActivityOpened(true, false, false, false, false, false);\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_bot_left_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2005) {\n if(roomProgress <= 2010)\n roomProgress = 2010;\n\n this.room2_activity2A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, true, false, false, false, false);\n \n } else if (this.room2_key_E.isDown && roomProgress < 2005) {\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_top_left_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y-75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2010) {\n if(roomProgress <= 2015)\n roomProgress = 2015;\n\n this.room2_activity3A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, false, true, false, false, false);\n\n } else if (this.room2_key_E.isDown && roomProgress < 2010){\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_bot_mid_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2015) {\n if(roomProgress <= 2020)\n roomProgress = 2020;\n\n this.room2_activity4A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, false, false, true, false, false);\n\n } else if (this.room2_key_E.isDown && roomProgress < 2015){\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n\n }\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_top_right_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y-75;\n\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2020) {\n if(roomProgress <= 2025)\n roomProgress = 2025;\n\n this.room2_activity5A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, false, false, false, true, false);\n }\n else if (this.room2_key_E.isDown && roomProgress < 2020){\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_bot_right_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2025) {\n if(roomProgress <= 2030)\n roomProgress = 2030;\n console.log(roomProgress); \n this.room2_activity6A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, false, false, false, false, true);\n }\n else if (this.room2_key_E.isDown && roomProgress < 2025){\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.coin0_zone, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y-75;\n if(this.coin0.alpha == 1.0) this.room2_E_KeyImg.alpha = 1.0;\n if(this.room2_key_E.isDown) {\n if(this.coin0.alpha == 1.0) this.collectCoin(0);\n //this.coin0.alpha = 0.0;\n }\n }\n else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_hole_zone_nextRoom, this.room2_character_north)) {\n if(roomProgress >= 2500) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown) {\n if (roomProgress <= 3000)\n\t\t roomProgress = 3000;\n\t\t this.scene.start(\"Account_Eqn\");\n\t\t //this.scene.start(\"winners_Room\");\n }\n }\n\n\n }\n\n else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_hole__zone_activity, this.room2_character_north)) {\n if(roomProgress >= 2030) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if(this.room2_key_E.isDown) {\n if(roomProgress <= 2100)\n roomProgress = 2100;\n\t\t this.scene.start(\"BB_ActRoom\");\n }\n }\n }\n\t else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_exitDoor, this.room2_character_north)){\n\t this.room2_E_KeyImg.x = this.room2_character_north.x+75;\n\t this.room2_E_KeyImg.y = this.room2_character_north.y;\n\t this.room2_E_KeyImg.alpha = 1.0;\n\t if (this.room2_key_E.isDown) {\n\t\t this.scene.start(\"Course_Intro\");\n\t }\n\t }\t\n\n else {\n this.hideActivities();\n this.room2_E_KeyImg.alpha = 0.0;\n }\n }", "componentIsAvailableForManagerCurrentWp(type, parentName, name){\n server.call('verifyWorkPackageComponents.componentExistsInCurrentWpScopeCalled', type, parentName, name, 'miles',\n (function(error, result){\n return(error === null);\n })\n )\n }", "shouldComponentUpdate(){\n console.log('Life Cycle A - shouldComponentUpdate');\n return true;\n }", "async vlidatePresenceOfElements () {\n await expect(await (await this.inputUsername).isDisplayed()).toBe(true);\n await expect(await (await this.inputPassword).isDisplayed()).toBe(true);\n // check if submit button is displayed or not\n await expect(await (await this.btnSubmit).isDisplayed()).toBe(true);\n // check if submit button is clickable or not\n await expect(await (await this.btnSubmit).isClickable()).toBe(true);\n }", "function checkFieldsOfBoardManager() {\n if($(\"#input-board-size-tile:invalid, #input-board-nb-tiles:invalid\").length === 0) {\n if($(__RESET_BUTTON__).attr(\"disabled\"))\n $(__RESET_BUTTON__).attr(\"disabled\", false);\n } else {\n if(!$(__RESET_BUTTON__).attr(\"disabled\"))\n $(__RESET_BUTTON__).attr(\"disabled\", true);\n }\n if($(\"#input-board-time-between-generations:invalid\").length === 0) {\n if(nbTiles !== 0 && $(__RUN_BUTTON__).attr(\"disabled\"))\n $(__RUN_BUTTON__).attr(\"disabled\", false);\n } else {\n if(!$(__RUN_BUTTON__).attr(\"disabled\"))\n $(__RUN_BUTTON__).attr(\"disabled\", true);\n }\n}", "function validateReleasedState() {\n if (!shoot) {\n shootReleased = true;\n }\n if (!pause) {\n pauseReleased = true;\n }\n if (!up && !down) {\n axisYReleased = true;\n }\n if (!left && !right) {\n axisXReleased = true;\n }\n}", "componentIsNotAvailableForManagerCurrentWp(type, parentName, name){\n server.call('verifyWorkPackageComponents.componentDoesNotExistInCurrentWpScopeCalled', type, parentName, name, 'miles',\n (function(error, result){\n return(error === null);\n })\n )\n }", "formSubmit() {\n return !(this.state.steps[0].Name === '' || this.state.steps[0].args === '' || this.state.steps[0].jar === '' )\n }", "function queueComponentIndexForCheck() {\n if (firstTemplatePass) {\n (tView.components || (tView.components = [])).push(previousOrParentTNode.index);\n }\n}", "errorChecker(name) {\n if(this.state._error!==null){\n const hasil = Object.keys(this.state._error.errors).filter(err => err === name).length > 0;\n return Object.keys(this.state._error.errors).filter(err => err === name).length > 0;\n }\n return false;\n }", "possiblyComponent(node) {\n var _a;\n return !!((_a = node.tag) === null || _a === void 0 ? void 0 : _a[0].match(/[A-Z]/));\n }", "function checkIfInputs(e) {\n // Check first 5 inputs\n for (let i = 0; i < 5; i ++) {\n if (e.target[i].value.length < 1) {\n formIsValid = false\n toggleButton()\n const warning = \"Merci de remplir tous les champs\"\n addWarning(e, warning)\n return\n }\n }\n if (mandatoryCheckBox.checked && formIsValid) {\n removeWarning(e)\n setInterval(()=>{successMessage.style.display = 'flex'}, 1000)\n }\n}", "function validateCombo() {\r\n\tif (comboArrowsCounter >= combo.length) {\r\n\t\tmultipleCombos++;\r\n\t\tcombinedComboReward = baseComboReward * comboLength * multipleCombos;\r\n\t\taddBread(combinedComboReward)\r\n\r\n\t\tcomboPointsAnimation(combinedComboReward, multipleCombos);\r\n\t\twhile (comboSequence.firstChild) {comboSequence.removeChild(comboSequence.firstChild);}\r\n\t\tcomboArrowsCounter = 0;\r\n\t}\r\n}", "function isRequiredFieldFinished() {\n let isInputFinished = true;\n $(\".combo-content\").each(function () {\n if ($(this).val() === \"\") {\n isInputFinished = false;\n }\n });\n return isInputFinished;\n }", "checkUserInput() {\r\n const {\r\n drugId1, drugId2, sample, dataset,\r\n } = this.state;\r\n return drugId1 !== 'Any' || sample !== 'Any' || dataset !== 'Any' || drugId2 !== 'Any';\r\n }", "function checkMove() {\n var discToMove = startPeg[startPeg.length - 1];\n var topDisc = endPeg[endPeg.length - 1];\n var moveAvailable = false;\n if (discToMove < topDisc || endPeg.length === 0) {\n moveAvailable = true;\n }\n return moveAvailable;\n }", "function victory_check(success : boolean)\r\n{\r\n\tif (success)\r\n\t{\r\n\t\tDebug.Log(\"Success!\");\r\n\t\tpuzzle_door.SendMessage(\"Open\", SendMessageOptions.DontRequireReceiver);\r\n\t} else{\r\n\t\tDebug.Log(\"Fail!\");\r\n\t\troller_ball.GetComponent.<roller_ball>().initialize_variables();\r\n\t\troller_ball.GetComponent.<roller_ball>().reset_pos();\r\n\t}\r\n}", "function checkRunning() {\n const spinner = routineGroup.$$('paper-spinner-lite');\n assertTrue(!!spinner);\n assertFalse(spinner.hidden);\n const icon = routineGroup.$$('.routine-icon');\n assertTrue(!!icon);\n assertTrue(icon.hidden);\n }", "function determineExpectedBehavior(){\n\t\tinputsThatShouldPass = []\n\t\tinputsThatShouldBlock = []\n\n\t\tinitWebDriver(false);\n\t\tcheckBehavior(testInputs.length-1)\n}", "function validateFlow(){\n if((jsPlumb.getAllConnections().length == 0) || (jsPlumb.getAllConnections().length <= eleList.length-2)){\n return false;\n }\n return true;\n}", "function checkContinue() {\n \t\tloopOn = defaultTrue( currentPart.loop );\n \tif ( loopOn ) requestAnimFrame( demo_loop );\n }", "validateNoColourSwatch() {\n this\n .waitForElementVisible('@noColourSwatchIcon', 10000, () => {}, '[STEP] - Color Swatch should not be displayed')\n .assert.visible('@noColourSwatchIcon');\n }", "function renderHasNotSuspendedYet(){// If something errored or completed, we can't really be sure,\n// so those are false.\nreturn workInProgressRootExitStatus===RootIncomplete;}" ]
[ "0.6132408", "0.59143686", "0.5884589", "0.5827174", "0.580699", "0.57434094", "0.57434094", "0.56972545", "0.56900185", "0.56510246", "0.56259197", "0.5619333", "0.56176275", "0.56169486", "0.56101614", "0.56101614", "0.56064254", "0.5538871", "0.5495302", "0.54732376", "0.5465294", "0.54588246", "0.5457651", "0.5444317", "0.5444317", "0.54424995", "0.5420336", "0.5417453", "0.54151464", "0.5412963", "0.5395614", "0.5369822", "0.53692305", "0.5366026", "0.5357232", "0.53522843", "0.53485435", "0.53478867", "0.5344014", "0.53360575", "0.5320736", "0.53206825", "0.53194803", "0.530563", "0.5303027", "0.53022414", "0.52975255", "0.52952194", "0.5292864", "0.5291843", "0.5284569", "0.5272066", "0.52696115", "0.5265299", "0.5260143", "0.5260143", "0.52554214", "0.5254802", "0.5250409", "0.5246542", "0.5244628", "0.524171", "0.5238963", "0.5228682", "0.5224212", "0.52241486", "0.52178794", "0.52174526", "0.5217088", "0.5217028", "0.5216242", "0.5214118", "0.5211035", "0.5207478", "0.5202866", "0.51958936", "0.5189727", "0.5187236", "0.51855123", "0.51841766", "0.51837283", "0.51785624", "0.5174241", "0.5171322", "0.5170416", "0.5168357", "0.51605046", "0.5158997", "0.5155718", "0.51533693", "0.5152743", "0.5152178", "0.51484734", "0.51474285", "0.51429564", "0.51397467", "0.5139025", "0.51389396", "0.5138651", "0.5137797", "0.51350945" ]
0.0
-1
Compares two ArrayBuffer or ArrayBufferView objects. If bitCount is omitted, the two values must be the same length and have the same contents in every byte. If bitCount is included, only that leading number of bits have to match.
function equalBuffers(a, b, bitCount) { var remainder; if (typeof bitCount === "undefined" && a.byteLength !== b.byteLength) { return false; } var aBytes = new Uint8Array(a); var bBytes = new Uint8Array(b); var length = a.byteLength; if (typeof bitCount !== "undefined") { length = Math.floor(bitCount / 8); } for (var i=0; i<length; i++) { if (aBytes[i] !== bBytes[i]) { return false; } } if (typeof bitCount !== "undefined") { remainder = bitCount % 8; return aBytes[length] >> (8 - remainder) === bBytes[length] >> (8 - remainder); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equalBuffers(a, b, bitCount) {\n var remainder;\n\n if (typeof bitCount === \"undefined\" && a.byteLength !== b.byteLength) {\n return false;\n }\n\n var aBytes = new Uint8Array(a);\n var bBytes = new Uint8Array(b);\n\n var length = a.byteLength;\n if (typeof bitCount !== \"undefined\") {\n length = Math.floor(bitCount / 8);\n }\n\n for (var i=0; i<length; i++) {\n if (aBytes[i] !== bBytes[i]) {\n return false;\n }\n }\n\n if (typeof bitCount !== \"undefined\") {\n remainder = bitCount % 8;\n return aBytes[length] >> (8 - remainder) === bBytes[length] >> (8 - remainder);\n }\n\n return true;\n }", "function buffersEqual(a, b) {\n if(!isBuffer(a) || !isBuffer(b)) {\n return false\n }\n\n if(a.length !== b.length) {\n return false\n }\n\n for(var i = 0; i < a.length; i++) {\n if(a[i] !== b[i]) {\n return false\n }\n }\n\n return true\n}", "function isArrayBufferEqual(a, b) {\n if (a == null || b == null) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n var viewA = new DataView(a);\n var viewB = new DataView(b);\n for (var i = 0; i < a.byteLength; i++) {\n if (viewA.getUint8(i) !== viewB.getUint8(i)) {\n return false;\n }\n }\n return true;\n}", "function isArrayBufferEqual(a, b) {\n if (a == null || b == null) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n var viewA = new DataView(a);\n var viewB = new DataView(b);\n for (var i = 0; i < a.byteLength; i++) {\n if (viewA.getUint8(i) !== viewB.getUint8(i)) {\n return false;\n }\n }\n return true;\n}", "function isArrayBufferEqual(a, b) {\r\n if (a == null || b == null) {\r\n return false;\r\n }\r\n if (a === b) {\r\n return true;\r\n }\r\n if (a.byteLength !== b.byteLength) {\r\n return false;\r\n }\r\n var viewA = new DataView(a);\r\n var viewB = new DataView(b);\r\n for (var i = 0; i < a.byteLength; i++) {\r\n if (viewA.getUint8(i) !== viewB.getUint8(i)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function equal (bufferA, bufferB) {\n //walk by all the arguments\n if (arguments.length > 2) {\n for (var i = 0, l = arguments.length - 1; i < l; i++) {\n if (!equal(arguments[i], arguments[i + 1])) return false;\n }\n return true;\n }\n\n validate(bufferA);\n validate(bufferB);\n\n if (bufferA.length !== bufferB.length || bufferA.numberOfChannels !== bufferB.numberOfChannels) return false;\n\n for (var channel = 0; channel < bufferA.numberOfChannels; channel++) {\n var dataA = bufferA.getChannelData(channel);\n var dataB = bufferB.getChannelData(channel);\n\n for (var i = 0; i < dataA.length; i++) {\n if (dataA[i] !== dataB[i]) return false;\n }\n }\n\n return true;\n}", "equals(otherBuffer) {\n if (!isInstance(otherBuffer, Uint8Array)) {\n throw new TypeError(\n // eslint-disable-next-line max-len\n `The \"otherBuffer\" argument must be an instance of Buffer or Uint8Array. Received type ${typeof otherBuffer}`\n );\n }\n\n if (this === otherBuffer) {\n return true;\n }\n if (this.byteLength !== otherBuffer.byteLength) {\n return false;\n }\n\n for (let i = 0; i < this.length; i++) {\n if (this[i] !== otherBuffer[i]) {\n return false;\n }\n }\n\n return true;\n }", "function compare(a, b) {\n if (a.length !== b.length) {\n return 0;\n }\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n result |= a[i] ^ b[i];\n }\n return (1 & ((result - 1) >>> 8));\n}", "function memcmp(buf1, pos1, buf2, pos2, num) {\n\t for (let i = 0; i < num; ++i) {\n\t if (buf1[pos1 + i] !== buf2[pos2 + i])\n\t return false;\n\t }\n\t return true;\n\t}", "function slowEquals(a, b) {\n let diff = a.length ^ b.length;\n\tfor (let i = 0; i < a.length && i < b.length; i++) {\n\t\tdiff |= a[i] ^ b[i];\n\t}\n\treturn diff === 0;\n}", "function CompareBytes(one, two) \t\t\t\t\t\t\t\t// Compare two bytearrays (Uint8Arrays)\r\n\t{\r\n\t\treturn (one.toString() === two.toString());\r\n\t}", "assertSameNumberOfBits(other) {\n if (other.bits.length !== this.bits.length) {\n throw new Error(`Bit mismatch (a = ${this.bits.length}, b = ${other.bits.length})`);\n }\n }", "function safeBufferEquals (a, b) {\n if (!a) return !b\n if (!b) return !a\n return equals(a, b)\n}", "function _bitLengthDiff(a, b) {\n return _bitLength(a) - _bitLength(b);\n}", "function compareArrayBySize(a, b) {\n if (a.values.length < b.values.length)\n return 1;\n if (a.values.length > b.values.length)\n return -1;\n return 0;\n}", "function arrayCompare(a, b) {\n //if the lengths of the two arrays are not equal, return false\n if (a.length !== b.length) return false;\n const uniqueValues = new Set([...a, ...b]);\n //otherwise iterate through the two arrays and see if their contents match\n for (const v of uniqueValues) {\n const aCount = a.filter(e => e === v).length;\n const bCount = b.filter(e => e === v).length;\n //if the contents do not match, return false\n if (aCount !== bCount) return false;\n }\n //otherwise return true\n return true;\n }", "function compare(a, b)\n{\n if(a.length != b.length){\n return false\n }\n //copy\n a = Array.from(a)\n b = Array.from(b)\n\n for(let i = 0; i < a.length; i++)\n {\n if(a[i] != b[i])\n {\n return false\n }\n }\n\n return true\n}", "function equalConstTime(b1, b2) {\n if (b1.length !== b2.length) {\n return false;\n }\n var res = 0;\n for (var i = 0; i < b1.length; i++) {\n res |= b1[i] ^ b2[i]; // jshint ignore:line\n }\n return res === 0;\n}", "function compArrays(a, b) {\n var i = a.length > b.length ? a.length : b.length;\n while (i--) {\n if (a[i] !== b[i]) return false;\n }\n return true\n\n}", "function xorBuffer(a, b) {\n var length = Math.max(a.length, b.length);\n var buffer = Buffer.allocUnsafe(length).fill(0);\n for (var i = 0; i < length; ++i) {\n if (i < a.length && i < b.length) {\n buffer[length - i - 1] = a[a.length - i - 1] ^ b[b.length - i - 1];\n }\n else if (i < a.length && i >= b.length) {\n buffer[length - i - 1] ^= a[a.length - i - 1];\n }\n else if (i < b.length && i >= a.length) {\n buffer[length - i - 1] ^= b[b.length - i - 1];\n }\n }\n // now need to remove leading zeros in the buffer if any\n var start = 0;\n var it = buffer.values();\n var value = it.next();\n while (!value.done && value.value === 0) {\n start++;\n value = it.next();\n }\n var buf2 = buffer.slice(start);\n return buf2;\n}", "function equalData(bytes1, bytes2) {\n if (!bytes1 || !bytes2) {\n return false;\n }\n if (bytes1.length !== bytes2.length) {\n return false;\n }\n for (let i = 0; i < bytes1.length; i++) {\n if (bytes1[i] !== bytes2[i]) {\n return false;\n }\n }\n return true;\n}", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "function deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n if (!isDataView$1(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray$1(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n isFunction$1(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n }", "async compare( a, b ) {\n\n if ( a.size < b.size ){\n return -1;\n }\n\n if ( a.size > b.size ){\n return 1;\n }\n \n return 0;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (\n (dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n ) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "compare(other) {\n // compare from most to least significant byte\n for (let i = 0; i < 32; i += 1) {\n if (this.array[i] > other.array[i]) {\n return 1;\n } else if (this.array[i] < other.array[i]) {\n return -1;\n }\n }\n return 0;\n }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if (\n\t (dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n\t ) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if (\n\t (dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n\t ) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if (\n\t (dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))\n\t ) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t }", "function areEqualArrays(array1, array2) {\n\t var temp = new Array();\n\t \n\t if((!array1[0]) || (!array2[0])) {\n\t return false;\n\t }\n\n\t if(array1.length != array2.length) {\n\t return false;\n\t }\n\t for(var i = 0; i < array1.length; i++) {\n\t key = (typeof array1[i]) + \"~\" + array1[i];\n\t if(temp[key]) {\n\t \ttemp[key]++;\n\t } else {\n\t \ttemp[key] = 1;\n\t }\n\t }\n\t \n for(var i = 0; i < array2.length; i++) {\n\t key = (typeof array2[i]) + \"~\" + array2[i];\n\t if(temp[key]) {\n\t if(temp[key] == 0) {\n\t \treturn false;\n\t } else {\n\t \ttemp[key]--;\n\t }\n\t } else {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function compareArrays(array1, array2, dontConvert) {\r\n var len = Math.min(array1.length, array2.length),\r\n lengthDiff = Math.abs(array1.length - array2.length),\r\n diffs = 0,\r\n i;\r\n for (i = 0; i < len; i++) {\r\n if ((dontConvert && array1[i] !== array2[i]) ||\r\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\r\n diffs++;\r\n }\r\n }\r\n return diffs + lengthDiff;\r\n }", "function compareArrays(array1, array2, dontConvert) {\r\n var len = Math.min(array1.length, array2.length),\r\n lengthDiff = Math.abs(array1.length - array2.length),\r\n diffs = 0,\r\n i;\r\n for (i = 0; i < len; i++) {\r\n if ((dontConvert && array1[i] !== array2[i]) ||\r\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\r\n diffs++;\r\n }\r\n }\r\n return diffs + lengthDiff;\r\n }", "function compareArrays(array1, array2, dontConvert) {\r\n var len = Math.min(array1.length, array2.length),\r\n lengthDiff = Math.abs(array1.length - array2.length),\r\n diffs = 0,\r\n i;\r\n for (i = 0; i < len; i++) {\r\n if ((dontConvert && array1[i] !== array2[i]) ||\r\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\r\n diffs++;\r\n }\r\n }\r\n return diffs + lengthDiff;\r\n }", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function compareArrays(array1, array2, dontConvert) {\n\t var len = Math.min(array1.length, array2.length),\n\t lengthDiff = Math.abs(array1.length - array2.length),\n\t diffs = 0,\n\t i;\n\t for (i = 0; i < len; i++) {\n\t if ((dontConvert && array1[i] !== array2[i]) ||\n\t (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n\t diffs++;\n\t }\n\t }\n\t return diffs + lengthDiff;\n\t}", "function charArraysEqual(a, b, orderMatters = false) {\n if (!a || !b || !Array.isArray(a) || !Array.isArray(a)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n if (!orderMatters) {\n a.sort();\n b.sort();\n }\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }" ]
[ "0.75339097", "0.6466259", "0.6395015", "0.6395015", "0.6380612", "0.6360943", "0.61681306", "0.5953913", "0.58806556", "0.5775409", "0.5770517", "0.5735271", "0.55813944", "0.556135", "0.5533317", "0.5440266", "0.54267716", "0.54244775", "0.5375167", "0.5310889", "0.5299251", "0.52900064", "0.52900064", "0.52900064", "0.52900064", "0.52900064", "0.52900064", "0.52900064", "0.52900064", "0.52900064", "0.52887034", "0.52785563", "0.52785563", "0.52785563", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.5278155", "0.527799", "0.52742505", "0.52622867", "0.526072", "0.5259507", "0.5256441", "0.5254171", "0.5254171", "0.5254171", "0.52494186", "0.5236028", "0.5236028", "0.5236028", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.5235376", "0.52341205", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547", "0.52167547" ]
0.75972325
0